Skip to content

Commit 85b44c3

Browse files
authored
Merge pull request #211 from magento/CD-develop
Merge changes from CD-develop to develop
2 parents cae669a + 9c276d0 commit 85b44c3

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ class ActionGroupWithSectionAndDataAsArgumentsCest
2727
*/
2828
public function ActionGroupWithSectionAndDataAsArguments(AcceptanceTester $I)
2929
{
30-
$I->waitForElementVisible("#element .John");
30+
$I->waitForElementVisible("#element .John", 10);
3131
}
3232
}

dev/tests/verification/Resources/BasicFunctionalTest.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class BasicFunctionalTestCest
126126
$I->moveMouseOver(".functionalTestSelector");
127127
$I->openNewTab();
128128
$I->pauseExecution();
129-
$I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();});
129+
$I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10);
130130
$I->pressKey("#page", "a");
131131
$I->pressKey("#page", ['ctrl', 'a'],'new');
132132
$I->pressKey("#page", ['shift', '111'],'1','x');
@@ -165,7 +165,7 @@ class BasicFunctionalTestCest
165165
$I->waitForElement(".functionalTestSelector", 30);
166166
$I->waitForElementNotVisible(".functionalTestSelector", 30);
167167
$I->waitForElementVisible(".functionalTestSelector", 30);
168-
$I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();});
168+
$I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10);
169169
$I->waitForJS("someJsFunction", 30);
170170
$I->waitForText("someInput", 30, ".functionalTestSelector");
171171
}

etc/config/.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,7 @@ MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_C
4444

4545
#*** Bool property which allows the user to toggle debug output during test execution
4646
#MFTF_DEBUG=
47+
48+
#*** Default timeout for wait actions
49+
#WAIT_TIMEOUT=10
4750
#*** End of .env ***#

src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class ActionObject
6868
const ACTION_ATTRIBUTE_SELECTOR = 'selector';
6969
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/';
7070
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/({{[\w]+\.[\w\[\]]+}})|({{[\w]+\.[\w]+\((?(?!}}).)+\)}})/';
71+
const DEFAULT_WAIT_TIMEOUT = 10;
7172

7273
/**
7374
* The unique identifier for the action
@@ -154,6 +155,16 @@ public function __construct(
154155
}
155156
}
156157

158+
/**
159+
* Retrieve default timeout in seconds for 'wait*' actions
160+
*
161+
* @return integer
162+
*/
163+
public static function getDefaultWaitTimeout()
164+
{
165+
return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT;
166+
}
167+
157168
/**
158169
* This function returns the string property stepKey.
159170
*
@@ -271,7 +282,6 @@ public function resolveReferences()
271282
* Warns user if they are using old Assertion syntax.
272283
*
273284
* @return void
274-
* @throws TestReferenceException
275285
*/
276286
public function trimAssertionAttributes()
277287
{

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

+1
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
595595
if (isset($customActionAttributes['timeout'])) {
596596
$time = $customActionAttributes['timeout'];
597597
}
598+
$time = $time ?? ActionObject::getDefaultWaitTimeout();
598599

599600
if (isset($customActionAttributes['parameterArray']) && $actionObject->getType() != 'pressKey') {
600601
// validate the param array is in the correct format

0 commit comments

Comments
 (0)