Skip to content

Commit 3c5c477

Browse files
committed
B2B-2094: [AWS S3] Failed to load gift card order print page
1 parent 73390b2 commit 3c5c477

File tree

4 files changed

+53
-50
lines changed

4 files changed

+53
-50
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
<description value="Print Order from Guest on Frontend"/>
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MC-38689"/>
18-
<skip>
19-
<issueId value="MQE-2834" />
20-
</skip>
2118
<group value="remote_storage_aws_s3"/>
2219
<group value="pr_exclude"/>
2320
</annotations>

app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
<description value="To be sure that other elements of Success page are shown for placed order as registered Customer."/>
1616
<severity value="CRITICAL"/>
1717
<testCaseId value="MC-16488"/>
18-
<skip>
19-
<issueId value="MQE-2834" />
20-
</skip>
2118
<group value="checkout"/>
2219
<group value="pr_exclude"/>
2320
</annotations>
@@ -30,7 +27,7 @@
3027
</before>
3128

3229
<after>
33-
<!--Cancel orders-->
30+
<!-- Cancel orders -->
3431
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
3532
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="goToOrdersPage"/>
3633
<actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumn">
@@ -46,35 +43,35 @@
4643
</actionGroup>
4744
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
4845

49-
<!--Logout from customer account-->
46+
<!-- Logout from customer account -->
5047
<amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomerOne"/>
5148
<waitForPageLoad stepKey="waitLogoutCustomerOne"/>
5249
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
5350
<deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/>
5451
</after>
5552

56-
<!--Log in to Storefront as Customer-->
53+
<!-- Log in to Storefront as Customer -->
5754
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser">
5855
<argument name="Customer" value="$$createSimpleUsCustomer$$"/>
5956
</actionGroup>
6057

61-
<!--Go to product page-->
58+
<!-- Go to product page -->
6259
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
6360
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
6461

65-
<!--Add Product to Shopping Cart-->
62+
<!-- Add Product to Shopping Cart -->
6663
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
6764
<argument name="productName" value="$$createSimpleProduct.name$$"/>
6865
</actionGroup>
6966

70-
<!--Go to Checkout-->
67+
<!-- Go to Checkout -->
7168
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
7269
<actionGroup ref="StorefrontSelectFirstShippingMethodActionGroup" stepKey="selectFirstShippingMethod"/>
7370
<comment userInput="Adding the comment to replace waitForLoadingMask2 action for preserving Backward Compatibility" stepKey="waitForLoadingMask2"/>
7471
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
7572
<!-- Checkout select Check/Money Order payment -->
7673
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
77-
<!--Click Place Order button-->
74+
<!-- Click Place Order button -->
7875
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/>
7976
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessTitle"/>
8077
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/>
@@ -83,40 +80,40 @@
8380
<click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/>
8481
<seeInCurrentUrl url="{{StorefrontCustomerOrderPage.url}}" stepKey="seeMyOrderPage"/>
8582

86-
<!--Go to product page-->
83+
<!-- Go to product page -->
8784
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/>
8885
<waitForPageLoad stepKey="waitForCatalogPageLoad2"/>
8986

90-
<!--Add Product to Shopping Cart-->
87+
<!-- Add Product to Shopping Cart -->
9188
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2">
9289
<argument name="productName" value="$$createSimpleProduct.name$$"/>
9390
</actionGroup>
9491

95-
<!--Go to Checkout-->
92+
<!-- Go to Checkout -->
9693
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/>
9794
<actionGroup ref="StorefrontSelectFirstShippingMethodActionGroup" stepKey="selectFirstShippingMethod2"/>
9895
<comment userInput="Adding the comment to replace waitForLoadingMask3 action for preserving Backward Compatibility" stepKey="waitForLoadingMask3"/>
9996
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext2"/>
10097
<!-- Checkout select Check/Money Order payment -->
10198
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment2"/>
10299

103-
<!--Click Place Order button-->
100+
<!-- Click Place Order button -->
104101
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/>
105102
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage2"/>
106103
<click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/>
107104
<see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/>
108105
<seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/>
109106

110-
<!--Go to product page-->
107+
<!-- Go to product page -->
111108
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage3"/>
112109
<waitForPageLoad stepKey="waitForCatalogPageLoad3"/>
113110

114-
<!--Add Product to Shopping Cart-->
111+
<!-- Add Product to Shopping Cart -->
115112
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage3">
116113
<argument name="productName" value="$$createSimpleProduct.name$$"/>
117114
</actionGroup>
118115

