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 137
137
138
138
<!-- See print page -->
139
139
<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" >
141
141
<argument name =" expectedUrl" >sales/order/print/order_id/</argument >
142
142
<argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
143
143
</helper >
Original file line number Diff line number Diff line change 5
5
*/
6
6
declare (strict_types=1 );
7
7
8
- namespace Magento \Ui \Test \Mftf \Helper ;
8
+ namespace Magento \Sales \Test \Mftf \Helper ;
9
9
10
10
use Facebook \WebDriver \Remote \RemoteWebDriver ;
11
11
use Magento \FunctionalTestingFramework \Helper \Helper ;
12
12
use Facebook \WebDriver \Exception \NoSuchWindowException ;
13
13
14
14
/**
15
- * Class for MFTF helpers for Ui module.
15
+ * Class for MFTF helpers for Sales module.
16
16
*/
17
- class UiHelper extends Helper
17
+ class SalesHelper extends Helper
18
18
{
19
19
private const COMPARISON_PATH_EXACT_MATCH = 'COMPARISON_PATH_EXACT_MATCH ' ;
20
20
private const COMPARISON_PATH_SUBSET_MATCH = 'COMPARISON_PATH_SUBSET_MATCH ' ;
@@ -24,6 +24,14 @@ class UiHelper extends Helper
24
24
self ::COMPARISON_PATH_SUBSET_MATCH
25
25
];
26
26
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
+ */
27
35
public function switchToWindowWithUrlAndClosePrintDialogIfEncountered (
28
36
string $ expectedUrl ,
29
37
string $ expectedUrlComparisonType
Original file line number Diff line number Diff line change 267
267
268
268
<!-- Click on the "Print Order" button -->
269
269
<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" >
271
271
<argument name =" expectedUrl" >sales/guest/print/order_id/</argument >
272
272
<argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
273
273
</helper >
Original file line number Diff line number Diff line change 48
48
<grabFromCurrentUrl regex =" ~/order_id/(\d+)/~" stepKey =" grabOrderIdFromURL" />
49
49
<comment userInput =" BIC workaround" stepKey =" waitForPrintWindowToOpen" />
50
50
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" >
52
52
<argument name =" expectedUrl" >sales/order/print/order_id/{$grabOrderIdFromURL}</argument >
53
53
<argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
54
54
</helper >
85
85
</actionGroup >
86
86
87
87
<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" >
89
89
<argument name =" expectedUrl" >sales/order/print/order_id/</argument >
90
90
<argument name =" expectedUrlComparisonType" >COMPARISON_PATH_SUBSET_MATCH</argument >
91
91
</helper >
You can’t perform that action at this time.
0 commit comments