Skip to content

MQE-587: Use element selectors in custom JS #23

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 5 commits into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -20,7 +20,7 @@
class ActionObject
{
const DATA_ENABLED_ATTRIBUTES = ["userInput", "parameterArray"];
const SELECTOR_ENABLED_ATTRIBUTES = ['selector', 'dependentSelector', "selector1", "selector2"];
const SELECTOR_ENABLED_ATTRIBUTES = ['selector', 'dependentSelector', "selector1", "selector2", "function"];
const MERGE_ACTION_ORDER_AFTER = 'after';
const MERGE_ACTION_ORDER_BEFORE = 'before';
const ACTION_ATTRIBUTE_URL = 'url';
Expand Down Expand Up @@ -368,7 +368,7 @@ private function findAndReplaceReferences($objectHandler, $inputString)
*/
private function resolveRegexPatternForReference($inputString)
{
if (preg_match(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER, $inputString) === 1) {
if (preg_match(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN_WITH_PARAMS, $inputString) === 1) {
return ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN_WITH_PARAMS;
} else {
return ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN;
Expand Down
6 changes: 3 additions & 3 deletions src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
}

if (isset($customActionAttributes['function'])) {
$function = $customActionAttributes['function'];
$function = $this->addUniquenessFunctionCall($customActionAttributes['function']);
}

if (isset($customActionAttributes['html'])) {
Expand Down Expand Up @@ -864,7 +864,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
$testSteps .= $this->wrapFunctionCall($actor, $actionName, $function);
break;
case "executeJS":
$testSteps .= $this->wrapFunctionCall($actor, $actionName, $this->wrapWithDoubleQuotes($function));
$testSteps .= $this->wrapFunctionCall($actor, $actionName, $function);
break;
case "performOn":
case "waitForElementChange":
Expand All @@ -874,7 +874,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false)
$testSteps .= $this->wrapFunctionCall(
$actor,
$actionName,
$this->wrapWithDoubleQuotes($function),
$function,
$time
);
break;
Expand Down