From d946b9e3aa077028fcf186430d2aef7a92928a67 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Thu, 9 Apr 2020 16:08:39 +0300 Subject: [PATCH 01/29] magento2-login-as-customer/issues/35: "Verify that UI elements are not shown if 'Login as customer' functionality is disabled" test added. --- ...merAbsentOnCustomerGirdPageActionGroup.xml | 16 +++++ ...ustomerAbsentOnCustomerPageActionGroup.xml | 19 ++++++ ...stomerAbsentOnOrderGridPageActionGroup.xml | 16 +++++ ...AsCustomerAbsentOnOrderPageActionGroup.xml | 19 ++++++ .../Mftf/Data/LoginAsCustomerConfigData.xml | 24 ++++++++ .../LoginAsCustomer/Test/Mftf/LICENSE.txt | 48 +++++++++++++++ .../LoginAsCustomer/Test/Mftf/LICENSE_AFL.txt | 48 +++++++++++++++ .../LoginAsCustomer/Test/Mftf/README.md | 3 + ...INotShownIfLoginAsCustomerDisabledTest.xml | 59 +++++++++++++++++++ 9 files changed, 252 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/LICENSE.txt create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/LICENSE_AFL.txt create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/README.md create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml new file mode 100644 index 0000000000000..5645395c61f49 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml new file mode 100644 index 0000000000000..a0a7eaeb970af --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml new file mode 100644 index 0000000000000..9c7fb4f3b7f82 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml new file mode 100644 index 0000000000000..10fc34c7697bf --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml new file mode 100644 index 0000000000000..4bee8de4fb3ec --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml @@ -0,0 +1,24 @@ + + + + + + mfloginascustomer/general/enabled + + + mfloginascustomer/general/disable_page_cache + + + + mfloginascustomer/general/keep_guest_cart + + + mfloginascustomer/general/store_view_login + + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/LICENSE.txt b/app/code/Magento/LoginAsCustomer/Test/Mftf/LICENSE.txt new file mode 100644 index 0000000000000..49525fd99da9c --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/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 " 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/LoginAsCustomer/Test/Mftf/LICENSE_AFL.txt b/app/code/Magento/LoginAsCustomer/Test/Mftf/LICENSE_AFL.txt new file mode 100644 index 0000000000000..f39d641b18a19 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/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 " 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/LoginAsCustomer/Test/Mftf/README.md b/app/code/Magento/LoginAsCustomer/Test/Mftf/README.md new file mode 100644 index 0000000000000..5069a2cb278f6 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/README.md @@ -0,0 +1,3 @@ +# Integration Functional Tests + +The Functional Test Module for **Magento Login As Customer** module. diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml new file mode 100644 index 0000000000000..533854d12bd61 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -0,0 +1,59 @@ + + + + + + + + + + <description value="Verify that UI elements are not shown if 'Login as customer' functionality is disabled"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!-- Verify Login As Customer Login action is absent in Customer grid page --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerGridPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerGridPage"/> + + <!-- Verify Login As Customer Login action is absent on Customer page --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerPage"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + + <!-- Create order --> + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> + + <!-- Verify Login As Customer Login action is absent on Order grid page --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderGridPage"/> + + <!-- Verify Login As Customer Login action is absent on Order page --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderPage"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + </test> +</tests> From 4f0a51466828da81accc75860a54e54be80564f5 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Fri, 10 Apr 2020 11:38:18 +0300 Subject: [PATCH 02/29] magento2-login-as-customer/issues/35: "Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled" test added. --- ...inAsCustomerLogAbsentInMenuActionGroup.xml | 16 +++++++++ ...CustomerLogPageNotAvailableActionGroup.xml | 16 +++++++++ .../Test/Mftf/Data/AdminMenuData.xml | 16 +++++++++ .../Mftf/Page/AdminLoginAsCustomerLogPage.xml | 12 +++++++ ...gNotShownIfLoginAsCustomerDisabledTest.xml | 34 +++++++++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml new file mode 100644 index 0000000000000..0049d3dcc2196 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.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"> + <!-- Verify Login As Customer is absent in admin menu --> + <actionGroup name="AdminLoginAsCustomerLogAbsentInMenuActionGroup"> + <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" stepKey="clickOnCustomersMenuItem"/> + <dontSeeElement selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" stepKey="dontSeeLoginAsCustomerLog"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml new file mode 100644 index 0000000000000..8b8386470a582 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.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"> + <!-- Verify Login As Customer is not available by direct url --> + <actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup"> + <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/> + <see selector="{{AdminHeaderSection.pageHeading}}" userInput="404 Error" stepKey="see404PageHeading"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml new file mode 100644 index 0000000000000..e326fa1e1d225 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml @@ -0,0 +1,16 @@ +<?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="AdminMenuLoginAsCustomer"> + <data key="pageTitle">Login As Customer Log</data> + <data key="title">Login As Customer Log</data> + <data key="dataUiId">magento-loginascustomer-login-log</data> + </entity> +</entities> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml new file mode 100644 index 0000000000000..2eef65e390309 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.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="AdminLoginAsCustomerLogPage" url="admin/loginascustomer/login/" area="admin" module="Magento_LoginAsCustomer"/> +</pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml new file mode 100644 index 0000000000000..d01bd27c00ca0 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.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="AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Availability of UI elements if module enable/disable"/> + <title value="'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/> + <description value="Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!-- Verify Login As Customer Log is absent in admin menu --> + <actionGroup ref="AdminLoginAsCustomerLogAbsentInMenuActionGroup" stepKey="verifyLoginAsCustomerLogAbsentInMenu"/> + + <!-- Verify Login As Customer Log is not available by direct url --> + <actionGroup ref="AdminLoginAsCustomerLogPageNotAvailableActionGroup" stepKey="verifyLoginAsCustomerLogNotAvailable"/> + </test> +</tests> From 70cab94833abf19859f8eb0e3f06334825dd10ee Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Fri, 10 Apr 2020 15:45:22 +0300 Subject: [PATCH 03/29] magento2-login-as-customer/issues/35: "Verify that UI elements are present and links are working if 'Login as customer' functionality enabled" test added. --- ...merAbsentOnCustomerGirdPageActionGroup.xml | 1 + ...ustomerAbsentOnCustomerPageActionGroup.xml | 3 +- ...stomerAbsentOnOrderGridPageActionGroup.xml | 1 + ...AsCustomerAbsentOnOrderPageActionGroup.xml | 3 +- ...CustomerLogPageNotAvailableActionGroup.xml | 1 + ...erLoginFromCustomerGirdPageActionGroup.xml | 22 ++++ ...stomerLoginFromCustomerPageActionGroup.xml | 22 ++++ ...tomerLoginFromOrderGridPageActionGroup.xml | 22 ++++ ...sCustomerLoginFromOrderPageActionGroup.xml | 22 ++++ ...sertLoginAsCustomerLoggedInActionGroup.xml | 29 +++++ ...torefrontSignOutAndCloseTabActionGroup.xml | 19 ++++ ...refrontLoginAsCustomerLoginProceedPage.xml | 12 +++ .../Mftf/Section/AdminCustomerGridSection.xml | 15 +++ .../AdminCustomerMainActionsSection.xml | 14 +++ .../AdminOrderDetailsMainActionsSection.xml | 14 +++ .../Mftf/Section/AdminOrdersGridSection.xml | 14 +++ ...minUIShownIfLoginAsCustomerEnabledTest.xml | 101 ++++++++++++++++++ 17 files changed, 313 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml index 5645395c61f49..3ea8d4f6f0e02 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml @@ -11,6 +11,7 @@ <!-- Verify Login As Customer Login action is absent on Customer grid page --> <actionGroup name="AdminLoginAsCustomerAbsentOnCustomerGridPageActionGroup"> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/> + <waitForPageLoad stepKey="waitForCustomerGridPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml index a0a7eaeb970af..bae87ca9000c5 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml @@ -11,9 +11,10 @@ <!-- Verify Login As Customer Login action is absent on Customer page --> <actionGroup name="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup"> <arguments> - <argument name="customerId"/> + <argument name="customerId" type="string"/> </arguments> <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> + <waitForPageLoad stepKey="waitForCustomerPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml index 9c7fb4f3b7f82..77f64c332639f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml @@ -11,6 +11,7 @@ <!-- Verify Login As Customer Login action is absent on Order grid page --> <actionGroup name="AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup"> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrderGridPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml index 10fc34c7697bf..fb55156d021d4 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml @@ -11,9 +11,10 @@ <!-- Verify Login As Customer Login action is absent on Order page --> <actionGroup name="AdminLoginAsCustomerAbsentOnOrderPageActionGroup"> <arguments> - <argument name="orderId"/> + <argument name="orderId" type="string"/> </arguments> <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> + <waitForPageLoad stepKey="waitForOrderPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml index 8b8386470a582..850604b990de9 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml @@ -11,6 +11,7 @@ <!-- Verify Login As Customer is not available by direct url --> <actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup"> <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/> + <waitForPageLoad stepKey="waitForLoginAsCustomerLogPageLoad"/> <see selector="{{AdminHeaderSection.pageHeading}}" userInput="404 Error" stepKey="see404PageHeading"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml new file mode 100644 index 0000000000000..0a35564875e18 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.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"> + <!-- Verify Login As Customer Login action is works properly from Customer grid page --> + <actionGroup name="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup"> + <arguments> + <argument name="customerEmail" type="string"/> + </arguments> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/> + <waitForPageLoad stepKey="waitForCustomerGridPageLoad"/> + <click selector="{{AdminCustomerGridSection.customerLoginAsCustomerLinkByEmail(customerEmail)}}" stepKey="clickLoginAsCustomerLink"/> + <switchToNextTab stepKey="switchToNewTab"/> + <waitForElementVisible selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml new file mode 100644 index 0000000000000..41db38169ac05 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.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"> + <!-- Verify Login As Customer Login action is works properly from Customer page --> + <actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"> + <arguments> + <argument name="customerId" type="string"/> + </arguments> + <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> + <waitForPageLoad stepKey="waitForCustomerPageLoad"/> + <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> + <switchToNextTab stepKey="switchToNewTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml new file mode 100644 index 0000000000000..aba61a86249cd --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.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"> + <!-- Verify Login As Customer Login action is works properly from Order grid page --> + <actionGroup name="AdminLoginAsCustomerLoginFromOrderGridPageActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrderGridPageLoad"/> + <click selector="{{AdminOrdersGridSection.loginAsCustomerLink(orderId)}}" stepKey="clickLoginAsCustomerLink"/> + <switchToNextTab stepKey="switchToNewTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml new file mode 100644 index 0000000000000..3b6f363a2d651 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.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"> + <!-- Verify Login As Customer Login action is works properly from Order grid page --> + <actionGroup name="AdminLoginAsCustomerLoginFromOrderPageActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> + <waitForPageLoad stepKey="waitForOrderPageLoad"/> + <click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> + <switchToNextTab stepKey="switchToNewTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml new file mode 100644 index 0000000000000..5a37ff8e43e7f --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.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"> + <!-- Verify Admin successfully logged in as Customer --> + <actionGroup name="StorefrontAssertLoginAsCustomerLoggedInActionGroup"> + <arguments> + <argument name="customerFullName" type="string"/> + <argument name="customerEmail" type="string"/> + </arguments> + <seeInCurrentUrl url="{{StorefrontLoginAsCustomerLoginProceedPage.url}}" stepKey="assertOnProceedPage"/> + <!-- TODO: uncomment after fix --> + <!-- <seeInTitle userInput="You are logged in." stepKey="assertYouAreLoggedInInTitle"/>--> + <see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="You are logged in." + stepKey="assertYouAreLoggedInOnPage"/> + <!-- TODO: uncomment after fix --> + <!-- <see selector="{{LoggedInCustomerHeaderLinksSection.customerDropdownMenu}}" userInput="Welcome, {{customerFullName}}!" stepKey="assertCorrectWelcomeMessage"/>--> + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="gotoCustomerAccountPage"/> + <waitForPageLoad stepKey="waitForCustomerAccountPageLoad"/> + <see selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" + userInput="{{customerEmail}}" stepKey="assertCustomerEmailInContactInformation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml new file mode 100644 index 0000000000000..523c2cd06f6f2 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.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"> + <!-- Customer sing out and close tab --> + <actionGroup name="StorefrontSignOutAndCloseTabActionGroup"> + <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> + <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You are signed out" stepKey="signOut"/> + <closeTab stepKey="closeTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml new file mode 100644 index 0000000000000..05af5f506112e --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.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="StorefrontLoginAsCustomerLoginProceedPage" url="loginascustomer/login/proceed" area="storefront" module="Magento_LoginAsCustomer"/> +</pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml new file mode 100644 index 0000000000000..e7b38bf9f9c94 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.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="AdminCustomerGridSection"> + <element name="customerLoginAsCustomerLinkByEmail" type="text" selector="//tr[contains(@class, 'data-row') and td/div[text()='{{customerEmail}}']]//a[@class='action-menu-item'][text() = 'Login As Customer']" parameterized="true" timeout="30"/> + </section> +</sections> + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml new file mode 100644 index 0000000000000..b7e35ba113795 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml @@ -0,0 +1,14 @@ +<?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="AdminCustomerMainActionsSection"> + <element name="loginAsCustomer" type="button" selector="#login_as_customer" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml new file mode 100644 index 0000000000000..629ec253d2778 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml @@ -0,0 +1,14 @@ +<?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="AdminOrderDetailsMainActionsSection"> + <element name="loginAsCustomer" type="button" selector="#guest_to_customer" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml new file mode 100644 index 0000000000000..ac2dc8ef8c421 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml @@ -0,0 +1,14 @@ +<?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="AdminOrdersGridSection"> + <element name="loginAsCustomerLink" type="text" selector="//td/div[contains(.,'{{orderId}}')]/../..//a[@class='action-menu-item'][text() = 'Login As Customer']" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml new file mode 100644 index 0000000000000..fd7828f570a85 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.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="AdminUIShownIfLoginAsCustomerEnabledTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Availability of UI elements if module enable/disable"/> + <title value="UI elements are shown if 'Login as customer' functionality is disabled"/> + <description + value="Verify that UI elements are present and links are working if 'Login as customer' functionality enabled"/> + <severity value="BLOCKER"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Verify Login As Customer Login action works correctly from Customer grid page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="verifyLoginAsCustomerWorksOnCustomerGridPage"> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerGird"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInFromCustomerGird"/> + + <!-- Verify Login As Customer Login action works correctly from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="verifyLoginAsCustomerWorksOnCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInFromCustomerPage"/> + + <!-- Create order --> + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> + <argument name="orderId" value="$grabOrderId"/> + </actionGroup> + + <!-- Verify Login As Customer Login action works correctly from Order grid page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromOrderGridPageActionGroup" + stepKey="verifyLoginAsCustomerWorksOnOrderGridPage"> + <argument name="orderId" value="$grabOrderId"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromOrderGridPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInFromOrderGridPage"/> + + <!-- Verify Login As Customer Login action works correctly from Order page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromOrderPageActionGroup" + stepKey="verifyLoginAsCustomerWorksOnOrderPage"> + <argument name="orderId" value="$grabOrderId"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromOrderPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInFromOrderPage"/> + </test> +</tests> From 5489b0ddc16719c824849b7b7b62358beeff8f1b Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Mon, 13 Apr 2020 15:20:27 +0300 Subject: [PATCH 04/29] magento2-login-as-customer/issues/41: "Admin user login as customer and place order" test added. --- ...sMessageOrderCreatedByAdminActionGroup.xml | 21 ++++++ ...sMessageOrderCreatedByAdminActionGroup.xml | 20 ++++++ .../AdminLoginAsCustomerPlaceOrderTest.xml | 71 +++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml new file mode 100644 index 0000000000000..8e92a115f4595 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.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"> + <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> + <actionGroup name="AdminAssertContainsMessageOrderCreatedByAdminActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + <argument name="adminUserFullName" defaultValue="Magento User" type="string"/> + </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="Order Placed by {{adminUserFullName}} using Login as Customer" stepKey="seeMessageOrderCreatedByAdmin"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml new file mode 100644 index 0000000000000..508ada3295a8e --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.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"> + <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> + <actionGroup name="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCustomerOrderViewPage.url(orderId)}}" stepKey="gotoOrderPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="Order Placed by Store Administrator" stepKey="seeMessageOrderCreatedByAdmin"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml new file mode 100644 index 0000000000000..c65ecb4f95206 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.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="AdminLoginAsCustomerPlaceOrderTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Place order and reorder"/> + <title value="Admin user login as customer and place order"/> + <description + value="Verify that admin user can place order using 'Login as customer' functionality"/> + <severity value="BLOCKER"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login As Customer from Customer grid page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="loginAsCustomer"> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + + <!-- Place Order as Customer --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createProduct.sku$$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCart"/> + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> + + <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> + <actionGroup ref="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyStorefrontMessageOrderCreatedByAdmin"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + + <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> + <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageOrderCreatedByAdmin"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + </test> +</tests> From db39be78feec1df4f93aab5b03dbba12453d789b Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Mon, 13 Apr 2020 15:59:40 +0300 Subject: [PATCH 05/29] magento2-login-as-customer/issues/41: "Admin user login as customer and reorder existing order" test added. --- .../AdminLoginAsCustomerPlaceOrderTest.xml | 1 - .../Test/AdminLoginAsCustomerReorderTest.xml | 86 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index c65ecb4f95206..54c364eb10cee 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -33,7 +33,6 @@ <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> - <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml new file mode 100644 index 0000000000000..d89da1e53d0b0 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -0,0 +1,86 @@ +<?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="AdminLoginAsCustomerReorderTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Place order and reorder"/> + <title value="Admin user login as customer and reorder existing order"/> + <description + value="Verify that admin user can reorder using 'Login as customer' functionality"/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login to storefront as Customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Place Order as Customer --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createProduct.sku$$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCart"/> + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> + + <!-- Log out from storefront as Customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogOut"/> + + <!-- Login As Customer from Customer grid page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="loginAsCustomer"> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + + <!-- Make reorder --> + <actionGroup ref="StorefrontCustomerReorderActionGroup" stepKey="makeReorder"> + <argument name="orderNumber" value="{$grabOrderId}"/> + </actionGroup> + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeReorder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabReorderId"/> + + <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> + <actionGroup ref="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyStorefrontMessageOrderCreatedByAdmin"> + <argument name="orderId" value="{grabReorderId}"/> + </actionGroup> + + <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> + <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageOrderCreatedByAdmin"> + <argument name="orderId" value="{grabReorderId}"/> + </actionGroup> + + </test> +</tests> From d27139a3fead24759bf4ffe1b3a20aaf6f1b79b9 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 14 Apr 2020 15:28:32 +0300 Subject: [PATCH 06/29] magento2-login-as-customer/issues/41: "Verify that 'Login as customer Log' record information about using 'Login as Customer' functionality properly" test added. --- ...ertLoginAsCustomerLogRecordActionGroup.xml | 22 ++++ ...minFilterLoginAsCustomerLogActionGroup.xml | 25 ++++ ...AdminOpenLoginAsCustomerLogActionGroup.xml | 17 +++ ...torefrontSignOutAndCloseTabActionGroup.xml | 2 +- .../Mftf/Page/AdminLoginAsCustomerLogPage.xml | 6 +- .../AdminLoginAsCustomerLogFiltersSection.xml | 21 ++++ .../AdminLoginAsCustomerLogGridSection.xml | 20 ++++ .../AdminLoginAsCustomerLogToolbarSection.xml | 16 +++ .../Test/AdminLoginAsCustomerLoggingTest.xml | 109 ++++++++++++++++++ 9 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogFiltersSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml new file mode 100644 index 0000000000000..270ce7d3719a2 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.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"> + <!-- Assert Login As Customer Log record is correct --> + <actionGroup name="AdminAssertLoginAsCustomerLogRecordActionGroup"> + <arguments> + <argument name="rowNumber" type="string"/> + <argument name="adminId" type="string"/> + <argument name="customerId" type="string"/> + </arguments> + <seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/> + <see selector="{{AdminLoginAsCustomerLogGridSection.adminIdInRow(rowNumber)}}" userInput="{{adminId}}" stepKey="seeCorrectAdminId"/> + <see selector="{{AdminLoginAsCustomerLogGridSection.customerIdInRow(rowNumber)}}" userInput="{{customerId}}" stepKey="seeCorrectCustomerId"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml new file mode 100644 index 0000000000000..cab68918745a6 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.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"> + <!-- Filter Login As Customer Log records --> + <actionGroup name="AdminFilterLoginAsCustomerLogActionGroup"> + <arguments> + <argument name="adminId" type="string"/> + <argument name="customerId" type="string"/> + </arguments> + <seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.resetFilter}}" stepKey="resetFilters"/> + <waitForLoadingMaskToDisappear stepKey="waitForResetFilter"/> + <fillField selector="{{AdminLoginAsCustomerLogFiltersSection.adminId}}" userInput="{{adminId}}" stepKey="fillAdminId"/> + <fillField selector="{{AdminLoginAsCustomerLogFiltersSection.customerId}}" userInput="{{customerId}}" stepKey="fillCustomerId"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.search}}" stepKey="applyFilters"/> + <waitForLoadingMaskToDisappear stepKey="waitForApplyFilter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml new file mode 100644 index 0000000000000..508b13abbc43e --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.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"> + <!-- Navigate to Login As Customer Log page --> + <actionGroup name="AdminOpenLoginAsCustomerLogActionGroup"> + <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="gotoLoginAsCustomerLogPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="Login As Customer Log" stepKey="titleIsVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml index 523c2cd06f6f2..9eaed420ba9da 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Customer sing out and close tab --> + <!-- Customer sign out and close tab --> <actionGroup name="StorefrontSignOutAndCloseTabActionGroup"> <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml index 2eef65e390309..0a26dd74d1ee9 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml @@ -8,5 +8,9 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> - <page name="AdminLoginAsCustomerLogPage" url="admin/loginascustomer/login/" area="admin" module="Magento_LoginAsCustomer"/> + <page name="AdminLoginAsCustomerLogPage" url="loginascustomer/login/" area="admin" module="Magento_LoginAsCustomer"> + <section name="AdminLoginAsCustomerLogToolbarSection"/> + <section name="AdminLoginAsCustomerLogFiltersSection"/> + <section name="AdminLoginAsCustomerLogGridSection"/> + </page> </pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogFiltersSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogFiltersSection.xml new file mode 100644 index 0000000000000..dce2204f86f82 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogFiltersSection.xml @@ -0,0 +1,21 @@ +<?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="AdminLoginAsCustomerLogFiltersSection"> + <element name="loginId" type="input" selector="//input[@id='subscriberGrid_filter_login_id']"/> + <element name="customerId" type="input" selector="//input[@id='subscriberGrid_filter_customer_id']"/> + <element name="customerEmail" type="input" selector="//input[@id='subscriberGrid_filter_email']"/> + <element name="adminId" type="input" selector="//input[@id='subscriberGrid_filter_admin_id']"/> + <element name="adminName" type="input" selector="//input[@id='subscriberGrid_filter_username']"/> + <element name="from" type="input" selector="//input[@name='created_at[from]']"/> + <element name="to" type="input" selector="//input[@name='created_at[to]']"/> + </section> +</sections> + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml new file mode 100644 index 0000000000000..d2f37fae04d13 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml @@ -0,0 +1,20 @@ +<?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="AdminLoginAsCustomerLogGridSection"> + <element name="loginIdInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='login_id']" parameterized="true"/> + <element name="customerIdInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='customer_id']" parameterized="true"/> + <element name="customerEmailInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='email']" parameterized="true"/> + <element name="adminIdInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='admin_id']" parameterized="true"/> + <element name="adminNameInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='username']" parameterized="true"/> + <element name="createdAtInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='created_at']" parameterized="true"/> + </section> +</sections> + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml new file mode 100644 index 0000000000000..a403367ee0d02 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.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="AdminLoginAsCustomerLogToolbarSection"> + <element name="search" type="button" selector="button[data-action='grid-filter-apply']"/> + <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']"/> + </section> +</sections> + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml new file mode 100644 index 0000000000000..c66a1519d9c63 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml @@ -0,0 +1,109 @@ +<?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="AdminLoginAsCustomerLoggingTest"> + <annotations> + <features value="Login As Customer"/> + <!-- TODO: change "stories" value --> + <stories value="Place order and reorder"/> + <title value="Using 'Login As Customer' is logged properly"/> + <description + value="Verify that 'Login as customer Log' record information about using 'Login as Customer' functionality properly"/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="NewAdminUser" stepKey="createNewAdmin"/> + <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> + <createData entity="Simple_US_CA_Customer" stepKey="createSecondCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> + <deleteData createDataKey="createSecondCustomer" stepKey="deleteSecondCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToDeleteNewAdmin"/> + <actionGroup ref="AdminDeleteUserViaCurlActionGroup" stepKey="deleteNewAdmin"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logoutAfter"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login into First Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="loginAsFirstCustomerByDefaultAdmin"> + <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/> + + <!-- Login into Second Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="loginAsSecondCustomerByDefaultAdmin"> + <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerDefaultAdmin"/> + + <!-- Log out as Default Admin User --> + <actionGroup ref="logout" stepKey="logoutAsDefaultAdmin"/> + + <!-- Login as New Admin User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="$$createNewAdmin.username$$"/> + <argument name="password" value="$$createNewAdmin.password$$"/> + </actionGroup> + + <!-- Login into First Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="loginAsFirstCustomerByNewAdmin"> + <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerNewAdmin"/> + + <!-- Login into Second Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + stepKey="loginAsSecondCustomerByNewAdmin"> + <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerNewAdmin"/> + + <!-- Navigate to Login As Customer Log page --> + <actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/> + + <!-- Perform assertions --> + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminFirstCustomerLogRecord"> + <argument name="rowNumber" value="4"/> + <argument name="adminId" value="1"/> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminSecondCustomerLogRecord"> + <argument name="rowNumber" value="3"/> + <argument name="adminId" value="1"/> + <argument name="customerId" value="$$createSecondCustomer.id$$"/> + </actionGroup> + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyNewAdminFirstCustomerLogRecord"> + <argument name="rowNumber" value="2"/> + <argument name="adminId" value="$$createNewAdmin.id$$"/> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyNewAdminSecondCustomerLogRecord"> + <argument name="rowNumber" value="1"/> + <argument name="adminId" value="$$createNewAdmin.id$$"/> + <argument name="customerId" value="$$createSecondCustomer.id$$"/> + </actionGroup> + + <!-- Log out as New Admin User --> + <actionGroup ref="logout" stepKey="logoutAsNewAdmin"/> + </test> +</tests> From e7ab82efb1fff67678f0043284449c17f80aca3a Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 15 Apr 2020 13:57:21 +0300 Subject: [PATCH 07/29] magento2-login-as-customer/issues/42: "Admin user login as customer and edit customer's address" test added. --- ...oginAsCustomerEditCustomersAddressTest.xml | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml new file mode 100644 index 0000000000000..88f65b167efc9 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.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="AdminLoginAsCustomerEditCustomersAddressTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Edit Customer addresses"/> + <title value="Admin user login as customer and edit customer's address"/> + <description + value="Verify Admin can access customer's personal cabinet and change his default shipping and billing addresses using Login As Customer functionality"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logoutAdmin"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login As Customer Login from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Add new default address --> + <actionGroup ref="StorefrontAddCustomerDefaultAddressActionGroup" stepKey="addNewDefaultAddress"> + <argument name="Address" value="US_Address_CA"/> + </actionGroup> + + <!-- Open Customer edit page --> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInAsCustomer"/> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + + <!-- Assert Customer Default Billing Address --> + <actionGroup stepKey="checkDefaultBilling" ref="AdminAssertCustomerDefaultBillingAddress"> + <argument name="firstName" value="$$createCustomer.firstname$$"/> + <argument name="lastName" value="$$createCustomer.lastname$$"/> + <argument name="street1" value="{{US_Address_CA.street[0]}}"/> + <argument name="state" value="{{US_Address_CA.state}}"/> + <argument name="postcode" value="{{US_Address_CA.postcode}}"/> + <argument name="country" value="{{US_Address_CA.country}}"/> + <argument name="telephone" value="{{US_Address_CA.telephone}}"/> + </actionGroup> + + <!-- Assert Customer Default Shipping Address --> + <actionGroup stepKey="checkDefaultShipping" ref="AdminAssertCustomerDefaultShippingAddress"> + <argument name="firstName" value="$$createCustomer.firstname$$"/> + <argument name="lastName" value="$$createCustomer.lastname$$"/> + <argument name="street1" value="{{US_Address_CA.street[0]}}"/> + <argument name="state" value="{{US_Address_CA.state}}"/> + <argument name="postcode" value="{{US_Address_CA.postcode}}"/> + <argument name="country" value="{{US_Address_CA.country}}"/> + <argument name="telephone" value="{{US_Address_CA.telephone}}"/> + </actionGroup> + </test> +</tests> From f09dbd2e923ff7ee81c7e014caab6076a98ed90b Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 15 Apr 2020 15:28:34 +0300 Subject: [PATCH 08/29] magento2-login-as-customer/issues/43: Admin user login as customer and add products to customer's wish-list" test added. --- ...oginAsCustomerAddProductToWishlistTest.xml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml new file mode 100644 index 0000000000000..1327bc1b74ecc --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml @@ -0,0 +1,62 @@ +<?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="AdminLoginAsCustomerAddProductToWishlistTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Added product to wish-list"/> + <title value="Admin user login as customer and add products to customer's wish-list"/> + <description + value="Verify that Admin can add products to customer's wish-list using Login As Customer functionality"/> + <severity value="AVERAGE"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Admin Login As Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="lLoginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Navigate to Product page and add it to Wishlist --> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> + <argument name="productVar" value="$$createSimpleProduct$$"/> + </actionGroup> + + <!-- Open Customer Wishlist and verify Product present there --> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductInWishlist"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + <argument name="productPrice" value="$$createSimpleProduct.price$$"/> + </actionGroup> + </test> +</tests> From affcbe95b03984ca17b4dd0e59840517e84ae3e9 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 15 Apr 2020 16:27:24 +0300 Subject: [PATCH 09/29] magento2-login-as-customer/issues/44: "Admin user login as customer and make subscription to newsletter" test added. --- ...ginAsCustomerSubscribeToNewsletterTest.xml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml new file mode 100644 index 0000000000000..477fb82408903 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.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="AdminLoginAsCustomerSubscribeToNewsletterTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Subscribe to newsletter"/> + <title value="Admin user login as customer and make subscription to newsletter"/> + <description + value="Verify that Admin can subscribe to newsletter using Login As Customer functionality"/> + <severity value="AVERAGE"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Admin Login As Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="lLoginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Subscribe for newsletter --> + <amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/> + <click selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" + stepKey="checkSubscribedNewsletter"/> + <click selector="{{StorefrontNewsletterManageSection.saveButton}}" + stepKey="saveSubscription"/> + <waitForPageLoad stepKey="waitForSubscriptionSaved"/> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInAsCustomer"/> + + <!-- Verify subscription successful --> + <amOnPage url="{{AdminNewsletterSubscriberPage.url}}" stepKey="goToNewsletterSubscriberGrid"/> + <see selector="{{AdminNewsletterSubscriberGridSection.email('1')}}" userInput="$$createCustomer.email$$" stepKey="seeCustomerEmailInSubscriberGrid"/> + <see selector="{{AdminNewsletterSubscriberGridSection.type('1')}}" userInput="Customer" stepKey="seeCustomerTypeInSubscriberGrid"/> + </test> +</tests> From 3b313a58fc33fa9fd7d74ab62b8959b311787e02 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Thu, 16 Apr 2020 15:13:46 +0300 Subject: [PATCH 10/29] magento2-login-as-customer/issues/40: "Login into Magento Admin panel as user that does not have access to 'Login as customer' button" test added. --- ...minNoAccessToLoginAsCustomerButtonTest.xml | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml new file mode 100644 index 0000000000000..5edbc0c5bbbf5 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.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="AdminNoAccessToLoginAsCustomerButtonTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Permissions and ACl"/> + <title value="User does not have access to 'Login as customer' button"/> + <description value="Login into Magento Admin panel as user that does not have access to 'Login as customer' button"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> + + <!--Create New User--> + <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillNewUserForm"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/> + + <!--Create New Role--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> + <argument name="role" value="roleSales"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + + <!--Delete new User--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> + <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> + </actionGroup> + + <!--Delete new Role--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRole"> + <argument name="roleName" value="{{roleSales.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!--Assign new role--> + <actionGroup ref="AdminOpenUserEditPageActionGroup" stepKey="openUserEditPage"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillUserForm"> + <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveUser"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You saved the user."/> + </actionGroup> + + <!-- Login as new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsSaleRoleUser"> + <argument name="adminUser" value="AdminUserWithUpdatedUserRoleToSales"/> + </actionGroup> + + <!-- Verify Login As Customer Login action is absent on Customer page --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerPage"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + + <!-- Create order --> + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> + + <!-- Verify Login As Customer Login action is absent on Order page --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderPage"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + </test> +</tests> From 73c429c6bbb17fd71d28abeee82e8b7d9b237b44 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Fri, 17 Apr 2020 10:27:35 +0300 Subject: [PATCH 11/29] magento2-login-as-customer/issues/40: "Login into Magento Admin panel as user that does not have access to 'Login as customer' section in System Configuration" test added. --- .../AdminRevokeRoleResourceActionGroup.xml | 23 +++++ ...rConfigNotAvailableDirectlyActionGroup.xml | 18 ++++ ...nAsCustomerConfigNotVisibleActionGroup.xml | 16 ++++ .../Test/Mftf/Data/UserRoleData.xml | 35 ++++++++ .../Mftf/Page/AdminCustomerConfigPage.xml | 11 +++ ...cessToLoginAsCustomerConfigurationTest.xml | 90 +++++++++++++++++++ 6 files changed, 193 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml new file mode 100644 index 0000000000000..49c404a92f0de --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.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"> + <!-- Revoke access to resource from edit role page --> + <actionGroup name="AdminRevokeRoleResourceActionGroup"> + <arguments> + <argument name="resourceName" type="string"/> + </arguments> + <selectOption selector="{{AdminEditRoleResourcesSection.resourceAccess}}" userInput="0" + stepKey="selectResourceAccessCustom"/> + <waitForElementVisible selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" + stepKey="waitForElementVisible"/> + <scrollTo selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" x="0" y="-80" stepKey="scrollToContentBlock"/> + <click selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" stepKey="clickContentBlockCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml new file mode 100644 index 0000000000000..94e3631a5cc51 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.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"> + <!-- Verify Login As Customer config section is not available by direct url --> + <actionGroup name="AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup"> + <amOnPage url="{{AdminLoginAsCustomerConfigPage.url}}" stepKey="navigateToLoginAsCustomerConfigSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeInCurrentUrl url="admin/system_config/index" stepKey="seeRedirectToConfigIndexPage"/> + <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml new file mode 100644 index 0000000000000..f093d57cb171f --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.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"> + <!-- Verify no Login As Customer config section available --> + <actionGroup name="AssertAdminLoginAsCustomerConfigNotVisibleActionGroup"> + <!-- TODO: update --> + <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomerItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml new file mode 100644 index 0000000000000..2f3d10dcd4daa --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml @@ -0,0 +1,35 @@ +<?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"> + <!--This Role has access for all resources individually --> + <entity name="customRoleAllResources" type="user_role"> + <data key="name" unique="suffix">allAccessRole</data> + <data key="rolename">allAccessRole</data> + <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> + <data key="resourceAccess">Custom</data> + <data key="resource"> + [ + 'Magento_Backend::dashboard', + 'Magento_Analytics::analytics', + 'Magento_Sales::sales', + 'Magento_Catalog::catalog', + 'Magento_Customer::customer', + 'Magento_Cart::cart', + 'Magento_Backend::myaccount', + 'Magento_Backend::marketing', + 'Magento_Backend::content', + 'Magento_Reports::report', + 'Magento_Backend::stores', + 'Magento_Backend::system', + 'Magento_Backend::global_search', + ] + </data> + </entity> +</entities> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml new file mode 100644 index 0000000000000..cfeead829e8ae --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml @@ -0,0 +1,11 @@ +<?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="AdminLoginAsCustomerConfigPage" url="admin/system_config/edit/section/mfloginascustomer" area="admin" module="Magento_LoginAsCustomer"> + </page> +</pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml new file mode 100644 index 0000000000000..eab2f2c6dfd6e --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml @@ -0,0 +1,90 @@ +<?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="AdminNoAccessToLoginAsCustomerConfigurationTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Permissions and ACl"/> + <title value="User does not have access to 'Login as customer' section in System Configuration"/> + <description + value="Login into Magento Admin panel as user that does not have access to 'Login as customer' section in System Configuration"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> + + <!--Create New Role--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> + <argument name="role" value="customRoleAllResources"/> + </actionGroup> + <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> + <argument name="resourceName" value="Login As Customer Section"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + + <!--Create New User--> + <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> + <argument name="user" value="NewAdminUser"/> + <argument name="role" value="customRoleAllResources"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + + <!--Delete new User--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + + <!--Delete new Role--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login as new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsSaleRoleUser"> + <argument name="adminUser" value="NewAdminUser"/> + </actionGroup> + + <!-- Navigate to Configuration page and open Customers tab --> + <actionGroup ref="AdminOpenStoreConfigPageActionGroup" stepKey="openStoreConfig"/> + <actionGroup ref="AdminExpandConfigTabActionGroup" stepKey="expandCustomersTab"> + <argument name="tabName" value="Customers"/> + </actionGroup> + + <!-- Assert no Login As Customer config section visible --> + <actionGroup ref="AssertAdminLoginAsCustomerConfigNotVisibleActionGroup" stepKey="assertConfigNotVisible"/> + + <!-- Assert Login As Customer config section is not available by direct url --> + <actionGroup ref="AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup" + stepKey="assertConfigNotAvailableDirectly"/> + </test> +</tests> From 3c3f7de02158afbb7b69944d3f40db8c53be84ea Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 21 Apr 2020 12:33:46 +0300 Subject: [PATCH 12/29] magento2-login-as-customer/issues/40: "Change admin user's access to 'Login as Customer Log'" test added. --- .../AdminEditUserRoleActionGroup.xml | 28 ++++++ ...nLoginAsCustomerLogFromMenuActionGroup.xml | 21 +++++ .../Test/Mftf/Page/AdminRoleEditPage.xml | 12 +++ ...hangUserAccessToLoginAsCustomerLogTest.xml | 91 +++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminRoleEditPage.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml new file mode 100644 index 0000000000000..6237b50923899 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.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"> + <!-- Open User Role resources for edit --> + <actionGroup name="AdminEditUserRoleActionGroup"> + <arguments> + <argument name="roleName" type="string"/> + </arguments> + <amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToUserRolesGrid"/> + <fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{roleName}}" + stepKey="enterRoleName"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <see selector="{{AdminDataGridTableSection.row('1')}}" userInput="{{roleName}}" stepKey="seeUserRole"/> + <click selector="{{AdminDataGridTableSection.row('1')}}" stepKey="openRoleEditPage"/> + <waitForPageLoad stepKey="waitForRoleEditPageLoad"/> + <fillField selector="{{AdminEditRoleInfoSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword" /> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourceTab"/> + <selectOption userInput="Custom" selector="{{AdminCreateRoleSection.resourceAccess}}" + stepKey="selectResourceAccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml new file mode 100644 index 0000000000000..584e1d22fbc96 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.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"> + <!-- Navigate to Login As Customer Log from Menu --> + <actionGroup name="AdminOpenLoginAsCustomerLogFromMenuActionGroup"> + <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" + stepKey="clickOnCustomersMenuItem"/> + <click selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" + stepKey="openLoginAsCustomerLog"/> + <waitForPageLoad stepKey="waitForLoginAsCustomerLog"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Login As Customer Log" + stepKey="seeForLoginAsCustomerLog"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminRoleEditPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminRoleEditPage.xml new file mode 100644 index 0000000000000..12eba90aea723 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminRoleEditPage.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="AdminRoleEditPage" url="admin/user_role/editrole/rid/{{roleId}}/" module="Magento_User" area="admin" parameterized="true"> + <section name="AdminRoleGridSection"/> + </page> +</pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml new file mode 100644 index 0000000000000..1b8720eec9fc8 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml @@ -0,0 +1,91 @@ +<?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="AdminChangUserAccessToLoginAsCustomerLogTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Permissions and ACl"/> + <title value="Change admin user's access to 'Login as Customer Log'"/> + <description + value="Verify admin user's access to 'Login as Customer Log' can be changed"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> + + <!--Create New Role--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> + <argument name="role" value="customRoleAllResources"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + + <!--Create New User--> + <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> + <argument name="user" value="NewAdminUser"/> + <argument name="role" value="customRoleAllResources"/> + </actionGroup> + </before> + <after> + <!--Delete new User--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUserAfter"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + + <!--Delete new Role--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login as new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUser"> + <argument name="adminUser" value="NewAdminUser"/> + </actionGroup> + + <!-- Verify new User has access to 'Login as Customer Log' --> + <actionGroup ref="AdminOpenLoginAsCustomerLogFromMenuActionGroup" stepKey="openLoginAsCustomerLog"/> + + <!-- Revoke 'Login as Customer Log' access for new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUser"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> + + <actionGroup ref="AdminEditUserRoleActionGroup" stepKey="openEditUserRole"> + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> + <argument name="resourceName" value="Login As Customer Log"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveEditedRole"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutDefaultAdminUserAfterRevoke"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserAfterRevoke"> + <argument name="adminUser" value="NewAdminUser"/> + </actionGroup> + + <!-- Verify new User no longer has access to 'Login as Customer Log' menu item --> + <actionGroup ref="AdminLoginAsCustomerLogAbsentInMenuActionGroup" stepKey="verifyLoginAsCustomerLogAbsentInMenu"/> + + <!-- Verify new User no longer has access to 'Login as Customer Log' --> + <actionGroup ref="AdminLoginAsCustomerLogPageNotAvailableActionGroup" stepKey="verifyLoginAsCustomerLogPageNotAvailable"/> + </test> +</tests> From be25d54e6efd0e852179683b86627531545beaa0 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 21 Apr 2020 14:20:45 +0300 Subject: [PATCH 13/29] magento2-login-as-customer/issues/40: "Change Admin user's access to 'Login as Customer' button" test added. --- ...gUserAccessToLoginAsCustomerButtonTest.xml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml new file mode 100644 index 0000000000000..e346e4ba8a587 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml @@ -0,0 +1,98 @@ +<?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="AdminChangUserAccessToLoginAsCustomerButtonTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Permissions and ACl"/> + <title value="Change admin user's access to 'Login as Customer Button'"/> + <description + value="Verify admin user's access to 'Login as Customer Button' can be changed"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserBefore"/> + + <!--Create New Role--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> + <argument name="role" value="customRoleAllResources"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + + <!--Create New User--> + <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> + <argument name="user" value="NewAdminUser"/> + <argument name="role" value="customRoleAllResources"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + + <!--Delete new User--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUserAfter"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + + <!--Delete new Role--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login as new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> + </actionGroup> + + <!-- Verify new User has access to 'Login as Customer Button' --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="verifyLoginAsCustomerWorksOnCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="customerSignOutAndCloseTab"/> + + <!-- Revoke 'Login as Customer Button' access for new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUser"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> + + <actionGroup ref="AdminEditUserRoleActionGroup" stepKey="openEditUserRole"> + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> + <argument name="resourceName" value="Login As Customer Button"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveEditedRole"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutDefaultAdminUserAfterRevoke"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserAfterRevoke"> + <argument name="adminUser" value="NewAdminUser"/> + </actionGroup> + + <!-- Verify new User no longer has access to 'Login as Customer Button' --> + <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerPage"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + </test> +</tests> From 994623525bcf009c1993f916348a9f3458b50dfa Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 21 Apr 2020 16:56:55 +0300 Subject: [PATCH 14/29] magento2-login-as-customer/issues/39: "Admin user directly login into customer account on custom website" test added. --- .../Mftf/Data/LoginAsCustomerConfigData.xml | 8 +- ...nAsCustomerDirectlyToCustomWebsiteTest.xml | 85 +++++++++++++++++++ 2 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml index 4bee8de4fb3ec..4fe414d1d895e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml @@ -11,14 +11,10 @@ <entity name="LoginAsCustomerConfigDataEnabled"> <data key="path">mfloginascustomer/general/enabled</data> </entity> - <entity name="disablePageCache"> + <entity name="LoginAsCustomerDisablePageCache"> <data key="path">mfloginascustomer/general/disable_page_cache</data> </entity> - <!-- Should be removed after https://github.com/magento/magento2-login-as-customer/issues/34 --> - <entity name="extensionsKeepGuestCart"> - <data key="path">mfloginascustomer/general/keep_guest_cart</data> - </entity> - <entity name="storeViewLogin"> + <entity name="LoginAsCustomerStoreViewLogin"> <data key="path">mfloginascustomer/general/store_view_login</data> </entity> </entities> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml new file mode 100644 index 0000000000000..a931aefc6edb5 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.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="AdminLoginAsCustomerDirectlyToCustomWebsiteTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Login As Customer into additional website"/> + <title value="Admin user directly login into customer account on custom website"/> + <description + value="Verify admin user can directly login into customer account on custom website using 'Login as customer' functionality"/> + <severity value="BLOCKER"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI + command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" + stepKey="enableAddStoreCodeToUrls"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createCustomWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreGroup.name}}"/> + <argument name="rootCategory" value="Default Category"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + <actionGroup ref="AdminCreateCustomerWithWebSiteAndGroupActionGroup" stepKey="createCustomer"> + <argument name="customerData" value="Simple_US_Customer"/> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="storeView" value="{{customStoreEN.name}}"/> + </actionGroup> + </before> + <after> + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> + <argument name="customerEmail" value="Simple_US_Customer.email"/> + </actionGroup> + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI + command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" + stepKey="disableAddStoreCodeToUrls"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login As Customer from Customer page --> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> + <argument name="customer" value="Simple_US_Customer"/> + </actionGroup> + <grabFromCurrentUrl regex="~id/(\d+)/~" stepKey="customerId" /> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="${customerId}"/> + </actionGroup> + + <!-- Assert Customer logged on Custom Website --> + <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> + <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeStoreCodeInUrl"> + <argument name="storeCode" value="{{customStoreEN.code}}"/> + </actionGroup> + + <!-- Log out Customer and close tab --> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/> + </test> +</tests> From a8ed99acd4b79ff7d18b7847f3f675f732f526c1 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 22 Apr 2020 17:42:54 +0300 Subject: [PATCH 15/29] magento2-login-as-customer/issues/38: "Admin user directly login into customer account on frontend to Default store view when Store View To Login In = Auto detection" test added. --- .../AdminLoginAsCustomerAutoDetectionTest.xml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml new file mode 100644 index 0000000000000..38115f63c8d81 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml @@ -0,0 +1,66 @@ +<?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="AdminLoginAsCustomerAutoDetectionTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Select Store View based on 'Store View To Login In' setting"/> + <title + value="Admin user directly login into customer account with store View To Login In = Auto detection"/> + <description + value="Verify admin user can directly login into customer account to Default store view when Store View To Login In = Auto detection"/> + <severity value="BLOCKER"/> + <group value="login_as_customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI + command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" + stepKey="enableAddStoreCodeToUrls"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"> + <argument name="customStore" value="customStore"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI + command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" + stepKey="disableAddStoreCodeToUrls"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login As Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Assert Customer logged on on default store view --> + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerGird"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> + <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeDefaultStoreCodeInUrl"/> + + <!-- Log out Customer and close tab --> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/> + </test> +</tests> From c0a4ac28de3e0c556264ee5424a978aaca478e34 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Thu, 23 Apr 2020 11:47:14 +0300 Subject: [PATCH 16/29] magento2-login-as-customer/issues/38: "Admin user prompted to select Store View when 'Store View To Login In' = Manual Choose" test added. --- ...inAsCustomerChooseStoreViewActionGroup.xml | 20 +++++ .../AdminLoginAsCustomerLoginManualPage.xml | 16 ++++ ...ginAsCustomerLoginManualActionsSection.xml | 14 ++++ ...ginAsCustomerLoginManualContentSection.xml | 14 ++++ .../AdminLoginAsCustomerManualChooseTest.xml | 75 +++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualActionsSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualContentSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml new file mode 100644 index 0000000000000..c4b5067eaa857 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.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"> + <!-- Manually choose store view for LoginAsCustomer functionality --> + <actionGroup name="AdminLoginAsCustomerChooseStoreViewActionGroup"> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + <selectOption selector="{{AdminLoginAsCustomerLoginManualContentSection.storeView}}" userInput="{{storeViewName}}" stepKey="selectStoreView"/> + <click selector="{{AdminLoginAsCustomerLoginManualActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomer"/> + <waitForElementVisible selector="{{StorefrontHeaderSection.logoLink}}" stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml new file mode 100644 index 0000000000000..ddb87ba83bc3a --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml @@ -0,0 +1,16 @@ +<?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="AdminLoginAsCustomerLoginManualPage" url="loginascustomer/login/manual/entity_id/{{id}}/" + area="storefront" module="Magento_LoginAsCustomer" parameterized="true"> + <section name="AdminLoginAsCustomerLoginManualActionsSection"/> + <section name="AdminLoginAsCustomerLoginManualContentSection"/> + </page> +</pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualActionsSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualActionsSection.xml new file mode 100644 index 0000000000000..a2d373d4d7ab3 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualActionsSection.xml @@ -0,0 +1,14 @@ +<?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="AdminLoginAsCustomerLoginManualActionsSection"> + <element name="loginAsCustomer" type="button" selector="#save" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualContentSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualContentSection.xml new file mode 100644 index 0000000000000..944bd2679e703 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLoginManualContentSection.xml @@ -0,0 +1,14 @@ +<?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="AdminLoginAsCustomerLoginManualContentSection"> + <element name="storeView" type="select" selector="//select[@name='store_id']" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml new file mode 100644 index 0000000000000..ae4a10e7fd568 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.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="AdminLoginAsCustomerManualChooseTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Select Store View based on 'Store View To Login In' setting"/> + <title + value="Admin user directly login into customer account with store View To Login In = Manual Choose"/> + <description + value="Verify admin user can directly login into customer account to Custom store view when Store View To Login In = Manual Choose"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1" + stepKey="enableLoginAsCustomerManualChoose"/> + <magentoCLI + command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" + stepKey="enableAddStoreCodeToUrls"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"> + <argument name="customStore" value="customStore"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI + command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" + stepKey="disableAddStoreCodeToUrls"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login As Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Choose custom store view --> + <actionGroup ref="AdminLoginAsCustomerChooseStoreViewActionGroup" stepKey="chooseCustomStoreView"> + <argument name="storeViewName" value="{{customStore.name}}"/> + </actionGroup> + + <!-- Assert Customer logged on on custom store view --> + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerGird"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> + <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreCodeInUrl"> + <argument name="storeCode" value="{{customStore.code}}"/> + </actionGroup> + + <!-- Log out Customer and close tab --> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/> + </test> +</tests> From 605cc5244ad18067ec0b94cb822bd46788ce4355 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Fri, 24 Apr 2020 15:35:11 +0300 Subject: [PATCH 17/29] MFTF tests updates. --- ...sMessageOrderCreatedByAdminActionGroup.xml | 11 ++-- ...ConfigNotAvailableDirectlyActionGroup.xml} | 7 ++- ...AsCustomerConfigNotVisibleActionGroup.xml} | 7 ++- ...ertLoginAsCustomerLogRecordActionGroup.xml | 11 ++-- .../AdminEditUserRoleActionGroup.xml | 5 +- ...minFilterLoginAsCustomerLogActionGroup.xml | 11 ++-- ...merAbsentOnCustomerGirdPageActionGroup.xml | 5 +- ...ustomerAbsentOnCustomerPageActionGroup.xml | 5 +- ...stomerAbsentOnOrderGridPageActionGroup.xml | 5 +- ...AsCustomerAbsentOnOrderPageActionGroup.xml | 5 +- ...inAsCustomerChooseStoreViewActionGroup.xml | 11 ++-- ...inAsCustomerLogAbsentInMenuActionGroup.xml | 11 ++-- ...CustomerLogPageNotAvailableActionGroup.xml | 8 ++- ...erLoginFromCustomerGirdPageActionGroup.xml | 22 -------- ...stomerLoginFromCustomerPageActionGroup.xml | 5 +- ...tomerLoginFromOrderGridPageActionGroup.xml | 22 -------- ...sCustomerLoginFromOrderPageActionGroup.xml | 5 +- ...AdminOpenLoginAsCustomerLogActionGroup.xml | 5 +- ...nLoginAsCustomerLogFromMenuActionGroup.xml | 5 +- .../AdminRevokeRoleResourceActionGroup.xml | 8 ++- ...sMessageOrderCreatedByAdminActionGroup.xml | 6 ++- ...sertLoginAsCustomerLoggedInActionGroup.xml | 13 ++--- ...sCustomerNotificationBannerActionGroup.xml | 27 ++++++++++ ...torefrontSignOutAndCloseTabActionGroup.xml | 6 ++- ...tificationBannerAndCloseTabActionGroup.xml | 22 ++++++++ .../Test/Mftf/Data/UserRoleData.xml | 2 +- ...rontLoginAsCustomerNotificationSection.xml | 16 ++++++ ...gUserAccessToLoginAsCustomerButtonTest.xml | 22 +++++--- ...hangUserAccessToLoginAsCustomerLogTest.xml | 31 ++++++----- ...oginAsCustomerAddProductToWishlistTest.xml | 4 +- ...oginAsCustomerEditCustomersAddressTest.xml | 4 +- ...gNotShownIfLoginAsCustomerDisabledTest.xml | 2 +- .../Test/AdminLoginAsCustomerLoggingTest.xml | 24 +++++---- .../AdminLoginAsCustomerPlaceOrderTest.xml | 36 ++++++++++--- .../Test/AdminLoginAsCustomerReorderTest.xml | 40 ++++++++++---- ...ginAsCustomerSubscribeToNewsletterTest.xml | 22 ++++---- ...minNoAccessToLoginAsCustomerButtonTest.xml | 50 ++++++++---------- ...cessToLoginAsCustomerConfigurationTest.xml | 32 +++++++----- ...INotShownIfLoginAsCustomerDisabledTest.xml | 2 +- ...minUIShownIfLoginAsCustomerEnabledTest.xml | 30 ++--------- ...tLoginAsCustomerNotificationBannerTest.xml | 52 +++++++++++++++++++ 41 files changed, 404 insertions(+), 213 deletions(-) rename app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/{AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml => AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml} (76%) rename app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/{AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml => AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml} (70%) delete mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml delete mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerNotificationBannerActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutNotificationBannerAndCloseTabActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontLoginAsCustomerNotificationSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml index 8e92a115f4595..bcf6fc96aa131 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertContainsMessageOrderCreatedByAdminActionGroup.xml @@ -8,14 +8,19 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> <actionGroup name="AdminAssertContainsMessageOrderCreatedByAdminActionGroup"> + <annotations> + <description>Assert Admin Order page contains message about Order created by a Store Administrator. + </description> + </annotations> <arguments> <argument name="orderId" type="string"/> - <argument name="adminUserFullName" defaultValue="Magento User" type="string"/> + <argument name="adminUserFullName" type="string"/> </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="Order Placed by {{adminUserFullName}} using Login as Customer" stepKey="seeMessageOrderCreatedByAdmin"/> + <see userInput="Order Placed by {{adminUserFullName}} using Login as Customer" + stepKey="seeMessageOrderCreatedByAdmin"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml similarity index 76% rename from app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml rename to app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml index 94e3631a5cc51..be66dceb8f161 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml @@ -8,8 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer config section is not available by direct url --> - <actionGroup name="AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup"> + <actionGroup name="AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup"> + <annotations> + <description>Verify Login As Customer config section is not available by direct url.</description> + </annotations> + <amOnPage url="{{AdminLoginAsCustomerConfigPage.url}}" stepKey="navigateToLoginAsCustomerConfigSection"/> <waitForPageLoad stepKey="waitForPageLoad"/> <seeInCurrentUrl url="admin/system_config/index" stepKey="seeRedirectToConfigIndexPage"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml similarity index 70% rename from app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml rename to app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml index f093d57cb171f..94fdea4b11b16 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AssertAdminLoginAsCustomerConfigNotVisibleActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml @@ -8,8 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify no Login As Customer config section available --> - <actionGroup name="AssertAdminLoginAsCustomerConfigNotVisibleActionGroup"> + <actionGroup name="AdminAssertLoginAsCustomerConfigNotVisibleActionGroup"> + <annotations> + <description>Verify no Login As Customer config section available.</description> + </annotations> + <!-- TODO: update --> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomerItem"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml index 270ce7d3719a2..ced0b51466bd5 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml @@ -8,15 +8,20 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Assert Login As Customer Log record is correct --> <actionGroup name="AdminAssertLoginAsCustomerLogRecordActionGroup"> + <annotations> + <description>Assert Login As Customer Log record is correct.</description> + </annotations> <arguments> <argument name="rowNumber" type="string"/> <argument name="adminId" type="string"/> <argument name="customerId" type="string"/> </arguments> + <seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/> - <see selector="{{AdminLoginAsCustomerLogGridSection.adminIdInRow(rowNumber)}}" userInput="{{adminId}}" stepKey="seeCorrectAdminId"/> - <see selector="{{AdminLoginAsCustomerLogGridSection.customerIdInRow(rowNumber)}}" userInput="{{customerId}}" stepKey="seeCorrectCustomerId"/> + <see selector="{{AdminLoginAsCustomerLogGridSection.adminIdInRow(rowNumber)}}" userInput="{{adminId}}" + stepKey="seeCorrectAdminId"/> + <see selector="{{AdminLoginAsCustomerLogGridSection.customerIdInRow(rowNumber)}}" userInput="{{customerId}}" + stepKey="seeCorrectCustomerId"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml index 6237b50923899..52f5b190c3cb8 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminEditUserRoleActionGroup.xml @@ -7,11 +7,14 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Open User Role resources for edit --> <actionGroup name="AdminEditUserRoleActionGroup"> + <annotations> + <description>Open User Role resources for edit.</description> + </annotations> <arguments> <argument name="roleName" type="string"/> </arguments> + <amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToUserRolesGrid"/> <fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{roleName}}" stepKey="enterRoleName"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml index cab68918745a6..18bfe790d29a5 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml @@ -8,17 +8,22 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Filter Login As Customer Log records --> <actionGroup name="AdminFilterLoginAsCustomerLogActionGroup"> + <annotations> + <description>Filter Login As Customer Log records.</description> + </annotations> <arguments> <argument name="adminId" type="string"/> <argument name="customerId" type="string"/> </arguments> + <seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/> <click selector="{{AdminLoginAsCustomerLogToolbarSection.resetFilter}}" stepKey="resetFilters"/> <waitForLoadingMaskToDisappear stepKey="waitForResetFilter"/> - <fillField selector="{{AdminLoginAsCustomerLogFiltersSection.adminId}}" userInput="{{adminId}}" stepKey="fillAdminId"/> - <fillField selector="{{AdminLoginAsCustomerLogFiltersSection.customerId}}" userInput="{{customerId}}" stepKey="fillCustomerId"/> + <fillField selector="{{AdminLoginAsCustomerLogFiltersSection.adminId}}" userInput="{{adminId}}" + stepKey="fillAdminId"/> + <fillField selector="{{AdminLoginAsCustomerLogFiltersSection.customerId}}" userInput="{{customerId}}" + stepKey="fillCustomerId"/> <click selector="{{AdminLoginAsCustomerLogToolbarSection.search}}" stepKey="applyFilters"/> <waitForLoadingMaskToDisappear stepKey="waitForApplyFilter"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml index 3ea8d4f6f0e02..071b4ed0e3c15 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml @@ -8,8 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer Login action is absent on Customer grid page --> <actionGroup name="AdminLoginAsCustomerAbsentOnCustomerGridPageActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is absent on Customer grid page.</description> + </annotations> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/> <waitForPageLoad stepKey="waitForCustomerGridPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml index bae87ca9000c5..28a8b483f094f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml @@ -8,11 +8,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer Login action is absent on Customer page --> <actionGroup name="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is absent on Customer page.</description> + </annotations> <arguments> <argument name="customerId" type="string"/> </arguments> + <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> <waitForPageLoad stepKey="waitForCustomerPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml index 77f64c332639f..cde0c8c484fbc 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml @@ -8,8 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer Login action is absent on Order grid page --> <actionGroup name="AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is absent on Order grid page.</description> + </annotations> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/> <waitForPageLoad stepKey="waitForOrderGridPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml index fb55156d021d4..746580546fbf3 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml @@ -8,11 +8,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer Login action is absent on Order page --> <actionGroup name="AdminLoginAsCustomerAbsentOnOrderPageActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is absent on Order page.</description> + </annotations> <arguments> <argument name="orderId" type="string"/> </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> <waitForPageLoad stepKey="waitForOrderPageLoad"/> <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml index c4b5067eaa857..7a751cb0f31b2 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml @@ -8,13 +8,18 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Manually choose store view for LoginAsCustomer functionality --> <actionGroup name="AdminLoginAsCustomerChooseStoreViewActionGroup"> + <annotations> + <description>Manually choose store view for LoginAsCustomer functionality.</description> + </annotations> <arguments> <argument name="storeViewName" type="string"/> </arguments> - <selectOption selector="{{AdminLoginAsCustomerLoginManualContentSection.storeView}}" userInput="{{storeViewName}}" stepKey="selectStoreView"/> - <click selector="{{AdminLoginAsCustomerLoginManualActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomer"/> + + <selectOption selector="{{AdminLoginAsCustomerLoginManualContentSection.storeView}}" + userInput="{{storeViewName}}" stepKey="selectStoreView"/> + <click selector="{{AdminLoginAsCustomerLoginManualActionsSection.loginAsCustomer}}" + stepKey="clickLoginAsCustomer"/> <waitForElementVisible selector="{{StorefrontHeaderSection.logoLink}}" stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml index 0049d3dcc2196..4f475c9793624 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml @@ -8,9 +8,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer is absent in admin menu --> <actionGroup name="AdminLoginAsCustomerLogAbsentInMenuActionGroup"> - <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" stepKey="clickOnCustomersMenuItem"/> - <dontSeeElement selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" stepKey="dontSeeLoginAsCustomerLog"/> + <annotations> + <description>Verify Login As Customer is absent in admin menu.</description> + </annotations> + + <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" + stepKey="clickOnCustomersMenuItem"/> + <dontSeeElement selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" + stepKey="dontSeeLoginAsCustomerLog"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml index 850604b990de9..9f23a69ab3aff 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml @@ -8,10 +8,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer is not available by direct url --> <actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup"> + <annotations> + <description>Verify Login As Customer is not available by direct url.</description> + </annotations> + <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/> <waitForPageLoad stepKey="waitForLoginAsCustomerLogPageLoad"/> - <see selector="{{AdminHeaderSection.pageHeading}}" userInput="404 Error" stepKey="see404PageHeading"/> + <see userInput="Sorry, you need permissions to view this content." + selector="{{AdminMessagesSection.accessDenied}}" stepKey="seeAccessDenied"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml deleted file mode 100644 index 0a35564875e18..0000000000000 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup.xml +++ /dev/null @@ -1,22 +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"> - <!-- Verify Login As Customer Login action is works properly from Customer grid page --> - <actionGroup name="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup"> - <arguments> - <argument name="customerEmail" type="string"/> - </arguments> - <amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/> - <waitForPageLoad stepKey="waitForCustomerGridPageLoad"/> - <click selector="{{AdminCustomerGridSection.customerLoginAsCustomerLinkByEmail(customerEmail)}}" stepKey="clickLoginAsCustomerLink"/> - <switchToNextTab stepKey="switchToNewTab"/> - <waitForElementVisible selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="waitForPageLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml index 41db38169ac05..c58ace5bbebc8 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml @@ -8,11 +8,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer Login action is works properly from Customer page --> <actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is works properly from Customer page.</description> + </annotations> <arguments> <argument name="customerId" type="string"/> </arguments> + <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> <waitForPageLoad stepKey="waitForCustomerPageLoad"/> <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml deleted file mode 100644 index aba61a86249cd..0000000000000 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderGridPageActionGroup.xml +++ /dev/null @@ -1,22 +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"> - <!-- Verify Login As Customer Login action is works properly from Order grid page --> - <actionGroup name="AdminLoginAsCustomerLoginFromOrderGridPageActionGroup"> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrderGridPageLoad"/> - <click selector="{{AdminOrdersGridSection.loginAsCustomerLink(orderId)}}" stepKey="clickLoginAsCustomerLink"/> - <switchToNextTab stepKey="switchToNewTab"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml index 3b6f363a2d651..88c1cef7ea0cc 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml @@ -8,11 +8,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Login As Customer Login action is works properly from Order grid page --> <actionGroup name="AdminLoginAsCustomerLoginFromOrderPageActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is works properly from Order grid page.</description> + </annotations> <arguments> <argument name="orderId" type="string"/> </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> <waitForPageLoad stepKey="waitForOrderPageLoad"/> <click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml index 508b13abbc43e..6cd47e474439a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml @@ -8,8 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Navigate to Login As Customer Log page --> <actionGroup name="AdminOpenLoginAsCustomerLogActionGroup"> + <annotations> + <description>Navigate to Login As Customer Log page.</description> + </annotations> + <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="gotoLoginAsCustomerLogPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <see userInput="Login As Customer Log" stepKey="titleIsVisible"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml index 584e1d22fbc96..0cc6722a1bbc1 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml @@ -8,8 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Navigate to Login As Customer Log from Menu --> <actionGroup name="AdminOpenLoginAsCustomerLogFromMenuActionGroup"> + <annotations> + <description>Navigate to Login As Customer Log from Menu.</description> + </annotations> + <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" stepKey="clickOnCustomersMenuItem"/> <click selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml index 49c404a92f0de..030b53408951e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminRevokeRoleResourceActionGroup.xml @@ -8,16 +8,20 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Revoke access to resource from edit role page --> <actionGroup name="AdminRevokeRoleResourceActionGroup"> + <annotations> + <description>Revoke access to resource from edit role page.</description> + </annotations> <arguments> <argument name="resourceName" type="string"/> </arguments> + <selectOption selector="{{AdminEditRoleResourcesSection.resourceAccess}}" userInput="0" stepKey="selectResourceAccessCustom"/> <waitForElementVisible selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" stepKey="waitForElementVisible"/> - <scrollTo selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" x="0" y="-80" stepKey="scrollToContentBlock"/> + <scrollTo selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" x="0" y="-80" + stepKey="scrollToContentBlock"/> <click selector="{{AdminEditRoleInfoSection.blockName(resourceName)}}" stepKey="clickContentBlockCheckbox"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml index 508ada3295a8e..f40ea7f93c7a1 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup.xml @@ -8,11 +8,15 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> <actionGroup name="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup"> + <annotations> + <description>Verify Storefront Order page contains message about Order created by a Store Administrator. + </description> + </annotations> <arguments> <argument name="orderId" type="string"/> </arguments> + <amOnPage url="{{StorefrontCustomerOrderViewPage.url(orderId)}}" stepKey="gotoOrderPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <see userInput="Order Placed by Store Administrator" stepKey="seeMessageOrderCreatedByAdmin"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml index 5a37ff8e43e7f..28d29b856a538 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml @@ -8,21 +8,18 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Verify Admin successfully logged in as Customer --> <actionGroup name="StorefrontAssertLoginAsCustomerLoggedInActionGroup"> + <annotations> + <description>Verify Admin successfully logged in as Customer.</description> + </annotations> <arguments> <argument name="customerFullName" type="string"/> <argument name="customerEmail" type="string"/> </arguments> - <seeInCurrentUrl url="{{StorefrontLoginAsCustomerLoginProceedPage.url}}" stepKey="assertOnProceedPage"/> - <!-- TODO: uncomment after fix --> - <!-- <seeInTitle userInput="You are logged in." stepKey="assertYouAreLoggedInInTitle"/>--> - <see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="You are logged in." - stepKey="assertYouAreLoggedInOnPage"/> - <!-- TODO: uncomment after fix --> - <!-- <see selector="{{LoggedInCustomerHeaderLinksSection.customerDropdownMenu}}" userInput="Welcome, {{customerFullName}}!" stepKey="assertCorrectWelcomeMessage"/>--> + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="gotoCustomerAccountPage"/> <waitForPageLoad stepKey="waitForCustomerAccountPageLoad"/> + <see selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}!" stepKey="assertCorrectWelcomeMessage"/> <see selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" userInput="{{customerEmail}}" stepKey="assertCustomerEmailInContactInformation"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerNotificationBannerActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerNotificationBannerActionGroup.xml new file mode 100644 index 0000000000000..ce2e261f10040 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerNotificationBannerActionGroup.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="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup"> + <annotations> + <description>Verify Login as Customer notification banner present on page.</description> + </annotations> + <arguments> + <argument name="customerFullName" type="string"/> + <argument name="websiteName" type="string" defaultValue="Main Website"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}" stepKey="waitForNotificationBanner"/> + <see selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}" + userInput="You are connected as {{customerFullName}} on {{websiteName}}" + stepKey="assertCorrectNotificationBannerMessage"/> + <seeElement selector="{{StorefrontLoginAsCustomerNotificationSection.closeLink}}" + stepKey="assertCloseNotificationBannerPresent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml index 9eaed420ba9da..87e5b264a6ed6 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutAndCloseTabActionGroup.xml @@ -8,9 +8,13 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Customer sign out and close tab --> <actionGroup name="StorefrontSignOutAndCloseTabActionGroup"> + <annotations> + <description>Customer sign out and close tab.</description> + </annotations> + <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> + <waitForElementVisible selector="{{StoreFrontSignOutSection.signOut}}" stepKey="waitForSignOut"/> <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> <waitForPageLoad stepKey="waitForPageLoad"/> <see userInput="You are signed out" stepKey="signOut"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutNotificationBannerAndCloseTabActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutNotificationBannerAndCloseTabActionGroup.xml new file mode 100644 index 0000000000000..e0e6973509eb3 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontSignOutNotificationBannerAndCloseTabActionGroup.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="StorefrontSignOutNotificationBannerAndCloseTabActionGroup"> + <annotations> + <description>Customer sign out by Notification Banner and close tab.</description> + </annotations> + + <waitForElementVisible selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}" stepKey="waitForNotificationBanner"/> + <click selector="{{StorefrontLoginAsCustomerNotificationSection.closeLink}}" stepKey="clickToSignOut"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You are signed out" stepKey="signOut"/> + <closeTab stepKey="closeTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml index 2f3d10dcd4daa..720ae7eb2147e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/UserRoleData.xml @@ -9,7 +9,7 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <!--This Role has access for all resources individually --> - <entity name="customRoleAllResources" type="user_role"> + <entity name="CustomRoleAllResources" type="user_role"> <data key="name" unique="suffix">allAccessRole</data> <data key="rolename">allAccessRole</data> <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontLoginAsCustomerNotificationSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontLoginAsCustomerNotificationSection.xml new file mode 100644 index 0000000000000..cee7609632e87 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontLoginAsCustomerNotificationSection.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="StorefrontLoginAsCustomerNotificationSection"> + <element name="notificationText" type="text" selector="//div[contains(@class, 'lac-notification')]//div[contains(@class, 'lac-notification-text')]/span" timeout="30"/> + <element name="closeLink" type="button" selector="//div[contains(@class, 'lac-notification')]//div[contains(@class, 'lac-notification-links')]/a[contains(@class, 'lac-notification-close-link')]" timeout="30"/> + </section> +</sections> + diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml index e346e4ba8a587..e2079d85f6267 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml @@ -17,10 +17,15 @@ value="Verify admin user's access to 'Login as Customer Button' can be changed"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="MQE-1964"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserBefore"/> @@ -28,14 +33,14 @@ <!--Create New Role--> <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> - <argument name="role" value="customRoleAllResources"/> + <argument name="role" value="CustomRoleAllResources"/> </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> <!--Create New User--> <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> <argument name="user" value="NewAdminUser"/> - <argument name="role" value="customRoleAllResources"/> + <argument name="role" value="CustomRoleAllResources"/> </actionGroup> </before> <after> @@ -50,7 +55,7 @@ <!--Delete new Role--> <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> - <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + <argument name="roleName" value="{{CustomRoleAllResources.rolename}}"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> @@ -75,19 +80,20 @@ <!-- Revoke 'Login as Customer Button' access for new User --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUser"/> <actionGroup ref="AdminEditUserRoleActionGroup" stepKey="openEditUserRole"> - <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + <argument name="roleName" value="{{CustomRoleAllResources.rolename}}"/> </actionGroup> <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> - <argument name="resourceName" value="Login As Customer Button"/> + <argument name="resourceName" value="Allow Login as Customer Button"/> </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveEditedRole"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutDefaultAdminUserAfterRevoke"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserAfterRevoke"> - <argument name="adminUser" value="NewAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUserAfterRevoke"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> <!-- Verify new User no longer has access to 'Login as Customer Button' --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml index 1b8720eec9fc8..255c6978d6e55 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml @@ -17,37 +17,42 @@ value="Verify admin user's access to 'Login as Customer Log' can be changed"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="MQE-1964"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserBefore"/> <!--Create New Role--> <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> - <argument name="role" value="customRoleAllResources"/> + <argument name="role" value="CustomRoleAllResources"/> </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> <!--Create New User--> <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> <argument name="user" value="NewAdminUser"/> - <argument name="role" value="customRoleAllResources"/> + <argument name="role" value="CustomRoleAllResources"/> </actionGroup> </before> <after> <!--Delete new User--> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUserAfter"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserAfter"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> <argument name="user" value="NewAdminUser"/> </actionGroup> <!--Delete new Role--> <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> - <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + <argument name="roleName" value="{{CustomRoleAllResources.rolename}}"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> @@ -58,8 +63,9 @@ <!-- Login as new User --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUser"> - <argument name="adminUser" value="NewAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> <!-- Verify new User has access to 'Login as Customer Log' --> @@ -67,19 +73,20 @@ <!-- Revoke 'Login as Customer Log' access for new User --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUser"/> <actionGroup ref="AdminEditUserRoleActionGroup" stepKey="openEditUserRole"> - <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + <argument name="roleName" value="{{CustomRoleAllResources.rolename}}"/> </actionGroup> <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> - <argument name="resourceName" value="Login As Customer Log"/> + <argument name="resourceName" value="View Login as Customer Log"/> </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveEditedRole"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutDefaultAdminUserAfterRevoke"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserAfterRevoke"> - <argument name="adminUser" value="NewAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUserAfterRevoke"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> <!-- Verify new User no longer has access to 'Login as Customer Log' menu item --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml index 1327bc1b74ecc..633aed7d0317d 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml @@ -21,13 +21,15 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml index 88f65b167efc9..35373d78f194b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml @@ -21,12 +21,14 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logoutAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index d01bd27c00ca0..bcd824707a1cd 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -20,7 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml index c66a1519d9c63..6d6dcc1377434 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml @@ -22,6 +22,8 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="NewAdminUser" stepKey="createNewAdmin"/> <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> @@ -35,28 +37,28 @@ <actionGroup ref="AdminDeleteUserViaCurlActionGroup" stepKey="deleteNewAdmin"> <argument name="user" value="NewAdminUser"/> </actionGroup> - <actionGroup ref="logout" stepKey="logoutAfter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login into First Customer account --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsFirstCustomerByDefaultAdmin"> - <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> </actionGroup> <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/> <!-- Login into Second Customer account --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsSecondCustomerByDefaultAdmin"> - <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> + <argument name="customerId" value="$$createSecondCustomer.id$$"/> </actionGroup> <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerDefaultAdmin"/> <!-- Log out as Default Admin User --> - <actionGroup ref="logout" stepKey="logoutAsDefaultAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdmin"/> <!-- Login as New Admin User --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> @@ -65,16 +67,16 @@ </actionGroup> <!-- Login into First Customer account --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsFirstCustomerByNewAdmin"> - <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> </actionGroup> <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerNewAdmin"/> <!-- Login into Second Customer account --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsSecondCustomerByNewAdmin"> - <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> + <argument name="customerId" value="$$createSecondCustomer.id$$"/> </actionGroup> <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerNewAdmin"/> @@ -104,6 +106,6 @@ </actionGroup> <!-- Log out as New Admin User --> - <actionGroup ref="logout" stepKey="logoutAsNewAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsNewAdmin"/> </test> </tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index 54c364eb10cee..b5c8817141438 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -21,28 +21,51 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + + <!-- Create new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateUserWithRoleActionGroup" stepKey="createAdminUser"> + <argument name="user" value="activeAdmin"/> + <argument name="role" value="roleDefaultAdministrator"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> + + <!-- Login as new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToNewAdmin"> + <argument name="username" value="{{activeAdmin.username}}"/> + <argument name="password" value="{{activeAdmin.password}}"/> + </actionGroup> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Delete new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser"> + <argument name="user" value="activeAdmin"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Login As Customer from Customer grid page --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" - stepKey="loginAsCustomer"> - <argument name="customerEmail" value="$$createCustomer.email$$"/> + <!-- Login As Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> </actionGroup> <!-- Place Order as Customer --> @@ -53,7 +76,7 @@ <argument name="product" value="$$createProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> - <actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCart"/> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/> <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> @@ -65,6 +88,7 @@ <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageOrderCreatedByAdmin"> <argument name="orderId" value="{$grabOrderId}"/> + <argument name="adminUserFullName" value="{{activeAdmin.firstname}} {{activeAdmin.lastname}}"/> </actionGroup> </test> </tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml index d89da1e53d0b0..13c052df8209e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -21,19 +21,42 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + + <!-- Create new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateUserWithRoleActionGroup" stepKey="createAdminUser"> + <argument name="user" value="activeAdmin"/> + <argument name="role" value="roleDefaultAdministrator"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> + + <!-- Login as new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToNewAdmin"> + <argument name="username" value="{{activeAdmin.username}}"/> + <argument name="password" value="{{activeAdmin.password}}"/> + </actionGroup> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Delete new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser"> + <argument name="user" value="activeAdmin"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> @@ -52,17 +75,16 @@ <argument name="product" value="$$createProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> - <actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCart"/> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/> <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> <!-- Log out from storefront as Customer --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogOut"/> - <!-- Login As Customer from Customer grid page --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" - stepKey="loginAsCustomer"> - <argument name="customerEmail" value="$$createCustomer.email$$"/> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> </actionGroup> <!-- Make reorder --> @@ -74,13 +96,13 @@ <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> <actionGroup ref="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyStorefrontMessageOrderCreatedByAdmin"> - <argument name="orderId" value="{grabReorderId}"/> + <argument name="orderId" value="${grabReorderId}"/> </actionGroup> <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageOrderCreatedByAdmin"> - <argument name="orderId" value="{grabReorderId}"/> + <argument name="orderId" value="${grabReorderId}"/> + <argument name="adminUserFullName" value="{{activeAdmin.firstname}} {{activeAdmin.lastname}}"/> </actionGroup> - </test> </tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml index 477fb82408903..60a6fe7963043 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml @@ -21,9 +21,11 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> @@ -39,17 +41,17 @@ </actionGroup> <!-- Subscribe for newsletter --> - <amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/> - <click selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" - stepKey="checkSubscribedNewsletter"/> - <click selector="{{StorefrontNewsletterManageSection.saveButton}}" - stepKey="saveSubscription"/> - <waitForPageLoad stepKey="waitForSubscriptionSaved"/> + <actionGroup ref="StorefrontCustomerNavigateToNewsletterPageActionGroup" stepKey="navigateToNewsletterPage"/> + <actionGroup ref="StorefrontCustomerUpdateGeneralSubscriptionActionGroup" stepKey="subscribeToNewsletter"/> + <actionGroup ref="AssertStorefrontCustomerMessagesActionGroup" stepKey="assertMessage"> + <argument name="message" value="We have saved your subscription."/> + </actionGroup> <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInAsCustomer"/> <!-- Verify subscription successful --> - <amOnPage url="{{AdminNewsletterSubscriberPage.url}}" stepKey="goToNewsletterSubscriberGrid"/> - <see selector="{{AdminNewsletterSubscriberGridSection.email('1')}}" userInput="$$createCustomer.email$$" stepKey="seeCustomerEmailInSubscriberGrid"/> - <see selector="{{AdminNewsletterSubscriberGridSection.type('1')}}" userInput="Customer" stepKey="seeCustomerTypeInSubscriberGrid"/> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewsletters" stepKey="assertSubscribedToNewsletter"/> </test> </tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml index 5edbc0c5bbbf5..5bacca897b66a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml @@ -16,30 +16,37 @@ <description value="Login into Magento Admin panel as user that does not have access to 'Login as customer' button"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="MQE-1964"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> - - <!--Create New User--> - <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/> - <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillNewUserForm"> - <argument name="user" value="NewAdminUser"/> - </actionGroup> - <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserBefore"/> <!--Create New Role--> <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> - <argument name="role" value="roleSales"/> + <argument name="role" value="CustomRoleAllResources"/> + </actionGroup> + <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> + <argument name="resourceName" value="Allow Login as Customer Button"/> </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + + <!--Create New User--> + <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> + <argument name="user" value="NewAdminUser"/> + <argument name="role" value="CustomRoleAllResources"/> + </actionGroup> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> @@ -48,14 +55,14 @@ <!--Delete new User--> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserAfter"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> - <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> + <argument name="user" value="NewAdminUser"/> </actionGroup> <!--Delete new Role--> - <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRole"> - <argument name="roleName" value="{{roleSales.rolename}}"/> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> + <argument name="roleName" value="{{CustomRoleAllResources.rolename}}"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> @@ -63,22 +70,11 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!--Assign new role--> - <actionGroup ref="AdminOpenUserEditPageActionGroup" stepKey="openUserEditPage"> - <argument name="user" value="NewAdminUser"/> - </actionGroup> - <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillUserForm"> - <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> - </actionGroup> - <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveUser"/> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> - <argument name="message" value="You saved the user."/> - </actionGroup> - <!-- Login as new User --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsSaleRoleUser"> - <argument name="adminUser" value="AdminUserWithUpdatedUserRoleToSales"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> <!-- Verify Login As Customer Login action is absent on Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml index eab2f2c6dfd6e..c7f42de741862 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml @@ -10,39 +10,44 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminNoAccessToLoginAsCustomerConfigurationTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Permissions and ACl"/> <title value="User does not have access to 'Login as customer' section in System Configuration"/> <description value="Login into Magento Admin panel as user that does not have access to 'Login as customer' section in System Configuration"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="MQE-1964"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserBefore"/> <!--Create New Role--> <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> - <argument name="role" value="customRoleAllResources"/> + <argument name="role" value="CustomRoleAllResources"/> </actionGroup> <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> - <argument name="resourceName" value="Login As Customer Section"/> + <argument name="resourceName" value="Login as Customer Section"/> </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> <!--Create New User--> <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> <argument name="user" value="NewAdminUser"/> - <argument name="role" value="customRoleAllResources"/> + <argument name="role" value="CustomRoleAllResources"/> </actionGroup> </before> <after> @@ -52,14 +57,14 @@ <!--Delete new User--> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserAfter"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> <argument name="user" value="NewAdminUser"/> </actionGroup> <!--Delete new Role--> <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> - <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> + <argument name="roleName" value="{{CustomRoleAllResources.rolename}}"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> @@ -70,8 +75,9 @@ <!-- Login as new User --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsSaleRoleUser"> - <argument name="adminUser" value="NewAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> <!-- Navigate to Configuration page and open Customers tab --> @@ -80,11 +86,11 @@ <argument name="tabName" value="Customers"/> </actionGroup> - <!-- Assert no Login As Customer config section visible --> - <actionGroup ref="AssertAdminLoginAsCustomerConfigNotVisibleActionGroup" stepKey="assertConfigNotVisible"/> + <!-- Assert no Login as Customer config section visible --> + <actionGroup ref="AdminAssertLoginAsCustomerConfigNotVisibleActionGroup" stepKey="assertConfigNotVisible"/> - <!-- Assert Login As Customer config section is not available by direct url --> - <actionGroup ref="AssertAdminLoginAsCustomerConfigNotAvailableDirectlyActionGroup" + <!-- Assert Login as Customer config section is not available by direct url --> + <actionGroup ref="AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup" stepKey="assertConfigNotAvailableDirectly"/> </test> </tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index 533854d12bd61..595b47cb56216 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml index fd7828f570a85..8170051dd2c32 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml @@ -12,7 +12,7 @@ <annotations> <features value="Login As Customer"/> <stories value="Availability of UI elements if module enable/disable"/> - <title value="UI elements are shown if 'Login as customer' functionality is disabled"/> + <title value="UI elements are shown if 'Login as customer' functionality is enabled"/> <description value="Verify that UI elements are present and links are working if 'Login as customer' functionality enabled"/> <severity value="BLOCKER"/> @@ -21,13 +21,15 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> @@ -40,18 +42,6 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Verify Login As Customer Login action works correctly from Customer grid page --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" - stepKey="verifyLoginAsCustomerWorksOnCustomerGridPage"> - <argument name="customerEmail" value="$$createCustomer.email$$"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerGird"> - <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> - <argument name="customerEmail" value="$$createCustomer.email$$"/> - </actionGroup> - <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInFromCustomerGird"/> - <!-- Verify Login As Customer Login action works correctly from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="verifyLoginAsCustomerWorksOnCustomerPage"> @@ -74,18 +64,6 @@ <argument name="orderId" value="$grabOrderId"/> </actionGroup> - <!-- Verify Login As Customer Login action works correctly from Order grid page --> - <actionGroup ref="AdminLoginAsCustomerLoginFromOrderGridPageActionGroup" - stepKey="verifyLoginAsCustomerWorksOnOrderGridPage"> - <argument name="orderId" value="$grabOrderId"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromOrderGridPage"> - <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> - <argument name="customerEmail" value="$$createCustomer.email$$"/> - </actionGroup> - <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInFromOrderGridPage"/> - <!-- Verify Login As Customer Login action works correctly from Order page --> <actionGroup ref="AdminLoginAsCustomerLoginFromOrderPageActionGroup" stepKey="verifyLoginAsCustomerWorksOnOrderPage"> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml new file mode 100644 index 0000000000000..ec47c2127a94d --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.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="StorefrontLoginAsCustomerNotificationBannerTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Availability of UI elements if module enable/disable"/> + <title value="Notification Banner is present on Storefront page"/> + <description + value="Verify that Notification Banner is present on page if 'Login as customer' functionality used"/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login As Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Assert Notification Banner is present on page --> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBanner"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Log out Customer by Notification Banner and close tab --> + <actionGroup ref="StorefrontSignOutNotificationBannerAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/> + </test> +</tests> From b2846ed473b2ad833b673a9c35e6f0e12ac7309a Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 28 Apr 2020 12:45:29 +0300 Subject: [PATCH 18/29] MFTF tests updates: skip failing tests. --- .../Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml | 3 +++ ...LoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml | 3 +++ .../Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml | 3 +++ .../Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml index a931aefc6edb5..d88f860b6078b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml @@ -17,6 +17,9 @@ value="Verify admin user can directly login into customer account on custom website using 'Login as customer' functionality"/> <severity value="BLOCKER"/> <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/issues/102"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index bcd824707a1cd..6fce0d7c69988 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -16,6 +16,9 @@ <description value="Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/issues/71"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index ae4a10e7fd568..036ab307527b0 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -18,6 +18,9 @@ value="Verify admin user can directly login into customer account to Custom store view when Store View To Login In = Manual Choose"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/issues/102"/> + </skip> </annotations> <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index 595b47cb56216..74fed6598085d 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -16,6 +16,9 @@ <description value="Verify that UI elements are not shown if 'Login as customer' functionality is disabled"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/issues/71"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> From 35381a20d985d57cd53559fd1320676e1ef8c378 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 28 Apr 2020 18:14:52 +0300 Subject: [PATCH 19/29] MFTF update. --- .../Test/Mftf/Data/LoginAsCustomerConfigData.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml index 4fe414d1d895e..316a810ce13e4 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/LoginAsCustomerConfigData.xml @@ -9,12 +9,12 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="LoginAsCustomerConfigDataEnabled"> - <data key="path">mfloginascustomer/general/enabled</data> + <data key="path">login_as_customer/general/enabled</data> </entity> <entity name="LoginAsCustomerDisablePageCache"> - <data key="path">mfloginascustomer/general/disable_page_cache</data> + <data key="path">login_as_customer/general/disable_page_cache</data> </entity> <entity name="LoginAsCustomerStoreViewLogin"> - <data key="path">mfloginascustomer/general/store_view_login</data> + <data key="path">login_as_customer/general/store_view_manual_choice_enabled</data> </entity> </entities> From a55759c41b13a46a69413cead5e8704eb616f2a6 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Mon, 4 May 2020 11:42:02 +0300 Subject: [PATCH 20/29] MFTF update. --- ...inAsCustomerChooseStoreViewActionGroup.xml | 25 --------------- ...stomerLoginFromCustomerPageActionGroup.xml | 5 +++ ...romCustomerPageManualChooseActionGroup.xml | 31 +++++++++++++++++++ ...sCustomerLoginFromOrderPageActionGroup.xml | 5 +++ .../Mftf/Page/AdminLoginAsCustomerLogPage.xml | 2 +- ...oginAsCustomerConfirmationModalSection.xml | 14 +++++++++ .../AdminLoginAsCustomerLogGridSection.xml | 12 +++---- ...oginAsCustomerAddProductToWishlistTest.xml | 2 +- ...gNotShownIfLoginAsCustomerDisabledTest.xml | 2 +- .../AdminLoginAsCustomerManualChooseTest.xml | 6 +--- ...INotShownIfLoginAsCustomerDisabledTest.xml | 3 -- 11 files changed, 65 insertions(+), 42 deletions(-) delete mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerConfirmationModalSection.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml deleted file mode 100644 index 7a751cb0f31b2..0000000000000 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerChooseStoreViewActionGroup.xml +++ /dev/null @@ -1,25 +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="AdminLoginAsCustomerChooseStoreViewActionGroup"> - <annotations> - <description>Manually choose store view for LoginAsCustomer functionality.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <selectOption selector="{{AdminLoginAsCustomerLoginManualContentSection.storeView}}" - userInput="{{storeViewName}}" stepKey="selectStoreView"/> - <click selector="{{AdminLoginAsCustomerLoginManualActionsSection.loginAsCustomer}}" - stepKey="clickLoginAsCustomer"/> - <waitForElementVisible selector="{{StorefrontHeaderSection.logoLink}}" stepKey="waitForPageLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml index c58ace5bbebc8..b10bad9fa2900 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml @@ -19,6 +19,11 @@ <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> <waitForPageLoad stepKey="waitForCustomerPageLoad"/> <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> + <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" + stepKey="seeModal"/> + <!-- TODO: Unskip after https://github.com/magento/magento2-login-as-customer/issues/137 is fixed--> + <!-- <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/>--> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml new file mode 100644 index 0000000000000..6fda137c3f6a4 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.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="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup"> + <annotations> + <description>Verify Login As Customer Login action is works properly from Customer page with manual Store View choose.</description> + </annotations> + <arguments> + <argument name="customerId" type="string"/> + <argument name="storeViewName" type="string" defaultValue="default"/> + </arguments> + + <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> + <waitForPageLoad stepKey="waitForCustomerPageLoad"/> + <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> + <see selector="{{AdminConfirmationModalSection.title}}" userInput="Login as Customer: Select Store View" stepKey="seeModal"/> + <!-- TODO: Unskip after https://github.com/magento/magento2-login-as-customer/issues/137 is fixed--> + <!-- <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/>--> + <selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.storeView}}" userInput="{{storeViewName}}" stepKey="selectStoreView"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <switchToNextTab stepKey="switchToNewTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml index 88c1cef7ea0cc..1aab6aa58c9e6 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml @@ -19,6 +19,11 @@ <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> <waitForPageLoad stepKey="waitForOrderPageLoad"/> <click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> + <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" + stepKey="seeModal"/> + <!-- TODO: Unskip after https://github.com/magento/magento2-login-as-customer/issues/137 is fixed--> + <!-- <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/>--> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml index 0a26dd74d1ee9..a917ab6acb182 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml @@ -8,7 +8,7 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> - <page name="AdminLoginAsCustomerLogPage" url="loginascustomer/login/" area="admin" module="Magento_LoginAsCustomer"> + <page name="AdminLoginAsCustomerLogPage" url="loginascustomer_log/log/index/" area="admin" module="Magento_LoginAsCustomer"> <section name="AdminLoginAsCustomerLogToolbarSection"/> <section name="AdminLoginAsCustomerLogFiltersSection"/> <section name="AdminLoginAsCustomerLogGridSection"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerConfirmationModalSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerConfirmationModalSection.xml new file mode 100644 index 0000000000000..f400ba02a5392 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerConfirmationModalSection.xml @@ -0,0 +1,14 @@ +<?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="AdminLoginAsCustomerConfirmationModalSection"> + <element name="storeView" type="select" selector="//select[@id='lac-confirmation-popup-store-id']"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml index d2f37fae04d13..032281a2277f4 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogGridSection.xml @@ -9,12 +9,12 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminLoginAsCustomerLogGridSection"> - <element name="loginIdInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='login_id']" parameterized="true"/> - <element name="customerIdInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='customer_id']" parameterized="true"/> - <element name="customerEmailInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='email']" parameterized="true"/> - <element name="adminIdInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='admin_id']" parameterized="true"/> - <element name="adminNameInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='username']" parameterized="true"/> - <element name="createdAtInRow" type="text" selector="//table[@class='data-grid']/tbody/tr[{{row}}]/td[@data-column='created_at']" parameterized="true"/> + <element name="loginIdInRow" type="text" selector="//table[@data-role='grid']/tbody/tr[{{row}}]/td[1]" parameterized="true"/> + <element name="customerIdInRow" type="text" selector="//table[@data-role='grid']/tbody/tr[{{row}}]/td[2]" parameterized="true"/> + <element name="customerEmailInRow" type="text" selector="//table[@data-role='grid']/tbody/tr[{{row}}]/td[3]" parameterized="true"/> + <element name="adminIdInRow" type="text" selector="//table[@data-role='grid']/tbody/tr[{{row}}]/td[4]" parameterized="true"/> + <element name="adminNameInRow" type="text" selector="//table[@data-role='grid']/tbody/tr[{{row}}]/td[5]" parameterized="true"/> + <element name="createdAtInRow" type="text" selector="//table[@data-role='grid']/tbody/tr[{{row}}]/td[6]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml index 633aed7d0317d..17480d0f84c7b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml @@ -43,7 +43,7 @@ <!-- Admin Login As Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" - stepKey="lLoginAsCustomerFromCustomerPage"> + stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index 6fce0d7c69988..3047843b0c758 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -17,7 +17,7 @@ <severity value="CRITICAL"/> <group value="login_as_customer"/> <skip> - <issueId value="https://github.com/magento/magento2-login-as-customer/issues/71"/> + <issueId value="https://github.com/magento/magento2-login-as-customer/issues/136"/> </skip> </annotations> <before> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index 036ab307527b0..a4e605864a976 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -52,13 +52,9 @@ </after> <!-- Login As Customer from Customer page --> - <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> - </actionGroup> - - <!-- Choose custom store view --> - <actionGroup ref="AdminLoginAsCustomerChooseStoreViewActionGroup" stepKey="chooseCustomStoreView"> <argument name="storeViewName" value="{{customStore.name}}"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index 74fed6598085d..595b47cb56216 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -16,9 +16,6 @@ <description value="Verify that UI elements are not shown if 'Login as customer' functionality is disabled"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> - <skip> - <issueId value="https://github.com/magento/magento2-login-as-customer/issues/71"/> - </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> From 3e06664d3b621448b2ab83f9bcec2fd9906d6daf Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 6 May 2020 17:37:48 +0300 Subject: [PATCH 21/29] MFTF update. --- ...ntAssertCustomerOnStoreViewActionGroup.xml | 21 +++++++++++ ...sertLoginAsCustomerLoggedInActionGroup.xml | 3 +- .../AdminLoginAsCustomerAutoDetectionTest.xml | 3 ++ ...CustomerManualChooseStoreCodeInUrlTest.xml | 36 +++++++++++++++++++ .../AdminLoginAsCustomerManualChooseTest.xml | 13 ++----- 5 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertCustomerOnStoreViewActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertCustomerOnStoreViewActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertCustomerOnStoreViewActionGroup.xml new file mode 100644 index 0000000000000..f63cda2303526 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertCustomerOnStoreViewActionGroup.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="StorefrontAssertCustomerOnStoreViewActionGroup"> + <annotations> + <description>Assert Customer is on the provided Store View.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string" defaultValue="Default Store View"/> + </arguments> + + <see selector="{{StorefrontHeaderSection.storeViewSwitcher}}" userInput="{{storeViewName}}" stepKey="clickStoreViewSwitcher"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml index 28d29b856a538..bb7e938bdfb59 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml @@ -17,8 +17,7 @@ <argument name="customerEmail" type="string"/> </arguments> - <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="gotoCustomerAccountPage"/> - <waitForPageLoad stepKey="waitForCustomerAccountPageLoad"/> + <seeInCurrentUrl url="{{StorefrontCustomerDashboardPage.url}}" stepKey="assertOnCustomerAccountPage"/> <see selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}!" stepKey="assertCorrectWelcomeMessage"/> <see selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" userInput="{{customerEmail}}" stepKey="assertCustomerEmailInContactInformation"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml index 38115f63c8d81..bbb6e342cca10 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml @@ -18,6 +18,9 @@ value="Verify admin user can directly login into customer account to Default store view when Store View To Login In = Auto detection"/> <severity value="BLOCKER"/> <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/pull/135"/> + </skip> </annotations> <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml new file mode 100644 index 0000000000000..3b78459301398 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml @@ -0,0 +1,36 @@ +<?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="AdminLoginAsCustomerManualChooseStoreCodeInUrlTest" extends="AdminLoginAsCustomerManualChooseTest"> + <annotations> + <features value="Login As Customer"/> + <stories value="Select Store View based on 'Store View To Login In' setting"/> + <title + value="Admin user directly login into customer account with store View To Login In = Manual Choose when store code is added to url"/> + <description + value="Verify admin user can directly login into customer account to Custom store view when Store View To Login In = Manual Choose when store code is added to url"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI + command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" + stepKey="enableAddStoreCodeToUrls" after="enableLoginAsCustomerManualChoose"/> + </before> + <after> + <magentoCLI + command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" + stepKey="disableAddStoreCodeToUrls" after="enableLoginAsCustomerAutoDetection"/> + </after> + <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreCodeInUrl" after="assertCustomStoreView"> + <argument name="storeCode" value="{{customStore.code}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index a4e605864a976..beda69e8d256c 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -28,15 +28,11 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1" stepKey="enableLoginAsCustomerManualChoose"/> - <magentoCLI - command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" - stepKey="enableAddStoreCodeToUrls"/> <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> </before> <after> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"> <argument name="customStore" value="customStore"/> </actionGroup> @@ -45,10 +41,8 @@ stepKey="disableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI - command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" - stepKey="disableAddStoreCodeToUrls"/> <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> </after> <!-- Login As Customer from Customer page --> @@ -63,9 +57,8 @@ <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> <argument name="customerEmail" value="$$createCustomer.email$$"/> </actionGroup> - <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> - <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreCodeInUrl"> - <argument name="storeCode" value="{{customStore.code}}"/> + <actionGroup ref="StorefrontAssertCustomerOnStoreViewActionGroup" stepKey="assertCustomStoreView"> + <argument name="storeViewName" value="{{customStore.name}}"/> </actionGroup> <!-- Log out Customer and close tab --> From 3a27449976106cef570833ec11b1b9658b88baec Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Thu, 25 Jun 2020 15:18:42 +0300 Subject: [PATCH 22/29] MFTF tests updates. --- .../AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml | 3 +-- .../AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml | 3 +-- ...AsCustomerLoginFromCustomerPageManualChooseActionGroup.xml | 3 +-- .../AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml | 3 +-- .../Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml | 4 ---- .../Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml | 4 ---- ...oginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml | 3 --- .../Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml | 2 +- 8 files changed, 5 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml index 9f23a69ab3aff..0efab2c1368c2 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml @@ -15,7 +15,6 @@ <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/> <waitForPageLoad stepKey="waitForLoginAsCustomerLogPageLoad"/> - <see userInput="Sorry, you need permissions to view this content." - selector="{{AdminMessagesSection.accessDenied}}" stepKey="seeAccessDenied"/> + <see userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="see404PageHeading"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml index b10bad9fa2900..0aa12d21e4772 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml @@ -21,8 +21,7 @@ <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" stepKey="seeModal"/> - <!-- TODO: Unskip after https://github.com/magento/magento2-login-as-customer/issues/137 is fixed--> - <!-- <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/>--> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml index 6fda137c3f6a4..e09fd270712d7 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml @@ -21,8 +21,7 @@ <waitForPageLoad stepKey="waitForCustomerPageLoad"/> <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="Login as Customer: Select Store View" stepKey="seeModal"/> - <!-- TODO: Unskip after https://github.com/magento/magento2-login-as-customer/issues/137 is fixed--> - <!-- <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/>--> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.storeView}}" userInput="{{storeViewName}}" stepKey="selectStoreView"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> <switchToNextTab stepKey="switchToNewTab"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml index 1aab6aa58c9e6..5be590d78361e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml @@ -21,8 +21,7 @@ <click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" stepKey="seeModal"/> - <!-- TODO: Unskip after https://github.com/magento/magento2-login-as-customer/issues/137 is fixed--> - <!-- <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/>--> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml index bbb6e342cca10..2ea3cb5ec341b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml @@ -18,9 +18,6 @@ value="Verify admin user can directly login into customer account to Default store view when Store View To Login In = Auto detection"/> <severity value="BLOCKER"/> <group value="login_as_customer"/> - <skip> - <issueId value="https://github.com/magento/magento2-login-as-customer/pull/135"/> - </skip> </annotations> <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> @@ -60,7 +57,6 @@ <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> <argument name="customerEmail" value="$$createCustomer.email$$"/> </actionGroup> - <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeDefaultStoreCodeInUrl"/> <!-- Log out Customer and close tab --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml index d88f860b6078b..8c7724a5f6ce6 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml @@ -17,9 +17,6 @@ value="Verify admin user can directly login into customer account on custom website using 'Login as customer' functionality"/> <severity value="BLOCKER"/> <group value="login_as_customer"/> - <skip> - <issueId value="https://github.com/magento/magento2-login-as-customer/issues/102"/> - </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" @@ -77,7 +74,6 @@ </actionGroup> <!-- Assert Customer logged on Custom Website --> - <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeStoreCodeInUrl"> <argument name="storeCode" value="{{customStoreEN.code}}"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index 3047843b0c758..bcd824707a1cd 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -16,9 +16,6 @@ <description value="Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> - <skip> - <issueId value="https://github.com/magento/magento2-login-as-customer/issues/136"/> - </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index beda69e8d256c..028ef0526b0c5 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -19,7 +19,7 @@ <severity value="CRITICAL"/> <group value="login_as_customer"/> <skip> - <issueId value="https://github.com/magento/magento2-login-as-customer/issues/102"/> + <issueId value="https://github.com/magento/magento2-login-as-customer/issues/58"/> </skip> </annotations> <before> From af840bd8d80264511883a001c6e29a5db99f46c3 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Tue, 14 Jul 2020 14:07:51 +0300 Subject: [PATCH 23/29] MFTF tests updates. --- ...merAbsentOnCustomerGirdPageActionGroup.xml | 20 ------------------- ...stomerAbsentOnOrderGridPageActionGroup.xml | 20 ------------------- ...INotShownIfLoginAsCustomerDisabledTest.xml | 5 ----- 3 files changed, 45 deletions(-) delete mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml delete mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml deleted file mode 100644 index 071b4ed0e3c15..0000000000000 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerGirdPageActionGroup.xml +++ /dev/null @@ -1,20 +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="AdminLoginAsCustomerAbsentOnCustomerGridPageActionGroup"> - <annotations> - <description>Verify Login As Customer Login action is absent on Customer grid page.</description> - </annotations> - - <amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/> - <waitForPageLoad stepKey="waitForCustomerGridPageLoad"/> - <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml deleted file mode 100644 index cde0c8c484fbc..0000000000000 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup.xml +++ /dev/null @@ -1,20 +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="AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup"> - <annotations> - <description>Verify Login As Customer Login action is absent on Order grid page.</description> - </annotations> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrderGridPageLoad"/> - <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index 595b47cb56216..a39b66a67aae1 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -33,8 +33,6 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Verify Login As Customer Login action is absent in Customer grid page --> - <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerGridPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerGridPage"/> <!-- Verify Login As Customer Login action is absent on Customer page --> <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerPage"> @@ -48,9 +46,6 @@ </actionGroup> <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> - <!-- Verify Login As Customer Login action is absent on Order grid page --> - <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderGridPage"/> - <!-- Verify Login As Customer Login action is absent on Order page --> <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderPage"> <argument name="orderId" value="{$grabOrderId}"/> From 32080f7ef6abc560efb87c1a7c93568bb5579442 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Fri, 17 Jul 2020 16:33:56 +0300 Subject: [PATCH 24/29] MFTF tests updates. --- ...rConfigNotAvailableDirectlyActionGroup.xml | 4 +- ...nAsCustomerConfigNotVisibleActionGroup.xml | 4 +- ...ertLoginAsCustomerLogRecordActionGroup.xml | 2 +- ...minFilterLoginAsCustomerLogActionGroup.xml | 2 +- ...ustomerAbsentOnCustomerPageActionGroup.xml | 4 +- ...AsCustomerAbsentOnOrderPageActionGroup.xml | 4 +- ...inAsCustomerLogAbsentInMenuActionGroup.xml | 2 +- ...CustomerLogPageNotAvailableActionGroup.xml | 2 +- ...stomerLoginFromCustomerPageActionGroup.xml | 2 +- ...romCustomerPageManualChooseActionGroup.xml | 2 +- ...sCustomerLoginFromOrderPageActionGroup.xml | 2 +- ...AdminOpenLoginAsCustomerLogActionGroup.xml | 4 +- ...nLoginAsCustomerLogFromMenuActionGroup.xml | 4 +- .../Test/Mftf/Data/AdminMenuData.xml | 4 +- .../LoginAsCustomer/Test/Mftf/README.md | 4 +- .../Mftf/Section/AdminCustomerGridSection.xml | 2 +- .../Mftf/Section/AdminOrdersGridSection.xml | 2 +- ...gUserAccessToLoginAsCustomerButtonTest.xml | 2 +- ...hangUserAccessToLoginAsCustomerLogTest.xml | 2 +- ...oginAsCustomerAddProductToWishlistTest.xml | 6 +- .../AdminLoginAsCustomerAutoDetectionTest.xml | 4 +- ...nAsCustomerDirectlyToCustomWebsiteTest.xml | 6 +- ...oginAsCustomerEditCustomersAddressTest.xml | 6 +- ...gNotShownIfLoginAsCustomerDisabledTest.xml | 10 +-- .../Test/AdminLoginAsCustomerLoggingTest.xml | 6 +- ...CustomerManualChooseStoreCodeInUrlTest.xml | 2 +- .../AdminLoginAsCustomerManualChooseTest.xml | 4 +- .../AdminLoginAsCustomerPlaceOrderTest.xml | 4 +- .../Test/AdminLoginAsCustomerReorderTest.xml | 2 +- ...ginAsCustomerSubscribeToNewsletterTest.xml | 6 +- ...inLoginAsCustomerUserSingleSessionTest.xml | 68 +++++++++++++++++++ ...minNoAccessToLoginAsCustomerButtonTest.xml | 6 +- ...INotShownIfLoginAsCustomerDisabledTest.xml | 6 +- ...minUIShownIfLoginAsCustomerEnabledTest.xml | 6 +- ...tLoginAsCustomerNotificationBannerTest.xml | 4 +- 35 files changed, 134 insertions(+), 66 deletions(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml index be66dceb8f161..7e032b168f062 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup.xml @@ -10,12 +10,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup"> <annotations> - <description>Verify Login As Customer config section is not available by direct url.</description> + <description>Verify Login as Customer config section is not available by direct url.</description> </annotations> <amOnPage url="{{AdminLoginAsCustomerConfigPage.url}}" stepKey="navigateToLoginAsCustomerConfigSection"/> <waitForPageLoad stepKey="waitForPageLoad"/> <seeInCurrentUrl url="admin/system_config/index" stepKey="seeRedirectToConfigIndexPage"/> - <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> + <dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml index 94fdea4b11b16..875869d9928a4 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigNotVisibleActionGroup.xml @@ -10,10 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertLoginAsCustomerConfigNotVisibleActionGroup"> <annotations> - <description>Verify no Login As Customer config section available.</description> + <description>Verify no Login as Customer config section available.</description> </annotations> <!-- TODO: update --> - <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomerItem"/> + <dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomerItem"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml index ced0b51466bd5..da47864e28eac 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerLogRecordActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertLoginAsCustomerLogRecordActionGroup"> <annotations> - <description>Assert Login As Customer Log record is correct.</description> + <description>Assert Login as Customer Log record is correct.</description> </annotations> <arguments> <argument name="rowNumber" type="string"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml index 18bfe790d29a5..17eb351bf8f1b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminFilterLoginAsCustomerLogActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminFilterLoginAsCustomerLogActionGroup"> <annotations> - <description>Filter Login As Customer Log records.</description> + <description>Filter Login as Customer Log records.</description> </annotations> <arguments> <argument name="adminId" type="string"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml index 28a8b483f094f..e56d898fa9197 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnCustomerPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup"> <annotations> - <description>Verify Login As Customer Login action is absent on Customer page.</description> + <description>Verify Login as Customer Login action is absent on Customer page.</description> </annotations> <arguments> <argument name="customerId" type="string"/> @@ -18,6 +18,6 @@ <amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/> <waitForPageLoad stepKey="waitForCustomerPageLoad"/> - <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> + <dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml index 746580546fbf3..1119f6b05fac3 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerAbsentOnOrderPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerAbsentOnOrderPageActionGroup"> <annotations> - <description>Verify Login As Customer Login action is absent on Order page.</description> + <description>Verify Login as Customer Login action is absent on Order page.</description> </annotations> <arguments> <argument name="orderId" type="string"/> @@ -18,6 +18,6 @@ <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/> <waitForPageLoad stepKey="waitForOrderPageLoad"/> - <dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/> + <dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml index 4f475c9793624..beb0f4cba973c 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogAbsentInMenuActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerLogAbsentInMenuActionGroup"> <annotations> - <description>Verify Login As Customer is absent in admin menu.</description> + <description>Verify Login as Customer is absent in admin menu.</description> </annotations> <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml index 0efab2c1368c2..939ff73199a63 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogPageNotAvailableActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup"> <annotations> - <description>Verify Login As Customer is not available by direct url.</description> + <description>Verify Login as Customer is not available by direct url.</description> </annotations> <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml index 0aa12d21e4772..599a6f8f9e270 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"> <annotations> - <description>Verify Login As Customer Login action is works properly from Customer page.</description> + <description>Verify Login as Customer Login action is works properly from Customer page.</description> </annotations> <arguments> <argument name="customerId" type="string"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml index e09fd270712d7..8db34a05252ee 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup"> <annotations> - <description>Verify Login As Customer Login action is works properly from Customer page with manual Store View choose.</description> + <description>Verify Login as Customer Login action is works properly from Customer page with manual Store View choose.</description> </annotations> <arguments> <argument name="customerId" type="string"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml index 5be590d78361e..a478f8e9d18cd 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminLoginAsCustomerLoginFromOrderPageActionGroup"> <annotations> - <description>Verify Login As Customer Login action is works properly from Order grid page.</description> + <description>Verify Login as Customer Login action is works properly from Order grid page.</description> </annotations> <arguments> <argument name="orderId" type="string"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml index 6cd47e474439a..9130ba5b05c51 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogActionGroup.xml @@ -10,11 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminOpenLoginAsCustomerLogActionGroup"> <annotations> - <description>Navigate to Login As Customer Log page.</description> + <description>Navigate to Login as Customer Log page.</description> </annotations> <amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="gotoLoginAsCustomerLogPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="Login As Customer Log" stepKey="titleIsVisible"/> + <see userInput="Login as Customer Log" stepKey="titleIsVisible"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml index 0cc6722a1bbc1..b1a99d67afe4f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminOpenLoginAsCustomerLogFromMenuActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminOpenLoginAsCustomerLogFromMenuActionGroup"> <annotations> - <description>Navigate to Login As Customer Log from Menu.</description> + <description>Navigate to Login as Customer Log from Menu.</description> </annotations> <click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" @@ -18,7 +18,7 @@ <click selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" stepKey="openLoginAsCustomerLog"/> <waitForPageLoad stepKey="waitForLoginAsCustomerLog"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Login As Customer Log" + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Login as Customer Log" stepKey="seeForLoginAsCustomerLog"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml index e326fa1e1d225..38779dd987c65 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Data/AdminMenuData.xml @@ -9,8 +9,8 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="AdminMenuLoginAsCustomer"> - <data key="pageTitle">Login As Customer Log</data> - <data key="title">Login As Customer Log</data> + <data key="pageTitle">Login as Customer Log</data> + <data key="title">Login as Customer Log</data> <data key="dataUiId">magento-loginascustomer-login-log</data> </entity> </entities> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/README.md b/app/code/Magento/LoginAsCustomer/Test/Mftf/README.md index 5069a2cb278f6..1d574fc35cdab 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/README.md +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/README.md @@ -1,3 +1,3 @@ -# Integration Functional Tests +# Functional Tests -The Functional Test Module for **Magento Login As Customer** module. +The Functional Tests for **Magento Login as Customer** module. diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml index e7b38bf9f9c94..4d7c49644957d 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerGridSection.xml @@ -9,7 +9,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminCustomerGridSection"> - <element name="customerLoginAsCustomerLinkByEmail" type="text" selector="//tr[contains(@class, 'data-row') and td/div[text()='{{customerEmail}}']]//a[@class='action-menu-item'][text() = 'Login As Customer']" parameterized="true" timeout="30"/> + <element name="customerLoginAsCustomerLinkByEmail" type="text" selector="//tr[contains(@class, 'data-row') and td/div[text()='{{customerEmail}}']]//a[@class='action-menu-item'][text() = 'Login as Customer']" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml index ac2dc8ef8c421..34c4a14e81bb5 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminOrdersGridSection.xml @@ -9,6 +9,6 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminOrdersGridSection"> - <element name="loginAsCustomerLink" type="text" selector="//td/div[contains(.,'{{orderId}}')]/../..//a[@class='action-menu-item'][text() = 'Login As Customer']" parameterized="true"/> + <element name="loginAsCustomerLink" type="text" selector="//td/div[contains(.,'{{orderId}}')]/../..//a[@class='action-menu-item'][text() = 'Login as Customer']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml index e2079d85f6267..9ebeae23d47a8 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerButtonTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminChangUserAccessToLoginAsCustomerButtonTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Permissions and ACl"/> <title value="Change admin user's access to 'Login as Customer Button'"/> <description diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml index 255c6978d6e55..c0aa3740309a6 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminChangUserAccessToLoginAsCustomerLogTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminChangUserAccessToLoginAsCustomerLogTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Permissions and ACl"/> <title value="Change admin user's access to 'Login as Customer Log'"/> <description diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml index 17480d0f84c7b..8ab3fe8ce3bc3 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml @@ -10,11 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerAddProductToWishlistTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Added product to wish-list"/> <title value="Admin user login as customer and add products to customer's wish-list"/> <description - value="Verify that Admin can add products to customer's wish-list using Login As Customer functionality"/> + value="Verify that Admin can add products to customer's wish-list using Login as Customer functionality"/> <severity value="AVERAGE"/> <group value="login_as_customer"/> </annotations> @@ -41,7 +41,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Admin Login As Customer from Customer page --> + <!-- Admin Login as Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml index 2ea3cb5ec341b..42d53113e20f4 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerAutoDetectionTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Select Store View based on 'Store View To Login In' setting"/> <title value="Admin user directly login into customer account with store View To Login In = Auto detection"/> @@ -46,7 +46,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Login As Customer from Customer page --> + <!-- Login as Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml index 8c7724a5f6ce6..e5a5a6f9a9738 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml @@ -10,8 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerDirectlyToCustomWebsiteTest"> <annotations> - <features value="Login As Customer"/> - <stories value="Login As Customer into additional website"/> + <features value="Login as Customer"/> + <stories value="Login as Customer into additional website"/> <title value="Admin user directly login into customer account on custom website"/> <description value="Verify admin user can directly login into customer account on custom website using 'Login as customer' functionality"/> @@ -63,7 +63,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Login As Customer from Customer page --> + <!-- Login as Customer from Customer page --> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> <argument name="customer" value="Simple_US_Customer"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml index 35373d78f194b..38a8798d401bb 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml @@ -10,11 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerEditCustomersAddressTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Edit Customer addresses"/> <title value="Admin user login as customer and edit customer's address"/> <description - value="Verify Admin can access customer's personal cabinet and change his default shipping and billing addresses using Login As Customer functionality"/> + value="Verify Admin can access customer's personal cabinet and change his default shipping and billing addresses using Login as Customer functionality"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> </annotations> @@ -35,7 +35,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Login As Customer Login from Customer page --> + <!-- Login as Customer Login from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index bcd824707a1cd..4ef72d949065d 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -10,10 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Availability of UI elements if module enable/disable"/> - <title value="'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/> - <description value="Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/> + <title value="'Login as Customer Log' not shown if 'Login as customer' functionality is disabled"/> + <description value="Verify that 'Login as Customer Log' not shown if 'Login as customer' functionality is disabled"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> </annotations> @@ -25,10 +25,10 @@ <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Verify Login As Customer Log is absent in admin menu --> + <!-- Verify Login as Customer Log is absent in admin menu --> <actionGroup ref="AdminLoginAsCustomerLogAbsentInMenuActionGroup" stepKey="verifyLoginAsCustomerLogAbsentInMenu"/> - <!-- Verify Login As Customer Log is not available by direct url --> + <!-- Verify Login as Customer Log is not available by direct url --> <actionGroup ref="AdminLoginAsCustomerLogPageNotAvailableActionGroup" stepKey="verifyLoginAsCustomerLogNotAvailable"/> </test> </tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml index 6d6dcc1377434..bf2556b30967b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml @@ -10,10 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerLoggingTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <!-- TODO: change "stories" value --> <stories value="Place order and reorder"/> - <title value="Using 'Login As Customer' is logged properly"/> + <title value="Using 'Login as Customer' is logged properly"/> <description value="Verify that 'Login as customer Log' record information about using 'Login as Customer' functionality properly"/> <severity value="MAJOR"/> @@ -80,7 +80,7 @@ </actionGroup> <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerNewAdmin"/> - <!-- Navigate to Login As Customer Log page --> + <!-- Navigate to Login as Customer Log page --> <actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/> <!-- Perform assertions --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml index 3b78459301398..27aee2061f204 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseStoreCodeInUrlTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerManualChooseStoreCodeInUrlTest" extends="AdminLoginAsCustomerManualChooseTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Select Store View based on 'Store View To Login In' setting"/> <title value="Admin user directly login into customer account with store View To Login In = Manual Choose when store code is added to url"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index 028ef0526b0c5..acae07d1cda11 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerManualChooseTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Select Store View based on 'Store View To Login In' setting"/> <title value="Admin user directly login into customer account with store View To Login In = Manual Choose"/> @@ -45,7 +45,7 @@ <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> </after> - <!-- Login As Customer from Customer page --> + <!-- Login as Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index b5c8817141438..a4994d5c041d2 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerPlaceOrderTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Place order and reorder"/> <title value="Admin user login as customer and place order"/> <description @@ -62,7 +62,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Login As Customer from Customer page --> + <!-- Login as Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml index 13c052df8209e..16e0b94112562 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerReorderTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Place order and reorder"/> <title value="Admin user login as customer and reorder existing order"/> <description diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml index 60a6fe7963043..44409471821db 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml @@ -10,11 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerSubscribeToNewsletterTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Subscribe to newsletter"/> <title value="Admin user login as customer and make subscription to newsletter"/> <description - value="Verify that Admin can subscribe to newsletter using Login As Customer functionality"/> + value="Verify that Admin can subscribe to newsletter using Login as Customer functionality"/> <severity value="AVERAGE"/> <group value="login_as_customer"/> </annotations> @@ -34,7 +34,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Admin Login As Customer from Customer page --> + <!-- Admin Login as Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="lLoginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml new file mode 100644 index 0000000000000..ad83476beeeda --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.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="AdminLoginAsCustomerUserSingleSessionTest"> + <annotations> + <features value="Login фs Customer"/> + <stories value="Destroy impersonated customer sessions on admin logout"/> + <title value="Admin users can have only one 'Login as Customer' session at a time"/> + <description + value="Verify Admin users can have only one 'Login as Customer' session at a time"/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/pull/193"/> + </skip> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> + <createData entity="Simple_US_CA_Customer" stepKey="createSecondCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> + <deleteData createDataKey="createSecondCustomer" stepKey="deleteSecondCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login into First Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsFirstCustomer"> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + + <!-- Assert correctly logged in as First Customer --> + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromFirstCustomerPage"> + <argument name="customerFullName" value="$$createFirstCustomer.firstname$$ $$createFirstCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> + </actionGroup> + + <!-- Login into Second Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsSecondCustomer"> + <argument name="customerId" value="$$createSecondCustomer.id$$"/> + </actionGroup> + + <!-- Assert correctly logged in as Second Customer --> + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromSecondCustomerPage"> + <argument name="customerFullName" value="$$createSecondCustomer.firstname$$ $$createSecondCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> + </actionGroup> + + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomer"/> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml index 5bacca897b66a..52f5d7c51dcd1 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminNoAccessToLoginAsCustomerButtonTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Permissions and ACl"/> <title value="User does not have access to 'Login as customer' button"/> <description value="Login into Magento Admin panel as user that does not have access to 'Login as customer' button"/> @@ -77,7 +77,7 @@ <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> - <!-- Verify Login As Customer Login action is absent on Customer page --> + <!-- Verify Login as Customer Login action is absent on Customer page --> <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerPage"> <argument name="customerId" value="$createCustomer.id$"/> </actionGroup> @@ -89,7 +89,7 @@ </actionGroup> <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> - <!-- Verify Login As Customer Login action is absent on Order page --> + <!-- Verify Login as Customer Login action is absent on Order page --> <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderPage"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index a39b66a67aae1..19a84ecadc72b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminUINotShownIfLoginAsCustomerDisabledTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Availability of UI elements if module enable/disable"/> <title value="UI elements are not shown if 'Login as customer' functionality is disabled"/> <description value="Verify that UI elements are not shown if 'Login as customer' functionality is disabled"/> @@ -34,7 +34,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Verify Login As Customer Login action is absent on Customer page --> + <!-- Verify Login as Customer Login action is absent on Customer page --> <actionGroup ref="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnCustomerPage"> <argument name="customerId" value="$createCustomer.id$"/> </actionGroup> @@ -46,7 +46,7 @@ </actionGroup> <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> - <!-- Verify Login As Customer Login action is absent on Order page --> + <!-- Verify Login as Customer Login action is absent on Order page --> <actionGroup ref="AdminLoginAsCustomerAbsentOnOrderPageActionGroup" stepKey="verifyLoginAsCustomerAbsentOnOrderPage"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml index 8170051dd2c32..2bf364b29ba8d 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminUIShownIfLoginAsCustomerEnabledTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Availability of UI elements if module enable/disable"/> <title value="UI elements are shown if 'Login as customer' functionality is enabled"/> <description @@ -42,7 +42,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Verify Login As Customer Login action works correctly from Customer page --> + <!-- Verify Login as Customer Login action works correctly from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="verifyLoginAsCustomerWorksOnCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> @@ -64,7 +64,7 @@ <argument name="orderId" value="$grabOrderId"/> </actionGroup> - <!-- Verify Login As Customer Login action works correctly from Order page --> + <!-- Verify Login as Customer Login action works correctly from Order page --> <actionGroup ref="AdminLoginAsCustomerLoginFromOrderPageActionGroup" stepKey="verifyLoginAsCustomerWorksOnOrderPage"> <argument name="orderId" value="$grabOrderId"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml index ec47c2127a94d..d953c493562c6 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontLoginAsCustomerNotificationBannerTest"> <annotations> - <features value="Login As Customer"/> + <features value="Login as Customer"/> <stories value="Availability of UI elements if module enable/disable"/> <title value="Notification Banner is present on Storefront page"/> <description @@ -35,7 +35,7 @@ <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> </after> - <!-- Login As Customer from Customer page --> + <!-- Login as Customer from Customer page --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> <argument name="customerId" value="$$createCustomer.id$$"/> From af4f6ecb68a14b3c065b6977861ae1a27a4bfb4e Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Mon, 20 Jul 2020 13:08:57 +0300 Subject: [PATCH 25/29] MFTF tests updates. --- ...ntAssertOnCustomerLoginPageActionGroup.xml | 18 ++++ ...oginAsCustomerMultishippingLoggingTest.xml | 102 ++++++++++++++++++ .../AdminLoginAsCustomerUserLogoutTest.xml | 58 ++++++++++ ...inLoginAsCustomerUserSingleSessionTest.xml | 2 +- 4 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertOnCustomerLoginPageActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertOnCustomerLoginPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertOnCustomerLoginPageActionGroup.xml new file mode 100644 index 0000000000000..830d021380b16 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertOnCustomerLoginPageActionGroup.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="StorefrontAssertOnCustomerLoginPageActionGroup"> + <annotations> + <description>Assert on the Storefront Customer Sign-In page.</description> + </annotations> + + <seeInCurrentUrl url="{{StorefrontCustomerSignInPage.url}}" stepKey="seeOnSignInPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml new file mode 100644 index 0000000000000..8e5c121fed157 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml @@ -0,0 +1,102 @@ +<?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="AdminLoginAsCustomerMultishippingLoggingTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="Place order and reorder"/> + <title value="Admin User login as Customer and place Order with Multiple Addresses"/> + <description value="Verify that Admin user can place Order with Multiple Addresses using 'Login as customer' functionality "/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + <group value="multishipping"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/pull/192"/> + </skip> + </annotations> + + <before> + <magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/> + <magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/> + <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="SimpleProduct2" stepKey="createProduct1"/> + <createData entity="SimpleProduct2" stepKey="createProduct2"/> + <createData entity="Simple_US_Customer_Two_Addresses" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllOrdersGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + <magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login as Customer from Customer page --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + <!-- Add Products to Cart --> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProduct1ToCart"> + <argument name="product" value="$$createProduct1$$"/> + </actionGroup> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProduct2ToCart"> + <argument name="product" value="$$createProduct2$$"/> + </actionGroup> + + <!-- Place Order --> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <actionGroup ref="CheckingWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> + <waitForPageLoad stepKey="waitForShippingInfoPageLoad"/> + <actionGroup ref="SelectMultiShippingInfoActionGroup" stepKey="checkoutWithMultipleShipping"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectBillingInfoActionGroup" stepKey="checkoutWithPaymentMethod"/> + <waitForPageLoad stepKey="waitForReviewOrderPageLoad"/> + <actionGroup ref="ReviewOrderForMultiShipmentActionGroup" stepKey="reviewOrderForMultiShipment"> + <argument name="totalNameForFirstOrder" value="Shipping & Handling"/> + <argument name="totalPositionForFirstOrder" value="1"/> + <argument name="totalNameForSecondOrder" value="Shipping & Handling"/> + <argument name="totalPositionForSecondOrder" value="2"/> + </actionGroup> + <waitForPageLoad stepKey="waitForPlaceOrderPageLoad"/> + <actionGroup ref="StorefrontPlaceOrderForMultipleAddressesActionGroup" stepKey="placeOrder"> + <argument name="firstOrderPosition" value="1"/> + <argument name="secondOrderPosition" value="2"/> + </actionGroup> + <waitForPageLoad stepKey="waitForOrderPageLoad"/> + + <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> + <actionGroup ref="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyStorefrontMessageFirstOrder"> + <argument name="orderId" value="{$getFirstOrderIdPlaceOrder}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyStorefrontMessageSecondOrder"> + <argument name="orderId" value="{$getSecondOrderIdPlaceOrder}"/> + </actionGroup> + + <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> + <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageFirstOrder"> + <argument name="orderId" value="{$getFirstOrderIdPlaceOrder}"/> + <argument name="adminUserFullName" value="Magento User"/> + </actionGroup> + <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageSecondOrder"> + <argument name="orderId" value="{$getSecondOrderIdPlaceOrder}"/> + <argument name="adminUserFullName" value="Magento User"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml new file mode 100644 index 0000000000000..4f484e73d580b --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml @@ -0,0 +1,58 @@ +<?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="AdminLoginAsCustomerUserLogoutTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="Destroy impersonated customer sessions on admin logout"/> + <title + value="Login as Customer sessions are ended/invalidated when the related admin session is logged out."/> + <description + value="Verify Login as Customer session is ended/invalidated when the related admin session is logged out."/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + </after> + + <!-- Login into Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsCustomer"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + + <!-- Assert correctly logged in as Customer --> + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + </actionGroup> + + <!-- End Admin session --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + + <!-- Assert Customer session invalidated --> + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="openCustomerAccountPage"/> + <actionGroup ref="StorefrontAssertOnCustomerLoginPageActionGroup" stepKey="AssertOnCustomerLoginPage"/> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml index ad83476beeeda..e4cd48d8e868e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminLoginAsCustomerUserSingleSessionTest"> <annotations> - <features value="Login фs Customer"/> + <features value="Login as Customer"/> <stories value="Destroy impersonated customer sessions on admin logout"/> <title value="Admin users can have only one 'Login as Customer' session at a time"/> <description From 7069f07b8de1603dc82d25a3479bc38f24edb1a4 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Thu, 23 Jul 2020 14:51:16 +0300 Subject: [PATCH 26/29] MFTF tests updates. --- ...oginAsCustomerConfigVisibleActionGroup.xml | 21 ++++ ...omerSectionLinkNotAvailableActionGroup.xml | 19 +++ .../Mftf/Page/AdminCustomerConfigPage.xml | 3 +- .../Section/AdminCustomerConfigSection.xml | 18 +++ ...merSettingsAvailableForGlobalLevelTest.xml | 40 ++++++ ...erBannerPresentOnAllPagesInSessionTest.xml | 112 +++++++++++++++++ ...sCustomerSeeSpecialPriceOnCategoryTest.xml | 114 ++++++++++++++++++ ...oppingCartIsNotMergedWithGuestCartTest.xml | 67 ++++++++++ 8 files changed, 393 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigVisibleActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerConfigSection.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSettingsAvailableForGlobalLevelTest.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml create mode 100644 app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigVisibleActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigVisibleActionGroup.xml new file mode 100644 index 0000000000000..cdc513651ad54 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerConfigVisibleActionGroup.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="AdminAssertLoginAsCustomerConfigVisibleActionGroup"> + <annotations> + <description>Verify Login as Customer config section available.</description> + </annotations> + + <seeElement selector="{{AdminCustomerConfigSection.loginAsCustomerSettingsHead}}" stepKey="seeLoginAsCustomerSettingsHead"/> + <seeElement selector="{{AdminCustomerConfigSection.enableExtensionLabel}}" stepKey="seeEnableExtensionLabel"/> + <seeElement selector="{{AdminCustomerConfigSection.disablePageCacheLabel}}" stepKey="seeDisablePageCacheLabel"/> + <seeElement selector="{{AdminCustomerConfigSection.storeViewToLoginToLabel}}" stepKey="seeStoreViewToLoginToLabel"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup.xml new file mode 100644 index 0000000000000..779cb1e5c8899 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup.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="AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup"> + <annotations> + <description>Verify Login as Customer config section isn't available.</description> + </annotations> + + <conditionalClick selector="{{CaptchaFormsDisplayingSection.customer}}" dependentSelector="{{AdminCustomerConfigSection.loginAsCustomerSettingsSectionLink}}" visible="false" stepKey="expandCustomerGroup"/> + <dontSeeElement selector="{{AdminCustomerConfigSection.loginAsCustomerSettingsSectionLink}}" stepKey="dontSeeLoginAsCustomerSettingsLink"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml index cfeead829e8ae..b48e20237cee8 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminCustomerConfigPage.xml @@ -6,6 +6,7 @@ */ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> - <page name="AdminLoginAsCustomerConfigPage" url="admin/system_config/edit/section/mfloginascustomer" area="admin" module="Magento_LoginAsCustomer"> + <page name="AdminLoginAsCustomerConfigPage" url="admin/system_config/edit/section/login_as_customer" area="admin" module="Magento_LoginAsCustomer"> + <section name="AdminCustomerConfigSection"/> </page> </pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerConfigSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerConfigSection.xml new file mode 100644 index 0000000000000..14b3336ea5484 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminCustomerConfigSection.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="AdminCustomerConfigSection"> + <element name="loginAsCustomerSettingsSectionLink" type="text" selector="//a/span[contains(text(),'Login as Customer')]" timeout="30"/> + <element name="loginAsCustomerSettingsHead" type="text" selector="#login_as_customer_general-head" timeout="30"/> + <element name="enableExtensionLabel" type="text" selector="//span[contains(text(),'Enable Extension') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/> + <element name="disablePageCacheLabel" type="text" selector="//span[contains(text(),'Disable Page Cache For Admin User') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/> + <element name="storeViewToLoginToLabel" type="text" selector="//span[contains(text(),'Store View To Login To') and contains(@data-config-scope,'[GLOBAL]')]" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSettingsAvailableForGlobalLevelTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSettingsAvailableForGlobalLevelTest.xml new file mode 100644 index 0000000000000..807603bdcba0a --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSettingsAvailableForGlobalLevelTest.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="AdminLoginAsCustomerSettingsAvailableForGlobalLevelTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="'Login as Customer' settings are available only for global level"/> + <title value="Verify all 'Login as Customer' settings are available for global level"/> + <description value="'Login as Customer' settings are available for global level"/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <amOnPage url="{{AdminLoginAsCustomerConfigPage.url}}" stepKey="navigateToLoginAsCustomerConfigSection"/> + <actionGroup ref="AdminAssertLoginAsCustomerConfigVisibleActionGroup" stepKey="seeLoginAsCustomerConfig"/> + + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToDefaultStoreView"> + <argument name="storeViewName" value="'Default Store View'"/> + </actionGroup> + <actionGroup ref="AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup" stepKey="dontSeeLoginAsCustomerSectionLinkOnStoreView"/> + + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToDefaultWebsite"> + <argument name="storeViewName" value="'Main Website'"/> + </actionGroup> + <actionGroup ref="AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup" stepKey="dontSeeLoginAsCustomerSectionLink"/> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml new file mode 100644 index 0000000000000..6874fcb4fd220 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml @@ -0,0 +1,112 @@ +<?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="StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="Notification banner appears on all pages in session"/> + <title value="Verify banner is persistent and appears during all page views in session"/> + <description value="Banner is persistent and appears on all pages in session"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> + <argument name="tags" value="config"/> + </actionGroup> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + </before> + <after> + <closeTab stepKey="closeLoginAsCustomerTab"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> + <argument name="tags" value="config"/> + </actionGroup> + </after> + + <!-- Admin Login as Customer from Customer page and assert notification banner --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBanner"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Go to Wishlist and assert notification banner --> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="amOnWishListPage"/> + <waitForPageLoad stepKey="waitForWishlistPageLoad"/> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnWishList"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Go to category page and assert notification banner --> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCategoryPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Go to product page and assert notification banner --> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnProductPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Add product to cart and assert notification banner --> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCartPage"/> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCartPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Proceed to checkout and assert notification banner --> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> + <waitForPageLoad stepKey="waitForProceedToCheckout"/> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCheckoutPage"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Assert notification banner before place order --> + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterClickNext"/> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerBeforePlaceOrder"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Assert notification banner after place order --> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerAfterPlaceOrder"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml new file mode 100644 index 0000000000000..c935e3446678f --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml @@ -0,0 +1,114 @@ +<?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="StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="'Login as Customer' should see special prices on a category page"/> + <title value="Special prices shown on category when Admin user Login as customer account"/> + <description value="Login as customer sees special prices on category"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> + <argument name="tags" value="config"/> + </actionGroup> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + <field key="price">10</field> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"> + <field key="group_id">3</field> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + </before> + <after> + <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> + <actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid"> + <argument name="name" value="{{_defaultCatalogRule.name}}"/> + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> + <argument name="tags" value="config"/> + </actionGroup> + </after> + + <!-- Creating a new catalog price rule with 50 percent discount for Retailer customer group --> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <argument name="categoryId" value="$createCategory.id$"/> + </actionGroup> + <actionGroup ref="SelectRetailerCustomerGroupActionGroup" stepKey="selectRetailerCustomerGroup"/> + <actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule"> + <argument name="apply" value="{{CatalogRuleToPercent.simple_action}}"/> + <argument name="discountAmount" value="50"/> + </actionGroup> + + <!-- Save and apply the new catalog price rule --> + <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + + <!-- Admin Login as Customer --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBanner"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Check simple product prices on store front category page --> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Price"> + <argument name="productInfo" value="$5.00"/> + <argument name="productNumber" value="1"/> + </actionGroup> + <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1RegularPrice"> + <argument name="productInfo" value="$10.00"/> + <argument name="productNumber" value="1"/> + </actionGroup> + + <!-- Place order --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createProduct.sku$$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/> + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> + <closeTab stepKey="closeLoginAsCustomerTab"/> + + <!-- Open order in admin --> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + + <!-- Assert order subtotal --> + <scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/> + <see selector="{{AdminOrderTotalSection.subTotal}}" userInput="$5.00" stepKey="checkOrderTotalInBackend"/> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml new file mode 100644 index 0000000000000..09ec1b427f515 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml @@ -0,0 +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="StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="Customer shopping cart shouldn't merge with guest shopping cart"/> + <title value="Customer shopping cart is not merged with guest shopping cart"/> + <description value="Shopping cart customer is not merged with guest cart"/> + <severity value="MAJOR"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> + <argument name="tags" value="config"/> + </actionGroup> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + </before> + <after> + <closeTab stepKey="closeLoginAsCustomerTab"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> + <argument name="tags" value="config"/> + </actionGroup> + </after> + + <!-- Add product to guest cart --> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + + <!-- Admin Login as Customer --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> + <argument name="customerId" value="$$createCustomer.id$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBanner"> + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> + </actionGroup> + + <!-- Check the mini cart is empty --> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEmpty"/> + </test> +</tests> From 72d29066938e8756ebdca8e35f79e73b2a3091c1 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 5 Aug 2020 14:30:09 +0300 Subject: [PATCH 27/29] Remove MFTF dependency to adobe stock module --- .../AdminMediaGalleryEnhancedEnableActionGroup.xml | 2 +- .../Mftf/Page/AdminMediaGalleryConfigSystemPage.xml | 12 ++++++++++++ .../Test/Mftf/Section/AdminConfigSystemSection.xml | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/MediaGalleryUi/Test/Mftf/Page/AdminMediaGalleryConfigSystemPage.xml diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryEnhancedEnableActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryEnhancedEnableActionGroup.xml index 8791c1b152249..d842535940253 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryEnhancedEnableActionGroup.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminMediaGalleryEnhancedEnableActionGroup.xml @@ -12,7 +12,7 @@ <arguments> <argument name="enabled" type="string" defaultValue="{{MediaGalleryConfigDataDisabled.value}}"/> </arguments> - <amOnPage url="{{AdminConfigSystemPage.url}}" stepKey="navigateToSystemConfigurationPage" /> + <amOnPage url="{{AdminMediaGalleryConfigSystemPage.url}}" stepKey="navigateToSystemConfigurationPage" /> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{AdminConfigSystemSection.enhancedMediaGalleryFieldset}}" stepKey="scrollToEnhancedMediaGalleryFieldset"/> <conditionalClick stepKey="expandEnhancedMediaGalleryTab" selector="{{AdminConfigSystemSection.enhancedMediaGalleryFieldset}}" dependentSelector="{{AdminConfigSystemSection.enhancedMediaGalleryEnabledField}}" visible="false" /> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Page/AdminMediaGalleryConfigSystemPage.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Page/AdminMediaGalleryConfigSystemPage.xml new file mode 100644 index 0000000000000..429e5da4129d3 --- /dev/null +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Page/AdminMediaGalleryConfigSystemPage.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="AdminMediaGalleryConfigSystemPage" url="admin/system_config/edit/section/system" area="admin" module="Magento_Config"> + <section name="AdminConfigSystemSection"/> + </page> +</pages> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminConfigSystemSection.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminConfigSystemSection.xml index e0305a8a6f172..b7900f6664c62 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminConfigSystemSection.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminConfigSystemSection.xml @@ -11,5 +11,6 @@ <section name="AdminConfigSystemSection"> <element name="enhancedMediaGalleryFieldset" type="block" selector="#system_media_gallery-head"/> <element name="enhancedMediaGalleryEnabledField" type="select" selector="[data-ui-id='select-groups-media-gallery-fields-enabled-value']"/> + <element name="saveConfig" type="button" selector="#save"/> </section> </sections> From c7fd5ef15f9b524ed8d226a3f171f407c641a1f4 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 5 Aug 2020 14:44:45 +0300 Subject: [PATCH 28/29] Remove selector dependency --- .../AdminEnhancedMediaGalleryDeleteGridViewActionGroup.xml | 6 +++--- .../Section/AdminEnhancedMediaGalleryActionsSection.xml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeleteGridViewActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeleteGridViewActionGroup.xml index d3d1f0aaf39de..95f3080049db7 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeleteGridViewActionGroup.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeleteGridViewActionGroup.xml @@ -17,9 +17,9 @@ </arguments> <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> - <click selector="{{AdminGridDefaultViewControls.viewByName(viewToDelete)}}{{AdminAdobeStockSection.editViewButtonPartial}}" stepKey="clickEditButton"/> - <seeElement selector="{{AdminAdobeStockSection.deleteViewButton}}" stepKey="seeDeleteButton"/> - <click selector="{{AdminAdobeStockSection.deleteViewButton}}" stepKey="clickDeleteButton"/> + <click selector="{{AdminGridDefaultViewControls.viewByName(viewToDelete)}}{{AdminEnhancedMediaGalleryActionsSection.editViewButtonPartial}}" stepKey="clickEditButton"/> + <seeElement selector="{{AdminEnhancedMediaGalleryActionsSection.deleteViewButton}}" stepKey="seeDeleteButton"/> + <click selector="{{AdminEnhancedMediaGalleryActionsSection.deleteViewButton}}" stepKey="clickDeleteButton"/> <waitForPageLoad stepKey="waitForDeletion" time="10"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryActionsSection.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryActionsSection.xml index 2feaaa8594da2..7f9a5aefdf69c 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryActionsSection.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryActionsSection.xml @@ -8,6 +8,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEnhancedMediaGalleryActionsSection"> + <element name="editViewButtonPartial" type="button" selector="/following-sibling::div/button[@class='action-edit']"/> + <element name="deleteViewButton" type="button" selector="//div[@data-bind='afterRender: \$data.setToolbarNode']//input/following-sibling::div/button[@class='action-delete']"/> <element name="upload" type="input" selector="#image-uploader-input"/> <element name="cancel" type="button" selector="[data-ui-id='cancel-button']"/> <element name="createFolder" type="button" selector="[data-ui-id='create-folder-button']"/> From 147525d4f19c8fb8b44b27fa69e679972e76b24b Mon Sep 17 00:00:00 2001 From: Valerii Naida <vnayda@adobe.com> Date: Thu, 6 Aug 2020 04:21:31 -0500 Subject: [PATCH 29/29] magento/magento2-login-as-customer#144: "Login as Customer" functionality should be enabled by default. --- .../StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml index c935e3446678f..775fcb122e181 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml @@ -16,6 +16,9 @@ <description value="Login as customer sees special prices on category"/> <severity value="CRITICAL"/> <group value="login_as_customer"/> + <skip> + <issueId value="https://github.com/magento/magento2-login-as-customer/pull/193"/> + </skip> </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"