Skip to content

Commit c324ae6

Browse files
author
Joan He
committed
Merge remote-tracking branch 'arcticfoxes/MAGETWO-96385' into BugFixPR
2 parents c55cc73 + 80e3553 commit c324ae6

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

app/code/Magento/Customer/Controller/Address/Delete.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
*/
77
namespace Magento\Customer\Controller\Address;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface;
910
use Magento\Framework\App\Action\HttpPostActionInterface;
1011

11-
class Delete extends \Magento\Customer\Controller\Address implements HttpPostActionInterface
12+
/**
13+
* Delete customer address controller action.
14+
*/
15+
class Delete extends \Magento\Customer\Controller\Address implements HttpPostActionInterface, HttpGetActionInterface
1216
{
1317
/**
18+
* @inheritdoc
1419
* @return \Magento\Framework\Controller\Result\Redirect
1520
*/
1621
public function execute()

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerAddressesSection">
1212
<element name="addressesList" type="text" selector=".block-addresses-list" />
13+
<element name="deleteAdditionalAddress" type="button" selector="//ol[@class='items addresses']/li[@class='item'][{{var}}]//a[@class='action delete']" parameterized="true"/>
1314
</section>
1415
</sections>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontDeleteCustomerAddressTest">
12+
<annotations>
13+
<stories value="Delete customer address from storefront"/>
14+
<title value="User should be able to delete Customer address successfully from storefront"/>
15+
<description value="User should be able to delete Customer address successfully from storefront"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-5713"/>
18+
<group value="Customer"/>
19+
</annotations>
20+
<before>
21+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
22+
</before>
23+
<after>
24+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
25+
</after>
26+
<amOnPage stepKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
27+
<fillField stepKey="fillEmail" userInput="$$createCustomer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
28+
<fillField stepKey="fillPassword" userInput="$$createCustomer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
29+
<click stepKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
30+
<actionGroup ref="EnterCustomerAddressInfo" stepKey="enterAddressInfo">
31+
<argument name="Address" value="US_Address_NY"/>
32+
</actionGroup>
33+
<see userInput="You saved the address." stepKey="verifyAddressCreated"/>
34+
<click selector="{{StorefrontCustomerAddressesSection.deleteAdditionalAddress('1')}}" stepKey="deleteAdditionalAddress"/>
35+
<waitForElementVisible selector="{{ModalConfirmationSection.modalContent}}" stepKey="waitFortheConfirmationModal"/>
36+
<see selector="{{ModalConfirmationSection.modalContent}}" userInput="Are you sure you want to delete this address?" stepKey="seeAddressDeleteConfirmationMessage"/>
37+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="confirmDelete"/>
38+
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
39+
<see userInput="You deleted the address." stepKey="verifyDeleteAddress"/>
40+
</test>
41+
</tests>

app/code/Magento/Ui/Test/Mftf/Section/ModalConfirmationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="ModalConfirmationSection">
12+
<element name="modalContent" type="text" selector="aside.confirm div.modal-content"/>
1213
<element name="CancelButton" type="button" selector="//footer[@class='modal-footer']/button[contains(@class, 'action-dismiss')]"/>
1314
<element name="OkButton" type="button" selector="//footer[@class='modal-footer']/button[contains(@class, 'action-accept')]"/>
1415
</section>

0 commit comments

Comments
 (0)