File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
dev/tests/functional/tests/app/Magento/Checkout/Test/Block Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public function openEstimateShippingAndTax()
86
86
*/
87
87
public function selectShippingMethod (array $ shipping )
88
88
{
89
+ $ this ->waitForUpdatedShippingMethods ();
89
90
$ selector = sprintf ($ this ->shippingMethod , $ shipping ['shipping_service ' ], $ shipping ['shipping_method ' ]);
90
91
if (!$ this ->_rootElement ->find ($ selector , Locator::SELECTOR_XPATH )->isVisible ()) {
91
92
$ this ->openEstimateShippingAndTax ();
Original file line number Diff line number Diff line change @@ -42,6 +42,18 @@ class Method extends Block
42
42
*/
43
43
protected $ blockWaitElement = '._block-content-loading ' ;
44
44
45
+ /**
46
+ * Wait until shipping rates will appear.
47
+ *
48
+ * @return void
49
+ */
50
+ private function waitForShippingRates ()
51
+ {
52
+ // Code under test uses JavaScript setTimeout at this point as well.
53
+ sleep (3 );
54
+ $ this ->waitForElementNotVisible ($ this ->blockWaitElement );
55
+ }
56
+
45
57
/**
46
58
* Select shipping method.
47
59
*
@@ -50,20 +62,19 @@ class Method extends Block
50
62
*/
51
63
public function selectShippingMethod (array $ method )
52
64
{
53
- // Code under test uses JavaScript setTimeout at this point as well.
54
- sleep (3 );
65
+ $ this ->waitForShippingRates ();
55
66
$ selector = sprintf ($ this ->shippingMethod , $ method ['shipping_method ' ], $ method ['shipping_service ' ]);
56
- $ this ->waitForElementNotVisible ($ this ->blockWaitElement );
57
67
$ this ->_rootElement ->find ($ selector , Locator::SELECTOR_XPATH )->click ();
58
68
}
59
69
60
70
/**
61
- * Click continue button
71
+ * Click continue button.
62
72
*
63
73
* @return void
64
74
*/
65
75
public function clickContinue ()
66
76
{
77
+ $ this ->waitForShippingRates ();
67
78
$ this ->_rootElement ->find ($ this ->continue )->click ();
68
79
$ browser = $ this ->browser ;
69
80
$ selector = $ this ->waitElement ;
You can’t perform that action at this time.
0 commit comments