Skip to content

Commit de5b49f

Browse files
committed
Merge remote-tracking branch 'origin/MC-38509' into 2.4-develop-pr100
2 parents a7bde28 + 417a2f6 commit de5b49f

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="StorefrontCreateCustomerWithInvalidDataTest">
12+
<annotations>
13+
<stories value="Create a Customer via the Storefront"/>
14+
<features value="Customer"/>
15+
<title value="Register customer on storefront after customer form validation failed."/>
16+
<description value="Customer should be able to re-submit register form after correcting invalid form data on storefront."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-38532"/>
19+
<useCaseId value="MC-38509"/>
20+
<group value="customer"/>
21+
</annotations>
22+
23+
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>
24+
<!--Try to submit register form with wrong password.-->
25+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountFormWithWrongData">
26+
<argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/>
27+
</actionGroup>
28+
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="tryToSubmitFormWithWrongPassword"/>
29+
<actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="seeTheErrorPasswordLength">
30+
<argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/>
31+
</actionGroup>
32+
<!--Re-submit customer register form with correct data.-->
33+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountFormWithCorrectData">
34+
<argument name="customer" value="Simple_US_Customer"/>
35+
</actionGroup>
36+
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/>
37+
<actionGroup ref="AssertMessageCustomerCreateAccountActionGroup" stepKey="seeSuccessMessage"/>
38+
</test>
39+
</tests>

app/code/Magento/Customer/view/frontend/web/js/block-submit-on-send.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ define([
1414

1515
dataForm.submit(function () {
1616
$(this).find(':submit').attr('disabled', 'disabled');
17+
18+
if (this.isValid === false) {
19+
$(this).find(':submit').prop('disabled', false);
20+
}
21+
this.isValid = true;
1722
});
1823
dataForm.bind('invalid-form.validate', function () {
1924
$(this).find(':submit').prop('disabled', false);
25+
this.isValid = false;
2026
});
2127
};
2228
});

0 commit comments

Comments
 (0)