Skip to content

[Pangolin] Deliver changes from Sprint 14 #17

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 48 commits into from
Dec 8, 2017
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fe5e815
MQE-494: Create MFTF demo repository
tomreece Nov 21, 2017
7f3545b
MQE-494: Create MFTF demo repository
tomreece Nov 21, 2017
36755e5
MQE-507: [Action Groups] Strange behavior with argument replacement i…
KevinBKozan Nov 27, 2017
93e5768
MQE-565: User are not able to use <actionGroup> after updating the la…
imeron2433 Nov 21, 2017
5cc6508
Merge remote-tracking branch 'origin/sprint-develop' into MQE-494
tomreece Nov 28, 2017
a948df6
MQE-494: Create MFTF demo repository
tomreece Nov 28, 2017
06ccb74
MQE-469: use 'number' for operation data type according to swagger 2.…
jilu1 Nov 29, 2017
39bfa9f
MQE-382: Adding a "assertElementContainsAttribute" method.
ivy00johns Nov 29, 2017
e1b663c
MQE-586: Ignore _generated folder for mftf code sniffer
tomreece Nov 30, 2017
c229c07
Merge branch 'MQE-469' into sprint-develop
jilu1 Dec 1, 2017
bab10a8
MQE-569: added SampleTests in module blacklist and not allowed to gen…
jilu1 Dec 1, 2017
3649824
MQE-541: changed to use stepKey for test step sequencing.
jilu1 Dec 1, 2017
3eff218
Merge branch 'MQE-494' into sprint-develop
tomreece Dec 4, 2017
62780b4
Merge remote-tracking branch 'origin/MQE-569' into sprint-develop
jilu1 Dec 4, 2017
9123be8
MQE-525: Include PHP Mess Detector to required checks for MFTF
KevinBKozan Dec 4, 2017
546f165
MQE-541: changed to use stepKey for test step sequencing.
jilu1 Dec 5, 2017
110c3a5
MQE-541: changed to use stepKey for test step sequencing.
jilu1 Dec 5, 2017
faeee49
Merge branch 'MQE-541' into MQE-574
jilu1 Dec 5, 2017
1b87a6f
MQE-591: Bin scripts do not return the correct error code
tomreece Dec 5, 2017
5fcbc02
MQE-591: Bin scripts do not return the correct error code
tomreece Dec 5, 2017
bdb8340
MQE-579: waitForLoadingMaskToDisappear fails sometimes when two loadi…
KevinBKozan Dec 5, 2017
da10983
MQE-570: Sanitize MAGENTO_BASE_URL (.env file) and Selenium params
KevinBKozan Dec 5, 2017
0369375
MQE-549: [Unit Test] ActionMergeUtil.php
tomreece Dec 6, 2017
b38bb3e
MQE-574: set proper required attributes in test schema and added attr…
jilu1 Dec 6, 2017
febae80
MQE-541: deprecated 'mergeKey' for test schema.
jilu1 Dec 6, 2017
1e14905
MQE-600: Prune README.md in EE repo
tomreece Dec 6, 2017
7b95c71
Merge branch 'develop' of github.com:magento-pangolin/magento2-functi…
okolesnyk Dec 7, 2017
eba01db
MQE-347: Use a remove tag instead of a remove attribute
imeron2433 Dec 5, 2017
a7121eb
MQE-347: Use a remove tag instead of a remove attribute
imeron2433 Dec 6, 2017
81c8690
MQE-347: Use a remove tag instead of a remove attribute
imeron2433 Dec 7, 2017
1632842
MQE-574: set proper required attributes in test schema and added attr…
jilu1 Dec 7, 2017
d1dc19e
MQE-574: set proper required attributes in test schema and added attr…
jilu1 Dec 7, 2017
46a9e9b
MQE-583: set licensing in composer.json.
jilu1 Dec 7, 2017
8aac939
MQE-606: adding changelog.md file
magterskine Dec 7, 2017
8983616
Merge branch 'changelog' into sprint-develop
magterskine Dec 7, 2017
2c70363
Merge branch 'MQE-541' into sprint-develop
jilu1 Dec 7, 2017
7c4954b
Merge branch 'sprint-develop' of https://github.com/magento-pangolin/…
jilu1 Dec 7, 2017
a50014a
MQE-607: Replace license file
tomreece Dec 7, 2017
d76e7ae
MQE-386: MFTF Compatibility with Windows Machine
imeron2433 Dec 5, 2017
3b84770
MQE-386: MFTF Compatability with Windows Machine
imeron2433 Dec 7, 2017
724af1d
Merge branch 'MQE-574' into sprint-develop
jilu1 Dec 7, 2017
2410096
Merge branch 'sprint-develop' of https://github.com/magento-pangolin/…
jilu1 Dec 7, 2017
dddf351
MQE-592: Test Case Audit
ivy00johns Dec 7, 2017
8c36bce
MQE-592: Test Case Audit
ivy00johns Dec 7, 2017
c57f9e0
MQE-592: Audit Test Cases on Firefox/Chrome on Windows/OSX
imeron2433 Dec 7, 2017
cd3d25c
Merge branch 'MQE-607' into sprint-develop
tomreece Dec 8, 2017
5d5e1db
MQE-599: Move composer.json, README, etc from EE to CE
okolesnyk Dec 8, 2017
7563d0a
Merge branch 'MQE-599' of github.com:magento-pangolin/magento2-functi…
okolesnyk Dec 8, 2017
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
Prev Previous commit
Next Next commit
MQE-574: set proper required attributes in test schema and added attr…
…ibute rule checks in test generator.
  • Loading branch information
