-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[MFTF] add StorefrontGiftMessageForOrderOnCheckoutCartPageTest #32792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
magento-engcom-team
merged 9 commits into
magento:2.4-develop
from
Usik2203:mftf-gift-message
Nov 4, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
716ee72
gift message for order
Usik2203 3f0219e
Added assertion for order from admin side
Usik2203 90e9b12
Merge branch '2.4-develop' into mftf-gift-message
Usik2203 a1a91ae
Merge branch '2.4-develop' into mftf-gift-message
Usik2203 d7a2d85
Merge branch '2.4-develop-mainline' into mftf-gift-message
engcom-Foxtrot c6016f5
magento/magento2#32821: [MFTF] add StorefrontGiftMessageForOrderOnChe…
engcom-Foxtrot 7502723
Merge branch '2.4-develop' into mftf-gift-message
Usik2203 ab39c95
Merge branch '2.4-develop' into mftf-gift-message
Usik2203 07a6b77
Merge branch '2.4-develop' into mftf-gift-message
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...e/Magento/GiftMessage/Test/Mftf/ActionGroup/AssertAdminGiftMessageForOrderActionGroup.xml
This file contains hidden or 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,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="AssertAdminGiftMessageForOrderActionGroup"> | ||
<annotations> | ||
<description>Check that Gift Message for order present on admin side.</description> | ||
</annotations> | ||
|
||
<seeInCurrentUrl url="sales/order/view" stepKey="assertOrderViewPage"/> | ||
<scrollTo selector="{{AdminOrderGiftSection.giftMessageOrderSection}}" stepKey="scrollToGiftMessageSection"/> | ||
<seeInField userInput="July" selector="{{AdminOrderGiftSection.giftMessageFromName}}" stepKey="seeFromName"/> | ||
<seeInField userInput="Josh" selector="{{AdminOrderGiftSection.giftMessageToName}}" stepKey="seeToName"/> | ||
<seeInField userInput="Best wishes!" selector="{{AdminOrderGiftSection.giftMessageMessage}}" stepKey="seeMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
24 changes: 24 additions & 0 deletions
24
...essage/Test/Mftf/ActionGroup/AssertStorefrontGiftMessageOnCheckoutCartPageActionGroup.xml
This file contains hidden or 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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertStorefrontGiftMessageOnCheckoutCartPageActionGroup"> | ||
<annotations> | ||
<description>Check that Gift Message for order present on checkout cart page.</description> | ||
</annotations> | ||
|
||
<waitForElementVisible selector="{{StorefrontOrderGiftSection.giftMessageTitle}}" stepKey="waitTitleOnThePage"/> | ||
<see selector="{{StorefrontOrderGiftSection.giftMessageTitle}}" userInput="Gift options" stepKey="seeTitleOnThePage"/> | ||
<click selector="{{StorefrontOrderGiftSection.giftMessageTitle}}" stepKey="openGiftMessageForm"/> | ||
<scrollTo selector="{{StorefrontOrderGiftSection.giftMessageToLabel}}" stepKey="scrollToTitleOnThePage"/> | ||
<see selector="{{StorefrontOrderGiftSection.giftMessageToLabel}}" userInput="To:" stepKey="seeTitleFromLabel"/> | ||
<see selector="{{StorefrontOrderGiftSection.giftMessageFromLabel}}" userInput="From:" stepKey="seeTitleToLabel"/> | ||
<see selector="{{StorefrontOrderGiftSection.giftMessageMessageLabel}}" userInput="Message:" stepKey="seeMessageLabel"/> | ||
</actionGroup> | ||
</actionGroups> |
24 changes: 24 additions & 0 deletions
24
.../GiftMessage/Test/Mftf/ActionGroup/GuestGiftCheckoutFillingShippingSectionActionGroup.xml
This file contains hidden or 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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="GuestGiftCheckoutFillingShippingSectionActionGroup" extends="GuestCheckoutFillingShippingSectionActionGroup"> | ||
<annotations> | ||
<description>EXTENDS: Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="customerVar" defaultValue="CustomerEntityOne"/> | ||
<argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> | ||
<!--First available shipping method will be selected if value is not passed for shippingMethod--> | ||
<argument name="shippingMethod" defaultValue="" type="string"/> | ||
</arguments> | ||
|
||
<seeInCurrentUrl url="{{CheckoutPage.url}}#payment" stepKey="assertCheckoutPaymentUrl"/> | ||
</actionGroup> | ||
</actionGroups> |
23 changes: 23 additions & 0 deletions
23
...gento/GiftMessage/Test/Mftf/ActionGroup/StorefrontFieldGiftMessageCartFormActionGroup.xml
This file contains hidden or 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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="StorefrontFieldGiftMessageCartFormActionGroup"> | ||
<annotations> | ||
<description>Fill gift messages for order.</description> | ||
</annotations> | ||
<fillField selector="{{StorefrontOrderGiftSection.giftMessageToField}}" userInput="Josh" stepKey="fillToField"/> | ||
<fillField selector="{{StorefrontOrderGiftSection.giftMessageFromField}}" userInput="July" stepKey="fillFromField"/> | ||
<fillField selector="{{StorefrontOrderGiftSection.giftMessageTextField}}" userInput="Best wishes!" stepKey="fillMessageField"/> | ||
<click selector="{{StorefrontOrderGiftSection.giftMessageUpdateButton}}" stepKey="saveGiftMessage"/> | ||
<waitForPageLoad stepKey="waitForPageLoaded" /> | ||
<scrollTo selector="{{StorefrontOrderGiftSection.giftMessageSummary}}" stepKey="scrollToGiftMessage"/> | ||
<see selector="{{StorefrontOrderGiftSection.giftMessageSummary}}" userInput="Best wishes!" stepKey="seeGiftMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains hidden or 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
This file contains hidden or 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
48 changes: 48 additions & 0 deletions
48
...agento/GiftMessage/Test/Mftf/Test/StorefrontGiftMessageForOrderOnCheckoutCartPageTest.xml
This file contains hidden or 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,48 @@ | ||
<?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="StorefrontGiftMessageForOrderOnCheckoutCartPageTest"> | ||
<annotations> | ||
<stories value="Gift Message for order present on checkout cart page."/> | ||
<title value="Gift Message for order present on checkout cart page."/> | ||
<description value="Gift Message for order present on checkout cart page."/> | ||
<severity value="MAJOR"/> | ||
</annotations> | ||
<before> | ||
<magentoCLI command="config:set sales/gift_options/allow_order 1" stepKey="enableGiftMessageForOrder"/> | ||
<createData entity="SimpleProduct2" stepKey="simpleProduct"/> | ||
</before> | ||
<after> | ||
<magentoCLI command="config:set sales/gift_options/allow_order 0" stepKey="disableGiftMessageForOrder"/> | ||
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> | ||
</after> | ||
|
||
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> | ||
<argument name="product" value="$$simpleProduct$$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage" /> | ||
<actionGroup ref="AssertStorefrontGiftMessageOnCheckoutCartPageActionGroup" stepKey="seeGiftMessageFields"/> | ||
<actionGroup ref="StorefrontFieldGiftMessageCartFormActionGroup" stepKey="fillGiftMessageFields"/> | ||
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> | ||
<actionGroup ref="GuestGiftCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> | ||
<argument name="shippingMethod" value="Flat Rate"/> | ||
</actionGroup> | ||
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="guestSelectCheckMoneyOrderPayment"/> | ||
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> | ||
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> | ||
<argument name="orderId" value="{$grabOrderNumber}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertAdminGiftMessageForOrderActionGroup" stepKey="assertGiftMessageForAdminOrder"/> | ||
</test> | ||
</tests> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add few more steps to place the order and check the messages are shown on the admin?