6
6
7
7
namespace Magento \FunctionalTestingFramework \Module ;
8
8
9
+ use Codeception \Module \WebDriver ;
10
+
9
11
/**
10
12
* Class MagentoPwaActions
11
13
*
15
17
*/
16
18
class MagentoPwaWebDriver extends MagentoWebDriver
17
19
{
20
+ /**
21
+ * Go to the page.
22
+ *
23
+ * Overriding the MagentoWebDriver version because it contains 'waitForPageLoad'.
24
+ * The AJAX check in 'waitForPageLoad' does NOT work with a PWA.
25
+ *
26
+ * @param string $page
27
+ * @throws \Exception
28
+ * @return void
29
+ */
30
+ public function amOnPage ($ page )
31
+ {
32
+ WebDriver::amOnPage ($ page );
33
+ }
34
+
18
35
/**
19
36
* Wait for a PWA Element to NOT be visible using JavaScript.
37
+ * Add the WAIT_TIMEOUT variable to your .env file for this action.
20
38
*
21
39
* @param null $selector
22
40
* @param null $timeout
@@ -25,8 +43,6 @@ class MagentoPwaWebDriver extends MagentoWebDriver
25
43
*/
26
44
public function waitForPwaElementNotVisible ($ selector , $ timeout = null )
27
45
{
28
- $ timeout = $ timeout ?? $ this ->_getConfig ()['pageload_timeout ' ];
29
-
30
46
// Determine what type of Selector is used.
31
47
// Then use the correct JavaScript to locate the Element.
32
48
if (\Codeception \Util \Locator::isXPath ($ selector )) {
@@ -38,6 +54,7 @@ public function waitForPwaElementNotVisible($selector, $timeout = null)
38
54
39
55
/**
40
56
* Wait for a PWA Element to be visible using JavaScript.
57
+ * Add the WAIT_TIMEOUT variable to your .env file for this action.
41
58
*
42
59
* @param null $selector
43
60
* @param null $timeout
@@ -46,8 +63,6 @@ public function waitForPwaElementNotVisible($selector, $timeout = null)
46
63
*/
47
64
public function waitForPwaElementVisible ($ selector , $ timeout = null )
48
65
{
49
- $ timeout = $ timeout ?? $ this ->_getConfig ()['pageload_timeout ' ];
50
-
51
66
// Determine what type of Selector is used.
52
67
// Then use the correct JavaScript to locate the Element.
53
68
if (\Codeception \Util \Locator::isXPath ($ selector )) {
0 commit comments