Skip to content

Commit 6a87bfe

Browse files
committed
MC-13844: [FT] [MFTF] AdminAvailabilityCreditMemoWithNoPaymentTest fails because of bad design
1 parent 0a91fff commit 6a87bfe

File tree

8 files changed

+34
-37
lines changed

8 files changed

+34
-37
lines changed

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
<click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQunatity"/>
7777
<waitForPageLoad stepKey="waitPageToBeLoaded"/>
7878
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
79-
<waitForPageLoad stepKey="waitForSuccessMessageLoad"/>
8079
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
8180
<waitForPageLoad stepKey="waitOrderDetailToLoad"/>
8281
<fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
4545
<waitForPageLoad stepKey="waitForNewInvoicePageLoad"/>
4646
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
47-
<waitForPageLoad stepKey="waitForSuccessMessageLoad"/>
4847
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/>
4948
<click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/>
5049
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5" />
@@ -58,9 +57,17 @@
5857
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/>
5958
</actionGroup>
6059

61-
<actionGroup name="submitInvoiceIntoOrder">
60+
<actionGroup name="StartCreateInvoiceFromOrderPage">
61+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/>
62+
<seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/>
63+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/>
64+
</actionGroup>
65+
66+
<actionGroup name="SubmitInvoice">
6267
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
63-
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageInvoice"/>
64-
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/>
68+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForMessageAppears"/>
69+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/>
70+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
71+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/>
6572
</actionGroup>
6673
</actionGroups>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
1919
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
2020
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
21-
<click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectDefaultStoreView"/>
21+
<conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/>
22+
<waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect" />
2223
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
2324
</actionGroup>
2425

app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +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="AdminInvoiceMainActionsSection">
12-
<element name="submitInvoice" type="button" selector=".action-default.scalable.save.submit-button.primary"/>
12+
<element name="submitInvoice" type="button" selector=".action-default.scalable.save.submit-button.primary" timeout="60"/>
1313
<element name="openNewCreditMemoFromInvoice" type="button" selector=".action-default.scalable.credit-memo"/>
1414
<element name="submitNewRefundFromInvoice" type="button" selector=".action-default.scalable.save.submit-button refund primary"/>
1515
</section>

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

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
</createData>
2626
<!-- Enable *Free Shipping* -->
2727
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/>
28+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
2829
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2930
</before>
3031
<after>
@@ -33,62 +34,53 @@
3334
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
3435
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
3536
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
37+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
38+
<argument name="customerEmail" value="Simple_US_Customer.email"/>
39+
</actionGroup>
40+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3641
<actionGroup ref="logout" stepKey="logOut"/>
3742
</after>
3843

39-
<!-- Flush Magento Cache -->
40-
<magentoCLI stepKey="flushCache" command="cache:flush"/>
41-
4244
<!--Proceed to Admin panel > SALES > Orders. Created order should be in Processing status-->
43-
<amOnPage url="{{AdminOrderCreatePage.url}}" stepKey="navigateToSalesOrderPage"/>
44-
<waitForPageLoad stepKey="waitForSalesOrderPageLoaded"/>
45-
46-
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
47-
<waitForElementVisible stepKey="waitForNewOrderPageOpened" selector="{{NewOrderSection.submitOrder}}"/>
48-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
45+
<actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>
4946

5047
<!--Check if order can be submitted without the required fields including email address-->
51-
<scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seeNewOrderPageTitle"/>
52-
<actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder" after="scrollToTopOfOrderFormPage">
48+
<scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage"/>
49+
<actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder">
5350
<argument name="product" value="$$createProduct$$"/>
5451
</actionGroup>
5552

5653
<!--Click *Custom Price* link, enter 0 and click *Update Items and Quantities* button-->
5754
<click selector="{{AdminOrderFormItemsSection.customPriceCheckbox}}" stepKey="clickCustomPriceCheckbox"/>
58-
<waitForElementVisible stepKey="waitForPriceFieldAppears" selector="{{AdminOrderFormItemsSection.customPriceField}}"/>
55+
<waitForElementVisible selector="{{AdminOrderFormItemsSection.customPriceField}}" stepKey="waitForPriceFieldAppears"/>
5956
<fillField selector="{{AdminOrderFormItemsSection.customPriceField}}" userInput="0" stepKey="fillCustomPriceField"/>
6057
<click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantitiesButton"/>
6158

6259
<!--Fill customer group and customer email-->
63-
<selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="clickUpdateItemsAndQuantitiesButton"/>
64-
<fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/>
60+
<selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup"/>
61+
<fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/>
6562

6663
<!--Fill customer address information-->
67-
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail">
64+
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress">
6865
<argument name="customer" value="Simple_US_Customer"/>
6966
<argument name="address" value="US_Address_TX"/>
7067
</actionGroup>
7168

7269
<!-- Select Free shipping -->
73-
<actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption" after="fillCustomerAddress"/>
70+
<actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/>
7471

7572
<!--Click *Submit Order* button-->
76-
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder" after="selectFreeShippingOption"/>
73+
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/>
7774

7875
<!--Click *Invoice* button-->
79-
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
80-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
81-
<waitForPageLoad stepKey="waitForInvoicePageOpened"/>
82-
83-
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
84-
<waitForPageLoad stepKey="waitForInvoiceSaved"/>
85-
<see userInput="The invoice has been created." stepKey="seeCorrectMessage"/>
76+
<actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/>
77+
<actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/>
8678

8779
<!--Verify that *Credit Memo* button is displayed-->
8880
<seeElement selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="seeCreditMemo"/>
8981
<click selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="clickCreditMemoItem"/>
9082
<waitForPageLoad stepKey="waitForCreditMemoPageLoaded"/>
91-
<see stepKey="seeNewMemoPage" userInput="New Memo"/>
92-
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeUrlOnPage"/>
83+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/>
84+
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewMemoUrlOnPage"/>
9385
</test>
9486
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="5" stepKey="ChangeQtyToInvoice"/>
8282
<click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQunatity"/>
8383
<waitForPageLoad stepKey="waitPageToBeLoaded"/>
84-
<actionGroup ref="submitInvoiceIntoOrder" stepKey="submitInvoice"/>
84+
<actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/>
8585

8686
<!--Verify invoiced items qty in ship tab-->
8787
<actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
7272
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/>
7373
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
74-
<waitForPageLoad stepKey="waitForInvoicePageLoad"/>
7574
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/>
7675
<click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/>
7776
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5" />

app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@
136136
<waitForPageLoad stepKey="waitForInvoicePageOpened"/>
137137

138138
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
139-
<waitForPageLoad stepKey="waitForInvoiceSaved"/>
140139

141-
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction" after="waitForInvoiceSaved"/>
140+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
142141
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl" after="clickShipAction"/>
143142
<!--Submit Shipment-->
144143
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment" after="seeOrderShipmentUrl"/>

0 commit comments

Comments
 (0)