This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cover validation for Email Text Length Limit field and check that pro…
…vided tip is truthful
- Loading branch information
1 parent
a2c6268
commit f236c1c
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
app/code/Magento/Wishlist/Test/Mftf/ActionGroup/setEmailTextLengthLimitActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="setEmailTextLengthLimitActionGroup"> | ||
<arguments> | ||
<argument name="emailTextLengthLimit" defaultValue="Wishlist.default_email_text_length_limit" type="string"/> | ||
</arguments> | ||
<amOnPage url="{{AdminCustomerWishlistConfigurationPage.url}}" stepKey="navigateToWishListConfigurationPage"/> | ||
<conditionalClick selector="{{WishListShareOptionsSection.shareOptionsTabIsNotExpanded}}" dependentSelector="{{WishListShareOptionsSection.shareOptionsTabIsExpanded}}" visible="false" stepKey="expandTabInNotAlreadyExpanded"/> | ||
<uncheckOption selector="{{WishListShareOptionsSection.useSystemValueForWishListEmailTextLimit}}" stepKey="uncheckUseSystemValueForWishListEmailTextLimit"/> | ||
<fillField selector="{{WishListShareOptionsSection.emailTextLengthLimitInput}}" userInput="{{emailTextLengthLimit}}" stepKey="enterWishListTextLengthLimit"/> | ||
<click selector="{{AdminMainActionsSection.save}}" stepKey="tryToSaveWishListConfig"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,8 @@ | |
<var key="customer_password" entityType="customer" entityKey="password"/> | ||
<data key="shareInfo_emails">[email protected],[email protected],[email protected]</data> | ||
<data key="shareInfo_message">Sharing message.</data> | ||
<data key="default_email_text_length_limit">255</data> | ||
<data key="min_email_text_length_limit">1</data> | ||
<data key="max_email_text_length_limit">10000</data> | ||
</entity> | ||
</entities> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Wishlist/Test/Mftf/Section/WishListShareOptionsSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?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="WishListShareOptionsSection"> | ||
<element name="shareOptionsTab" type="button" selector="#wishlist_email-head"/> | ||
<element name="shareOptionsTabIsExpanded" type="button" selector="#wishlist_email-head.open"/> | ||
<element name="shareOptionsTabIsNotExpanded" type="button" selector="#wishlist_email-head"/> | ||
<element name="emailTextLengthLimitInput" type="input" selector="#wishlist_email_text_limit"/> | ||
<element name="emailTextLengthLimitMessage" type="text" selector="#wishlist_email_text_limit-error"/> | ||
<element name="useSystemValueForWishListEmailTextLimit" type="checkbox" selector="#wishlist_email_text_limit_inherit"/> | ||
</section> | ||
</sections> |
72 changes: 72 additions & 0 deletions
72
.../Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?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="AdminCustomerWishListShareOptionsInputValidationTest"> | ||
<annotations> | ||
<features value="Wishlist"/> | ||
<stories value="MAGETWO-8709"/> | ||
<group value="wishlist"/> | ||
<title value="When user tries to set the Email Text Length Limit higher then 10,000 then validation message occurs"/> | ||
<description value="When user tries to set the Email Text Length Limit higher then 10,000 then validation message occurs"/> | ||
<severity value="AVERAGE"/> | ||
<testCaseId value="N/a"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="rollbackEmailTextLengthLimit"> | ||
<argument name="emailTextLengthLimit" value="{{Wishlist.default_email_text_length_limit}}"/> | ||
</actionGroup> | ||
<checkOption selector="{{WishListShareOptionsSection.useSystemValueForWishListEmailTextLimit}}" stepKey="checkUseSystemValueForWishListEmailTextLimit"/> | ||
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> | ||
</after> | ||
|
||
<actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="setEmailTextLengthLimitToMin"> | ||
<argument name="emailTextLengthLimit" value="{{Wishlist.min_email_text_length_limit}}"/> | ||
</actionGroup> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccessMessageForMinimum"/> | ||
<grabValueFrom selector="{{WishListShareOptionsSection.emailTextLengthLimitInput}}" stepKey="minimumWishListTextLengthLimit"/> | ||
<assertEquals stepKey="AssertMinimumTextLengthLimitIsApplied"> | ||
<expectedResult type="string">{{Wishlist.min_email_text_length_limit}}</expectedResult> | ||
<actualResult type="variable">minimumWishListTextLengthLimit</actualResult> | ||
</assertEquals> | ||
|
||
<actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="setEmailTextLengthLimitToMax"> | ||
<argument name="emailTextLengthLimit" value="{{Wishlist.max_email_text_length_limit}}"/> | ||
</actionGroup> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccessMessageForMaximum"/> | ||
<grabValueFrom selector="{{WishListShareOptionsSection.emailTextLengthLimitInput}}" stepKey="maximumWishListTextLengthLimit"/> | ||
<assertEquals stepKey="AssertMaximumTextLengthLimitIsApplied"> | ||
<expectedResult type="string">{{Wishlist.max_email_text_length_limit}}</expectedResult> | ||
<actualResult type="variable">maximumWishListTextLengthLimit</actualResult> | ||
</assertEquals> | ||
|
||
<actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="setEmailTextLengthLimitToLowerThanMin"> | ||
<argument name="emailTextLengthLimit" value="0"/> | ||
</actionGroup> | ||
<dontSee selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="dontSeeSuccessMessageForLowerThanMinimum"/> | ||
<grabTextFrom selector="{{WishListShareOptionsSection.emailTextLengthLimitMessage}}" stepKey="enterWishListTextLengthLimitLowerThanMinimum"/> | ||
<assertEquals stepKey="AssertTextLengthLimitIsNotAppliedWhenLowerThanMinimum"> | ||
<expectedResult type="string">The value is not within the specified range.</expectedResult> | ||
<actualResult type="variable">enterWishListTextLengthLimitLowerThanMinimum</actualResult> | ||
</assertEquals> | ||
|
||
<actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="setEmailTextLengthLimitToHigherThanMaximum"> | ||
<argument name="emailTextLengthLimit" value="10001"/> | ||
</actionGroup> | ||
<dontSee selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="dontSeeSuccessMessageForHigherThanMaximum"/> | ||
<grabTextFrom selector="{{WishListShareOptionsSection.emailTextLengthLimitMessage}}" stepKey="enterWishListTextLengthLimitHigherThanMaximum"/> | ||
<assertEquals stepKey="AssertTextLengthLimitIsNotAppliedWhenHigherThanMaximum"> | ||
<expectedResult type="string">The value is not within the specified range.</expectedResult> | ||
<actualResult type="variable">enterWishListTextLengthLimitHigherThanMaximum</actualResult> | ||
</assertEquals> | ||
</test> | ||
</tests> |