From 95708308239091419a971866ab63d0da1c8de68f Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 6 Dec 2021 16:14:15 -0600 Subject: [PATCH 1/3] MQE-3122: Logging of failed test is not working when test fails in `after` section --- .../ActionGroupContainsStepKeyInArgText.txt | 20 +++++++++++++++++-- .../ActionGroupMergedViaInsertAfter.txt | 20 +++++++++++++++++-- .../ActionGroupMergedViaInsertBefore.txt | 20 +++++++++++++++++-- .../ActionGroupReturningValueTest.txt | 12 +++++++++-- .../Resources/ActionGroupToExtend.txt | 20 +++++++++++++++++-- .../Resources/ActionGroupUsingCreateData.txt | 20 +++++++++++++++++-- .../ActionGroupUsingNestedArgument.txt | 20 +++++++++++++++++-- .../ActionGroupWithDataOverrideTest.txt | 12 +++++++++-- .../Resources/ActionGroupWithDataTest.txt | 20 +++++++++++++++++-- ...hDefaultArgumentAndStringSelectorParam.txt | 20 +++++++++++++++++-- ...eParameterSelectorsFromDefaultArgument.txt | 20 +++++++++++++++++-- .../Resources/ActionGroupWithNoArguments.txt | 20 +++++++++++++++++-- .../ActionGroupWithNoDefaultTest.txt | 12 +++++++++-- ...roupWithParameterizedElementWithHyphen.txt | 20 +++++++++++++++++-- ...meterizedElementsWithStepKeyReferences.txt | 20 +++++++++++++++++-- ...thPassedArgumentAndStringSelectorParam.txt | 20 +++++++++++++++++-- .../ActionGroupWithPersistedData.txt | 12 +++++++++-- ...tionGroupWithSectionAndDataAsArguments.txt | 20 +++++++++++++++++-- ...WithSimpleDataUsageFromDefaultArgument.txt | 20 +++++++++++++++++-- ...pWithSimpleDataUsageFromPassedArgument.txt | 20 +++++++++++++++++-- ...leParameterSelectorFromDefaultArgument.txt | 20 +++++++++++++++++-- ...gleParameterSelectorFromPassedArgument.txt | 20 +++++++++++++++++-- .../ActionGroupWithStepKeyReferences.txt | 20 +++++++++++++++++-- .../ActionGroupWithTopLevelPersistedData.txt | 12 +++++++++-- .../ArgumentWithSameNameAsElement.txt | 12 +++++++++-- .../verification/Resources/AssertTest.txt | 20 +++++++++++++++++-- .../Resources/BasicActionGroupTest.txt | 20 +++++++++++++++++-- .../Resources/BasicFunctionalTest.txt | 12 +++++++++-- .../verification/Resources/BasicMergeTest.txt | 12 +++++++++-- .../Resources/CharacterReplacementTest.txt | 20 +++++++++++++++++-- .../Resources/ChildExtendedTestAddHooks.txt | 12 +++++++++-- .../Resources/ChildExtendedTestMerging.txt | 12 +++++++++-- .../Resources/ChildExtendedTestNoParent.txt | 16 +++++++++++++++ .../ChildExtendedTestRemoveAction.txt | 12 +++++++++-- .../ChildExtendedTestRemoveHookAction.txt | 12 +++++++++-- .../Resources/ChildExtendedTestReplace.txt | 12 +++++++++-- .../ChildExtendedTestReplaceHook.txt | 12 +++++++++-- .../Resources/DataActionsTest.txt | 20 +++++++++++++++++-- .../Resources/DataReplacementTest.txt | 20 +++++++++++++++++-- .../Resources/DeprecatedEntitiesTest.txt | 20 +++++++++++++++++-- .../verification/Resources/DeprecatedTest.txt | 20 +++++++++++++++++-- .../Resources/ExecuteJsEscapingTest.txt | 20 +++++++++++++++++-- .../Resources/ExtendParentDataTest.txt | 20 +++++++++++++++++-- .../Resources/ExtendedActionGroup.txt | 20 +++++++++++++++++-- .../ExtendedActionGroupReturningValueTest.txt | 9 +++++++-- ...ndedChildActionGroupReturningValueTest.txt | 20 +++++++++++++++++-- .../ExtendedChildTestInSuiteCest.txt | 12 +++++++++-- .../Resources/ExtendedChildTestNotInSuite.txt | 12 +++++++++-- .../Resources/ExtendedParameterArrayTest.txt | 20 +++++++++++++++++-- .../Resources/ExtendedRemoveActionGroup.txt | 20 +++++++++++++++++-- .../Resources/ExtendingSkippedTest.txt | 16 +++++++++++++++ .../Resources/GroupSkipGenerationTest.txt | 20 +++++++++++++++++-- .../Resources/HookActionsTest.txt | 12 +++++++++-- .../Resources/LocatorFunctionTest.txt | 20 +++++++++++++++++-- .../Resources/MergeMassViaInsertAfter.txt | 20 +++++++++++++++++-- .../Resources/MergeMassViaInsertBefore.txt | 20 +++++++++++++++++-- .../verification/Resources/MergeSkip.txt | 16 +++++++++++++++ .../MergedActionGroupReturningValueTest.txt | 12 +++++++++-- .../Resources/MergedActionGroupTest.txt | 12 +++++++++-- .../Resources/MergedReferencesTest.txt | 12 +++++++++-- .../Resources/MultipleActionGroupsTest.txt | 12 +++++++++-- .../Resources/PageReplacementTest.txt | 20 +++++++++++++++++-- .../Resources/ParameterArrayTest.txt | 20 +++++++++++++++++-- .../Resources/ParentExtendedTest.txt | 12 +++++++++-- .../PersistedAndXmlEntityArguments.txt | 20 +++++++++++++++++-- .../Resources/PersistedReplacementTest.txt | 20 +++++++++++++++++-- .../PersistenceActionGroupAppendingTest.txt | 20 +++++++++++++++++-- .../Resources/PersistenceCustomFieldsTest.txt | 20 +++++++++++++++++-- .../Resources/SectionReplacementTest.txt | 20 +++++++++++++++++-- .../verification/Resources/SkippedTest.txt | 16 +++++++++++++++ .../Resources/SkippedTestTwoIssues.txt | 16 +++++++++++++++ .../Resources/SkippedTestWithHooks.txt | 16 +++++++++++++++ .../Resources/XmlCommentedActionGroupTest.txt | 20 +++++++++++++++++-- .../Resources/XmlCommentedTest.txt | 12 +++++++++-- .../Util/TestGenerator.php | 17 ++++++++++++++-- 75 files changed, 1140 insertions(+), 138 deletions(-) diff --git a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt index ad906d4ea..710612750 100644 --- a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt +++ b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupContainsStepKeyInArgTextCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -28,6 +33,17 @@ class ActionGroupContainsStepKeyInArgTextCest $I->comment("Exiting Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -44,7 +60,7 @@ class ActionGroupContainsStepKeyInArgTextCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt index a69b8d212..ab10b3b80 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupMergedViaInsertAfterCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -38,7 +54,7 @@ class ActionGroupMergedViaInsertAfterCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt index 45d5188d4..05d82165a 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupMergedViaInsertBeforeCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -38,7 +54,7 @@ class ActionGroupMergedViaInsertBeforeCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupReturningValueTest.txt b/dev/tests/verification/Resources/ActionGroupReturningValueTest.txt index 2d0220e65..1fb0726e1 100644 --- a/dev/tests/verification/Resources/ActionGroupReturningValueTest.txt +++ b/dev/tests/verification/Resources/ActionGroupReturningValueTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupReturningValueTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class ActionGroupReturningValueTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -75,7 +83,7 @@ class ActionGroupReturningValueTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupToExtend.txt b/dev/tests/verification/Resources/ActionGroupToExtend.txt index 14ef8a29a..5ec7f0a0e 100644 --- a/dev/tests/verification/Resources/ActionGroupToExtend.txt +++ b/dev/tests/verification/Resources/ActionGroupToExtend.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupToExtendCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -34,7 +50,7 @@ class ActionGroupToExtendCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt index 8afc91f6f..b451abc2b 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupUsingCreateDataCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -29,6 +34,17 @@ class ActionGroupUsingCreateDataCest $I->comment("Exiting Action Group [Key1] actionGroupWithCreateData"); } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -42,7 +58,7 @@ class ActionGroupUsingCreateDataCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt index 657046cd5..ff745ba05 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupUsingNestedArgumentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -34,7 +50,7 @@ class ActionGroupUsingNestedArgumentCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt index bf430a668..2ecc0f729 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithDataOverrideTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class ActionGroupWithDataOverrideTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -76,7 +84,7 @@ class ActionGroupWithDataOverrideTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt index 0de660c0e..bde1dcdd6 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithDataTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -31,6 +36,17 @@ class ActionGroupWithDataTestCest $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @param AcceptanceTester $I * @throws \Exception @@ -76,7 +92,7 @@ class ActionGroupWithDataTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt index 21f54d3ed..7a68cf16a 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::BLOCKER) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt index b24fac754..6b8c738e0 100644 --- a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithMultipleParameterSelectorsFromDefaultArgumentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::BLOCKER) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithMultipleParameterSelectorsFromDefaultArgumentCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt index 383164241..2371d86dd 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithNoArgumentsCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::BLOCKER) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithNoArgumentsCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt index 97a060d1c..19f3de5ad 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithNoDefaultTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class ActionGroupWithNoDefaultTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -74,7 +82,7 @@ class ActionGroupWithNoDefaultTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt index 53657a2ae..17a9d766b 100644 --- a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt +++ b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithParameterizedElementWithHyphenCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -33,7 +49,7 @@ class ActionGroupWithParameterizedElementWithHyphenCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementsWithStepKeyReferences.txt b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementsWithStepKeyReferences.txt index 47d0566eb..2f31d0686 100644 --- a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementsWithStepKeyReferences.txt +++ b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementsWithStepKeyReferences.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithParameterizedElementsWithStepKeyReferencesCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -38,7 +54,7 @@ class ActionGroupWithParameterizedElementsWithStepKeyReferencesCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt index 31771d938..e58d8c5a5 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithPassedArgumentAndStringSelectorParamCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::BLOCKER) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt index 3943f1271..782e27a8e 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithPersistedDataCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class ActionGroupWithPersistedDataCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -75,7 +83,7 @@ class ActionGroupWithPersistedDataCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt index 71519b234..d07a32cd0 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithSectionAndDataAsArgumentsCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -33,7 +49,7 @@ class ActionGroupWithSectionAndDataAsArgumentsCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt index 72ade673a..ab5465ca0 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithSimpleDataUsageFromDefaultArgumentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithSimpleDataUsageFromDefaultArgumentCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt index b19c6b20f..c86e9dc4f 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithSimpleDataUsageFromPassedArgumentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) @@ -62,7 +78,7 @@ class ActionGroupWithSimpleDataUsageFromPassedArgumentCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt index 81712b6fe..34ba535f8 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithSingleParameterSelectorFromDefaultArgumentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::BLOCKER) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithSingleParameterSelectorFromDefaultArgumentCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt index eeb346b60..45f72a95b 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithSingleParameterSelectorFromPassedArgumentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::BLOCKER) * @Features({"TestModule"}) @@ -35,7 +51,7 @@ class ActionGroupWithSingleParameterSelectorFromPassedArgumentCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt index ef20ee94b..532c70868 100644 --- a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt +++ b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithStepKeyReferencesCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -58,7 +74,7 @@ class ActionGroupWithStepKeyReferencesCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt index daba0ab12..285e66370 100644 --- a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ActionGroupWithTopLevelPersistedDataCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class ActionGroupWithTopLevelPersistedDataCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -74,7 +82,7 @@ class ActionGroupWithTopLevelPersistedDataCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt index 2ea282f07..b643eb759 100644 --- a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt +++ b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ArgumentWithSameNameAsElementCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class ArgumentWithSameNameAsElementCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -71,7 +79,7 @@ class ArgumentWithSameNameAsElementCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/AssertTest.txt b/dev/tests/verification/Resources/AssertTest.txt index c4fe946e4..6c30b7273 100644 --- a/dev/tests/verification/Resources/AssertTest.txt +++ b/dev/tests/verification/Resources/AssertTest.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class AssertTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -26,6 +31,17 @@ class AssertTestCest $I->createEntity("createData1", "hook", "ReplacementPerson", [], []); // stepKey: createData1 } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -163,7 +179,7 @@ class AssertTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/BasicActionGroupTest.txt b/dev/tests/verification/Resources/BasicActionGroupTest.txt index e2bfdae7e..45cac4937 100644 --- a/dev/tests/verification/Resources/BasicActionGroupTest.txt +++ b/dev/tests/verification/Resources/BasicActionGroupTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class BasicActionGroupTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -31,6 +36,17 @@ class BasicActionGroupTestCest $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) @@ -52,7 +68,7 @@ class BasicActionGroupTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index e6ac37f12..c5ce0305c 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class BasicFunctionalTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class BasicFunctionalTestCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -188,7 +196,7 @@ class BasicFunctionalTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/BasicMergeTest.txt b/dev/tests/verification/Resources/BasicMergeTest.txt index a32d6b50e..0ccd3e898 100644 --- a/dev/tests/verification/Resources/BasicMergeTest.txt +++ b/dev/tests/verification/Resources/BasicMergeTest.txt @@ -20,6 +20,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class BasicMergeTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -37,6 +42,9 @@ class BasicMergeTestCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl1"); // stepKey: after1 + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -78,7 +86,7 @@ class BasicMergeTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/CharacterReplacementTest.txt b/dev/tests/verification/Resources/CharacterReplacementTest.txt index 3cdccd7e6..b87c36a40 100644 --- a/dev/tests/verification/Resources/CharacterReplacementTest.txt +++ b/dev/tests/verification/Resources/CharacterReplacementTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class CharacterReplacementTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -38,7 +54,7 @@ class CharacterReplacementTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt b/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt index 782eec26f..2e949082a 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestAddHooksCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class ChildExtendedTestAddHooksCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -61,7 +69,7 @@ class ChildExtendedTestAddHooksCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestMerging.txt b/dev/tests/verification/Resources/ChildExtendedTestMerging.txt index dd8fba438..9e892e290 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestMerging.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestMerging.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestMergingCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -37,6 +42,9 @@ class ChildExtendedTestMergingCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -67,7 +75,7 @@ class ChildExtendedTestMergingCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt b/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt index 779f89c7e..12094a518 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt @@ -20,6 +20,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestNoParentCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) diff --git a/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt b/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt index 2a0eddf57..28b4ec7fd 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestRemoveActionCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class ChildExtendedTestRemoveActionCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -61,7 +69,7 @@ class ChildExtendedTestRemoveActionCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt b/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt index 2ab9eaf11..3649c85fe 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestRemoveHookActionCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -34,6 +39,9 @@ class ChildExtendedTestRemoveHookActionCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -61,7 +69,7 @@ class ChildExtendedTestRemoveHookActionCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestReplace.txt b/dev/tests/verification/Resources/ChildExtendedTestReplace.txt index daf1bfe2f..a3cfdd2aa 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestReplace.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestReplace.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestReplaceCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class ChildExtendedTestReplaceCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -62,7 +70,7 @@ class ChildExtendedTestReplaceCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt b/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt index 67ef1b40e..abe55a071 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ChildExtendedTestReplaceHookCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class ChildExtendedTestReplaceHookCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -62,7 +70,7 @@ class ChildExtendedTestReplaceHookCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/DataActionsTest.txt b/dev/tests/verification/Resources/DataActionsTest.txt index 2c735ed35..f84f97040 100644 --- a/dev/tests/verification/Resources/DataActionsTest.txt +++ b/dev/tests/verification/Resources/DataActionsTest.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class DataActionsTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -28,6 +33,17 @@ class DataActionsTestCest $I->deleteEntity("createdInBefore", "hook"); // stepKey: deleteInBefore } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -46,7 +62,7 @@ class DataActionsTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/DataReplacementTest.txt b/dev/tests/verification/Resources/DataReplacementTest.txt index f1d405750..00c28b31e 100644 --- a/dev/tests/verification/Resources/DataReplacementTest.txt +++ b/dev/tests/verification/Resources/DataReplacementTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class DataReplacementTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -92,7 +108,7 @@ class DataReplacementTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/DeprecatedEntitiesTest.txt b/dev/tests/verification/Resources/DeprecatedEntitiesTest.txt index 4d0652bb3..9a0ec8a27 100644 --- a/dev/tests/verification/Resources/DeprecatedEntitiesTest.txt +++ b/dev/tests/verification/Resources/DeprecatedEntitiesTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class DeprecatedEntitiesTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -34,7 +50,7 @@ class DeprecatedEntitiesTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/DeprecatedTest.txt b/dev/tests/verification/Resources/DeprecatedTest.txt index 71fc1de4d..acdb53cc0 100644 --- a/dev/tests/verification/Resources/DeprecatedTest.txt +++ b/dev/tests/verification/Resources/DeprecatedTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class DeprecatedTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -34,7 +50,7 @@ class DeprecatedTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt b/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt index 6d4de9ad1..fc1331ef2 100644 --- a/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt +++ b/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExecuteJsEscapingTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -35,7 +51,7 @@ class ExecuteJsEscapingTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendParentDataTest.txt b/dev/tests/verification/Resources/ExtendParentDataTest.txt index 7e97473bd..6b96cbbda 100644 --- a/dev/tests/verification/Resources/ExtendParentDataTest.txt +++ b/dev/tests/verification/Resources/ExtendParentDataTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendParentDataTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -36,7 +52,7 @@ class ExtendParentDataTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedActionGroup.txt b/dev/tests/verification/Resources/ExtendedActionGroup.txt index 71e9121fa..a2cc9fc74 100644 --- a/dev/tests/verification/Resources/ExtendedActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedActionGroup.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendedActionGroupCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -37,7 +53,7 @@ class ExtendedActionGroupCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt b/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt index 9b89b3825..e5efd6cc9 100644 --- a/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt +++ b/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendedActionGroupReturningValueTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) @@ -40,7 +45,7 @@ class ExtendedActionGroupReturningValueTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedChildActionGroupReturningValueTest.txt b/dev/tests/verification/Resources/ExtendedChildActionGroupReturningValueTest.txt index e0d9e29f6..c262ffd85 100644 --- a/dev/tests/verification/Resources/ExtendedChildActionGroupReturningValueTest.txt +++ b/dev/tests/verification/Resources/ExtendedChildActionGroupReturningValueTest.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendedChildActionGroupReturningValueTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) @@ -43,7 +59,7 @@ class ExtendedChildActionGroupReturningValueTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt index 2d1c91630..2e6da3464 100644 --- a/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendedChildTestInSuiteCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class ExtendedChildTestInSuiteCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -62,7 +70,7 @@ class ExtendedChildTestInSuiteCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt index 30d188c9d..a18346a77 100644 --- a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendedChildTestNotInSuiteCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -34,6 +39,9 @@ class ExtendedChildTestNotInSuiteCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -61,7 +69,7 @@ class ExtendedChildTestNotInSuiteCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedParameterArrayTest.txt b/dev/tests/verification/Resources/ExtendedParameterArrayTest.txt index 306f10fee..7af46fe5a 100644 --- a/dev/tests/verification/Resources/ExtendedParameterArrayTest.txt +++ b/dev/tests/verification/Resources/ExtendedParameterArrayTest.txt @@ -16,6 +16,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendParentDataTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -35,7 +51,7 @@ class ExtendParentDataTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt index 792a4ac4f..1e24e644a 100644 --- a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendedRemoveActionGroupCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -32,7 +48,7 @@ class ExtendedRemoveActionGroupCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ExtendingSkippedTest.txt b/dev/tests/verification/Resources/ExtendingSkippedTest.txt index 45b8614e4..0b78b5136 100644 --- a/dev/tests/verification/Resources/ExtendingSkippedTest.txt +++ b/dev/tests/verification/Resources/ExtendingSkippedTest.txt @@ -19,6 +19,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ExtendingSkippedTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) diff --git a/dev/tests/verification/Resources/GroupSkipGenerationTest.txt b/dev/tests/verification/Resources/GroupSkipGenerationTest.txt index 1a6156cac..b13aa399a 100644 --- a/dev/tests/verification/Resources/GroupSkipGenerationTest.txt +++ b/dev/tests/verification/Resources/GroupSkipGenerationTest.txt @@ -19,6 +19,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class GroupSkipGenerationTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Stories({"GroupSkipGenerationTestStory"}) * @Severity(level = SeverityLevel::MINOR) @@ -34,7 +50,7 @@ class GroupSkipGenerationTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/HookActionsTest.txt b/dev/tests/verification/Resources/HookActionsTest.txt index 0ffabfd9e..a04a980a1 100644 --- a/dev/tests/verification/Resources/HookActionsTest.txt +++ b/dev/tests/verification/Resources/HookActionsTest.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class HookActionsTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -36,6 +41,9 @@ class HookActionsTestCest { $I->createEntity("sampleCreateAfter", "hook", "sampleCreatedEntity", [], []); // stepKey: sampleCreateAfter $I->deleteEntity("sampleCreateForAfter", "hook"); // stepKey: sampleDeleteAfter + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -60,7 +68,7 @@ class HookActionsTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/LocatorFunctionTest.txt b/dev/tests/verification/Resources/LocatorFunctionTest.txt index deffe887b..86d744a2d 100644 --- a/dev/tests/verification/Resources/LocatorFunctionTest.txt +++ b/dev/tests/verification/Resources/LocatorFunctionTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class LocatorFunctionTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -43,7 +59,7 @@ class LocatorFunctionTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt b/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt index 250cb8b18..49c246251 100644 --- a/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt +++ b/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MergeMassViaInsertAfterCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -36,7 +52,7 @@ class MergeMassViaInsertAfterCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt b/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt index 2e14981b0..6080a5f23 100644 --- a/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt +++ b/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MergeMassViaInsertBeforeCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -36,7 +52,7 @@ class MergeMassViaInsertBeforeCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/MergeSkip.txt b/dev/tests/verification/Resources/MergeSkip.txt index 885d622ac..8ce10f3e1 100644 --- a/dev/tests/verification/Resources/MergeSkip.txt +++ b/dev/tests/verification/Resources/MergeSkip.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MergeSkipCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") diff --git a/dev/tests/verification/Resources/MergedActionGroupReturningValueTest.txt b/dev/tests/verification/Resources/MergedActionGroupReturningValueTest.txt index ef7960d21..71d8ed94a 100644 --- a/dev/tests/verification/Resources/MergedActionGroupReturningValueTest.txt +++ b/dev/tests/verification/Resources/MergedActionGroupReturningValueTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MergedActionGroupReturningValueTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class MergedActionGroupReturningValueTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -77,7 +85,7 @@ class MergedActionGroupReturningValueTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/MergedActionGroupTest.txt b/dev/tests/verification/Resources/MergedActionGroupTest.txt index f592a9806..e92a06f6f 100644 --- a/dev/tests/verification/Resources/MergedActionGroupTest.txt +++ b/dev/tests/verification/Resources/MergedActionGroupTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MergedActionGroupTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class MergedActionGroupTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -73,7 +81,7 @@ class MergedActionGroupTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/MergedReferencesTest.txt b/dev/tests/verification/Resources/MergedReferencesTest.txt index 678ae79fe..b1f95d56c 100644 --- a/dev/tests/verification/Resources/MergedReferencesTest.txt +++ b/dev/tests/verification/Resources/MergedReferencesTest.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MergedReferencesTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class MergedReferencesTestCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: after1 + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -63,7 +71,7 @@ class MergedReferencesTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt index 6a387eb76..15659f21f 100644 --- a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt +++ b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class MultipleActionGroupsTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -41,6 +46,9 @@ class MultipleActionGroupsTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -83,7 +91,7 @@ class MultipleActionGroupsTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/PageReplacementTest.txt b/dev/tests/verification/Resources/PageReplacementTest.txt index a83a8ac02..af4defdb9 100644 --- a/dev/tests/verification/Resources/PageReplacementTest.txt +++ b/dev/tests/verification/Resources/PageReplacementTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class PageReplacementTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -42,7 +58,7 @@ class PageReplacementTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ParameterArrayTest.txt b/dev/tests/verification/Resources/ParameterArrayTest.txt index b6ed5ac8c..6488db6b0 100644 --- a/dev/tests/verification/Resources/ParameterArrayTest.txt +++ b/dev/tests/verification/Resources/ParameterArrayTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ParameterArrayTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -53,7 +69,7 @@ class ParameterArrayTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/ParentExtendedTest.txt b/dev/tests/verification/Resources/ParentExtendedTest.txt index 3a035ede7..73e6b7aa0 100644 --- a/dev/tests/verification/Resources/ParentExtendedTest.txt +++ b/dev/tests/verification/Resources/ParentExtendedTest.txt @@ -19,6 +19,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class ParentExtendedTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -35,6 +40,9 @@ class ParentExtendedTestCest public function _after(AcceptanceTester $I) { $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -62,7 +70,7 @@ class ParentExtendedTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt index 9e991362a..f4cc8cfaa 100644 --- a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt +++ b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class PersistedAndXmlEntityArgumentsCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -33,7 +49,7 @@ class PersistedAndXmlEntityArgumentsCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/PersistedReplacementTest.txt b/dev/tests/verification/Resources/PersistedReplacementTest.txt index f0609e4a8..95706e75b 100644 --- a/dev/tests/verification/Resources/PersistedReplacementTest.txt +++ b/dev/tests/verification/Resources/PersistedReplacementTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class PersistedReplacementTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @param AcceptanceTester $I * @throws \Exception @@ -62,7 +78,7 @@ class PersistedReplacementTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt index b966d7ca6..d1f75ccb6 100644 --- a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt +++ b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class PersistenceActionGroupAppendingTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -32,6 +37,17 @@ class PersistenceActionGroupAppendingTestCest $I->comment("Exiting Action Group [ACTIONGROUPBEFORE] DataPersistenceAppendingActionGroup"); } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -52,7 +68,7 @@ class PersistenceActionGroupAppendingTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt index 34409d108..5bbc0b325 100644 --- a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt +++ b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt @@ -17,6 +17,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class PersistenceCustomFieldsTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -30,6 +35,17 @@ class PersistenceCustomFieldsTestCest $I->createEntity("createData2", "hook", "uniqueData", ["createData1"], $createData2Fields); // stepKey: createData2 } + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -64,7 +80,7 @@ class PersistenceCustomFieldsTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/SectionReplacementTest.txt b/dev/tests/verification/Resources/SectionReplacementTest.txt index 8b3eadc1b..a71d1c4ef 100644 --- a/dev/tests/verification/Resources/SectionReplacementTest.txt +++ b/dev/tests/verification/Resources/SectionReplacementTest.txt @@ -17,6 +17,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class SectionReplacementTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") @@ -66,7 +82,7 @@ class SectionReplacementTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/SkippedTest.txt b/dev/tests/verification/Resources/SkippedTest.txt index b50145c0e..99832ef9a 100644 --- a/dev/tests/verification/Resources/SkippedTest.txt +++ b/dev/tests/verification/Resources/SkippedTest.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class SkippedTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Stories({"skipped"}) * @Severity(level = SeverityLevel::MINOR) diff --git a/dev/tests/verification/Resources/SkippedTestTwoIssues.txt b/dev/tests/verification/Resources/SkippedTestTwoIssues.txt index a494328ba..951d15678 100644 --- a/dev/tests/verification/Resources/SkippedTestTwoIssues.txt +++ b/dev/tests/verification/Resources/SkippedTestTwoIssues.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class SkippedTestTwoIssuesCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Stories({"skippedMultiple"}) * @Severity(level = SeverityLevel::MINOR) diff --git a/dev/tests/verification/Resources/SkippedTestWithHooks.txt b/dev/tests/verification/Resources/SkippedTestWithHooks.txt index 15936c463..84b0203c4 100644 --- a/dev/tests/verification/Resources/SkippedTestWithHooks.txt +++ b/dev/tests/verification/Resources/SkippedTestWithHooks.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class SkippedTestWithHooksCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Stories({"skippedWithHooks"}) * @Severity(level = SeverityLevel::MINOR) diff --git a/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt b/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt index 5765aab13..f45e8f0b2 100644 --- a/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt +++ b/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt @@ -18,6 +18,22 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class XmlCommentedActionGroupTestCest { + /** + * @var bool + */ + private $isSuccess = false; + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) @@ -36,7 +52,7 @@ class XmlCommentedActionGroupTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/dev/tests/verification/Resources/XmlCommentedTest.txt b/dev/tests/verification/Resources/XmlCommentedTest.txt index 663732493..9e7a300ee 100644 --- a/dev/tests/verification/Resources/XmlCommentedTest.txt +++ b/dev/tests/verification/Resources/XmlCommentedTest.txt @@ -18,6 +18,11 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; */ class XmlCommentedTestCest { + /** + * @var bool + */ + private $isSuccess = false; + /** * @param AcceptanceTester $I * @throws \Exception @@ -38,6 +43,9 @@ class XmlCommentedTestCest $I->comment("< > & \$abc \" abc ' /"); $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey $I->comment("< > & \$abc \" abc ' /"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** @@ -73,7 +81,7 @@ class XmlCommentedTestCest public function _passed(AcceptanceTester $I) { - // Deleting itself so that we can rerun only failed tests. - unlink(__FILE__); + // Test passed successfully. + $this->isSuccess = true; } } diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 8ea831963..c0249a32b 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -279,6 +279,10 @@ public function assembleTestPhp($testObject) $cestPhp .= $classAnnotationsPhp; $cestPhp .= sprintf("class %s\n", $className); $cestPhp .= "{\n"; + $cestPhp .= "\t/**\n"; + $cestPhp .= "\t * @var bool\n"; + $cestPhp .= "\t */\n"; + $cestPhp .= "\tprivate \$isSuccess = false;\n\n"; $cestPhp .= $this->generateInjectMethod(); $cestPhp .= $hookPhp; $cestPhp .= $testsPhp; @@ -1743,6 +1747,10 @@ private function generateHooksPhp($hookObjects) { $hooks = ""; + if (!isset($hookObjects['after'])) { + $hookObjects['after'] = new TestHookObject('after', '', []); + } + foreach ($hookObjects as $hookObject) { $type = $hookObject->getType(); $dependencies = 'AcceptanceTester $I'; @@ -1764,6 +1772,11 @@ private function generateHooksPhp($hookObjects) $hooks .= sprintf("\tpublic function _{$type}(%s)\n", $dependencies); $hooks .= "\t{\n"; $hooks .= $steps; + if ($type === 'after') { + $hooks .= "\t\t" . 'if ($this->isSuccess) {' . "\n"; + $hooks .= "\t\t\t" . 'unlink(__FILE__);' . "\n"; + $hooks .= "\t\t" . '}' . "\n"; + } $hooks .= "\t}\n\n"; } @@ -1816,8 +1829,8 @@ private function generateTestPhp($test) $testPhp .= PHP_EOL; $testPhp .= sprintf("\tpublic function _passed(%s)\n", $dependencies); $testPhp .= "\t{\n"; - $testPhp .= "\t\t// Deleting itself so that we can rerun only failed tests." . PHP_EOL; - $testPhp .= "\t\tunlink(__FILE__);" . PHP_EOL; + $testPhp .= "\t\t// Test passed successfully." . PHP_EOL; + $testPhp .= "\t\t\$this->isSuccess = true;" . PHP_EOL; $testPhp .= "\t}\n"; } From 6ac15c1ef16f0250d703e1d401b05f35f84be797 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 6 Dec 2021 16:24:43 -0600 Subject: [PATCH 2/3] MQE-3122: Logging of failed test is not working when test fails in `after` section --- .../Resources/ActionGroupWithDataTest.txt | 14 +++----------- .../ExtendedActionGroupReturningValueTest.txt | 11 +++++++++++ .../Resources/ExtendingSkippedTest.txt | 11 ----------- dev/tests/verification/Resources/MergeSkip.txt | 11 ----------- .../Resources/PersistedReplacementTest.txt | 12 ++++++------ dev/tests/verification/Resources/SkippedTest.txt | 11 ----------- .../Resources/SkippedTestTwoIssues.txt | 11 ----------- .../Resources/SkippedTestWithHooks.txt | 11 ----------- 8 files changed, 20 insertions(+), 72 deletions(-) diff --git a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt index bde1dcdd6..1cfc77d0a 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt @@ -36,17 +36,6 @@ class ActionGroupWithDataTestCest $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - if ($this->isSuccess) { - unlink(__FILE__); - } - } - /** * @param AcceptanceTester $I * @throws \Exception @@ -57,6 +46,9 @@ class ActionGroupWithDataTestCest $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); + if ($this->isSuccess) { + unlink(__FILE__); + } } /** diff --git a/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt b/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt index e5efd6cc9..5ecc0d0cd 100644 --- a/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt +++ b/dev/tests/verification/Resources/ExtendedActionGroupReturningValueTest.txt @@ -23,6 +23,17 @@ class ExtendedActionGroupReturningValueTestCest */ private $isSuccess = false; + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + if ($this->isSuccess) { + unlink(__FILE__); + } + } + /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) diff --git a/dev/tests/verification/Resources/ExtendingSkippedTest.txt b/dev/tests/verification/Resources/ExtendingSkippedTest.txt index 0b78b5136..304376ebf 100644 --- a/dev/tests/verification/Resources/ExtendingSkippedTest.txt +++ b/dev/tests/verification/Resources/ExtendingSkippedTest.txt @@ -24,17 +24,6 @@ class ExtendingSkippedTestCest */ private $isSuccess = false; - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - if ($this->isSuccess) { - unlink(__FILE__); - } - } - /** * @Severity(level = SeverityLevel::CRITICAL) * @Features({"TestModule"}) diff --git a/dev/tests/verification/Resources/MergeSkip.txt b/dev/tests/verification/Resources/MergeSkip.txt index 8ce10f3e1..d807f994f 100644 --- a/dev/tests/verification/Resources/MergeSkip.txt +++ b/dev/tests/verification/Resources/MergeSkip.txt @@ -22,17 +22,6 @@ class MergeSkipCest */ private $isSuccess = false; - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - if ($this->isSuccess) { - unlink(__FILE__); - } - } - /** * @Features({"TestModule"}) * @Parameter(name = "AcceptanceTester", value="$I") diff --git a/dev/tests/verification/Resources/PersistedReplacementTest.txt b/dev/tests/verification/Resources/PersistedReplacementTest.txt index 95706e75b..e8e249bf7 100644 --- a/dev/tests/verification/Resources/PersistedReplacementTest.txt +++ b/dev/tests/verification/Resources/PersistedReplacementTest.txt @@ -26,20 +26,20 @@ class PersistedReplacementTestCest * @param AcceptanceTester $I * @throws \Exception */ - public function _after(AcceptanceTester $I) + public function _before(AcceptanceTester $I) { - if ($this->isSuccess) { - unlink(__FILE__); - } + $I->createEntity("createData1", "hook", "ReplacementPerson", [], []); // stepKey: createData1 } /** * @param AcceptanceTester $I * @throws \Exception */ - public function _before(AcceptanceTester $I) + public function _after(AcceptanceTester $I) { - $I->createEntity("createData1", "hook", "ReplacementPerson", [], []); // stepKey: createData1 + if ($this->isSuccess) { + unlink(__FILE__); + } } /** diff --git a/dev/tests/verification/Resources/SkippedTest.txt b/dev/tests/verification/Resources/SkippedTest.txt index 99832ef9a..c261a77ad 100644 --- a/dev/tests/verification/Resources/SkippedTest.txt +++ b/dev/tests/verification/Resources/SkippedTest.txt @@ -23,17 +23,6 @@ class SkippedTestCest */ private $isSuccess = false; - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - if ($this->isSuccess) { - unlink(__FILE__); - } - } - /** * @Stories({"skipped"}) * @Severity(level = SeverityLevel::MINOR) diff --git a/dev/tests/verification/Resources/SkippedTestTwoIssues.txt b/dev/tests/verification/Resources/SkippedTestTwoIssues.txt index 951d15678..a2941e5f1 100644 --- a/dev/tests/verification/Resources/SkippedTestTwoIssues.txt +++ b/dev/tests/verification/Resources/SkippedTestTwoIssues.txt @@ -23,17 +23,6 @@ class SkippedTestTwoIssuesCest */ private $isSuccess = false; - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - if ($this->isSuccess) { - unlink(__FILE__); - } - } - /** * @Stories({"skippedMultiple"}) * @Severity(level = SeverityLevel::MINOR) diff --git a/dev/tests/verification/Resources/SkippedTestWithHooks.txt b/dev/tests/verification/Resources/SkippedTestWithHooks.txt index 84b0203c4..fdc56c5e1 100644 --- a/dev/tests/verification/Resources/SkippedTestWithHooks.txt +++ b/dev/tests/verification/Resources/SkippedTestWithHooks.txt @@ -23,17 +23,6 @@ class SkippedTestWithHooksCest */ private $isSuccess = false; - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - if ($this->isSuccess) { - unlink(__FILE__); - } - } - /** * @Stories({"skippedWithHooks"}) * @Severity(level = SeverityLevel::MINOR) From fe20f1bb70525e8c6cc94bdeae2d1db68f998b4b Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Tue, 7 Dec 2021 10:35:03 -0600 Subject: [PATCH 3/3] MQE-3122: Logging of failed test is not working when test fails in `after` section - preparing everything for release --- CHANGELOG.md | 7 +++++++ composer.json | 2 +- composer.lock | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa96a63e..52fa211e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ Magento Functional Testing Framework Changelog ================================================ +3.7.2 +--------- + +### Bug fix: +* Failed tests weren't logged correctly to `failed` file which caused a failure during run:failed command execution + + 3.7.1 --------- diff --git a/composer.json b/composer.json index 61ff7b158..48c35e618 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2-functional-testing-framework", "description": "Magento2 Functional Testing Framework", "type": "library", - "version": "3.7.1", + "version": "3.7.2", "license": "AGPL-3.0", "keywords": ["magento", "automation", "functional", "testing"], "config": { diff --git a/composer.lock b/composer.lock index 7c4e8d9c9..3a589c395 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f74783e12acad4c892369ccf2820dff5", + "content-hash": "b91a4e8102c543f132c120747714e9ab", "packages": [ { "name": "allure-framework/allure-codeception",