Skip to content

Merge changes from CD-develop to develop #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class ActionGroupWithSectionAndDataAsArgumentsCest
*/
public function ActionGroupWithSectionAndDataAsArguments(AcceptanceTester $I)
{
$I->waitForElementVisible("#element .John");
$I->waitForElementVisible("#element .John", 10);
}
}
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/BasicFunctionalTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class BasicFunctionalTestCest
$I->moveMouseOver(".functionalTestSelector");
$I->openNewTab();
$I->pauseExecution();
$I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();});
$I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10);
$I->pressKey("#page", "a");
$I->pressKey("#page", ['ctrl', 'a'],'new');
$I->pressKey("#page", ['shift', '111'],'1','x');
Expand Down Expand Up @@ -165,7 +165,7 @@ class BasicFunctionalTestCest
$I->waitForElement(".functionalTestSelector", 30);
$I->waitForElementNotVisible(".functionalTestSelector", 30);
$I->waitForElementVisible(".functionalTestSelector", 30);
$I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();});
$I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10);
$I->waitForJS("someJsFunction", 30);
$I->waitForText("someInput", 30, ".functionalTestSelector");
}
Expand Down
3 changes: 3 additions & 0 deletions etc/config/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_C

#*** Bool property which allows the user to toggle debug output during test execution
#MFTF_DEBUG=

#*** Default timeout for wait actions
#WAIT_TIMEOUT=10
#*** End of .env ***#
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class ActionObject
const ACTION_ATTRIBUTE_SELECTOR = 'selector';
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/';
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/({{[\w]+\.[\w\[\]]+}})|({{[\w]+\.[\w]+\((?(?!}}).)+\)}})/';
const DEFAULT_WAIT_TIMEOUT = 10;

/**
* The unique identifier for the action
Expand Down Expand Up @@ -154,6 +155,16 @@ public function __construct(
}
}

/**
* Retrieve default timeout in seconds for 'wait*' actions
*
* @return integer
*/
public static function getDefaultWaitTimeout()
{
return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT;
}

/**
* This function returns the string property stepKey.
*
Expand Down Expand Up @@ -271,7 +282,6 @@ public function resolveReferences()
* Warns user if they are using old Assertion syntax.
*
* @return void
* @throws TestReferenceException
*/
public function trimAssertionAttributes()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
if (isset($customActionAttributes['timeout'])) {
$time = $customActionAttributes['timeout'];
}
$time = $time ?? ActionObject::getDefaultWaitTimeout();

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