diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index 6b38edc03..63cac272f 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -239,6 +239,22 @@ public function trimAssertionAttributes() return; } + /** MQE-683 DEPRECATE OLD METHOD HERE + * Unnecessary validation, only needed for backwards compatibility + */ + $singleChildTypes = ['assertEmpty', 'assertFalse', 'assertFileExists', 'assertFileNotExists', + 'assertIsEmpty', 'assertNotEmpty', 'assertNotNull', 'assertNull', 'assertTrue', + 'assertElementContainsAttribute']; + + if (!in_array($this->type, $singleChildTypes)) { + if (!in_array('expectedResult', $relevantAssertionAttributes) + || !in_array('actualResult', $relevantAssertionAttributes)) { + // @codingStandardsIgnoreStart + throw new TestReferenceException("{$this->type} must have both an expectedResult and actualResult defined (stepKey: {$this->stepKey})"); + // @codingStandardsIgnoreEnd + } + } + // Flatten nested Elements's type and value into key=>value entries foreach ($this->actionAttributes as $key => $subAttributes) { if (in_array($key, $relevantKeys)) { diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/assertActions.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/assertActions.xsd index 929da9219..4fdde9990 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/assertActions.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/assertActions.xsd @@ -94,10 +94,10 @@ - + - + @@ -114,9 +114,9 @@ Asserts that a given element contains a specific attribute. - + - + @@ -141,10 +141,10 @@ Asserts that given array has a key. - + - + @@ -159,10 +159,10 @@ Asserts that given array does not contain a key. - + - + @@ -177,10 +177,10 @@ Asserts that given array contains a subset array. - + - + @@ -196,10 +196,10 @@ Asserts that given array contains a value. - + - + @@ -214,10 +214,10 @@ Asserts that expected count is equal to actual count. - + - + @@ -232,9 +232,9 @@ Asserts that given variable is empty. - + - + @@ -249,10 +249,10 @@ Asserts that two given variables are equal. Can be given a "delta" to allow precision tolerance in floating point comparison. - + - + @@ -268,9 +268,9 @@ Asserts that given condition is false. - + - + @@ -285,9 +285,9 @@ Asserts that given file exists. - + - + @@ -302,9 +302,9 @@ Asserts that given file does not exist. - + - + @@ -319,10 +319,10 @@ Asserts that given actual value is greater or equal to expected value. - + - + @@ -337,10 +337,10 @@ Asserts that given actual value is greater than expected value. - + - + @@ -355,10 +355,10 @@ Asserts that given actual value is greater than or equal to expected value. - + - + @@ -373,10 +373,10 @@ Asserts that given actual is an instance of expected class. - + - + @@ -391,10 +391,10 @@ Asserts that given actual is internal type. - + - + @@ -409,9 +409,9 @@ Asserts that given actual is empty. - + - + @@ -426,10 +426,10 @@ Asserts that given actual less than or equal to expected. - + - + @@ -444,10 +444,10 @@ Asserts that given actual less than expected. - + - + @@ -462,10 +462,10 @@ Asserts that given actual less than or equal to expected. - + - + @@ -480,10 +480,10 @@ Asserts that given array does not contain a value. - + - + @@ -498,9 +498,9 @@ Asserts that given actual variable is not empty. - + - + @@ -515,10 +515,10 @@ Asserts that actual and expected are not equal. Can be given a "delta" to allow precision tolerance in floating point comparison. - + - + @@ -534,10 +534,10 @@ Asserts that given actual is not an instance of a class. - + - + @@ -552,9 +552,9 @@ Asserts that given actual is not null. - + - + @@ -569,10 +569,10 @@ Asserts that given actual string does not match with expected pattern. - + - + @@ -587,10 +587,10 @@ Asserts that given actual and expected are not the same. - + - + @@ -605,9 +605,9 @@ Asserts that given actual is null. - + - + @@ -622,10 +622,10 @@ Asserts that given actual string matches with expected pattern. - + - + @@ -640,10 +640,10 @@ Asserts that actual and expected are the same. - + - + @@ -658,10 +658,10 @@ Asserts that actual string does not start with the expected prefix. - + - + @@ -676,10 +676,10 @@ Asserts that actual string starts with the expected prefix. - + - + @@ -694,9 +694,9 @@ Asserts that given actual is true. - + - + @@ -711,10 +711,10 @@ Handles and checks expected exception called inside actual callback function. - + - +