jilu1 committed Dec 7, 2017
commit 1632842b6a035b2a6668a59c5fc6797dc169917e
53 changes: 23 additions & 30 deletions src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
foreach ($stepsObject as $steps) {
$actor = "I";
$actionName = $steps->getType();
$attribute = null;
$stepKey = $steps->getStepKey();
$customActionAttributes = $steps->getCustomActionAttributes();
$attribute = null;
$selector = null;
$selector1 = null;
$selector2 = null;
Expand Down Expand Up @@ -377,7 +378,7 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
$assertDelta = null;

// Validate action attributes and print notice messages on violation.
$this->validateXmlAttributesMutuallyExclusive($actionName, $customActionAttributes);
$this->validateXmlAttributesMutuallyExclusive($stepKey, $actionName, $customActionAttributes);

if (isset($customActionAttributes['returnVariable'])) {
$returnVariable = $customActionAttributes['returnVariable'];
Expand Down Expand Up @@ -517,12 +518,11 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
switch ($actionName) {
case "createData":
$entity = $customActionAttributes['entity'];
$key = $steps->getStepKey();
//Add an informative statement to help the user debug test runs
$testSteps .= sprintf(
"\t\t$%s->amGoingTo(\"create entity that has the stepKey: %s\");\n",
$actor,
$key
$stepKey
);
//Get Entity from Static data.
$testSteps .= sprintf(
Expand Down Expand Up @@ -554,17 +554,17 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
}

if ($hookObject) {
$createEntityFunctionCall = sprintf("\t\t\$this->%s->createEntity(", $key);
$createEntityFunctionCall = sprintf("\t\t\$this->%s->createEntity(", $stepKey);
$dataPersistenceHandlerFunctionCall = sprintf(
"\t\t\$this->%s = new DataPersistenceHandler($%s",
$key,
$stepKey,
$entity
);
} else {
$createEntityFunctionCall = sprintf("\t\t\$%s->createEntity(", $key);
$createEntityFunctionCall = sprintf("\t\t\$%s->createEntity(", $stepKey);
$dataPersistenceHandlerFunctionCall = sprintf(
"\t\t$%s = new DataPersistenceHandler($%s",
$key,
$stepKey,
$entity
);
}
Expand Down Expand Up @@ -659,12 +659,11 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
break;
case "getData":
$entity = $customActionAttributes['entity'];
$key = $steps->getStepKey();
//Add an informative statement to help the user debug test runs
$testSteps .= sprintf(
"\t\t$%s->amGoingTo(\"get entity that has the stepKey: %s\");\n",
$actor,
$key
$stepKey
);
//Get Entity from Static data.
$testSteps .= sprintf(
Expand Down Expand Up @@ -696,17 +695,17 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
}

if ($hookObject) {
$getEntityFunctionCall = sprintf("\t\t\$this->%s->getEntity(", $key);
$getEntityFunctionCall = sprintf("\t\t\$this->%s->getEntity(", $stepKey);
$dataPersistenceHandlerFunctionCall = sprintf(
"\t\t\$this->%s = new DataPersistenceHandler($%s",
$key,
$stepKey,
$entity
);
} else {
$getEntityFunctionCall = sprintf("\t\t\$%s->getEntity(", $key);
$getEntityFunctionCall = sprintf("\t\t\$%s->getEntity(", $stepKey);
$dataPersistenceHandlerFunctionCall = sprintf(
"\t\t$%s = new DataPersistenceHandler($%s",
$key,
$stepKey,
$entity
);
}
Expand Down Expand Up @@ -1543,11 +1542,12 @@ private function stripQuotes($inStr)
/**
* Validate action attributes are either not set at all or only one is set for a given rule.
*
* @param string $key
* @param string $tagName
* @param array $attributes
* @return void
*/
private function validateXmlAttributesMutuallyExclusive($tagName, $attributes)
private function validateXmlAttributesMutuallyExclusive($key, $tagName, $attributes)
{
$rules = [
[ 'attributes' => [
Expand Down Expand Up @@ -1588,34 +1588,27 @@ private function validateXmlAttributesMutuallyExclusive($tagName, $attributes)
}
}
if ($count > 1) {
$this->printRuleErrorToConsole($tagName, $rule['attributes']);
$this->printRuleErrorToConsole($key, $tagName, $rule['attributes']);
}
}
}

/**
* Print rule violation message to console.
*
* @param $tagName
* @param $attributes
* @param string $key
* @param string $tagName
* @param array $attributes
* @return void
*/
private function printRuleErrorToConsole($tagName, $attributes)
private function printRuleErrorToConsole($key, $tagName, $attributes)
{
if (empty($tagName) || empty($attributes)) {
return;
}
$message = "Only one of the attributes: ";
$first = true;
foreach ($attributes as $attribute) {
if ($first) {
$message .= '"' . $attribute . '"';
$first = false;
} else {
$message .= ', "' . $attribute . '"';
}
}
$message .= ' can be use for action: "' . $tagName . "\"\n";
$message = 'On step with stepKey "' . $key . '", only one of the attributes: "';
$message .= implode('", "', $attributes);
$message .= '" can be use for action "' . $tagName . "\".\n";
print $message;
}
}