Skip to content

Commit 535ce51

Browse files
committed
B2B-2106: [AWS S3] Test Failed to add product to order because page is loading
- Improving flaky test
1 parent 9b1016b commit 535ce51

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/>
2323
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
2424
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/>
25+
<waitForPageLoad stepKey="waitForProductLoad"/>
2526
<fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/>
2627
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
2728
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
28-
<waitForLoadingMaskToDisappear stepKey="waitForOptionsToLoad"/>
29+
<waitForPageLoad stepKey="waitForOptionsToLoad"/>
2930
</actionGroup>
3031
</actionGroups>

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
</annotations>
1414
<arguments>
1515
<argument name="file" type="string" defaultValue="{{TestImageNew.file}}" />
16+
<argument name="fileName" type="string" defaultValue="{{TestImageNew.filename}}"/>
1617
</arguments>
1718

1819
<remove keyForRemoval="fillProductQty"/>
19-
<waitForAjaxLoad stepKey="waitForAjaxLoad" after="selectProduct"/>
20-
<fillField selector="{{AdminOrderFormCustomOptionsSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQty" after="waitForAjaxLoad"/>
20+
<comment userInput="BIC workaround" stepKey="waitForAjaxLoad" after="waitForProductLoad"/>
21+
<waitForElementVisible selector="{{AdminOrderFormCustomOptionsSection.quantity}}" stepKey="waitForProductQty" after="waitForAjaxLoad"/>
22+
<fillField selector="{{AdminOrderFormCustomOptionsSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQty" after="waitForProductQty"/>
2123
<attachFile selector="{{AdminOrderFormCustomOptionsSection.file}}" userInput="{{file}}" stepKey="attachImageForOptional" after="fillProductQty"/>
22-
<click selector="{{AdminOrderFormCustomOptionsSection.buttonOk}}" stepKey="clickButtonOK" after="attachImageForOptional"/>
24+
<waitForPageLoad stepKey="waitForImageUploaded" after="attachImageForOptional"/>
25+
<click selector="{{AdminOrderFormCustomOptionsSection.buttonOk}}" stepKey="clickButtonOK" after="waitForImageUploaded"/>
26+
<waitForPageLoad stepKey="waitForSlideOutGone" after="clickButtonOK"/>
27+
<waitForElementNotVisible selector="{{AdminOrderFormCustomOptionsSection.buttonOk}}" stepKey="waitForOkButtonGone" after="waitForSlideOutGone"/>
2328
</actionGroup>
2429
</actionGroups>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@
1212
<description>Change custom option file on admin order page.</description>
1313
</annotations>
1414
<arguments>
15-
<argument name="file" type="string" defaultValue="{{TestImageNew.file}}" />
15+
<argument name="file" type="string" defaultValue="{{TestImageNew.file}}"/>
16+
<argument name="fileName" type="string" defaultValue="{{TestImageNew.filename}}"/>
1617
</arguments>
1718

1819
<click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/>
19-
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
20+
<waitForPageLoad stepKey="waitForAjaxLoad"/>
21+
<waitForElementVisible selector="{{AdminOrderFormCustomOptionsSection.linkChange}}" stepKey="waitForLinkChange"/>
2022
<click selector="{{AdminOrderFormCustomOptionsSection.linkChange}}" stepKey="clickLinkChange"/>
2123
<waitForPageLoad stepKey="waitForChangeLoad"/>
24+
<waitForElementVisible selector="{{AdminOrderFormCustomOptionsSection.file}}" stepKey="waitForAttachImage"/>
2225
<attachFile selector="{{AdminOrderFormCustomOptionsSection.file}}" userInput="{{file}}" stepKey="changeAttachImage"/>
26+
<waitForPageLoad stepKey="waitForImageUploaded"/>
2327
<click selector="{{AdminOrderFormCustomOptionsSection.buttonOk}}" stepKey="clickButtonOK"/>
2428
<waitForPageLoad stepKey="waitForCustomOptionApplied"/>
29+
<waitForElementNotVisible selector="{{AdminOrderFormCustomOptionsSection.buttonOk}}" stepKey="waitForOkButtonGone"/>
2530
</actionGroup>
2631
</actionGroups>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
<argument name="productQty" value="$simpleProduct.quantity$"/>
5151
</actionGroup>
5252
<!--Verify, admin able to change file for custom option.-->
53-
<actionGroup ref="AdminChangeCustomerOptionFileActionGroup" stepKey="changeFile"/>
53+
<actionGroup ref="AdminChangeCustomerOptionFileActionGroup" stepKey="changeFile">
54+
<argument name="file" value="{{TestImageAdobe.file}}"/>
55+
<argument name="fileName" value="{{TestImageAdobe.filename}}"/>
56+
</actionGroup>
5457
</test>
5558
</tests>

0 commit comments

Comments
 (0)