Skip to content

MQE-842: Update feature and story tags to map to test functions when generated #49

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 1 commit into from
Mar 12, 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 @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class ActionGroupWithDataOverrideTestCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class ActionGroupWithDataOverrideTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/ActionGroupWithDataTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class ActionGroupWithDataTestCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class ActionGroupWithDataTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class ActionGroupWithNoDefaultTestCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class ActionGroupWithNoDefaultTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class ActionGroupWithPersistedDataCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class ActionGroupWithPersistedDataCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class ActionGroupWithTopLevelPersistedDataCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class ActionGroupWithTopLevelPersistedDataCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class ArgumentWithSameNameAsElementCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class ArgumentWithSameNameAsElementCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/BasicActionGroupTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class BasicActionGroupTestCest
{
Expand All @@ -44,6 +42,8 @@ class BasicActionGroupTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/BasicFunctionalTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Basic Functional Cest"})
* @Stories({"MQE-305"})
*/
class BasicFunctionalTestCest
{
Expand Down Expand Up @@ -53,6 +51,8 @@ class BasicFunctionalTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Basic Functional Cest"})
* @Stories({"MQE-305"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/BasicMergeTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
* @Title("A Functional Cest")
* @group functional
* @group mergeTest
* @Features({"Merge Functional Cest"})
* @Stories({"MQE-433"})
*/
class BasicMergeTestCest
{
Expand Down Expand Up @@ -55,6 +53,8 @@ class BasicMergeTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Merge Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/MergedActionGroupTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class MergedActionGroupTestCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class MergedActionGroupTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/MergedReferencesTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Merge Functional Cest"})
* @Stories({"MQE-433"})
*/
class MergedReferencesTestCest
{
Expand Down Expand Up @@ -53,6 +51,8 @@ class MergedReferencesTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Merge Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
4 changes: 2 additions & 2 deletions dev/tests/verification/Resources/MultipleActionGroupsTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
* @Title("A Functional Cest")
* @group functional
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
*/
class MultipleActionGroupsTestCest
{
Expand Down Expand Up @@ -64,6 +62,8 @@ class MultipleActionGroupsTestCest

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"Action Group Functional Cest"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
Expand Down
47 changes: 24 additions & 23 deletions src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,30 @@ private function generateMethodAnnotations($annotationType = null, $annotationNa
$indent = "\t";

switch ($annotationType) {
case "features":
$features = "";
foreach ($annotationName as $name) {
$features .= sprintf("\"%s\"", $name);

if (next($annotationName)) {
$features .= ", ";
}
}
$annotationToAppend .= sprintf("{$indent} * @Features({%s})\n", $features);
break;

case "stories":
$stories = "";
foreach ($annotationName as $name) {
$stories .= sprintf("\"%s\"", $name);

if (next($annotationName)) {
$stories .= ", ";
}
}
$annotationToAppend .= sprintf("{$indent} * @Stories({%s})\n", $stories);
break;

case "severity":
$annotationToAppend = sprintf("{$indent} * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]);
break;
Expand Down Expand Up @@ -327,29 +351,6 @@ private function generateClassAnnotations($annotationType, $annotationName)
$annotationToAppend = null;

switch ($annotationType) {
case "features":
$features = "";
foreach ($annotationName as $name) {
$features .= sprintf("\"%s\"", $name);

if (next($annotationName)) {
$features .= ", ";
}
}
$annotationToAppend .= sprintf(" * @Features({%s})\n", $features);
break;

case "stories":
$stories = "";
foreach ($annotationName as $name) {
$stories .= sprintf("\"%s\"", $name);

if (next($annotationName)) {
$stories .= ", ";
}
}
$annotationToAppend .= sprintf(" * @Stories({%s})\n", $stories);
break;

case "title":
$annotationToAppend = sprintf(" * @Title(\"%s\")\n", $annotationName[0]);
Expand Down