119-
<!--Go to Checkout-->
116+
<!-- Go to Checkout -->
120117
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart3"/>
121118
<actionGroup ref="StorefrontSelectFirstShippingMethodActionGroup" stepKey="selectFirstShippingMethod3"/>
122119
<comment userInput="Adding the comment to replace waitForLoadingMask4 action for preserving Backward Compatibility" stepKey="waitForLoadingMask4"/>
@@ -125,11 +122,11 @@
125122
<!-- Checkout select Check/Money Order payment -->
126123
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment3"/>
127124

128-
<!--Click Place Order button-->
125+
<!-- Click Place Order button -->
129126
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder3"/>
130127
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage3"/>
131128

132-
<!--Check "Print Receipt" button is presented (desktop only)-->
129+
<!-- Check "Print Receipt" button is presented (desktop only) -->
133130
<seeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeVisiblePrint"/>
134131
<resizeWindow width="600" height="800" stepKey="resizeWindow"/>
135132
<waitForElementNotVisible selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="waitInvisiblePrint"/>
@@ -138,11 +135,16 @@
138135
<waitForElementVisible selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="waitVisiblePrint"/>
139136
<seeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeVisiblePrint2"/>
140137

141-
<!--See print page-->
138+
<!-- See print page -->
142139
<click selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="clickPrintLink"/>
143-
<switchToWindow stepKey="switchToWindow"/>
144-
<switchToNextTab stepKey="switchToTab"/>
145-
<seeInCurrentUrl url="sales/order/print/order_id" stepKey="seePrintPage"/>
140+
<helper class="Magento\Ui\Test\Mftf\Helper\UiHelper" method="switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey="switchToWindowWithUrlAndClosePrintDialogIfEncountered">
141+
<argument name="expectedUrl">sales/order/print/order_id</argument>
142+
<argument name="expectedUrlComparisonType">COMPARISON_PATH_SUBSET_MATCH</argument>
143+
</helper>
144+
145+
<comment userInput="Step key preserved for backwards compatibility" stepKey="switchToWindow"/>
146+
<comment userInput="Step key preserved for backwards compatibility" stepKey="switchToTab"/>
147+
<comment userInput="Step key preserved for backwards compatibility" stepKey="seePrintPage"/>
146148
<seeElement selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="seeOrderTitleOnPrint"/>
147149
<switchToWindow stepKey="switchToWindow2"/>
148150
</test>

app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Print Order from Guest on Frontend"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-28494"/>
19-
<skip>
20-
<issueId value="MQE-2834" />
21-
</skip>
2219
<group value="sales"/>
2320
<group value="mtf_migrated"/>
2421
<group value="pr_exclude"/>
@@ -122,7 +119,7 @@
122119
</actionGroup>
123120
<grabTextFrom selector="{{AdminConfigurableProductFormSection.currentAttribute}}" stepKey="grabAttribute"/>
124121
<assertNotEmpty stepKey="assertNotEmpty">
125-
<actualResult type="const">$grabAttribute</actualResult>
122+
<actualResult type="const">$grabAttribute</actualResult>
126123
</assertNotEmpty>
127124

128125
<!-- Create bundle Product -->
@@ -157,7 +154,7 @@
157154
</actionGroup>
158155
<grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/>
159156
<assertNotEmpty stepKey="assertBundleOptionNotEmpty">
160-
<actualResult type="const">$grabBundleOption</actualResult>
157+
<actualResult type="const">$grabBundleOption</actualResult>
161158
</assertNotEmpty>
162159

163160
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductGridFilters"/>
@@ -270,12 +267,17 @@
270267

271268
<!-- Click on the "Print Order" button -->
272269
<click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="printOrder"/>
273-
<waitForPageLoad stepKey="waitForPrintWindowToOpen" />
274-
<switchToWindow stepKey="switchToWindow"/>
275-
<waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="waitForPrintTabToOpen"/>
276-
<switchToNextTab stepKey="switchToTab"/>
277-
<waitForPageLoad stepKey="waitForPrintPreviewToLoad"/>
278-
<seeInCurrentUrl url="sales/guest/print/order_id/" stepKey="seePrintPage"/>
270+
<helper class="Magento\Ui\Test\Mftf\Helper\UiHelper" method="switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey="switchToWindowWithUrlAndClosePrintDialogIfEncountered">
271+
<argument name="expectedUrl">sales/guest/print/order_id/</argument>
272+
<argument name="expectedUrlComparisonType">COMPARISON_PATH_SUBSET_MATCH</argument>
273+
</helper>
274+
275+
<comment userInput="Step key preserved for backwards compatibility" stepKey="waitForPrintWindowToOpen" />
276+
<comment userInput="Step key preserved for backwards compatibility" stepKey="switchToWindow"/>
277+
<comment userInput="Step key preserved for backwards compatibility" stepKey="waitForPrintTabToOpen"/>
278+
<comment userInput="Step key preserved for backwards compatibility" stepKey="switchToTab"/>
279+
<comment userInput="Step key preserved for backwards compatibility" stepKey="waitForPrintPreviewToLoad"/>
280+
<comment userInput="Step key preserved for backwards compatibility" stepKey="seePrintPage"/>
279281

