File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 137137
138138 <!-- See print page -->
139139 <click selector =" {{CheckoutSuccessMainSection.printLink}}" stepKey =" clickPrintLink" />
140- <helper class =" Magento\Ui \Test\Mftf\Helper\UiHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" >
140+ <helper class =" Magento\Sales \Test\Mftf\Helper\SalesHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" >
141141 <argument name =" expectedUrl" >sales/order/print/order_id/</argument >
142142 <argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
143143 </helper >
Original file line number Diff line number Diff line change 55 */
66declare (strict_types=1 );
77
8- namespace Magento \Ui \Test \Mftf \Helper ;
8+ namespace Magento \Sales \Test \Mftf \Helper ;
99
1010use Facebook \WebDriver \Remote \RemoteWebDriver ;
1111use Magento \FunctionalTestingFramework \Helper \Helper ;
1212use Facebook \WebDriver \Exception \NoSuchWindowException ;
1313
1414/**
15- * Class for MFTF helpers for Ui module.
15+ * Class for MFTF helpers for Sales module.
1616 */
17- class UiHelper extends Helper
17+ class SalesHelper extends Helper
1818{
1919 private const COMPARISON_PATH_EXACT_MATCH = 'COMPARISON_PATH_EXACT_MATCH ' ;
2020 private const COMPARISON_PATH_SUBSET_MATCH = 'COMPARISON_PATH_SUBSET_MATCH ' ;
@@ -24,6 +24,14 @@ class UiHelper extends Helper
2424 self ::COMPARISON_PATH_SUBSET_MATCH
2525 ];
2626
27+ /**
28+ * Iterate through all available window handles and attach webdriver to window matching $expectedUrl.
29+ * If print dialog is found, close it to prevent selenium from hanging and becoming unresponsive.
30+ *
31+ * @param string $expectedUrl
32+ * @param string $expectedUrlComparisonType
33+ * @throws \Codeception\Exception\ModuleException
34+ */
2735 public function switchToWindowWithUrlAndClosePrintDialogIfEncountered (
2836 string $ expectedUrl ,
2937 string $ expectedUrlComparisonType
Original file line number Diff line number Diff line change 267267
268268 <!-- Click on the "Print Order" button -->
269269 <click selector =" {{StorefrontGuestOrderViewSection.printOrder}}" stepKey =" printOrder" />
270- <helper class =" Magento\Ui \Test\Mftf\Helper\UiHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" >
270+ <helper class =" Magento\Sales \Test\Mftf\Helper\SalesHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" >
271271 <argument name =" expectedUrl" >sales/guest/print/order_id/</argument >
272272 <argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
273273 </helper >
Original file line number Diff line number Diff line change 4848 <grabFromCurrentUrl regex =" ~/order_id/(\d+)/~" stepKey =" grabOrderIdFromURL" />
4949 <comment userInput =" BIC workaround" stepKey =" waitForPrintWindowToOpen" />
5050
51- <helper class =" Magento\Ui \Test\Mftf\Helper\UiHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" >
51+ <helper class =" Magento\Sales \Test\Mftf\Helper\SalesHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" >
5252 <argument name =" expectedUrl" >sales/order/print/order_id/{$grabOrderIdFromURL}</argument >
5353 <argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
5454 </helper >
8585 </actionGroup >
8686
8787 <comment userInput =" Step key preserved for backwards compatibility" stepKey =" waitForPrintWindowToOpen2" />
88- <helper class =" Magento\Ui \Test\Mftf\Helper\UiHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered2" >
88+ <helper class =" Magento\Sales \Test\Mftf\Helper\SalesHelper " method =" switchToWindowWithUrlAndClosePrintDialogIfEncountered" stepKey =" switchToWindowWithUrlAndClosePrintDialogIfEncountered2" >
8989 <argument name =" expectedUrl" >sales/order/print/order_id/</argument >
9090 <argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
9191 </helper >
You can’t perform that action at this time.
0 commit comments