280282
<!-- AssertSalesPrintOrderProducts -->
281283
<see userInput="$createBundleProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeBundleProduct"/>

app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Check while order printing URL with an id of not relevant order redirects to order history"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-28543"/>
19-
<skip>
20-
<issueId value="MQE-2834" />
21-
</skip>
2219
<group value="sales"/>
2320
<group value="pr_exclude"/>
2421
</annotations>
@@ -37,17 +34,17 @@
3734
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
3835
</after>
3936

40-
<!--Log in to Storefront as Customer 1 -->
37+
<!-- Log in to Storefront as Customer 1 -->
4138
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp">
4239
<argument name="Customer" value="$createCustomer$"/>
4340
</actionGroup>
4441

45-
<!--Create an order at Storefront as Customer 1 -->
42+
<!-- Create an order at Storefront as Customer 1 -->
4643
<actionGroup ref="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" stepKey="createOrderToPrint">
4744
<argument name="Category" value="$createCategory$"/>
4845
</actionGroup>
4946

50-
<!--Go to 'print order' page by grabbed order id-->
47+
<!-- Go to 'print order' page by grabbed order id-->
5148
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderIdFromURL"/>
5249
<comment userInput="BIC workaround" stepKey="waitForPrintWindowToOpen"/>
5350
<switchToWindow stepKey="switchToPrintPage"/>
@@ -62,7 +59,7 @@
6259
<switchToWindow stepKey="switchToDuplicatePrintPage"/>
6360
<waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkDuplicatePrintPage"/>
6461

65-
<!--Log out as customer 1-->
62+
<!-- Log out of customer 1's account -->
6663
<openNewTab stepKey="openNewTab2"/>
6764
<waitForPageLoad stepKey="waitForNewTabToOpen1" />
6865
<switchToNextTab stepKey="switchForward2"/>
@@ -71,25 +68,30 @@
7168
<amOnPage url="{{StorefrontCustomerSignOutPage.url}}" stepKey="signOut"/>
7269
<waitForLoadingMaskToDisappear stepKey="waitSignOutPage"/>
7370

74-
<!--Log in to Storefront as Customer 2 -->
71+
<!-- Log in to Storefront as Customer 2 -->
7572
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp2">
7673
<argument name="Customer" value="$createCustomer2$"/>
7774
</actionGroup>
7875

79-
<!--Create an order at Storefront as Customer 2 -->
76+
<!-- Create an order on Storefront as Customer 2 and open print order page -->
8077
<actionGroup ref="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" stepKey="createOrderToPrint2">
8178
<argument name="Category" value="$createCategory$"/>
8279
</actionGroup>
8380

84-
<!--Try to load 'print order' page with not relevant order id to be redirected to 'order history' page-->
85-
<waitForPageLoad stepKey="waitForPrintWindowToOpen2" />
86-
<switchToWindow stepKey="switchToPrintPage2"/>
87-
<waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage2"/>
81+
<comment userInput="Step key preserved for backwards compatibility" stepKey="waitForPrintWindowToOpen2" />
82+
<helper class="Magento\Ui\Test\Mftf\Helper\UiHelper" method="switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey="switchToWindowWithUrlAndClosePrintDialogIfEncountered">
83+
<argument name="expectedUrl">sales/order/print/order_id/</argument>
84+
<argument name="expectedUrlComparisonType">COMPARISON_PATH_SUBSET_MATCH</argument>
85+
</helper>
86+
<comment userInput="Step key preserved for backwards compatibility" stepKey="switchToPrintPage2"/>
87+
<comment userInput="Step key preserved for backwards compatibility" stepKey="checkPrintPage2"/>
8888

8989
<openNewTab stepKey="openNewTab3"/>
9090
<waitForPageLoad stepKey="waitForNewTabToOpen2" />
9191
<switchToNextTab stepKey="switchForward4"/>
9292
<waitForElement selector="body" stepKey="waitForNewTabHTML" />
93+
94+
<!-- Assert trying to load 'print order' page as customer 2 with the the order id created by customer 1 will redirect to 'order history' page -->
9395
<amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage2"/>
9496
<waitForPageLoad stepKey="waitForOpenDuplicatePage" />
9597
<seeElement selector="{{StorefrontCustomerOrderSection.isMyOrdersSection}}" stepKey="waitOrderHistoryPage"/>

0 commit comments

Comments
 (0)