From d51d8ef8dd432cef1a880c0961133e7395712305 Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Sat, 24 Mar 2018 17:25:48 +0200 Subject: [PATCH 01/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Added WAIT_TIMEOUT environment variable to .env file - Implemented getDefaultWaitTimeout method that retrieves WAIT_TIMEOUT environment variable or a constant value - Edited wait action methods to use default timeout if not set --- .../Module/MagentoWebDriver.php | 147 +++++++++++++++++- 1 file changed, 145 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 9e50687a3..45ced03c9 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -13,11 +13,13 @@ use Facebook\WebDriver\WebDriverSelect; use Facebook\WebDriver\WebDriverBy; use Facebook\WebDriver\Exception\NoSuchElementException; +use Facebook\WebDriver\WebDriverExpectedCondition; use Codeception\Exception\ElementNotFound; use Codeception\Exception\ModuleConfigException; use Codeception\Exception\ModuleException; use Codeception\Util\Uri; use Codeception\Util\ActionSequence; +use Codeception\Util\Locator; use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport; use Magento\FunctionalTestingFramework\Util\Protocol\CurlInterface; use Magento\Setup\Exception; @@ -55,6 +57,8 @@ class MagentoWebDriver extends WebDriver '//div[@data-role="spinner"]' ]; + const DEFAULT_WAIT_TIMEOUT = 10; + /** * The module required fields, to be set in the suite .yml configuration file. * @@ -115,6 +119,11 @@ public function _resetConfig() $this->config = ConfigSanitizerUtil::sanitizeWebDriverConfig($this->config); } + public function getDefaultWaitTimeout() + { + return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT; + } + /** * Returns URL of a host. * @@ -301,6 +310,140 @@ public function selectMultipleOptions($selectSearchTextField, $selectSearchResul } } + /** + * Wait for $timeout seconds. + * + * @param int|float $timeout secs + * @throws \Codeception\Exception\TestRuntimeException + */ + public function wait($timeout = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + if ($timeout >= 1000) { + throw new TestRuntimeException( + " + Waiting for more then 1000 seconds: 16.6667 mins\n + Please note that wait method accepts number of seconds as parameter." + ); + } + usleep($timeout * 1000000); + } + + /** + * Waits up to $timeout seconds for the given element to change. + * + * @param $element + * @param \Closure $callback + * @param int $timeout seconds + * @throws \Codeception\Exception\ElementNotFound + * @throws \Exception + */ + public function waitForElementChange($element, \Closure $callback, $timeout = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + $el = $this->matchFirstOrFail($this->baseElement, $element); + $checker = function () use ($el, $callback) { + return $callback($el); + }; + $this->webDriver->wait($timeout)->until($checker); + } + + /** + * Waits up to $timeout seconds for an element to appear on the page. + * + * @param $element + * @param int $timeout seconds + * @throws \Exception + */ + public function waitForElement($element, $timeout = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + $condition = WebDriverExpectedCondition::presenceOfElementLocated($this->getLocator($element)); + $this->webDriver->wait($timeout)->until($condition); + } + + /** + * Waits up to $timeout seconds for the given element to be visible on the page. + * + * @param $element + * @param int $timeout seconds + * @throws \Exception + */ + public function waitForElementVisible($element, $timeout = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + $condition = WebDriverExpectedCondition::visibilityOfElementLocated($this->getLocator($element)); + $this->webDriver->wait($timeout)->until($condition); + } + + /** + * Waits up to $timeout seconds for the given element to become invisible. + * + * @param $element + * @param int $timeout seconds + * @throws \Exception + */ + public function waitForElementNotVisible($element, $timeout = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + $condition = WebDriverExpectedCondition::invisibilityOfElementLocated($this->getLocator($element)); + $this->webDriver->wait($timeout)->until($condition); + } + + /** + * Waits up to $timeout seconds for the given string to appear on the page. + * + * @param string $text + * @param int $timeout seconds + * @param string $selector optional + * @throws \Exception + */ + public function waitForText($text, $timeout = null, $selector = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + $message = sprintf( + 'Waited for %d secs but text %s still not found', + $timeout, + Locator::humanReadableString($text) + ); + if (!$selector) { + $condition = WebDriverExpectedCondition::elementTextContains(WebDriverBy::xpath('//body'), $text); + $this->webDriver->wait($timeout)->until($condition, $message); + return; + } + + $condition = WebDriverExpectedCondition::elementTextContains($this->getLocator($selector), $text); + $this->webDriver->wait($timeout)->until($condition, $message); + } + + /** + * Executes JavaScript and waits up to $timeout seconds for it to return true. + * + * @param string $script + * @param int $timeout seconds + * @throws \Exception + */ + public function waitForJS($script, $timeout = null) + { + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + + $condition = function ($wd) use ($script) { + return $wd->executeScript($script); + }; + $message = sprintf( + 'Waited for %d secs but script %s still not executed', + $timeout, + Locator::humanReadableString($script) + ); + $this->webDriver->wait($timeout)->until($condition, $message); + } + /** * Wait for all Ajax calls to finish. * @@ -308,7 +451,7 @@ public function selectMultipleOptions($selectSearchTextField, $selectSearchResul */ public function waitForAjaxLoad($timeout = null) { - $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); try { $this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout); @@ -327,7 +470,7 @@ public function waitForAjaxLoad($timeout = null) */ public function waitForPageLoad($timeout = null) { - $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; + $timeout = $timeout ?? $this->getDefaultWaitTimeout(); $this->waitForJS('return document.readyState == "complete"', $timeout); $this->waitForAjaxLoad($timeout); From 33e95b66fa6758ab2ea30a91d95d56d5118cb0de Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Sat, 24 Mar 2018 17:38:55 +0200 Subject: [PATCH 02/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Added Unit test for getDefaultWaitTimeout method --- .../Module/MagentoWebDriverTest.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php new file mode 100644 index 000000000..4959af307 --- /dev/null +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php @@ -0,0 +1,26 @@ +assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), MagentoWebDriver::DEFAULT_WAIT_TIMEOUT); + + $envFile = new \Dotenv\Dotenv(__DIR__ . '/../../../../../../'); + $envFile->load(); + + $this->assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), 20); + } +} From 6d11082d2ab61ad74fa1666b005773a3d211a57f Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Sat, 24 Mar 2018 17:40:17 +0200 Subject: [PATCH 03/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Added WAIT_TIMEOUT environment variable to .env file --- .env | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 000000000..fd072c843 --- /dev/null +++ b/.env @@ -0,0 +1,40 @@ +#Copyright © Magento, Inc. All rights reserved. +#See COPYING.txt for license details. + +#*** Set the base URL for your Magento instance ***# +MAGENTO_BASE_URL=http://devdocs.magento.com/ + +#*** Set the Admin Username and Password for your Magento instance ***# +MAGENTO_BACKEND_NAME= +MAGENTO_ADMIN_USERNAME= +MAGENTO_ADMIN_PASSWORD= + +#*** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation +#MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php +#MAGENTO_CLI_COMMAND_PARAMETER=command + +#*** Selenium Server Protocol, Host, Port, and Path, with local defaults. Uncomment and change if not running Selenium locally. +#SELENIUM_HOST=127.0.0.1 +#SELENIUM_PORT=4444 +#SELENIUM_PROTOCOL=http +#SELENIUM_PATH=/wd/hub + +#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***# +#MAGENTO_RESTAPI_SERVER_HOST= +#MAGENTO_RESTAPI_SERVER_PORT= + +#*** Uncomment these properties to set up a dev environment with symlinked projects ***# +#TESTS_BP= +#FW_BP= +#TESTS_MODULE_PATH= + +#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set +MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch +#CUSTOM_MODULE_PATHS= + +#*** Bool property which allows the user to toggle debug output during test execution +#MFTF_DEBUG= + +#*** Default timeout for wait actions +WAIT_TIMEOUT=20 +#*** End of .env ***# From 035f515828f915720697f86c2b7fcd6547e8d6fd Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Sat, 24 Mar 2018 17:41:48 +0200 Subject: [PATCH 04/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Removed .env and updated .env.example file --- .env | 40 ---------------------------------------- .env.example | 3 +++ 2 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index fd072c843..000000000 --- a/.env +++ /dev/null @@ -1,40 +0,0 @@ -#Copyright © Magento, Inc. All rights reserved. -#See COPYING.txt for license details. - -#*** Set the base URL for your Magento instance ***# -MAGENTO_BASE_URL=http://devdocs.magento.com/ - -#*** Set the Admin Username and Password for your Magento instance ***# -MAGENTO_BACKEND_NAME= -MAGENTO_ADMIN_USERNAME= -MAGENTO_ADMIN_PASSWORD= - -#*** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation -#MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php -#MAGENTO_CLI_COMMAND_PARAMETER=command - -#*** Selenium Server Protocol, Host, Port, and Path, with local defaults. Uncomment and change if not running Selenium locally. -#SELENIUM_HOST=127.0.0.1 -#SELENIUM_PORT=4444 -#SELENIUM_PROTOCOL=http -#SELENIUM_PATH=/wd/hub - -#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***# -#MAGENTO_RESTAPI_SERVER_HOST= -#MAGENTO_RESTAPI_SERVER_PORT= - -#*** Uncomment these properties to set up a dev environment with symlinked projects ***# -#TESTS_BP= -#FW_BP= -#TESTS_MODULE_PATH= - -#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set -MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch -#CUSTOM_MODULE_PATHS= - -#*** Bool property which allows the user to toggle debug output during test execution -#MFTF_DEBUG= - -#*** Default timeout for wait actions -WAIT_TIMEOUT=20 -#*** End of .env ***# diff --git a/.env.example b/.env.example index 536ea1fa5..fd072c843 100644 --- a/.env.example +++ b/.env.example @@ -34,4 +34,7 @@ MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_C #*** Bool property which allows the user to toggle debug output during test execution #MFTF_DEBUG= + +#*** Default timeout for wait actions +WAIT_TIMEOUT=20 #*** End of .env ***# From 4249e883f934ca69a09ec7618f31f6ef8283e032 Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Thu, 29 Mar 2018 17:38:35 +0300 Subject: [PATCH 05/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Transformed 'getDefaultWaitTimeout' into static method --- .../FunctionalTestingFramework/Module/MagentoWebDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 45ced03c9..c1f11063c 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -119,7 +119,7 @@ public function _resetConfig() $this->config = ConfigSanitizerUtil::sanitizeWebDriverConfig($this->config); } - public function getDefaultWaitTimeout() + public static function getDefaultWaitTimeout() { return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT; } From d26cfe2454b1752916258036db090b237aad8891 Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Thu, 29 Mar 2018 17:40:24 +0300 Subject: [PATCH 06/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Used .env.example configuration file instead of .env - Changed hardcoded value to environment variable --- .../FunctionalTestFramework/Module/MagentoWebDriverTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php index 4959af307..5ae07f63b 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php @@ -18,9 +18,9 @@ public function testGetDefaultWaitTimeout() { $this->assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), MagentoWebDriver::DEFAULT_WAIT_TIMEOUT); - $envFile = new \Dotenv\Dotenv(__DIR__ . '/../../../../../../'); + $envFile = new \Dotenv\Dotenv(__DIR__ . '/../../../../../../', '.env.example'); $envFile->load(); - $this->assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), 20); + $this->assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), getenv('WAIT_TIMEOUT')); } } From 6381a4ba46950bf40735aea4512390ba8a866d32 Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Thu, 29 Mar 2018 17:45:06 +0300 Subject: [PATCH 07/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Added PHPDoc block to getDefaultWaitTimeout method - Changed usage of getDefaultWaitTimeout static method in other methods --- .../Module/MagentoWebDriver.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index c1f11063c..0018348ff 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -119,6 +119,11 @@ public function _resetConfig() $this->config = ConfigSanitizerUtil::sanitizeWebDriverConfig($this->config); } + /** + * Retrieve default timeout in seconds for 'wait*' actions + * + * @return int + */ public static function getDefaultWaitTimeout() { return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT; @@ -318,7 +323,7 @@ public function selectMultipleOptions($selectSearchTextField, $selectSearchResul */ public function wait($timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); if ($timeout >= 1000) { throw new TestRuntimeException( @@ -341,7 +346,7 @@ public function wait($timeout = null) */ public function waitForElementChange($element, \Closure $callback, $timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $el = $this->matchFirstOrFail($this->baseElement, $element); $checker = function () use ($el, $callback) { @@ -359,7 +364,7 @@ public function waitForElementChange($element, \Closure $callback, $timeout = nu */ public function waitForElement($element, $timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $condition = WebDriverExpectedCondition::presenceOfElementLocated($this->getLocator($element)); $this->webDriver->wait($timeout)->until($condition); @@ -374,7 +379,7 @@ public function waitForElement($element, $timeout = null) */ public function waitForElementVisible($element, $timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $condition = WebDriverExpectedCondition::visibilityOfElementLocated($this->getLocator($element)); $this->webDriver->wait($timeout)->until($condition); @@ -389,7 +394,7 @@ public function waitForElementVisible($element, $timeout = null) */ public function waitForElementNotVisible($element, $timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $condition = WebDriverExpectedCondition::invisibilityOfElementLocated($this->getLocator($element)); $this->webDriver->wait($timeout)->until($condition); @@ -405,7 +410,7 @@ public function waitForElementNotVisible($element, $timeout = null) */ public function waitForText($text, $timeout = null, $selector = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $message = sprintf( 'Waited for %d secs but text %s still not found', @@ -431,7 +436,7 @@ public function waitForText($text, $timeout = null, $selector = null) */ public function waitForJS($script, $timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $condition = function ($wd) use ($script) { return $wd->executeScript($script); @@ -451,7 +456,7 @@ public function waitForJS($script, $timeout = null) */ public function waitForAjaxLoad($timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); try { $this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout); @@ -470,7 +475,7 @@ public function waitForAjaxLoad($timeout = null) */ public function waitForPageLoad($timeout = null) { - $timeout = $timeout ?? $this->getDefaultWaitTimeout(); + $timeout = $timeout ?? self::getDefaultWaitTimeout(); $this->waitForJS('return document.readyState == "complete"', $timeout); $this->waitForAjaxLoad($timeout); From f463ebdd4d771d14cccf42e4177feedfcb294108 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 16:47:53 +0300 Subject: [PATCH 08/63] The property of the parent element is used first when making a request --- .../DataGenerator/Persist/CurlHandler.php | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index c72cafc25..e3433629c 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -200,13 +200,31 @@ private function resolveUrlReference($urlIn, $entityObjects) if (!empty($matchedParams)) { foreach ($matchedParams[0] as $paramKey => $paramValue) { + + $paramEntityParent = ""; + $matchedParent = []; + $dataItem = $matchedParams[1][$paramKey]; + preg_match_all("/(.+?)\./", $dataItem, $matchedParent); + + if (!empty($matchedParent) && !empty($matchedParent[0])) + { + $paramEntityParent = $matchedParent[1][0]; + $dataItem = preg_replace('/^'.$matchedParent[0][0].'/', '', $dataItem); + } + foreach ($entityObjects as $entityObject) { - $param = $entityObject->getDataByName( - $matchedParams[1][$paramKey], - EntityDataObject::CEST_UNIQUE_VALUE - ); + + if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) + { + $param = $entityObject->getDataByName( + $dataItem, + EntityDataObject::CEST_UNIQUE_VALUE + ); + } + if (null !== $param) { $urlOut = str_replace($paramValue, $param, $urlOut); + $param = null; continue; } } From 73c437125effd276c00e0f0d629c31be52073f62 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 17:29:19 +0300 Subject: [PATCH 09/63] Added the ability to use entity properties in metadata --- .../Persist/OperationDataArrayResolver.php | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index 6097f64da..ac9a091e4 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -134,6 +134,14 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op )); } } else { + + $operationElementProperty = null; + if(strpos($operationElementType, '.') !== false){ + $operationElementComponents = explode('.',$operationElementType); + $operationElementType = $operationElementComponents[0]; + $operationElementProperty = $operationElementComponents[1]; + } + $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($operationElementType); // If an element is required by metadata, but was not provided in the entity, throw an exception @@ -146,12 +154,23 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op )); } foreach ($entityNamesOfType as $entityName) { - $operationDataSubArray = $this->resolveNonPrimitiveElement( - $entityName, - $operationElement, - $operation, - $fromArray - ); + + if($operationElementProperty === null) { + $operationDataSubArray = $this->resolveNonPrimitiveElement( + $entityName, + $operationElement, + $operation, + $fromArray + ); + }else { + $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); + $operationDataSubArray = $linkedEntityObj->getDataByName($operationElementProperty,0); + + if($operationDataSubArray === null) + throw new \Exception( + sprintf('Property %s not found in entity %s \n', $operationElementProperty, $entityName) + ); + } if ($operationElement->getType() == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY) { $operationDataArray[$operationElement->getKey()][] = $operationDataSubArray; From 14d65c2ecf5d11d41e8cbeeb9d971ac470c79201 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 17:33:56 +0300 Subject: [PATCH 10/63] Cleaned up some code --- .../DataGenerator/Persist/CurlHandler.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index e3433629c..c049e346f 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -206,16 +206,14 @@ private function resolveUrlReference($urlIn, $entityObjects) $dataItem = $matchedParams[1][$paramKey]; preg_match_all("/(.+?)\./", $dataItem, $matchedParent); - if (!empty($matchedParent) && !empty($matchedParent[0])) - { + if (!empty($matchedParent) && !empty($matchedParent[0])) { $paramEntityParent = $matchedParent[1][0]; $dataItem = preg_replace('/^'.$matchedParent[0][0].'/', '', $dataItem); } foreach ($entityObjects as $entityObject) { - if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) - { + if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) { $param = $entityObject->getDataByName( $dataItem, EntityDataObject::CEST_UNIQUE_VALUE From 231fe18175e6603373225b94db3d90d0ced7f6a8 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 18:09:37 +0300 Subject: [PATCH 11/63] Cleaned up some code --- .../Persist/OperationDataArrayResolver.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index ac9a091e4..f1f11935f 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -136,8 +136,8 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op } else { $operationElementProperty = null; - if(strpos($operationElementType, '.') !== false){ - $operationElementComponents = explode('.',$operationElementType); + if (strpos($operationElementType, '.') !== false) { + $operationElementComponents = explode('.', $operationElementType); $operationElementType = $operationElementComponents[0]; $operationElementProperty = $operationElementComponents[1]; } @@ -155,21 +155,22 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op } foreach ($entityNamesOfType as $entityName) { - if($operationElementProperty === null) { + if ($operationElementProperty === null) { $operationDataSubArray = $this->resolveNonPrimitiveElement( $entityName, $operationElement, $operation, $fromArray ); - }else { + } else { $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); - $operationDataSubArray = $linkedEntityObj->getDataByName($operationElementProperty,0); + $operationDataSubArray = $linkedEntityObj->getDataByName($operationElementProperty, 0); - if($operationDataSubArray === null) + if ($operationDataSubArray === null) { throw new \Exception( sprintf('Property %s not found in entity %s \n', $operationElementProperty, $entityName) ); + } } if ($operationElement->getType() == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY) { From d0983253e1a4e46b70fe4719f27dc2c0a87dba83 Mon Sep 17 00:00:00 2001 From: Vasyl Malanka Date: Sat, 7 Apr 2018 16:46:51 +0300 Subject: [PATCH 12/63] magento/magento2-functional-testing-framework#54: Set a global value for timeouts that's used across all wait related actions - Reverted MagentoWebDriver class - Moved getDefaultWaitTimeout method to ActionObject class - Changed generateStepsPhp method in TestGenerator class to use timeout from getDefaultWaitTimeout method if not set - Moved and fixed unit test for the implementation --- .env.example | 2 +- .../Module/MagentoWebDriverTest.php | 26 --- .../Test/Objects/ActionObjectTest.php | 13 ++ .../Module/MagentoWebDriver.php | 152 +----------------- .../Test/Objects/ActionObject.php | 11 ++ .../Util/TestGenerator.php | 1 + 6 files changed, 28 insertions(+), 177 deletions(-) delete mode 100644 dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php diff --git a/.env.example b/.env.example index fd072c843..d0ec1db4d 100644 --- a/.env.example +++ b/.env.example @@ -36,5 +36,5 @@ MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_C #MFTF_DEBUG= #*** Default timeout for wait actions -WAIT_TIMEOUT=20 +WAIT_TIMEOUT=10 #*** End of .env ***# diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php deleted file mode 100644 index 5ae07f63b..000000000 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Module/MagentoWebDriverTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), MagentoWebDriver::DEFAULT_WAIT_TIMEOUT); - - $envFile = new \Dotenv\Dotenv(__DIR__ . '/../../../../../../', '.env.example'); - $envFile->load(); - - $this->assertEquals(MagentoWebDriver::getDefaultWaitTimeout(), getenv('WAIT_TIMEOUT')); - } -} diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects/ActionObjectTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects/ActionObjectTest.php index 98646d0c4..0bce48efd 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects/ActionObjectTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects/ActionObjectTest.php @@ -291,6 +291,19 @@ public function testTooManyArgumentException() $actionObject->resolveReferences(); } + /** + * Method should return either .env file value or constant value + */ + public function testGetDefaultWaitTimeout() + { + $this->assertEquals(ActionObject::getDefaultWaitTimeout(), ActionObject::DEFAULT_WAIT_TIMEOUT); + + $envFile = new \Dotenv\Dotenv(__DIR__ . '/../../../../../../../', '.env.example'); + $envFile->load(); + + $this->assertEquals(ActionObject::getDefaultWaitTimeout(), getenv('WAIT_TIMEOUT')); + } + private function mockSectionHandlerWithElement($elementObject) { $sectionObject = new SectionObject('SectionObject', ['elementObject' => $elementObject]); diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 0018348ff..9e50687a3 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -13,13 +13,11 @@ use Facebook\WebDriver\WebDriverSelect; use Facebook\WebDriver\WebDriverBy; use Facebook\WebDriver\Exception\NoSuchElementException; -use Facebook\WebDriver\WebDriverExpectedCondition; use Codeception\Exception\ElementNotFound; use Codeception\Exception\ModuleConfigException; use Codeception\Exception\ModuleException; use Codeception\Util\Uri; use Codeception\Util\ActionSequence; -use Codeception\Util\Locator; use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport; use Magento\FunctionalTestingFramework\Util\Protocol\CurlInterface; use Magento\Setup\Exception; @@ -57,8 +55,6 @@ class MagentoWebDriver extends WebDriver '//div[@data-role="spinner"]' ]; - const DEFAULT_WAIT_TIMEOUT = 10; - /** * The module required fields, to be set in the suite .yml configuration file. * @@ -119,16 +115,6 @@ public function _resetConfig() $this->config = ConfigSanitizerUtil::sanitizeWebDriverConfig($this->config); } - /** - * Retrieve default timeout in seconds for 'wait*' actions - * - * @return int - */ - public static function getDefaultWaitTimeout() - { - return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT; - } - /** * Returns URL of a host. * @@ -315,140 +301,6 @@ public function selectMultipleOptions($selectSearchTextField, $selectSearchResul } } - /** - * Wait for $timeout seconds. - * - * @param int|float $timeout secs - * @throws \Codeception\Exception\TestRuntimeException - */ - public function wait($timeout = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - if ($timeout >= 1000) { - throw new TestRuntimeException( - " - Waiting for more then 1000 seconds: 16.6667 mins\n - Please note that wait method accepts number of seconds as parameter." - ); - } - usleep($timeout * 1000000); - } - - /** - * Waits up to $timeout seconds for the given element to change. - * - * @param $element - * @param \Closure $callback - * @param int $timeout seconds - * @throws \Codeception\Exception\ElementNotFound - * @throws \Exception - */ - public function waitForElementChange($element, \Closure $callback, $timeout = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - $el = $this->matchFirstOrFail($this->baseElement, $element); - $checker = function () use ($el, $callback) { - return $callback($el); - }; - $this->webDriver->wait($timeout)->until($checker); - } - - /** - * Waits up to $timeout seconds for an element to appear on the page. - * - * @param $element - * @param int $timeout seconds - * @throws \Exception - */ - public function waitForElement($element, $timeout = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - $condition = WebDriverExpectedCondition::presenceOfElementLocated($this->getLocator($element)); - $this->webDriver->wait($timeout)->until($condition); - } - - /** - * Waits up to $timeout seconds for the given element to be visible on the page. - * - * @param $element - * @param int $timeout seconds - * @throws \Exception - */ - public function waitForElementVisible($element, $timeout = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - $condition = WebDriverExpectedCondition::visibilityOfElementLocated($this->getLocator($element)); - $this->webDriver->wait($timeout)->until($condition); - } - - /** - * Waits up to $timeout seconds for the given element to become invisible. - * - * @param $element - * @param int $timeout seconds - * @throws \Exception - */ - public function waitForElementNotVisible($element, $timeout = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - $condition = WebDriverExpectedCondition::invisibilityOfElementLocated($this->getLocator($element)); - $this->webDriver->wait($timeout)->until($condition); - } - - /** - * Waits up to $timeout seconds for the given string to appear on the page. - * - * @param string $text - * @param int $timeout seconds - * @param string $selector optional - * @throws \Exception - */ - public function waitForText($text, $timeout = null, $selector = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - $message = sprintf( - 'Waited for %d secs but text %s still not found', - $timeout, - Locator::humanReadableString($text) - ); - if (!$selector) { - $condition = WebDriverExpectedCondition::elementTextContains(WebDriverBy::xpath('//body'), $text); - $this->webDriver->wait($timeout)->until($condition, $message); - return; - } - - $condition = WebDriverExpectedCondition::elementTextContains($this->getLocator($selector), $text); - $this->webDriver->wait($timeout)->until($condition, $message); - } - - /** - * Executes JavaScript and waits up to $timeout seconds for it to return true. - * - * @param string $script - * @param int $timeout seconds - * @throws \Exception - */ - public function waitForJS($script, $timeout = null) - { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); - - $condition = function ($wd) use ($script) { - return $wd->executeScript($script); - }; - $message = sprintf( - 'Waited for %d secs but script %s still not executed', - $timeout, - Locator::humanReadableString($script) - ); - $this->webDriver->wait($timeout)->until($condition, $message); - } - /** * Wait for all Ajax calls to finish. * @@ -456,7 +308,7 @@ public function waitForJS($script, $timeout = null) */ public function waitForAjaxLoad($timeout = null) { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); + $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; try { $this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout); @@ -475,7 +327,7 @@ public function waitForAjaxLoad($timeout = null) */ public function waitForPageLoad($timeout = null) { - $timeout = $timeout ?? self::getDefaultWaitTimeout(); + $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; $this->waitForJS('return document.readyState == "complete"', $timeout); $this->waitForAjaxLoad($timeout); diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index 24971cef5..eb45febea 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -42,6 +42,7 @@ class ActionObject const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/'; const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w]+\.[\w\[\]]+}}/'; const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN_WITH_PARAMS= '/{{[\w]+\.[\w]+\(.+\)}}/'; + const DEFAULT_WAIT_TIMEOUT = 10; /** * The unique identifier for the action @@ -128,6 +129,16 @@ public function __construct( } } + /** + * Retrieve default timeout in seconds for 'wait*' actions + * + * @return int + */ + public static function getDefaultWaitTimeout() + { + return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT; + } + /** * This function returns the string property stepKey. * diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 2ac2d0abd..51d6dfccb 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -492,6 +492,7 @@ private function generateStepsPhp($actionObjects, $hookObject = false) if (isset($customActionAttributes['timeout'])) { $time = $customActionAttributes['timeout']; } + $time = $time ?? ActionObject::getDefaultWaitTimeout(); if (isset($customActionAttributes['parameterArray']) && $actionObject->getType() != 'pressKey') { // validate the param array is in the correct format From 4e2b2660f7d9d504cfb9551684ce80a68f14b450 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 08:47:53 -0500 Subject: [PATCH 13/63] The property of the parent element is used first when making a request (cherry picked from commit f463ebd) --- .../DataGenerator/Persist/CurlHandler.php | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index ee61d8c12..2cfc7dfe9 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -201,13 +201,31 @@ private function resolveUrlReference($urlIn, $entityObjects) if (!empty($matchedParams)) { foreach ($matchedParams[0] as $paramKey => $paramValue) { + + $paramEntityParent = ""; + $matchedParent = []; + $dataItem = $matchedParams[1][$paramKey]; + preg_match_all("/(.+?)\./", $dataItem, $matchedParent); + + if (!empty($matchedParent) && !empty($matchedParent[0])) + { + $paramEntityParent = $matchedParent[1][0]; + $dataItem = preg_replace('/^'.$matchedParent[0][0].'/', '', $dataItem); + } + foreach ($entityObjects as $entityObject) { - $param = $entityObject->getDataByName( - $matchedParams[1][$paramKey], - EntityDataObject::CEST_UNIQUE_VALUE - ); + + if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) + { + $param = $entityObject->getDataByName( + $dataItem, + EntityDataObject::CEST_UNIQUE_VALUE + ); + } + if (null !== $param) { $urlOut = str_replace($paramValue, $param, $urlOut); + $param = null; continue; } } From fa321354c4abdfcb221f3e726b2096b9be915a00 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 09:33:56 -0500 Subject: [PATCH 14/63] Cleaned up some code (cherry picked from commit 14d65c2) --- .../DataGenerator/Persist/CurlHandler.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index 2cfc7dfe9..8710cba7c 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -207,16 +207,14 @@ private function resolveUrlReference($urlIn, $entityObjects) $dataItem = $matchedParams[1][$paramKey]; preg_match_all("/(.+?)\./", $dataItem, $matchedParent); - if (!empty($matchedParent) && !empty($matchedParent[0])) - { + if (!empty($matchedParent) && !empty($matchedParent[0])) { $paramEntityParent = $matchedParent[1][0]; $dataItem = preg_replace('/^'.$matchedParent[0][0].'/', '', $dataItem); } foreach ($entityObjects as $entityObject) { - if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) - { + if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) { $param = $entityObject->getDataByName( $dataItem, EntityDataObject::CEST_UNIQUE_VALUE From 593e531e1149378cea2a65c20e74516a6010ae70 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 10 Oct 2018 13:33:23 -0500 Subject: [PATCH 15/63] MQE-910: [GitHub PR] The property of the parent element is used first when making a request --- .../DataGenerator/Persist/CurlHandler.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index 8710cba7c..74f76c0c8 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -201,7 +201,6 @@ private function resolveUrlReference($urlIn, $entityObjects) if (!empty($matchedParams)) { foreach ($matchedParams[0] as $paramKey => $paramValue) { - $paramEntityParent = ""; $matchedParent = []; $dataItem = $matchedParams[1][$paramKey]; @@ -213,6 +212,7 @@ private function resolveUrlReference($urlIn, $entityObjects) } foreach ($entityObjects as $entityObject) { + $param = null; if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) { $param = $entityObject->getDataByName( @@ -223,7 +223,6 @@ private function resolveUrlReference($urlIn, $entityObjects) if (null !== $param) { $urlOut = str_replace($paramValue, $param, $urlOut); - $param = null; continue; } } From 382711bb185845a7678a5aa1a03c2e763bf2c548 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 09:29:19 -0500 Subject: [PATCH 16/63] Added the ability to use entity properties in metadata (cherry picked from commit 73c4371) --- .../Persist/OperationDataArrayResolver.php | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index a14d384a8..6d346e75b 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -134,6 +134,14 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op )); } } else { + + $operationElementProperty = null; + if(strpos($operationElementType, '.') !== false){ + $operationElementComponents = explode('.',$operationElementType); + $operationElementType = $operationElementComponents[0]; + $operationElementProperty = $operationElementComponents[1]; + } + $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($operationElementType); // If an element is required by metadata, but was not provided in the entity, throw an exception @@ -146,12 +154,23 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op )); } foreach ($entityNamesOfType as $entityName) { - $operationDataSubArray = $this->resolveNonPrimitiveElement( - $entityName, - $operationElement, - $operation, - $fromArray - ); + + if($operationElementProperty === null) { + $operationDataSubArray = $this->resolveNonPrimitiveElement( + $entityName, + $operationElement, + $operation, + $fromArray + ); + }else { + $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); + $operationDataSubArray = $linkedEntityObj->getDataByName($operationElementProperty,0); + + if($operationDataSubArray === null) + throw new \Exception( + sprintf('Property %s not found in entity %s \n', $operationElementProperty, $entityName) + ); + } if ($operationElement->getType() == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY) { $operationDataArray[$operationElement->getKey()][] = $operationDataSubArray; From 39f39a220057889162600ffe27fbbc5c5d5d2299 Mon Sep 17 00:00:00 2001 From: Grigoruta Cristian Date: Mon, 2 Apr 2018 10:09:37 -0500 Subject: [PATCH 17/63] Cleaned up some code (cherry picked from commit 231fe18) --- .../Persist/OperationDataArrayResolver.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index 6d346e75b..afae6e285 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -136,8 +136,8 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op } else { $operationElementProperty = null; - if(strpos($operationElementType, '.') !== false){ - $operationElementComponents = explode('.',$operationElementType); + if (strpos($operationElementType, '.') !== false) { + $operationElementComponents = explode('.', $operationElementType); $operationElementType = $operationElementComponents[0]; $operationElementProperty = $operationElementComponents[1]; } @@ -155,21 +155,22 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op } foreach ($entityNamesOfType as $entityName) { - if($operationElementProperty === null) { + if ($operationElementProperty === null) { $operationDataSubArray = $this->resolveNonPrimitiveElement( $entityName, $operationElement, $operation, $fromArray ); - }else { + } else { $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); - $operationDataSubArray = $linkedEntityObj->getDataByName($operationElementProperty,0); + $operationDataSubArray = $linkedEntityObj->getDataByName($operationElementProperty, 0); - if($operationDataSubArray === null) + if ($operationDataSubArray === null) { throw new \Exception( sprintf('Property %s not found in entity %s \n', $operationElementProperty, $entityName) ); + } } if ($operationElement->getType() == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY) { From 009377273c9f88a2bf1ed35dd86f163156b122d7 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 18 Oct 2018 11:46:41 -0500 Subject: [PATCH 18/63] MQE-1279: MFTF will not output any test results if instance respondes with 503 - Disabled MagentoRestDriver --- etc/config/functional.suite.dist.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/etc/config/functional.suite.dist.yml b/etc/config/functional.suite.dist.yml index da05a13e3..a7a9f12bf 100644 --- a/etc/config/functional.suite.dist.yml +++ b/etc/config/functional.suite.dist.yml @@ -14,12 +14,6 @@ modules: - \Magento\FunctionalTestingFramework\Module\MagentoWebDriver - \Magento\FunctionalTestingFramework\Helper\Acceptance - \Magento\FunctionalTestingFramework\Helper\MagentoFakerData - - \Magento\FunctionalTestingFramework\Module\MagentoRestDriver: - url: "%MAGENTO_BASE_URL%/rest/default/V1/" - username: "%MAGENTO_ADMIN_USERNAME%" - password: "%MAGENTO_ADMIN_PASSWORD%" - depends: PhpBrowser - part: Json - \Magento\FunctionalTestingFramework\Module\MagentoSequence - \Magento\FunctionalTestingFramework\Module\MagentoAssert - Asserts From 4079fc986b675729b2675933e0adfc514c989081 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 19 Oct 2018 10:07:44 -0500 Subject: [PATCH 19/63] MQE-911: [GitHub PR] Added the ability to use entity properties in metadata - Fixed static test failures --- .../DataGenerator/Persist/OperationDataArrayResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index afae6e285..95bcd1bab 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -66,6 +66,8 @@ public function __construct($dependentEntities = null) * @return array * @throws \Exception * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function resolveOperationDataArray($entityObject, $operationMetadata, $operation, $fromArray = false) { @@ -134,7 +136,6 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op )); } } else { - $operationElementProperty = null; if (strpos($operationElementType, '.') !== false) { $operationElementComponents = explode('.', $operationElementType); @@ -154,7 +155,6 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op )); } foreach ($entityNamesOfType as $entityName) { - if ($operationElementProperty === null) { $operationDataSubArray = $this->resolveNonPrimitiveElement( $entityName, From d6e0b77fe0317f0073dac399f966070005ef0689 Mon Sep 17 00:00:00 2001 From: GwanYeong Kim Date: Fri, 26 Oct 2018 20:29:45 +0900 Subject: [PATCH 20/63] Removed unused variables in FunctionCommentSniff.php --- .../Magento/Sniffs/Commenting/FunctionCommentSniff.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php index 2bd8be194..259a54408 100644 --- a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php +++ b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php @@ -68,7 +68,7 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) $phpcsFile->addError($error, $return, 'MissingReturnType'); } else { // Support both a return type and a description. - $split = preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); + preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); if (isset($returnParts[1]) === false) { return; } @@ -78,7 +78,7 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) // Check return type (can be multiple, separated by '|'). $typeNames = explode('|', $returnType); $suggestedNames = array(); - foreach ($typeNames as $i => $typeName) { + foreach ($typeNames as $typeName) { $suggestedName = Common::suggestType($typeName); if (in_array($suggestedName, $suggestedNames) === false) { $suggestedNames[] = $suggestedName; @@ -460,7 +460,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum => $line) { + foreach ($param['commentLines'] as $lineNum) { if ($lineNum === 0 || $param['commentLines'][$lineNum]['indent'] === 0 ) { From 4babbdf901e4ff5b017d1162712b9ceaf065ce1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Fri, 2 Nov 2018 17:21:31 +0200 Subject: [PATCH 21/63] Use custom Backend domain, refactoring to Executors responsible for calling HTTP endpoints --- etc/config/.env.example | 8 +++-- etc/config/functional.suite.dist.yml | 1 + .../Persist/Curl/AbstractExecutor.php | 24 ++------------ .../Persist/Curl/AdminExecutor.php | 33 ++++++++----------- .../Persist/Curl/FrontendExecutor.php | 9 ++--- .../Persist/Curl/WebapiExecutor.php | 29 +++++++++++++--- .../Util/ModuleResolver.php | 16 +++++++-- 7 files changed, 64 insertions(+), 56 deletions(-) diff --git a/etc/config/.env.example b/etc/config/.env.example index 17ea384ca..899a52df4 100644 --- a/etc/config/.env.example +++ b/etc/config/.env.example @@ -4,6 +4,9 @@ #*** Set the base URL for your Magento instance ***# MAGENTO_BASE_URL=http://devdocs.magento.com/ +#*** Uncomment if you are running Admin Panel on separate domain (used with MAGENTO_BACKEND_NAME) ***# +# MAGENTO_BACKEND_BASE_HOST=http://admin.example.com/ + #*** Set the Admin Username and Password for your Magento instance ***# MAGENTO_BACKEND_NAME=admin MAGENTO_ADMIN_USERNAME=admin @@ -23,8 +26,9 @@ MAGENTO_ADMIN_PASSWORD=123123q BROWSER=chrome #*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***# -#MAGENTO_RESTAPI_SERVER_HOST= -#MAGENTO_RESTAPI_SERVER_PORT= +#MAGENTO_RESTAPI_SERVER_HOST=restapi.magento.com +#MAGENTO_RESTAPI_SERVER_PORT=8080 +#MAGENTO_RESTAPI_SERVER_PROTOCOL=https #*** Uncomment these properties to set up a dev environment with symlinked projects ***# #TESTS_BP= diff --git a/etc/config/functional.suite.dist.yml b/etc/config/functional.suite.dist.yml index da05a13e3..12c006801 100644 --- a/etc/config/functional.suite.dist.yml +++ b/etc/config/functional.suite.dist.yml @@ -26,6 +26,7 @@ modules: config: \Magento\FunctionalTestingFramework\Module\MagentoWebDriver: url: "%MAGENTO_BASE_URL%" + backend_url: "%MAGENTO_BACKEND_BASE_URL%" backend_name: "%MAGENTO_BACKEND_NAME%" browser: 'chrome' restart: true diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php index 6adf87892..30e25abd2 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php @@ -14,32 +14,14 @@ abstract class AbstractExecutor implements CurlInterface { /** - * Base url. + * Returns Magento base URL. Used as a fallback for other services (eg. WebApi, Backend) * * @var string */ protected static $baseUrl = null; - /** - * Resolve base url. - * - * @return void - */ - protected static function resolveBaseUrl() + public function getBaseUrl(): string { - - if ((getenv('MAGENTO_RESTAPI_SERVER_HOST') !== false) - && (getenv('MAGENTO_RESTAPI_SERVER_HOST') !== '') ) { - self::$baseUrl = getenv('MAGENTO_RESTAPI_SERVER_HOST'); - } else { - self::$baseUrl = getenv('MAGENTO_BASE_URL'); - } - - if ((getenv('MAGENTO_RESTAPI_SERVER_PORT') !== false) - && (getenv('MAGENTO_RESTAPI_SERVER_PORT') !== '')) { - self::$baseUrl .= ':' . getenv('MAGENTO_RESTAPI_SERVER_PORT'); - } - - self::$baseUrl = rtrim(self::$baseUrl, '/') . '/'; + return getenv('MAGENTO_BASE_URL'); } } diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php index cff7c04fb..7524d7913 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php @@ -37,18 +37,11 @@ class AdminExecutor extends AbstractExecutor implements CurlInterface private $response; /** - * Should executor remove backend_name from api url + * Flag describes whether the request is to Magento Base URL, removes backend_name from api url * @var boolean */ private $removeBackend; - /** - * Backend url. - * - * @var string - */ - private static $adminUrl; - /** * Constructor. * @param boolean $removeBackend @@ -58,15 +51,17 @@ class AdminExecutor extends AbstractExecutor implements CurlInterface */ public function __construct($removeBackend) { - if (!isset(parent::$baseUrl)) { - parent::resolveBaseUrl(); - } - self::$adminUrl = parent::$baseUrl . getenv('MAGENTO_BACKEND_NAME') . '/'; $this->removeBackend = $removeBackend; $this->transport = new CurlTransport(); $this->authorize(); } + public function getBaseUrl(): string + { + $backendHost = getenv('MAGENTO_BACKEND_BASE_URL') ?: parent::getBaseUrl(); + return $backendHost . getenv('MAGENTO_BACKEND_NAME') . '/'; + } + /** * Authorize admin on backend. * @@ -76,11 +71,11 @@ public function __construct($removeBackend) private function authorize() { // Perform GET to backend url so form_key is set - $this->transport->write(self::$adminUrl, [], CurlInterface::GET); + $this->transport->write($this->getBaseUrl(), [], CurlInterface::GET); $this->read(); // Authenticate admin user - $authUrl = self::$adminUrl . 'admin/auth/login/'; + $authUrl = $this->getBaseUrl() . 'admin/auth/login/'; $data = [ 'login[username]' => getenv('MAGENTO_ADMIN_USERNAME'), 'login[password]' => getenv('MAGENTO_ADMIN_PASSWORD'), @@ -110,19 +105,19 @@ private function setFormKey() * Send request to the remote server. * * @param string $url - * @param array $data + * @param array $data * @param string $method - * @param array $headers + * @param array $headers * @return void * @throws TestFrameworkException */ public function write($url, $data = [], $method = CurlInterface::POST, $headers = []) { $url = ltrim($url, "/"); - $apiUrl = self::$adminUrl . $url; + $apiUrl = $this->getBaseUrl() . $url; if ($this->removeBackend) { - $apiUrl = parent::$baseUrl . $url; + $apiUrl = parent::getBaseUrl() . $url; } if ($this->formKey) { @@ -168,7 +163,7 @@ public function read($successRegex = null, $returnRegex = null) /** * Add additional option to cURL. * - * @param integer $option CURLOPT_* constants. + * @param integer $option CURLOPT_* constants. * @param integer|string|boolean|array $value * @return void */ diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php index aa1706ef3..806507656 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php @@ -67,9 +67,6 @@ class FrontendExecutor extends AbstractExecutor implements CurlInterface */ public function __construct($customerEmail, $customerPassWord) { - if (!isset(parent::$baseUrl)) { - parent::resolveBaseUrl(); - } $this->transport = new CurlTransport(); $this->customerEmail = $customerEmail; $this->customerPassword = $customerPassWord; @@ -84,11 +81,11 @@ public function __construct($customerEmail, $customerPassWord) */ private function authorize() { - $url = parent::$baseUrl . 'customer/account/login/'; + $url = $this->getBaseUrl() . 'customer/account/login/'; $this->transport->write($url); $this->read(); - $url = parent::$baseUrl . 'customer/account/loginPost/'; + $url = $this->getBaseUrl() . 'customer/account/loginPost/'; $data = [ 'login[username]' => $this->customerEmail, 'login[password]' => $this->customerPassword, @@ -146,7 +143,7 @@ public function write($url, $data = [], $method = CurlInterface::POST, $headers if (isset($data['customer_password'])) { unset($data['customer_password']); } - $apiUrl = parent::$baseUrl . $url; + $apiUrl = $this->getBaseUrl() . $url; if ($this->formKey) { $data['form_key'] = $this->formKey; } else { diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php index 16fef75f2..e1d68ab28 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php @@ -59,15 +59,34 @@ class WebapiExecutor extends AbstractExecutor implements CurlInterface */ public function __construct($storeCode = null) { - if (!isset(parent::$baseUrl)) { - parent::resolveBaseUrl(); - } - $this->storeCode = $storeCode; $this->transport = new CurlTransport(); $this->authorize(); } + /** + * Returns WebApi base URL, fallback to Magento Base URL + * @return string + */ + public function getBaseUrl(): string + { + $baseUrl = parent::getBaseUrl(); + + $webapiHost = getenv('MAGENTO_RESTAPI_SERVER_HOST'); + $webapiPort = getenv("MAGENTO_RESTAPI_SERVER_PORT"); + $webapiProtocol = getenv("MAGENTO_RESTAPI_SERVER_PROTOCOL"); + + if ($webapiHost) { + $baseUrl = sprintf('%s://%s/', $webapiProtocol, $webapiHost); + } + + if ($webapiPort) { + $baseUrl = rtrim($baseUrl,'/').':'.$webapiPort.'/'; + } + + return $baseUrl; + } + /** * Returns the authorization token needed for some requests via REST call. * @@ -152,7 +171,7 @@ public function close() */ public function getFormattedUrl($resource) { - $urlResult = parent::$baseUrl . 'rest/'; + $urlResult = $this->getBaseUrl() . 'rest/'; if ($this->storeCode != null) { $urlResult .= $this->storeCode . "/"; } diff --git a/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php index 55130deeb..978186203 100644 --- a/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php +++ b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php @@ -396,17 +396,18 @@ protected function getAdminToken() { $login = $_ENV['MAGENTO_ADMIN_USERNAME'] ?? null; $password = $_ENV['MAGENTO_ADMIN_PASSWORD'] ?? null; - if (!$login || !$password || !isset($_ENV['MAGENTO_BASE_URL'])) { + if (!$login || !$password || !$this->getBackendUrl()) { $message = "Cannot retrieve API token without credentials and base url, please fill out .env."; $context = [ "MAGENTO_BASE_URL" => getenv("MAGENTO_BASE_URL"), + "MAGENTO_BACKEND_BASE_URL" => getenv("MAGENTO_BACKEND_BASE_URL"), "MAGENTO_ADMIN_USERNAME" => getenv("MAGENTO_ADMIN_USERNAME"), "MAGENTO_ADMIN_PASSWORD" => getenv("MAGENTO_ADMIN_PASSWORD"), ]; throw new TestFrameworkException($message, $context); } - $url = ConfigSanitizerUtil::sanitizeUrl($_ENV['MAGENTO_BASE_URL']) . $this->adminTokenUrl; + $url = ConfigSanitizerUtil::sanitizeUrl($this->getBackendUrl()) . $this->adminTokenUrl; $data = [ 'username' => $login, 'password' => $password @@ -428,7 +429,7 @@ protected function getAdminToken() if ($responseCode !== 200) { if ($responseCode == 0) { - $details = "Could not find Magento Instance at given MAGENTO_BASE_URL"; + $details = "Could not find Magento Backend Instance at MAGENTO_BACKEND_BASE_URL or MAGENTO_BASE_URL"; } else { $details = $responseCode . " " . Response::$statusTexts[$responseCode]; } @@ -563,4 +564,13 @@ private function getRegisteredModuleList() } return []; } + + /** + * Returns custom Backend URL if set, fallback to Magento Base URL + * @return string|null + */ + private function getBackendUrl() + { + return getenv('MAGENTO_BACKEND_BASE_URL') ?: getenv('MAGENTO_BASE_URL'); + } } From 85efb600efc659cf8d313d3b978721d548f4c0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Sat, 3 Nov 2018 15:29:19 +0200 Subject: [PATCH 22/63] Add PHPDoc for getBaseUrl methods --- .../DataGenerator/Persist/Curl/AbstractExecutor.php | 4 ++++ .../DataGenerator/Persist/Curl/AdminExecutor.php | 4 ++++ .../DataGenerator/Persist/Curl/WebapiExecutor.php | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php index 30e25abd2..b6c3f29ec 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AbstractExecutor.php @@ -20,6 +20,10 @@ abstract class AbstractExecutor implements CurlInterface */ protected static $baseUrl = null; + /** + * Returns base URL for Magento instance + * @return string + */ public function getBaseUrl(): string { return getenv('MAGENTO_BASE_URL'); diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php index 7524d7913..91a0b8f4b 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php @@ -56,6 +56,10 @@ public function __construct($removeBackend) $this->authorize(); } + /** + * Returns base URL for Magento backend instance + * @return string + */ public function getBaseUrl(): string { $backendHost = getenv('MAGENTO_BACKEND_BASE_URL') ?: parent::getBaseUrl(); diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php index e1d68ab28..6efd3a173 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php @@ -65,7 +65,7 @@ public function __construct($storeCode = null) } /** - * Returns WebApi base URL, fallback to Magento Base URL + * Returns base URL for Magento Web API instance * @return string */ public function getBaseUrl(): string From 96a63c7dbbeef4127b31b9d80b6049d8f10952a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Sat, 3 Nov 2018 22:20:38 +0200 Subject: [PATCH 23/63] Cleanup for LoggingUtil. --- .../Util/Logger/LoggingUtil.php | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php index 78b0c29ef..6d959e43b 100644 --- a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php @@ -19,55 +19,61 @@ class LoggingUtil private $loggers = []; /** - * Singleton LogginUtil Instance + * Singleton LoggingUtil Instance * * @var LoggingUtil */ - private static $INSTANCE; + private static $instance; /** * Singleton accessor for instance variable * * @return LoggingUtil */ - public static function getInstance() + public static function getInstance(): LoggingUtil { - if (self::$INSTANCE == null) { - self::$INSTANCE = new LoggingUtil(); + if (self::$instance === null) { + self::$instance = new LoggingUtil(); } - return self::$INSTANCE; + return self::$instance; } /** - * Constructor for Logging Util + * Avoids instantiation of LoggingUtil by new. */ private function __construct() { - // private constructor + } + + /** + * Avoids instantiation of LoggingUtil by clone. + */ + private function __clone() + { } /** * Creates a new logger instances based on class name if it does not exist. If logger instance already exists, the * existing instance is simply returned. * - * @param string $clazz + * @param string $className * @return MftfLogger * @throws \Exception */ - public function getLogger($clazz) + public function getLogger($className): MftfLogger { - if ($clazz == null) { - throw new \Exception("You must pass a class to receive a logger"); + if ($className == null) { + throw new \Exception("You must pass a class name to receive a logger"); } - if (!array_key_exists($clazz, $this->loggers)) { - $logger = new MftfLogger($clazz); + if (!array_key_exists($className, $this->loggers)) { + $logger = new MftfLogger($className); $logger->pushHandler(new StreamHandler($this->getLoggingPath())); - $this->loggers[$clazz] = $logger; + $this->loggers[$className] = $logger; } - return $this->loggers[$clazz]; + return $this->loggers[$className]; } /** @@ -75,7 +81,7 @@ public function getLogger($clazz) * * @return string */ - public function getLoggingPath() + public function getLoggingPath(): string { return TESTS_BP . DIRECTORY_SEPARATOR . "mftf.log"; } From bd2ed6f5d4fc2af7799c8dd420ee2eaf84153099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Sat, 3 Nov 2018 22:25:26 +0200 Subject: [PATCH 24/63] Add CURL to the list of dependencies for MFTF (eg. Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport) --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c59fd3279..53bc773a7 100755 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ }, "require": { "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0", + "ext-curl": "*", "allure-framework/allure-codeception": "~1.2.6", "codeception/codeception": "~2.3.4", "consolidation/robo": "^1.0.0", From d383edd364373d66ca43d049a3a9fda7cb000879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Sat, 3 Nov 2018 22:29:40 +0200 Subject: [PATCH 25/63] Cleanup for ActionGroupObjectHandler class --- .../Test/Handlers/ActionGroupObjectHandler.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php index 994467bd3..d30f5892d 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -27,7 +27,7 @@ class ActionGroupObjectHandler implements ObjectHandlerInterface * * @var ActionGroupObjectHandler */ - private static $ACTION_GROUP_OBJECT_HANDLER; + private static $instance; /** * Array of action groups indexed by name @@ -48,14 +48,13 @@ class ActionGroupObjectHandler implements ObjectHandlerInterface * * @return ActionGroupObjectHandler */ - public static function getInstance() + public static function getInstance(): ActionGroupObjectHandler { - if (!self::$ACTION_GROUP_OBJECT_HANDLER) { - self::$ACTION_GROUP_OBJECT_HANDLER = new ActionGroupObjectHandler(); - self::$ACTION_GROUP_OBJECT_HANDLER->initActionGroups(); + if (!self::$instance) { + self::$instance = new ActionGroupObjectHandler(); } - return self::$ACTION_GROUP_OBJECT_HANDLER; + return self::$instance; } /** @@ -64,6 +63,7 @@ public static function getInstance() private function __construct() { $this->extendUtil = new ObjectExtensionUtil(); + $this->initActionGroups(); } /** @@ -72,7 +72,7 @@ private function __construct() * @param string $actionGroupName * @return ActionGroupObject */ - public function getObject($actionGroupName) + public function getObject($actionGroupName): ActionGroupObject { if (array_key_exists($actionGroupName, $this->actionGroups)) { $actionGroupObject = $this->actionGroups[$actionGroupName]; @@ -87,7 +87,7 @@ public function getObject($actionGroupName) * * @return array */ - public function getAllObjects() + public function getAllObjects(): array { foreach ($this->actionGroups as $actionGroupName => $actionGroup) { $this->actionGroups[$actionGroupName] = $this->extendActionGroup($actionGroup); @@ -125,7 +125,7 @@ private function initActionGroups() * @param ActionGroupObject $actionGroupObject * @return ActionGroupObject */ - private function extendActionGroup($actionGroupObject) + private function extendActionGroup($actionGroupObject): ActionGroupObject { if ($actionGroupObject->getParentName() !== null) { return $this->extendUtil->extendActionGroup($actionGroupObject); From c83e4236e04062a212491de246adb39ed15f9e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Sat, 3 Nov 2018 22:33:49 +0200 Subject: [PATCH 26/63] Cleanup for SuiteObjectHandler class --- .../Suite/Handlers/SuiteObjectHandler.php | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php b/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php index d4b044cf8..c3fee572f 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php @@ -23,7 +23,7 @@ class SuiteObjectHandler implements ObjectHandlerInterface * * @var SuiteObjectHandler */ - private static $SUITE_OBJECT_HANLDER_INSTANCE; + private static $instance; /** * Array of suite objects keyed by suite name. @@ -33,11 +33,17 @@ class SuiteObjectHandler implements ObjectHandlerInterface private $suiteObjects; /** - * SuiteObjectHandler constructor. + * Avoids instantiation of SuiteObjectHandler by new. */ private function __construct() { - // empty constructor + } + + /** + * Avoids instantiation of SuiteObjectHandler by clone. + */ + private function __clone() + { } /** @@ -46,14 +52,14 @@ private function __construct() * @return ObjectHandlerInterface * @throws XmlException */ - public static function getInstance() + public static function getInstance(): ObjectHandlerInterface { - if (self::$SUITE_OBJECT_HANLDER_INSTANCE == null) { - self::$SUITE_OBJECT_HANLDER_INSTANCE = new SuiteObjectHandler(); - self::$SUITE_OBJECT_HANLDER_INSTANCE->initSuiteData(); + if (self::$instance == null) { + self::$instance = new SuiteObjectHandler(); + self::$instance->initSuiteData(); } - return self::$SUITE_OBJECT_HANLDER_INSTANCE; + return self::$instance; } /** @@ -62,7 +68,7 @@ public static function getInstance() * @param string $objectName * @return SuiteObject */ - public function getObject($objectName) + public function getObject($objectName): SuiteObject { if (!array_key_exists($objectName, $this->suiteObjects)) { trigger_error("Suite ${objectName} is not defined.", E_USER_ERROR); @@ -75,7 +81,7 @@ public function getObject($objectName) * * @return array */ - public function getAllObjects() + public function getAllObjects(): array { return $this->suiteObjects; } @@ -85,7 +91,7 @@ public function getAllObjects() * * @return array */ - public function getAllTestReferences() + public function getAllTestReferences(): array { $testsReferencedInSuites = []; $suites = $this->getAllObjects(); From 6517bf054c5065beb3f3e5efbc0ce0ac180d2c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Mon, 5 Nov 2018 09:31:18 +0100 Subject: [PATCH 27/63] PHPCS Changes --- .../Suite/Handlers/SuiteObjectHandler.php | 2 ++ .../Suite/SuiteGenerator.php | 21 +++++++++++++------ .../Util/Logger/LoggingUtil.php | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php b/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php index c3fee572f..30a67c31d 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Suite/Handlers/SuiteObjectHandler.php @@ -34,6 +34,7 @@ class SuiteObjectHandler implements ObjectHandlerInterface /** * Avoids instantiation of SuiteObjectHandler by new. + * @return void */ private function __construct() { @@ -41,6 +42,7 @@ private function __construct() /** * Avoids instantiation of SuiteObjectHandler by clone. + * @return void */ private function __clone() { diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 7f3efdbfc..9f0045d19 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -33,7 +33,7 @@ class SuiteGenerator * * @var SuiteGenerator */ - private static $SUITE_GENERATOR_INSTANCE; + private static $instance; /** * Group Class Generator initialized in constructor. @@ -43,28 +43,37 @@ class SuiteGenerator private $groupClassGenerator; /** - * SuiteGenerator constructor. + * Avoids instantiation of LoggingUtil by new. + * @return void */ private function __construct() { $this->groupClassGenerator = new GroupClassGenerator(); } + /** + * Avoids instantiation of SuiteGenerator by clone. + * @return void + */ + private function __clone() + { + } + /** * Singleton method which is used to retrieve the instance of the suite generator. * * @return SuiteGenerator */ - public static function getInstance() + public static function getInstance(): SuiteGenerator { - if (!self::$SUITE_GENERATOR_INSTANCE) { + if (!self::$instance) { // clear any previous configurations before any generation occurs. self::clearPreviousGroupPreconditions(); self::clearPreviousSessionConfigEntries(); - self::$SUITE_GENERATOR_INSTANCE = new SuiteGenerator(); + self::$instance = new SuiteGenerator(); } - return self::$SUITE_GENERATOR_INSTANCE; + return self::$instance; } /** diff --git a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php index 6d959e43b..7ac128f28 100644 --- a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php @@ -41,6 +41,7 @@ public static function getInstance(): LoggingUtil /** * Avoids instantiation of LoggingUtil by new. + * @return void */ private function __construct() { @@ -48,6 +49,7 @@ private function __construct() /** * Avoids instantiation of LoggingUtil by clone. + * @return void */ private function __clone() { From d24ac0a79d556e2a49fe4f4dfa2d2cfb09dbc9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Mon, 5 Nov 2018 10:05:46 +0100 Subject: [PATCH 28/63] PHPUnit missing in dependencies --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c59fd3279..c7f63b32c 100755 --- a/composer.json +++ b/composer.json @@ -30,6 +30,7 @@ "goaop/framework": "2.2.0", "codacy/coverage": "^1.4", "phpmd/phpmd": "^2.6.0", + "phpunit/phpunit": "~6.5.0", "rregeer/phpunit-coverage-check": "^0.1.4", "php-coveralls/php-coveralls": "^1.0", "symfony/stopwatch": "~3.4.6" From 0fe21e944f6fbf7092cdd1ba0ef85853731f02d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Sat, 3 Nov 2018 15:45:06 +0200 Subject: [PATCH 29/63] Method arguments alignment to comply with PHPCS --- .../DataGenerator/Persist/Curl/AdminExecutor.php | 6 +++--- .../DataGenerator/Persist/Curl/FrontendExecutor.php | 2 +- .../DataGenerator/Persist/Curl/WebapiExecutor.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php index 91a0b8f4b..1f7ae70d7 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php @@ -109,9 +109,9 @@ private function setFormKey() * Send request to the remote server. * * @param string $url - * @param array $data + * @param array $data * @param string $method - * @param array $headers + * @param array $headers * @return void * @throws TestFrameworkException */ @@ -167,7 +167,7 @@ public function read($successRegex = null, $returnRegex = null) /** * Add additional option to cURL. * - * @param integer $option CURLOPT_* constants. + * @param integer $option CURLOPT_* constants. * @param integer|string|boolean|array $value * @return void */ diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php index 806507656..0a82e88a6 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php @@ -85,7 +85,7 @@ private function authorize() $this->transport->write($url); $this->read(); - $url = $this->getBaseUrl() . 'customer/account/loginPost/'; + $url = $this->getBaseUrl() . 'customer/account/loginPost/'; $data = [ 'login[username]' => $this->customerEmail, 'login[password]' => $this->customerPassword, diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php index 6efd3a173..5eb877443 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php @@ -81,7 +81,7 @@ public function getBaseUrl(): string } if ($webapiPort) { - $baseUrl = rtrim($baseUrl,'/').':'.$webapiPort.'/'; + $baseUrl = rtrim($baseUrl, '/') . ':' . $webapiPort . '/'; } return $baseUrl; @@ -175,7 +175,7 @@ public function getFormattedUrl($resource) if ($this->storeCode != null) { $urlResult .= $this->storeCode . "/"; } - $urlResult.= trim($resource, "/"); + $urlResult .= trim($resource, "/"); return $urlResult; } } From 5193f1e48913fdc2b9d8287ab8efe01de2f34e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Mon, 5 Nov 2018 10:16:56 +0100 Subject: [PATCH 30/63] Composer lock update after adding PHPUnit to dependencies. --- composer.lock | 493 ++++++++++++++++++++------------------------------ 1 file changed, 197 insertions(+), 296 deletions(-) diff --git a/composer.lock b/composer.lock index ae923f943..b7c6f58a4 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": "d733d1bb277b1397e891340fed0877a2", + "content-hash": "5ef6800d76e663122dad73ca097046ad", "packages": [ { "name": "allure-framework/allure-codeception", @@ -349,16 +349,16 @@ }, { "name": "consolidation/config", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "c9fc25e9088a708637e18a256321addc0670e578" + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/c9fc25e9088a708637e18a256321addc0670e578", - "reference": "c9fc25e9088a708637e18a256321addc0670e578", + "url": "https://api.github.com/repos/consolidation/config/zipball/925231dfff32f05b787e1fddb265e789b939cf4c", + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c", "shasum": "" }, "require": { @@ -399,7 +399,7 @@ } ], "description": "Provide configuration services for a commandline tool.", - "time": "2018-08-07T22:57:00+00:00" + "time": "2018-10-24T17:55:35+00:00" }, { "name": "consolidation/log", @@ -452,19 +452,20 @@ }, { "name": "consolidation/output-formatters", - "version": "3.2.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5" + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/d78ef59aea19d3e2e5a23f90a055155ee78a0ad5", - "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", "shasum": "" }, "require": { + "dflydev/dot-access-data": "^1.1.0", "php": ">=5.4.0", "symfony/console": "^2.8|^3|^4", "symfony/finder": "^2.5|^3|^4" @@ -503,7 +504,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2018-05-25T18:02:34+00:00" + "time": "2018-10-19T22:35:38+00:00" }, { "name": "consolidation/robo", @@ -588,16 +589,16 @@ }, { "name": "consolidation/self-update", - "version": "1.1.3", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/consolidation/self-update.git", - "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318" + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/self-update/zipball/de33822f907e0beb0ffad24cf4b1b4fae5ada318", - "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", "shasum": "" }, "require": { @@ -634,7 +635,7 @@ } ], "description": "Provides a self:update command for Symfony Console applications.", - "time": "2018-08-24T17:01:46+00:00" + "time": "2018-10-28T01:52:03+00:00" }, { "name": "container-interop/container-interop", @@ -728,30 +729,30 @@ }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -792,24 +793,24 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2017-12-06T07:11:42+00:00" }, { "name": "doctrine/collections", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/coding-standard": "~0.1@dev", @@ -859,36 +860,36 @@ "collections", "iterator" ], - "time": "2017-01-03T10:49:41+00:00" + "time": "2017-07-22T10:37:32+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -913,7 +914,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "doctrine/lexer", @@ -1477,16 +1478,16 @@ }, { "name": "jms/metadata", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/metadata.git", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab" + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8", "shasum": "" }, "require": { @@ -1509,9 +1510,13 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" @@ -1524,7 +1529,7 @@ "xml", "yaml" ], - "time": "2016-12-05T10:18:33+00:00" + "time": "2018-10-26T12:40:10+00:00" }, { "name": "jms/parser-lib", @@ -1712,16 +1717,16 @@ }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1786,7 +1791,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "moontoast/math", @@ -1885,25 +1890,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -1926,7 +1934,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "paragonie/random_compat", @@ -3569,25 +3577,25 @@ }, { "name": "symfony/browser-kit", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0" + "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/f6668d1a6182d5a8dec65a1c863a4c1d963816c0", - "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd", + "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/dom-crawler": "~2.8|~3.0|~4.0" + "php": "^7.1.3", + "symfony/dom-crawler": "~3.4|~4.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0", - "symfony/process": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" }, "suggest": { "symfony/process": "" @@ -3595,7 +3603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3622,25 +3630,24 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-07-26T09:10:45+00:00" }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3649,11 +3656,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3664,7 +3671,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3691,29 +3698,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-31T09:30:44+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" + "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/d67de79a70a27d93c92c47f37ece958bf8de4d8a", + "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3744,85 +3751,29 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.17", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722" + "reference": "80e60271bb288de2a2259662cff125cff4f93f95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c705bee03ade5b47c087807dd9ffaaec8dda2722", - "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95", + "reference": "80e60271bb288de2a2259662cff125cff4f93f95", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3830,7 +3781,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3857,34 +3808,34 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "552541dad078c85d9414b09c041ede488b456cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/552541dad078c85d9414b09c041ede488b456cd5", + "reference": "552541dad078c85d9414b09c041ede488b456cd5", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3893,7 +3844,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3920,30 +3871,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-10-10T13:52:42+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3970,29 +3921,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-30T13:18:25+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "url": "https://api.github.com/repos/symfony/finder/zipball/1f17195b44543017a9c9b2d437c670627e96ad06", + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4019,34 +3970,34 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" + "time": "2018-10-03T08:47:56+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1" + "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a4498236ade473c52b92d509303e5fd1b211ab1", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/82d494c1492b0dd24bbc5c2d963fb02eb44491af", + "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php70": "~1.6" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.8|~3.0|~4.0" + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4073,11 +4024,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:48:18+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -4135,16 +4086,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -4190,88 +4141,29 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.9.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0|~9.99", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/process", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/process/zipball/3e83acef94d979b1de946599ef86b3a352abcdc9", + "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4298,11 +4190,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-14T20:48:13+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -4503,16 +4395,16 @@ "packages-dev": [ { "name": "brainmaestro/composer-git-hooks", - "version": "v2.5.0", + "version": "v2.6.0", "source": { "type": "git", "url": "https://github.com/BrainMaestro/composer-git-hooks.git", - "reference": "5b2feb35fa8d460b14fc71792aca57f97d349430" + "reference": "1ae36cc7c1a4387f026e5f085b3ba63fdf912cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/BrainMaestro/composer-git-hooks/zipball/5b2feb35fa8d460b14fc71792aca57f97d349430", - "reference": "5b2feb35fa8d460b14fc71792aca57f97d349430", + "url": "https://api.github.com/repos/BrainMaestro/composer-git-hooks/zipball/1ae36cc7c1a4387f026e5f085b3ba63fdf912cb7", + "reference": "1ae36cc7c1a4387f026e5f085b3ba63fdf912cb7", "shasum": "" }, "require": { @@ -4530,7 +4422,16 @@ "extra": { "hooks": { "pre-commit": "composer check-style", - "pre-push": "composer test" + "pre-push": [ + "composer test", + "appver=$(grep -o -P '\\d.\\d.\\d' cghooks)", + "tag=$(git tag --sort=-v:refname | head -n 1 | tr -d v)", + "if [ \"$tag\" != \"$appver\" ]; then", + "echo \"The most recent tag v$tag does not match the application version $appver\n\"", + "sed -i -E \"s/$appver/$tag/\" cghooks", + "exit 1", + "fi" + ] } }, "autoload": { @@ -4557,7 +4458,7 @@ "composer", "git" ], - "time": "2018-09-02T01:27:40+00:00" + "time": "2018-10-28T02:55:04+00:00" }, { "name": "codacy/coverage", @@ -4606,16 +4507,16 @@ }, { "name": "codeception/aspect-mock", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/Codeception/AspectMock.git", - "reference": "061386697d2f47c4d3c695e28ee23a68a2383199" + "reference": "130afd10a3d8131d267f393ee1ec322e3e583d67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/061386697d2f47c4d3c695e28ee23a68a2383199", - "reference": "061386697d2f47c4d3c695e28ee23a68a2383199", + "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/130afd10a3d8131d267f393ee1ec322e3e583d67", + "reference": "130afd10a3d8131d267f393ee1ec322e3e583d67", "shasum": "" }, "require": { @@ -4646,7 +4547,7 @@ } ], "description": "Experimental Mocking Framework powered by Aspects", - "time": "2018-07-31T20:44:39+00:00" + "time": "2018-10-07T16:21:11+00:00" }, { "name": "doctrine/cache", @@ -5441,32 +5342,31 @@ }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -5474,7 +5374,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -5501,29 +5401,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "aea20fef4e92396928b5db175788b90234c0270d" + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", - "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e72ee2c23d952e4c368ee98610fa22b79b89b483", + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", + "symfony/config": "<4.1.1", + "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, @@ -5531,8 +5431,8 @@ "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/config": "~4.1", + "symfony/expression-language": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -5545,7 +5445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -5572,11 +5472,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-31T10:54:16+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -5670,7 +5570,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0" + "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0", + "ext-curl": "*" }, "platform-dev": [] } From 37fbc613095f801ceb135e941eeb02858fcf87b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Mon, 5 Nov 2018 10:19:38 +0100 Subject: [PATCH 31/63] Composer lock update after adding PHPUnit to dependencies. --- composer.lock | 490 ++++++++++++++++++++------------------------------ 1 file changed, 195 insertions(+), 295 deletions(-) diff --git a/composer.lock b/composer.lock index ae923f943..98af9fa15 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": "d733d1bb277b1397e891340fed0877a2", + "content-hash": "e45d8a8ff9e4619b02437ef720399cf8", "packages": [ { "name": "allure-framework/allure-codeception", @@ -349,16 +349,16 @@ }, { "name": "consolidation/config", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "c9fc25e9088a708637e18a256321addc0670e578" + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/c9fc25e9088a708637e18a256321addc0670e578", - "reference": "c9fc25e9088a708637e18a256321addc0670e578", + "url": "https://api.github.com/repos/consolidation/config/zipball/925231dfff32f05b787e1fddb265e789b939cf4c", + "reference": "925231dfff32f05b787e1fddb265e789b939cf4c", "shasum": "" }, "require": { @@ -399,7 +399,7 @@ } ], "description": "Provide configuration services for a commandline tool.", - "time": "2018-08-07T22:57:00+00:00" + "time": "2018-10-24T17:55:35+00:00" }, { "name": "consolidation/log", @@ -452,19 +452,20 @@ }, { "name": "consolidation/output-formatters", - "version": "3.2.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5" + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/d78ef59aea19d3e2e5a23f90a055155ee78a0ad5", - "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", + "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", "shasum": "" }, "require": { + "dflydev/dot-access-data": "^1.1.0", "php": ">=5.4.0", "symfony/console": "^2.8|^3|^4", "symfony/finder": "^2.5|^3|^4" @@ -503,7 +504,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2018-05-25T18:02:34+00:00" + "time": "2018-10-19T22:35:38+00:00" }, { "name": "consolidation/robo", @@ -588,16 +589,16 @@ }, { "name": "consolidation/self-update", - "version": "1.1.3", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/consolidation/self-update.git", - "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318" + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/self-update/zipball/de33822f907e0beb0ffad24cf4b1b4fae5ada318", - "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/a1c273b14ce334789825a09d06d4c87c0a02ad54", + "reference": "a1c273b14ce334789825a09d06d4c87c0a02ad54", "shasum": "" }, "require": { @@ -634,7 +635,7 @@ } ], "description": "Provides a self:update command for Symfony Console applications.", - "time": "2018-08-24T17:01:46+00:00" + "time": "2018-10-28T01:52:03+00:00" }, { "name": "container-interop/container-interop", @@ -728,30 +729,30 @@ }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -792,24 +793,24 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2017-12-06T07:11:42+00:00" }, { "name": "doctrine/collections", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/coding-standard": "~0.1@dev", @@ -859,36 +860,36 @@ "collections", "iterator" ], - "time": "2017-01-03T10:49:41+00:00" + "time": "2017-07-22T10:37:32+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -913,7 +914,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "doctrine/lexer", @@ -1477,16 +1478,16 @@ }, { "name": "jms/metadata", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/metadata.git", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab" + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8", "shasum": "" }, "require": { @@ -1509,9 +1510,13 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" @@ -1524,7 +1529,7 @@ "xml", "yaml" ], - "time": "2016-12-05T10:18:33+00:00" + "time": "2018-10-26T12:40:10+00:00" }, { "name": "jms/parser-lib", @@ -1712,16 +1717,16 @@ }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1786,7 +1791,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "moontoast/math", @@ -1885,25 +1890,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -1926,7 +1934,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "paragonie/random_compat", @@ -3569,25 +3577,25 @@ }, { "name": "symfony/browser-kit", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0" + "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/f6668d1a6182d5a8dec65a1c863a4c1d963816c0", - "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd", + "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/dom-crawler": "~2.8|~3.0|~4.0" + "php": "^7.1.3", + "symfony/dom-crawler": "~3.4|~4.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0", - "symfony/process": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" }, "suggest": { "symfony/process": "" @@ -3595,7 +3603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3622,25 +3630,24 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-07-26T09:10:45+00:00" }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3649,11 +3656,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3664,7 +3671,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3691,29 +3698,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-31T09:30:44+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" + "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/d67de79a70a27d93c92c47f37ece958bf8de4d8a", + "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3744,85 +3751,29 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.17", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722" + "reference": "80e60271bb288de2a2259662cff125cff4f93f95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c705bee03ade5b47c087807dd9ffaaec8dda2722", - "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95", + "reference": "80e60271bb288de2a2259662cff125cff4f93f95", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3830,7 +3781,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3857,34 +3808,34 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "552541dad078c85d9414b09c041ede488b456cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/552541dad078c85d9414b09c041ede488b456cd5", + "reference": "552541dad078c85d9414b09c041ede488b456cd5", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3893,7 +3844,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3920,30 +3871,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-10-10T13:52:42+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3970,29 +3921,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-30T13:18:25+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "url": "https://api.github.com/repos/symfony/finder/zipball/1f17195b44543017a9c9b2d437c670627e96ad06", + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4019,34 +3970,34 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" + "time": "2018-10-03T08:47:56+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1" + "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a4498236ade473c52b92d509303e5fd1b211ab1", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/82d494c1492b0dd24bbc5c2d963fb02eb44491af", + "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php70": "~1.6" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.8|~3.0|~4.0" + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4073,11 +4024,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:48:18+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -4135,16 +4086,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -4190,88 +4141,29 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.9.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0|~9.99", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/process", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/process/zipball/3e83acef94d979b1de946599ef86b3a352abcdc9", + "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4298,11 +4190,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-14T20:48:13+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -4503,16 +4395,16 @@ "packages-dev": [ { "name": "brainmaestro/composer-git-hooks", - "version": "v2.5.0", + "version": "v2.6.0", "source": { "type": "git", "url": "https://github.com/BrainMaestro/composer-git-hooks.git", - "reference": "5b2feb35fa8d460b14fc71792aca57f97d349430" + "reference": "1ae36cc7c1a4387f026e5f085b3ba63fdf912cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/BrainMaestro/composer-git-hooks/zipball/5b2feb35fa8d460b14fc71792aca57f97d349430", - "reference": "5b2feb35fa8d460b14fc71792aca57f97d349430", + "url": "https://api.github.com/repos/BrainMaestro/composer-git-hooks/zipball/1ae36cc7c1a4387f026e5f085b3ba63fdf912cb7", + "reference": "1ae36cc7c1a4387f026e5f085b3ba63fdf912cb7", "shasum": "" }, "require": { @@ -4530,7 +4422,16 @@ "extra": { "hooks": { "pre-commit": "composer check-style", - "pre-push": "composer test" + "pre-push": [ + "composer test", + "appver=$(grep -o -P '\\d.\\d.\\d' cghooks)", + "tag=$(git tag --sort=-v:refname | head -n 1 | tr -d v)", + "if [ \"$tag\" != \"$appver\" ]; then", + "echo \"The most recent tag v$tag does not match the application version $appver\n\"", + "sed -i -E \"s/$appver/$tag/\" cghooks", + "exit 1", + "fi" + ] } }, "autoload": { @@ -4557,7 +4458,7 @@ "composer", "git" ], - "time": "2018-09-02T01:27:40+00:00" + "time": "2018-10-28T02:55:04+00:00" }, { "name": "codacy/coverage", @@ -4606,16 +4507,16 @@ }, { "name": "codeception/aspect-mock", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/Codeception/AspectMock.git", - "reference": "061386697d2f47c4d3c695e28ee23a68a2383199" + "reference": "130afd10a3d8131d267f393ee1ec322e3e583d67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/061386697d2f47c4d3c695e28ee23a68a2383199", - "reference": "061386697d2f47c4d3c695e28ee23a68a2383199", + "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/130afd10a3d8131d267f393ee1ec322e3e583d67", + "reference": "130afd10a3d8131d267f393ee1ec322e3e583d67", "shasum": "" }, "require": { @@ -4646,7 +4547,7 @@ } ], "description": "Experimental Mocking Framework powered by Aspects", - "time": "2018-07-31T20:44:39+00:00" + "time": "2018-10-07T16:21:11+00:00" }, { "name": "doctrine/cache", @@ -5441,32 +5342,31 @@ }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -5474,7 +5374,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -5501,29 +5401,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "aea20fef4e92396928b5db175788b90234c0270d" + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", - "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e72ee2c23d952e4c368ee98610fa22b79b89b483", + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", + "symfony/config": "<4.1.1", + "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, @@ -5531,8 +5431,8 @@ "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/config": "~4.1", + "symfony/expression-language": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -5545,7 +5445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -5572,11 +5472,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-31T10:54:16+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", From 198aeaa3360eb95b2df0a9f4ec5c15f8ec40924a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Mon, 5 Nov 2018 12:31:20 +0100 Subject: [PATCH 32/63] Fix PHPUnit errors --- .../Suite/Handlers/SuiteObjectHandlerTest.php | 2 +- .../Suite/SuiteGeneratorTest.php | 4 +- .../Test/Util/ObjectExtensionUtilTest.php | 59 ++++++++++--------- dev/tests/unit/Util/TestLoggingUtil.php | 10 ++-- .../Handlers/ActionGroupObjectHandler.php | 2 +- 5 files changed, 40 insertions(+), 37 deletions(-) diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Suite/Handlers/SuiteObjectHandlerTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Suite/Handlers/SuiteObjectHandlerTest.php index 8133c82a3..99125a9e3 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Suite/Handlers/SuiteObjectHandlerTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Suite/Handlers/SuiteObjectHandlerTest.php @@ -85,7 +85,7 @@ private function setMockTestAndSuiteParserOutput($testData, $suiteData) $property->setValue(null); // clear suite object handler value to inject parsed content - $property = new \ReflectionProperty(SuiteObjectHandler::class, 'SUITE_OBJECT_HANLDER_INSTANCE'); + $property = new \ReflectionProperty(SuiteObjectHandler::class, 'instance'); $property->setAccessible(true); $property->setValue(null); diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php index 7bef700ab..eb6298afc 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php @@ -149,7 +149,7 @@ public function testGenerateEmptySuite() */ private function setMockTestAndSuiteParserOutput($testData, $suiteData) { - $property = new \ReflectionProperty(SuiteGenerator::class, 'SUITE_GENERATOR_INSTANCE'); + $property = new \ReflectionProperty(SuiteGenerator::class, 'instance'); $property->setAccessible(true); $property->setValue(null); @@ -159,7 +159,7 @@ private function setMockTestAndSuiteParserOutput($testData, $suiteData) $property->setValue(null); // clear suite object handler value to inject parsed content - $property = new \ReflectionProperty(SuiteObjectHandler::class, 'SUITE_OBJECT_HANLDER_INSTANCE'); + $property = new \ReflectionProperty(SuiteObjectHandler::class, 'instance'); $property->setAccessible(true); $property->setValue(null); diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ObjectExtensionUtilTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ObjectExtensionUtilTest.php index c3d418516..b023b16c7 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ObjectExtensionUtilTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ObjectExtensionUtilTest.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace tests\unit\Magento\FunctionalTestFramework\Test\Util; use AspectMock\Proxy\Verifier; @@ -31,6 +32,15 @@ public function setUp() TestLoggingUtil::getInstance()->setMockLoggingUtil(); } + /** + * After class functionality + * @return void + */ + public static function tearDownAfterClass() + { + TestLoggingUtil::getInstance()->clearMockLoggingUtil(); + } + /** * Tests generating a test that extends another test * @throws \Exception @@ -38,19 +48,19 @@ public function setUp() public function testGenerateExtendedTest() { $mockActions = [ - "mockStep" => ["nodeName" => "mockNode", "stepKey" => "mockStep"] + "mockStep" => ["nodeName" => "mockNode", "stepKey" => "mockStep"] ]; $testDataArrayBuilder = new TestDataArrayBuilder(); $mockSimpleTest = $testDataArrayBuilder ->withName('simpleTest') - ->withAnnotations(['title'=>[['value' => 'simpleTest']]]) + ->withAnnotations(['title' => [['value' => 'simpleTest']]]) ->withTestActions($mockActions) ->build(); $mockExtendedTest = $testDataArrayBuilder ->withName('extendedTest') - ->withAnnotations(['title'=>[['value' => 'extendedTest']]]) + ->withAnnotations(['title' => [['value' => 'extendedTest']]]) ->withTestReference("simpleTest") ->build(); @@ -88,14 +98,14 @@ public function testGenerateExtendedWithHooks() $testDataArrayBuilder = new TestDataArrayBuilder(); $mockSimpleTest = $testDataArrayBuilder ->withName('simpleTest') - ->withAnnotations(['title'=>[['value' => 'simpleTest']]]) + ->withAnnotations(['title' => [['value' => 'simpleTest']]]) ->withBeforeHook($mockBeforeHooks) ->withAfterHook($mockAfterHooks) ->build(); $mockExtendedTest = $testDataArrayBuilder ->withName('extendedTest') - ->withAnnotations(['title'=>[['value' => 'extendedTest']]]) + ->withAnnotations(['title' => [['value' => 'extendedTest']]]) ->withTestReference("simpleTest") ->build(); @@ -117,7 +127,7 @@ public function testGenerateExtendedWithHooks() $this->assertArrayHasKey("mockStepBefore", $testObject->getHooks()['before']->getActions()); $this->assertArrayHasKey("mockStepAfter", $testObject->getHooks()['after']->getActions()); } - + /** * Tests generating a test that extends another test * @throws \Exception @@ -158,14 +168,14 @@ public function testExtendingExtendedTest() $mockSimpleTest = $testDataArrayBuilder ->withName('simpleTest') - ->withAnnotations(['title'=>[['value' => 'simpleTest']]]) + ->withAnnotations(['title' => [['value' => 'simpleTest']]]) ->withTestActions() ->withTestReference("anotherTest") ->build(); $mockExtendedTest = $testDataArrayBuilder ->withName('extendedTest') - ->withAnnotations(['title'=>[['value' => 'extendedTest']]]) + ->withAnnotations(['title' => [['value' => 'extendedTest']]]) ->withTestReference("simpleTest") ->build(); @@ -347,7 +357,7 @@ private function setMockTestOutput($testData = null, $actionGroupData = null) $property->setValue(null); // clear test object handler value to inject parsed content - $property = new \ReflectionProperty(ActionGroupObjectHandler::class, 'ACTION_GROUP_OBJECT_HANDLER'); + $property = new \ReflectionProperty(ActionGroupObjectHandler::class, 'instance'); $property->setAccessible(true); $property->setValue(null); @@ -358,28 +368,21 @@ private function setMockTestOutput($testData = null, $actionGroupData = null) )->make(); $instance = AspectMock::double( ObjectManager::class, - ['create' => function ($clazz) use ( - $mockDataParser, - $mockActionGroupParser - ) { - if ($clazz == TestDataParser::class) { - return $mockDataParser; + [ + 'create' => function ($className) use ( + $mockDataParser, + $mockActionGroupParser + ) { + if ($className == TestDataParser::class) { + return $mockDataParser; + } + if ($className == ActionGroupDataParser::class) { + return $mockActionGroupParser; + } } - if ($clazz == ActionGroupDataParser::class) { - return $mockActionGroupParser; - } - }] + ] )->make(); // bypass the private constructor AspectMock::double(ObjectManagerFactory::class, ['getObjectManager' => $instance]); } - - /** - * After class functionality - * @return void - */ - public static function tearDownAfterClass() - { - TestLoggingUtil::getInstance()->clearMockLoggingUtil(); - } } diff --git a/dev/tests/unit/Util/TestLoggingUtil.php b/dev/tests/unit/Util/TestLoggingUtil.php index 655048552..6d2e4b964 100644 --- a/dev/tests/unit/Util/TestLoggingUtil.php +++ b/dev/tests/unit/Util/TestLoggingUtil.php @@ -18,7 +18,7 @@ class TestLoggingUtil extends Assert /** * @var TestLoggingUtil */ - private static $INSTANCE; + private static $instance; /** * @var TestHandler @@ -40,11 +40,11 @@ private function __construct() */ public static function getInstance() { - if (self::$INSTANCE == null) { - self::$INSTANCE = new TestLoggingUtil(); + if (self::$instance == null) { + self::$instance = new TestLoggingUtil(); } - return self::$INSTANCE; + return self::$instance; } /** @@ -61,7 +61,7 @@ public function setMockLoggingUtil() LoggingUtil::class, ['getLogger' => $testLogger] )->make(); - $property = new \ReflectionProperty(LoggingUtil::class, 'INSTANCE'); + $property = new \ReflectionProperty(LoggingUtil::class, 'instance'); $property->setAccessible(true); $property->setValue($mockLoggingUtil); } diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php index d30f5892d..d4a46adb9 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -72,7 +72,7 @@ private function __construct() * @param string $actionGroupName * @return ActionGroupObject */ - public function getObject($actionGroupName): ActionGroupObject + public function getObject($actionGroupName) { if (array_key_exists($actionGroupName, $this->actionGroups)) { $actionGroupObject = $this->actionGroups[$actionGroupName]; From 37bdd100dab03c9f5cd2dd738e6a84e52f2d0624 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 6 Nov 2018 10:49:54 -0600 Subject: [PATCH 33/63] MQE-1178: MFTF Generate:Suite Does Not Generate Extended Items Correctly --- .../Test/Handlers/TestObjectHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php index 19cd025c9..a508d8fd4 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php @@ -110,7 +110,7 @@ public function getTestsByGroup($groupName) foreach ($this->tests as $test) { /** @var TestObject $test */ if (in_array($groupName, $test->getAnnotationByName('group'))) { - $relevantTests[$test->getName()] = $test; + $relevantTests[$test->getName()] = $this->extendTest($test); continue; } } From 2fe867cf0f9afa7a207c9aed8d0bc097c4d4f504 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 23 Oct 2018 10:44:24 -0500 Subject: [PATCH 34/63] MQE-1185: MFTF DragAndDrop Action Is Not Using X, Y Offsets Correctly - bug fix --- .../Module/MagentoWebDriver.php | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index c64aa3721..452a40bde 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -596,23 +596,29 @@ public function _before(TestInterface $test) */ public function dragAndDrop($source, $target, $xOffset = null, $yOffset = null) { - if ($xOffset !== null || $yOffset !== null) { - $snodes = $this->matchFirstOrFail($this->baseElement, $source); - $tnodes = $this->matchFirstOrFail($this->baseElement, $target); + if ($xOffset === null && $yOffset === null) { + parent::dragAndDrop($source, $target); + } else { + $sNode = $this->matchFirstOrFail($this->baseElement, $source); + $tNode = $this->matchFirstOrFail($this->baseElement, $target); - $targetX = intval($tnodes->getLocation()->getX() + $xOffset); - $targetY = intval($tnodes->getLocation()->getY() + $yOffset); + $sHeight = $sNode->getSize()->getHeight(); + $sWidth = $sNode->getSize()->getWidth(); - $travelX = intval($targetX - $snodes->getLocation()->getX()); - $travelY = intval($targetY - $snodes->getLocation()->getY()); + $travelX = intval($tNode->getLocation()->getX() - $sNode->getLocation()->getX() + $xOffset); + $travelY = intval($tNode->getLocation()->getY() - $sNode->getLocation()->getY() + $yOffset); $action = new WebDriverActions($this->webDriver); - $action->moveToElement($snodes)->perform(); - $action->clickAndHold($snodes)->perform(); - $action->moveByOffset($travelX, $travelY)->perform(); - $action->release()->perform(); - } else { - parent::dragAndDrop($source, $target); + if ($travelX >0 && $travelY >0 && $travelX < $sWidth && $travelY < $sHeight) { + // Perform separate action steps when dragging and dropping inside the source element boundary + $action->moveToElement($sNode)->perform(); + $action->clickAndHold($sNode)->perform(); + $action->moveByOffset($travelX, $travelY)->perform(); + $action->release()->perform(); + } else { + // Call dragAndDropBy otherwise + $action->dragAndDropBy($sNode, $travelX, $travelY)->perform(); + } } } From d6488bdc6ee1a30d6b641a3272e00ff5a8a79cfd Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 8 Nov 2018 16:08:07 -0600 Subject: [PATCH 35/63] MQE-1279: MFTF will not output any test results if instance respondes with 503 - Removed outdated MagentoRestDriver.php --- .../Module/MagentoRestDriver.php | 673 ------------------ 1 file changed, 673 deletions(-) delete mode 100644 src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php deleted file mode 100644 index 513d92dfb..000000000 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php +++ /dev/null @@ -1,673 +0,0 @@ - '', - 'username' => '', - 'password' => '' - ]; - - /** - * Admin tokens for Magento webapi access. - * - * @var array - */ - protected static $adminTokens = []; - - /** - * Before suite. - * - * @param array $settings - * @return void - */ - public function _beforeSuite($settings = []) - { - parent::_beforeSuite($settings); - if (empty($this->config['url']) || empty($this->config['username']) || empty($this->config['password'])) { - return; - } - - $this->config = ConfigSanitizerUtil::sanitizeWebDriverConfig($this->config, ['url']); - - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendPOST( - 'integration/admin/token', - ['username' => $this->config['username'], 'password' => $this->config['password']] - ); - $token = substr($this->grabResponse(), 1, strlen($this->grabResponse())-2); - $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - $this->haveHttpHeader('Authorization', 'Bearer ' . $token); - self::$adminTokens[$this->config['username']] = $token; - // @codingStandardsIgnoreStart - $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoSequence')->_initialize(); - // @codingStandardsIgnoreEnd - } - - /** - * After suite. - * @return void - */ - public function _afterSuite() - { - parent::_afterSuite(); - $this->deleteHeader('Authorization'); - } - - /** - * Get admin auth token by username and password. - * - * @param string $username - * @param string $password - * @param boolean $newToken - * @return string - * @part json - * @part xml - */ - public function getAdminAuthToken($username = null, $password = null, $newToken = false) - { - $username = $username !== null ? $username : $this->config['username']; - $password = $password !== null ? $password : $this->config['password']; - - // Use existing token if it exists - if (!$newToken - && (isset(self::$adminTokens[$username]) || array_key_exists($username, self::$adminTokens))) { - return self::$adminTokens[$username]; - } - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendPOST('integration/admin/token', ['username' => $username, 'password' => $password]); - $token = substr($this->grabResponse(), 1, strlen($this->grabResponse())-2); - $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - self::$adminTokens[$username] = $token; - return $token; - } - - /** - * Admin token authentication for a given user. - * - * @param string $username - * @param string $password - * @param boolean $newToken - * @part json - * @part xml - * @return void - */ - public function amAdminTokenAuthenticated($username = null, $password = null, $newToken = false) - { - $username = $username !== null ? $username : $this->config['username']; - $password = $password !== null ? $password : $this->config['password']; - - $this->haveHttpHeader('Content-Type', 'application/json'); - if ($newToken || !isset(self::$adminTokens[$username])) { - $this->sendPOST('integration/admin/token', ['username' => $username, 'password' => $password]); - $token = substr($this->grabResponse(), 1, strlen($this->grabResponse()) - 2); - $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - self::$adminTokens[$username] = $token; - } - $this->amBearerAuthenticated(self::$adminTokens[$username]); - } - - /** - * Send REST API request. - * - * @param string $endpoint - * @param string $httpMethod - * @param array $params - * @param string $grabByJsonPath - * @param boolean $decode - * @return mixed - * @throws \LogicException - * @part json - * @part xml - */ - public function sendRestRequest($endpoint, $httpMethod, $params = [], $grabByJsonPath = null, $decode = true) - { - $this->amAdminTokenAuthenticated(); - switch ($httpMethod) { - case self::HTTP_METHOD_GET: - $this->sendGET($endpoint, $params); - break; - case self::HTTP_METHOD_POST: - $this->sendPOST($endpoint, $params); - break; - case self::HTTP_METHOD_PUT: - $this->sendPUT($endpoint, $params); - break; - case self::HTTP_METHOD_DELETE: - $this->sendDELETE($endpoint, $params); - break; - default: - throw new \LogicException("HTTP method '{$httpMethod}' is not supported."); - } - $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - - if (!$decode && $grabByJsonPath === null) { - return $this->grabResponse(); - } elseif (!$decode) { - return $this->grabDataFromResponseByJsonPath($grabByJsonPath); - } else { - return \GuzzleHttp\json_decode($this->grabResponse()); - } - } - - /** - * Create a category in Magento. - * - * @param array $categoryData - * @return array|mixed - * @part json - * @part xml - */ - public function requireCategory($categoryData = []) - { - if (!$categoryData) { - $categoryData = $this->getCategoryApiData(); - } - $categoryData = $this->sendRestRequest( - self::$categoryEndpoint, - self::HTTP_METHOD_POST, - ['category' => $categoryData] - ); - return $categoryData; - } - - /** - * Create a simple product in Magento. - * - * @param integer $categoryId - * @param array $simpleProductData - * @return array|mixed - * @part json - * @part xml - */ - public function requireSimpleProduct($categoryId = 0, $simpleProductData = []) - { - if (!$simpleProductData) { - $simpleProductData = $this->getProductApiData('simple', $categoryId); - } - $simpleProductData = $this->sendRestRequest( - self::$productEndpoint, - self::HTTP_METHOD_POST, - ['product' => $simpleProductData] - ); - return $simpleProductData; - } - - /** - * Create a configurable product in Magento. - * - * @param integer $categoryId - * @param array $configurableProductData - * @return array|mixed - * @part json - * @part xml - */ - public function requireConfigurableProduct($categoryId = 0, $configurableProductData = []) - { - $configurableProductData = $this->getProductApiData('configurable', $categoryId, $configurableProductData); - $this->sendRestRequest( - self::$productEndpoint, - self::HTTP_METHOD_POST, - ['product' => $configurableProductData] - ); - - $attributeData = $this->getProductAttributeApiData(); - $attribute = $this->sendRestRequest( - self::$productAttributesEndpoint, - self::HTTP_METHOD_POST, - $attributeData - ); - $options = $this->sendRestRequest( - sprintf(self::$productAttributesOptionsEndpoint, $attribute->attribute_code), - self::HTTP_METHOD_GET - ); - - $attributeSetData = $this->getAssignAttributeToAttributeSetApiData($attribute->attribute_code); - $this->sendRestRequest( - self::$productAttributeSetEndpoint, - self::HTTP_METHOD_POST, - $attributeSetData - ); - - $simpleProduct1Data = $this->getProductApiData('simple', $categoryId); - array_push( - $simpleProduct1Data['custom_attributes'], - [ - 'attribute_code' => $attribute->attribute_code, - 'value' => $options[1]->value - ] - ); - $simpleProduct1Id = $this->sendRestRequest( - self::$productEndpoint, - self::HTTP_METHOD_POST, - ['product' => $simpleProduct1Data] - )->id; - - $simpleProduct2Data = $this->getProductApiData('simple', $categoryId); - array_push( - $simpleProduct2Data['custom_attributes'], - [ - 'attribute_code' => $attribute->attribute_code, - 'value' => $options[2]->value - ] - ); - $simpleProduct2Id = $this->sendRestRequest( - self::$productEndpoint, - self::HTTP_METHOD_POST, - ['product' => $simpleProduct2Data] - )->id; - - $tAttributes[] = [ - 'id' => $attribute->attribute_id, - 'code' => $attribute->attribute_code - ]; - - $tOptions = [ - intval($options[1]->value), - intval($options[2]->value) - ]; - - $configOptions = $this->getConfigurableProductOptionsApiData($tAttributes, $tOptions); - - $configurableProductData = $this->getConfigurableProductApiData( - $configOptions, - [$simpleProduct1Id, $simpleProduct2Id], - $configurableProductData - ); - - $configurableProductData = $this->sendRestRequest( - self::$productEndpoint . '/' . $configurableProductData['sku'], - self::HTTP_METHOD_PUT, - ['product' => $configurableProductData] - ); - return $configurableProductData; - } - - /** - * Create a product attribute in Magento. - * - * @param string $code - * @return array|mixed - * @part json - * @part xml - */ - public function requireProductAttribute($code = 'attribute') - { - $attributeData = $this->getProductAttributeApiData($code); - $attributeData = $this->sendRestRequest( - self::$productAttributesEndpoint, - self::HTTP_METHOD_POST, - $attributeData - ); - return $attributeData; - } - - /** - * Create a customer in Magento. - * - * @param array $customerData - * @param string $password - * @return array|mixed - * @part json - * @part xml - */ - public function requireCustomer(array $customerData = [], $password = '123123qW') - { - if (!$customerData) { - $customerData = $this->getCustomerApiData(); - } - $customerData = $this->getCustomerApiDataWithPassword($customerData, $password); - $customerData = $this->sendRestRequest( - self::$customersEndpoint, - self::HTTP_METHOD_POST, - $customerData - ); - return $customerData; - } - - /** - * Get category api data. - * - * @param array $categoryData - * @return array - * @part json - * @part xml - */ - public function getCategoryApiData($categoryData = []) - { - $faker = \Faker\Factory::create(); - $sq = sqs(); - return array_replace_recursive( - [ - 'parent_id' => '2', - 'name' => 'category' . $sq, - 'is_active' => true, - 'include_in_menu' => true, - 'available_sort_by' => ['position', 'name'], - 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => 'category' . $sq], - ['attribute_code' => 'description', 'value' => $faker->text(20)], - ['attribute_code' => 'meta_title', 'value' => $faker->text(20)], - ['attribute_code' => 'meta_keywords', 'value' => $faker->text(20)], - ['attribute_code' => 'meta_description', 'value' => $faker->text(20)], - ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], - ['attribute_code' => 'landing_page', 'value' => ''], - ['attribute_code' => 'is_anchor', 'value' => '0'], - ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], - ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], - ['attribute_code' => 'custom_design', 'value' => ''], - ['attribute_code' => 'page_layout', 'value' => ''], - ['attribute_code' => 'custom_design_to', 'value' => $faker->date($format = 'm/d/Y')], - ['attribute_code' => 'custom_design_from', 'value' => $faker->date($format = 'm/d/Y', 'now')] - ] - ], - $categoryData - ); - } - - /** - * Get simple product api data. - * - * @param string $type - * @param integer $categoryId - * @param array $productData - * @return array - * @part json - * @part xml - */ - public function getProductApiData($type = 'simple', $categoryId = 0, $productData = []) - { - $faker = \Faker\Factory::create(); - $sq = sqs(); - return array_replace_recursive( - [ - 'sku' => $type . '_product_sku' . $sq, - 'name' => $type . '_product' . $sq, - 'visibility' => 4, - 'type_id' => $type, - 'price' => $faker->randomFloat(2, 1), - 'status' => 1, - 'attribute_set_id' => 4, - 'extension_attributes' => [ - 'stock_item' => ['is_in_stock' => 1, 'qty' => $faker->numberBetween(100, 9000)] - ], - 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => $type . '_product' . $sq], - ['attribute_code' => 'tax_class_id', 'value' => 2], - ['attribute_code' => 'category_ids', 'value' => $categoryId], - ], - ], - $productData - ); - } - - /** - * Get Customer Api data. - * - * @param array $customerData - * @return array - * @part json - * @part xml - */ - public function getCustomerApiData($customerData = []) - { - $faker = \Faker\Factory::create(); - return array_replace_recursive( - [ - 'firstname' => $faker->firstName, - 'middlename' => $faker->firstName, - 'lastname' => $faker->lastName, - 'email' => $faker->email, - 'gender' => rand(0, 1), - 'group_id' => 1, - 'store_id' => 1, - 'website_id' => 1, - 'custom_attributes' => [ - [ - 'attribute_code' => 'disable_auto_group_change', - 'value' => '0', - ], - ], - ], - $customerData - ); - } - - /** - * Get customer data including password. - * - * @param array $customerData - * @param string $password - * @return array - * @part json - * @part xml - */ - public function getCustomerApiDataWithPassword($customerData = [], $password = '123123qW') - { - return ['customer' => self::getCustomerApiData($customerData), 'password' => $password]; - } - - /** - * @param string $code - * @param array $attributeData - * @return array - * @part json - * @part xml - */ - public function getProductAttributeApiData($code = 'attribute', $attributeData = []) - { - $sq = sqs(); - return array_replace_recursive( - [ - 'attribute' => [ - 'attribute_code' => $code . $sq, - 'frontend_labels' => [ - [ - 'store_id' => 0, - 'label' => $code . $sq - ], - ], - 'is_required' => false, - 'is_unique' => false, - 'is_visible' => true, - 'scope' => 'global', - 'default_value' => '', - 'frontend_input' => 'select', - 'is_visible_on_front' => true, - 'is_searchable' => true, - 'is_visible_in_advanced_search' => true, - 'is_filterable' => true, - 'is_filterable_in_search' => true, - //'is_used_in_grid' => true, - //'is_visible_in_grid' => true, - //'is_filterable_in_grid' => true, - 'used_in_product_listing' => true, - 'is_used_for_promo_rules' => true, - 'options' => [ - [ - 'label' => 'option1', - 'value' => '', - 'sort_order' => 0, - 'is_default' => true, - 'store_labels' => [ - [ - 'store_id' => 0, - 'label' => 'option1' - ], - [ - 'store_id' => 1, - 'label' => 'option1' - ] - ] - ], - [ - 'label' => 'option2', - 'value' => '', - 'sort_order' => 1, - 'is_default' => false, - 'store_labels' => [ - [ - 'store_id' => 0, - 'label' => 'option2' - ], - [ - 'store_id' => 1, - 'label' => 'option2' - ] - ] - ] - ] - ], - ], - $attributeData - ); - } - - /** - * @param array $attributes - * @param array $optionIds - * @return array - * @part json - * @part xml - */ - public function getConfigurableProductOptionsApiData($attributes, $optionIds) - { - $configurableProductOptions = []; - foreach ($attributes as $attribute) { - $attributeItem = [ - 'attribute_id' => (string)$attribute['id'], - 'label' => $attribute['code'], - 'values' => [] - ]; - foreach ($optionIds as $optionId) { - $attributeItem['values'][] = ['value_index' => $optionId]; - } - $configurableProductOptions [] = $attributeItem; - } - return $configurableProductOptions; - } - - /** - * @param array $configurableProductOptions - * @param array $childProductIds - * @param array $configurableProduct - * @param integer $categoryId - * @return array - * @part json - * @part xml - */ - public function getConfigurableProductApiData( - array $configurableProductOptions, - array $childProductIds, - array $configurableProduct = [], - int $categoryId = 0 - ) { - if (!$configurableProduct) { - $configurableProduct = $this->getProductApiData('configurable', $categoryId); - } - $configurableProduct = array_merge_recursive( - $configurableProduct, - [ - 'extension_attributes' => [ - 'configurable_product_options' => $configurableProductOptions, - 'configurable_product_links' => $childProductIds, - ], - ] - ); - return $configurableProduct; - } - - /** - * @param string $attributeCode - * @param integer $attributeSetId - * @param integer $attributeGroupId - * @return array - * @part json - * @part xml - */ - public function getAssignAttributeToAttributeSetApiData( - $attributeCode, - int $attributeSetId = 4, - int $attributeGroupId = 7 - ) { - return [ - 'attributeSetId' => $attributeSetId, - 'attributeGroupId' => $attributeGroupId, - 'attributeCode' => $attributeCode, - 'sortOrder' => 0 - ]; - } -} From 5b34a47585e351b6df1f0be8dbcf1da41fa10227 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 9 Nov 2018 11:28:23 -0600 Subject: [PATCH 36/63] MQE-1178: MFTF Generate:Suite Does Not Generate Extended Items Correctly - added verification test --- dev/tests/_bootstrap.php | 3 +- .../ExtendedTestInSuiteChildTestCest.txt | 63 +++++++++++++++++++ .../Test/ExtendedFunctionalTest.xml | 28 +++++++++ .../Tests/SuiteGenerationTest.php | 39 ++++++++++++ .../_suite/functionalSuiteExtends.xml | 15 +++++ 5 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt create mode 100644 dev/tests/verification/_suite/functionalSuiteExtends.xml diff --git a/dev/tests/_bootstrap.php b/dev/tests/_bootstrap.php index b55f12c2b..4b9d04442 100644 --- a/dev/tests/_bootstrap.php +++ b/dev/tests/_bootstrap.php @@ -82,7 +82,8 @@ $paths = [ $suiteDirectory . DIRECTORY_SEPARATOR . 'functionalSuite.xml', - $suiteDirectory . DIRECTORY_SEPARATOR . 'functionalSuiteHooks.xml' + $suiteDirectory . DIRECTORY_SEPARATOR . 'functionalSuiteHooks.xml', + $suiteDirectory . DIRECTORY_SEPARATOR . 'functionalSuiteExtends.xml' ]; // create and return the iterator for these file paths diff --git a/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt b/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt new file mode 100644 index 000000000..6658525eb --- /dev/null +++ b/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt @@ -0,0 +1,63 @@ +amOnPage("/beforeUrl"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + $I->amOnPage("/afterUrl"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _failed(AcceptanceTester $I) + { + $I->saveScreenshot(); + } + + /** + * @Severity(level = SeverityLevel::TRIVIAL) + * @Features({"TestModule"}) + * @Stories({"ExtendedTestInSuiteChildTest"}) + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function ExtendedTestInSuiteChildTest(AcceptanceTester $I) + { + $I->comment("Different Input"); + } +} diff --git a/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml b/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml index 9d50f7197..345718751 100644 --- a/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml +++ b/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml @@ -158,4 +158,32 @@ + + + + + + <group value="ExtendedTestInSuite"/> + <features value="ExtendedTestInSuite"/> + <stories value="ExtendedTestInSuite"/> + </annotations> + <before> + <amOnPage url="/beforeUrl" stepKey="beforeAmOnPageKey"/> + </before> + <after> + <amOnPage url="/afterUrl" stepKey="afterAmOnPageKey"/> + </after> + <comment stepKey="basicCommentWithNoData" userInput="Parent Comment"/> + </test> + + <test name="ExtendedTestInSuiteChildTest" extends="ExtendedTestInSuiteParentTest"> + <annotations> + <severity value="MINOR"/> + <title value="ExtendedTestInSuiteChildTest"/> + <group value="ExtendedTestInSuiteChildTest"/> + <features value="ExtendedTestInSuiteChildTest"/> + <stories value="ExtendedTestInSuiteChildTest"/> + </annotations> + <comment stepKey="basicCommentWithNoData" userInput="Different Input"/> + </test> </tests> \ No newline at end of file diff --git a/dev/tests/verification/Tests/SuiteGenerationTest.php b/dev/tests/verification/Tests/SuiteGenerationTest.php index 52b34b3ef..094a97b5b 100644 --- a/dev/tests/verification/Tests/SuiteGenerationTest.php +++ b/dev/tests/verification/Tests/SuiteGenerationTest.php @@ -285,6 +285,45 @@ public function testSuiteGenerationSingleRun() $this->assertEquals($expectedManifest, file_get_contents(self::getManifestFilePath())); } + /** + * Test extends tests generation in a suite + */ + public function testSuiteGenerationWithExtends() + { + $groupName = 'suiteExtends'; + + $expectedContents = [ + 'ExtendedTestInSuiteChildTestCest.php' + ]; + + // Generate the Suite + SuiteGenerator::getInstance()->generateSuite($groupName); + + // Validate log message and add group name for later deletion + TestLoggingUtil::getInstance()->validateMockLogStatement( + 'info', + "suite generated", + ['suite' => $groupName, 'relative_path' => "_generated" . DIRECTORY_SEPARATOR . $groupName] + ); + self::$TEST_GROUPS[] = $groupName; + + // Validate Yaml file updated + $yml = Yaml::parse(file_get_contents(self::CONFIG_YML_FILE)); + $this->assertArrayHasKey($groupName, $yml['groups']); + + $suiteResultBaseDir = self::GENERATE_RESULT_DIR . + DIRECTORY_SEPARATOR . + $groupName . + DIRECTORY_SEPARATOR; + + // Validate tests have been generated + $dirContents = array_diff(scandir($suiteResultBaseDir), ['..', '.']); + + foreach ($expectedContents as $expectedFile) { + $this->assertTrue(in_array($expectedFile, $dirContents)); + } + } + /** * revert any changes made to config.yml * remove _generated directory diff --git a/dev/tests/verification/_suite/functionalSuiteExtends.xml b/dev/tests/verification/_suite/functionalSuiteExtends.xml new file mode 100644 index 000000000..fccfddcd9 --- /dev/null +++ b/dev/tests/verification/_suite/functionalSuiteExtends.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd"> + <suite name="suiteExtends"> + <include> + <group name="ExtendedTestInSuiteChildTest"/> + </include> + </suite> +</suites> From ada23538bf6a3a704c48fd952b4e5cf0f5f3ed4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sat, 10 Nov 2018 12:00:45 +0000 Subject: [PATCH 37/63] Update `composer.lock` after MFTF master branch update. --- composer.lock | 400 ++++++++++++++++++-------------------------------- 1 file changed, 143 insertions(+), 257 deletions(-) diff --git a/composer.lock b/composer.lock index 9396abad5..c95ef429c 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": "afd707f35922d7ce72085b5fbe0c0ef7", + "content-hash": "ab52f12570440f5833f0d81bce06f884", "packages": [ { "name": "allure-framework/allure-codeception", @@ -729,30 +729,30 @@ }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -793,24 +793,24 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2017-12-06T07:11:42+00:00" }, { "name": "doctrine/collections", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/coding-standard": "~0.1@dev", @@ -860,36 +860,36 @@ "collections", "iterator" ], - "time": "2017-01-03T10:49:41+00:00" + "time": "2017-07-22T10:37:32+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -914,7 +914,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "doctrine/lexer", @@ -1717,16 +1717,16 @@ }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1791,7 +1791,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "moontoast/math", @@ -1890,25 +1890,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -1931,7 +1934,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "paragonie/random_compat", @@ -3574,25 +3577,25 @@ }, { "name": "symfony/browser-kit", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0" + "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/f6668d1a6182d5a8dec65a1c863a4c1d963816c0", - "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd", + "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/dom-crawler": "~2.8|~3.0|~4.0" + "php": "^7.1.3", + "symfony/dom-crawler": "~3.4|~4.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0", - "symfony/process": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" }, "suggest": { "symfony/process": "" @@ -3600,7 +3603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3627,25 +3630,24 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-07-26T09:10:45+00:00" }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3654,11 +3656,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3669,7 +3671,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3696,29 +3698,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-31T09:30:44+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" + "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/d67de79a70a27d93c92c47f37ece958bf8de4d8a", + "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3749,85 +3751,29 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.17", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722" + "reference": "80e60271bb288de2a2259662cff125cff4f93f95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c705bee03ade5b47c087807dd9ffaaec8dda2722", - "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95", + "reference": "80e60271bb288de2a2259662cff125cff4f93f95", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3835,7 +3781,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3862,34 +3808,34 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "552541dad078c85d9414b09c041ede488b456cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/552541dad078c85d9414b09c041ede488b456cd5", + "reference": "552541dad078c85d9414b09c041ede488b456cd5", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3898,7 +3844,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3925,30 +3871,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-10-10T13:52:42+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3975,29 +3921,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-30T13:18:25+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "url": "https://api.github.com/repos/symfony/finder/zipball/1f17195b44543017a9c9b2d437c670627e96ad06", + "reference": "1f17195b44543017a9c9b2d437c670627e96ad06", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4024,34 +3970,34 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" + "time": "2018-10-03T08:47:56+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1" + "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a4498236ade473c52b92d509303e5fd1b211ab1", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/82d494c1492b0dd24bbc5c2d963fb02eb44491af", + "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php70": "~1.6" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.8|~3.0|~4.0" + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4078,7 +4024,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:48:18+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4197,86 +4143,27 @@ ], "time": "2018-09-21T13:07:52+00:00" }, - { - "name": "symfony/polyfill-php70", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0|~9.99", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-09-21T06:26:08+00:00" - }, { "name": "symfony/process", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/process/zipball/3e83acef94d979b1de946599ef86b3a352abcdc9", + "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4303,11 +4190,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-14T20:48:13+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -5455,32 +5342,31 @@ }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -5488,7 +5374,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -5515,29 +5401,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.17", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "aea20fef4e92396928b5db175788b90234c0270d" + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", - "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e72ee2c23d952e4c368ee98610fa22b79b89b483", + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", + "symfony/config": "<4.1.1", + "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, @@ -5545,8 +5431,8 @@ "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/config": "~4.1", + "symfony/expression-language": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -5559,7 +5445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -5586,11 +5472,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-31T10:54:16+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", From bc9fc3a22089ff7259b8d6a62808c5054573a875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sat, 10 Nov 2018 12:15:40 +0000 Subject: [PATCH 38/63] Fallback `composer.lock` to be PHP 7.0 compliant --- composer.lock | 384 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 249 insertions(+), 135 deletions(-) diff --git a/composer.lock b/composer.lock index c95ef429c..b6a5e1db8 100644 --- a/composer.lock +++ b/composer.lock @@ -729,30 +729,30 @@ }, { "name": "doctrine/annotations", - "version": "v1.6.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", - "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^7.1" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -793,24 +793,24 @@ "docblock", "parser" ], - "time": "2017-12-06T07:11:42+00:00" + "time": "2017-02-24T16:22:25+00:00" }, { "name": "doctrine/collections", - "version": "v1.5.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/coding-standard": "~0.1@dev", @@ -860,36 +860,36 @@ "collections", "iterator" ], - "time": "2017-07-22T10:37:32+00:00" + "time": "2017-01-03T10:49:41+00:00" }, { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -914,7 +914,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "doctrine/lexer", @@ -1890,28 +1890,25 @@ }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", "shasum": "" }, "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { @@ -1934,7 +1931,7 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" + "time": "2017-10-19T19:58:43+00:00" }, { "name": "paragonie/random_compat", @@ -3577,25 +3574,25 @@ }, { "name": "symfony/browser-kit", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd" + "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd", - "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/f6668d1a6182d5a8dec65a1c863a4c1d963816c0", + "reference": "f6668d1a6182d5a8dec65a1c863a4c1d963816c0", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/dom-crawler": "~3.4|~4.0" + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" }, "require-dev": { - "symfony/css-selector": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/process": "" @@ -3603,7 +3600,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3630,24 +3627,25 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:10:45+00:00" + "time": "2018-07-26T09:06:28+00:00" }, { "name": "symfony/console", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "432122af37d8cd52fba1b294b11976e0d20df595" + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", - "reference": "432122af37d8cd52fba1b294b11976e0d20df595", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3656,11 +3654,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", @@ -3671,7 +3669,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3698,29 +3696,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:30:44+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/css-selector", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a" + "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/d67de79a70a27d93c92c47f37ece958bf8de4d8a", - "reference": "d67de79a70a27d93c92c47f37ece958bf8de4d8a", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3751,29 +3749,85 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:36:10+00:00" + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "80e60271bb288de2a2259662cff125cff4f93f95" + "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95", - "reference": "80e60271bb288de2a2259662cff125cff4f93f95", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c705bee03ade5b47c087807dd9ffaaec8dda2722", + "reference": "c705bee03ade5b47c087807dd9ffaaec8dda2722", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~3.4|~4.0" + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3781,7 +3835,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3808,34 +3862,34 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:40:59+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "552541dad078c85d9414b09c041ede488b456cd5" + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/552541dad078c85d9414b09c041ede488b456cd5", - "reference": "552541dad078c85d9414b09c041ede488b456cd5", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "conflict": { - "symfony/dependency-injection": "<3.4" + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/stopwatch": "~3.4|~4.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3844,7 +3898,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3871,30 +3925,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-10-10T13:52:42+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/filesystem", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", - "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3921,29 +3975,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-30T13:18:25+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/finder", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "1f17195b44543017a9c9b2d437c670627e96ad06" + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1f17195b44543017a9c9b2d437c670627e96ad06", - "reference": "1f17195b44543017a9c9b2d437c670627e96ad06", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3970,34 +4024,34 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:47:56+00:00" + "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af" + "reference": "5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/82d494c1492b0dd24bbc5c2d963fb02eb44491af", - "reference": "82d494c1492b0dd24bbc5c2d963fb02eb44491af", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0", + "reference": "5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.1" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" }, "require-dev": { - "predis/predis": "~1.0", - "symfony/expression-language": "~3.4|~4.0" + "symfony/expression-language": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -4024,7 +4078,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:09:42+00:00" + "time": "2018-10-31T08:57:11+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4143,27 +4197,86 @@ ], "time": "2018-09-21T13:07:52+00:00" }, + { + "name": "symfony/polyfill-php70", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T06:26:08+00:00" + }, { "name": "symfony/process", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9" + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3e83acef94d979b1de946599ef86b3a352abcdc9", - "reference": "3e83acef94d979b1de946599ef86b3a352abcdc9", + "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -4190,7 +4303,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-14T20:48:13+00:00" + "time": "2018-10-14T17:33:21+00:00" }, { "name": "symfony/yaml", @@ -5342,31 +5455,32 @@ }, { "name": "symfony/config", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", - "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0", + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<3.4" + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" }, "require-dev": { - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -5374,7 +5488,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -5401,29 +5515,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:09:42+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.1.7", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483" + "reference": "9c98452ac7fff4b538956775630bc9701f5384ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e72ee2c23d952e4c368ee98610fa22b79b89b483", - "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9c98452ac7fff4b538956775630bc9701f5384ba", + "reference": "9c98452ac7fff4b538956775630bc9701f5384ba", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<4.1.1", - "symfony/finder": "<3.4", + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, @@ -5431,8 +5545,8 @@ "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~4.1", - "symfony/expression-language": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -5445,7 +5559,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -5472,7 +5586,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-31T10:54:16+00:00" + "time": "2018-10-31T10:49:51+00:00" }, { "name": "symfony/stopwatch", From ecac0435d1c4b1115a2c8a65355f60350cc5bc11 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Mon, 12 Nov 2018 15:16:01 -0600 Subject: [PATCH 39/63] MQE-1264: Failing Allure steps showing up as passed - MagnetoAllureAdapter overrides parent stepAfter, fires off StepFailedEvent to properly set the step status --- .../Allure/Adapter/MagentoAllureAdapter.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index d23af52da..e0fd32422 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -5,10 +5,11 @@ */ namespace Magento\FunctionalTestingFramework\Allure\Adapter; -use Magento\FunctionalTestingFramework\Data\Argument\Interpreter\NullType; use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler; use Yandex\Allure\Adapter\AllureAdapter; use Yandex\Allure\Adapter\Event\StepStartedEvent; +use Yandex\Allure\Adapter\Event\StepFinishedEvent; +use Yandex\Allure\Adapter\Event\StepFailedEvent; use Codeception\Event\SuiteEvent; use Codeception\Event\StepEvent; @@ -117,4 +118,18 @@ public function stepBefore(StepEvent $stepEvent) $this->emptyStep = false; $this->getLifecycle()->fire(new StepStartedEvent($stepName)); } + + /** + * Override of parent method, fires StepFailedEvent if step has failed (for xml output) + * @param StepEvent $stepEvent + * @throws \Yandex\Allure\Adapter\AllureException + * @return void + */ + public function stepAfter(StepEvent $stepEvent = null) + { + if ($stepEvent->getStep()->hasFailed()) { + $this->getLifecycle()->fire(new StepFailedEvent()); + } + $this->getLifecycle()->fire(new StepFinishedEvent()); + } } From 0849daaec42964959702f6ddc1bae4c2202cce7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 14 Nov 2018 06:26:31 +0100 Subject: [PATCH 40/63] Add PHPUnit >=7.0.0,<7.1.0 to the dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 97842671a..706bd9657 100755 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "goaop/framework": "2.2.0", "codacy/coverage": "^1.4", "phpmd/phpmd": "^2.6.0", - "phpunit/phpunit": "~6.5.0", + "phpunit/phpunit": "~6.5.0 || ~7.0.0", "rregeer/phpunit-coverage-check": "^0.1.4", "php-coveralls/php-coveralls": "^1.0", "symfony/stopwatch": "~3.4.6" From 9d72141a3671e5ca261efd67f0c623a49512ce49 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Wed, 21 Nov 2018 09:10:13 -0600 Subject: [PATCH 41/63] MQE-1302: MFTF Remove Action Not Working For Extended PageBuilder Test - bug fix --- .../Test/Handlers/TestObjectHandler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php index a508d8fd4..1c0f7e2fc 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php @@ -92,10 +92,11 @@ public function getObject($testName) */ public function getAllObjects() { + $testObjects = []; foreach ($this->tests as $testName => $test) { - $this->tests[$testName] = $this->extendTest($test); + $testObjects[$testName] = $this->extendTest($test); } - return $this->tests; + return $testObjects; } /** From 58810eb27bb25d81536f511c5040e8d6c95d5ee7 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Wed, 21 Nov 2018 13:15:18 -0600 Subject: [PATCH 42/63] MQE-1302: MFTF Remove Action Not Working For Extended PageBuilder Test - added verification tests --- ...t.txt => ExtendedChildTestInSuiteCest.txt} | 10 +-- .../Resources/ExtendedChildTestNotInSuite.txt | 62 +++++++++++++++++++ .../Test/ExtendedFunctionalTest.xml | 32 +++++++--- .../Tests/ExtendedGenerationTest.php | 11 ++++ .../Tests/SuiteGenerationTest.php | 13 ++-- .../_suite/functionalSuiteExtends.xml | 2 +- 6 files changed, 109 insertions(+), 21 deletions(-) rename dev/tests/verification/Resources/{ExtendedTestInSuiteChildTestCest.txt => ExtendedChildTestInSuiteCest.txt} (84%) create mode 100644 dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt diff --git a/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt similarity index 84% rename from dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt rename to dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt index 6658525eb..da343e0e1 100644 --- a/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt @@ -15,10 +15,10 @@ use Yandex\Allure\Adapter\Model\SeverityLevel; use Yandex\Allure\Adapter\Annotation\TestCaseId; /** - * @Title("[NO TESTCASEID]: ExtendedTestInSuiteChildTest") - * @group ExtendedTestInSuiteChildTest + * @Title("[NO TESTCASEID]: ExtendedChildTestInSuite") + * @group ExtendedTestInSuite */ -class ExtendedTestInSuiteChildTestCest +class ExtendedChildTestInSuiteCest { /** * @param AcceptanceTester $I @@ -50,13 +50,13 @@ class ExtendedTestInSuiteChildTestCest /** * @Severity(level = SeverityLevel::TRIVIAL) * @Features({"TestModule"}) - * @Stories({"ExtendedTestInSuiteChildTest"}) + * @Stories({"ExtendedChildTestInSuite"}) * @Parameter(name = "AcceptanceTester", value="$I") * @param AcceptanceTester $I * @return void * @throws \Exception */ - public function ExtendedTestInSuiteChildTest(AcceptanceTester $I) + public function ExtendedChildTestInSuite(AcceptanceTester $I) { $I->comment("Different Input"); } diff --git a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt new file mode 100644 index 000000000..cba6db454 --- /dev/null +++ b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt @@ -0,0 +1,62 @@ +<?php +namespace Magento\AcceptanceTest\_default\Backend; + +use Magento\FunctionalTestingFramework\AcceptanceTester; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; +use \Codeception\Util\Locator; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; + +/** + * @Title("[NO TESTCASEID]: ExtendedChildTestNotInSuite") + */ +class ExtendedChildTestNotInSuiteCest +{ + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _before(AcceptanceTester $I) + { + $I->amOnPage("/beforeUrl"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + $I->amOnPage("/afterUrl"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _failed(AcceptanceTester $I) + { + $I->saveScreenshot(); + } + + /** + * @Severity(level = SeverityLevel::TRIVIAL) + * @Features({"TestModule"}) + * @Stories({"ExtendedChildTestNotInSuite"}) + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function ExtendedChildTestNotInSuite(AcceptanceTester $I) + { + $I->comment("Different Input"); + } +} diff --git a/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml b/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml index 345718751..486a6036f 100644 --- a/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml +++ b/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml @@ -159,13 +159,13 @@ <comment userInput="child" stepKey="replaceMe"/> </test> - <test name="ExtendedTestInSuiteParentTest"> + <test name="ExtendedTestRelatedToSuiteParentTest"> <annotations> <severity value="AVERAGE"/> - <title value="ExtendedTestInSuiteParentTest"/> - <group value="ExtendedTestInSuite"/> - <features value="ExtendedTestInSuite"/> - <stories value="ExtendedTestInSuite"/> + <title value="ExtendedTestRelatedToSuiteParentTest"/> + <group value="ExtendedTestRelatedToSuite"/> + <features value="ExtendedTestRelatedToSuiteParentTest"/> + <stories value="ExtendedTestRelatedToSuiteParentTest"/> </annotations> <before> <amOnPage url="/beforeUrl" stepKey="beforeAmOnPageKey"/> @@ -174,16 +174,28 @@ <amOnPage url="/afterUrl" stepKey="afterAmOnPageKey"/> </after> <comment stepKey="basicCommentWithNoData" userInput="Parent Comment"/> + <amOnPage url="/url/in/parent" stepKey="amOnPageInParent"/> </test> - <test name="ExtendedTestInSuiteChildTest" extends="ExtendedTestInSuiteParentTest"> + <test name="ExtendedChildTestInSuite" extends="ExtendedTestRelatedToSuiteParentTest"> + <annotations> + <severity value="MINOR"/> + <title value="ExtendedChildTestInSuite"/> + <group value="ExtendedTestInSuite"/> + <features value="ExtendedChildTestInSuite"/> + <stories value="ExtendedChildTestInSuite"/> + </annotations> + <comment stepKey="basicCommentWithNoData" userInput="Different Input"/> + <remove keyForRemoval="amOnPageInParent"/> + </test> + <test name="ExtendedChildTestNotInSuite" extends="ExtendedTestRelatedToSuiteParentTest"> <annotations> <severity value="MINOR"/> - <title value="ExtendedTestInSuiteChildTest"/> - <group value="ExtendedTestInSuiteChildTest"/> - <features value="ExtendedTestInSuiteChildTest"/> - <stories value="ExtendedTestInSuiteChildTest"/> + <title value="ExtendedChildTestNotInSuite"/> + <features value="ExtendedChildTestNotInSuite"/> + <stories value="ExtendedChildTestNotInSuite"/> </annotations> <comment stepKey="basicCommentWithNoData" userInput="Different Input"/> + <remove keyForRemoval="amOnPageInParent"/> </test> </tests> \ No newline at end of file diff --git a/dev/tests/verification/Tests/ExtendedGenerationTest.php b/dev/tests/verification/Tests/ExtendedGenerationTest.php index e7bb0a879..73fb5fdfb 100644 --- a/dev/tests/verification/Tests/ExtendedGenerationTest.php +++ b/dev/tests/verification/Tests/ExtendedGenerationTest.php @@ -118,4 +118,15 @@ public function testExtendingSkippedGeneration() { $this->generateAndCompareTest('ExtendingSkippedTest'); } + + /** + * Tests extending and removing parent steps test generation. + * + * @throws \Exception + * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException + */ + public function testExtendingAndRemovingStepsGeneration() + { + $this->generateAndCompareTest('ExtendedChildTestNotInSuite'); + } } diff --git a/dev/tests/verification/Tests/SuiteGenerationTest.php b/dev/tests/verification/Tests/SuiteGenerationTest.php index 094a97b5b..f305e565f 100644 --- a/dev/tests/verification/Tests/SuiteGenerationTest.php +++ b/dev/tests/verification/Tests/SuiteGenerationTest.php @@ -292,8 +292,8 @@ public function testSuiteGenerationWithExtends() { $groupName = 'suiteExtends'; - $expectedContents = [ - 'ExtendedTestInSuiteChildTestCest.php' + $expectedFileNames = [ + 'ExtendedChildTestInSuiteCest' ]; // Generate the Suite @@ -312,15 +312,18 @@ public function testSuiteGenerationWithExtends() $this->assertArrayHasKey($groupName, $yml['groups']); $suiteResultBaseDir = self::GENERATE_RESULT_DIR . - DIRECTORY_SEPARATOR . $groupName . DIRECTORY_SEPARATOR; // Validate tests have been generated $dirContents = array_diff(scandir($suiteResultBaseDir), ['..', '.']); - foreach ($expectedContents as $expectedFile) { - $this->assertTrue(in_array($expectedFile, $dirContents)); + foreach ($expectedFileNames as $expectedFileName) { + $this->assertTrue(in_array($expectedFileName . ".php", $dirContents)); + $this->assertFileEquals( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . $expectedFileName . ".txt", + $suiteResultBaseDir . $expectedFileName . ".php" + ); } } diff --git a/dev/tests/verification/_suite/functionalSuiteExtends.xml b/dev/tests/verification/_suite/functionalSuiteExtends.xml index fccfddcd9..aac3b51e5 100644 --- a/dev/tests/verification/_suite/functionalSuiteExtends.xml +++ b/dev/tests/verification/_suite/functionalSuiteExtends.xml @@ -9,7 +9,7 @@ <suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd"> <suite name="suiteExtends"> <include> - <group name="ExtendedTestInSuiteChildTest"/> + <group name="ExtendedTestInSuite"/> </include> </suite> </suites> From 59b3f6131955bd084b21ede74bcb690206cb3eb6 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Tue, 27 Nov 2018 11:05:56 -0600 Subject: [PATCH 43/63] MQE-910: [GitHub PR] The property of the parent element is used first when making a request - added some comments --- .../DataGenerator/Persist/CurlHandler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index 74f76c0c8..9c8a9e175 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -197,6 +197,7 @@ private function resolveUrlReference($urlIn, $entityObjects) { $urlOut = $urlIn; $matchedParams = []; + // Find all the params ({}) references preg_match_all("/[{](.+?)[}]/", $urlIn, $matchedParams); if (!empty($matchedParams)) { @@ -204,6 +205,8 @@ private function resolveUrlReference($urlIn, $entityObjects) $paramEntityParent = ""; $matchedParent = []; $dataItem = $matchedParams[1][$paramKey]; + // Find all the parent property (Type.key) references, assuming there will be only one + // parent property reference within one param preg_match_all("/(.+?)\./", $dataItem, $matchedParent); if (!empty($matchedParent) && !empty($matchedParent[0])) { From 970b467017fb0942ae57b6f5b9a00334b2b53249 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Wed, 28 Nov 2018 14:21:08 -0600 Subject: [PATCH 44/63] MQE-1361: Unable to use empty string literal as argument to selector in tests - bug fix --- .../FunctionalTestingFramework/Test/Objects/ActionObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index c91ebaf5c..c50a51201 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -691,7 +691,7 @@ private function matchParameterReferences($reference, $parameters) $resolvedParameters = []; foreach ($parameters as $parameter) { $parameter = trim($parameter); - preg_match_all("/[$'][\w\D]+[$']/", $parameter, $stringOrPersistedMatch); + preg_match_all("/[$'][\w\D]*[$']/", $parameter, $stringOrPersistedMatch); preg_match_all('/{\$[a-z][a-zA-Z\d]+}/', $parameter, $variableMatch); if (!empty($stringOrPersistedMatch[0])) { $resolvedParameters[] = ltrim(rtrim($parameter, "'"), "'"); From 04a15f1690435d14436fa9771ae7cb01590e70b6 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Wed, 28 Nov 2018 15:23:35 -0600 Subject: [PATCH 45/63] MQE-1361: Unable to use empty string literal as argument to selector in tests - added some verification tests --- dev/tests/verification/Resources/SectionReplacementTest.txt | 2 ++ dev/tests/verification/TestModule/Section/SampleSection.xml | 1 + .../verification/TestModule/Test/SectionReplacementTest.xml | 3 +++ 3 files changed, 6 insertions(+) diff --git a/dev/tests/verification/Resources/SectionReplacementTest.txt b/dev/tests/verification/Resources/SectionReplacementTest.txt index 5bdba2812..c4d738811 100644 --- a/dev/tests/verification/Resources/SectionReplacementTest.txt +++ b/dev/tests/verification/Resources/SectionReplacementTest.txt @@ -68,5 +68,7 @@ class SectionReplacementTestCest $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .Doe" . msq("uniqueData")); $I->click("#element .1#element .2"); $I->click("#element .1#element .{$data}"); + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,'')]"); + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,' ')]"); } } diff --git a/dev/tests/verification/TestModule/Section/SampleSection.xml b/dev/tests/verification/TestModule/Section/SampleSection.xml index 735c5fe7b..a560e2f1e 100644 --- a/dev/tests/verification/TestModule/Section/SampleSection.xml +++ b/dev/tests/verification/TestModule/Section/SampleSection.xml @@ -18,5 +18,6 @@ <element name="threeOneDuplicateParamElement" type="button" selector="#{{var1}}-{{var2}} .{{var1}} [{{var3}}]" parameterized="true"/> <element name="timeoutElement" type="button" selector="#foo" timeout="30"/> <element name="mergeElement" type="button" selector="#unMerge"/> + <element name="anotherTwoParamsElement" type="button" selector="(//div[@data-role='slide'])[{{arg1}}]/a[@data-element='link'][contains(@href,'{{arg2}}')]" parameterized="true"/> </section> </sections> diff --git a/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml b/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml index 9daef72cd..17aeb4d69 100644 --- a/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml +++ b/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml @@ -50,5 +50,8 @@ <click stepKey="selectorReplaceTwoParamElements" selector="{{SampleSection.oneParamElement('1')}}{{SampleSection.oneParamElement('2')}}"/> <click stepKey="selectorReplaceTwoParamMixedTypes" selector="{{SampleSection.oneParamElement('1')}}{{SampleSection.oneParamElement({$data})}}"/> + + <click stepKey="selectorParamWithEmptyString" selector="{{SampleSection.anotherTwoParamsElement('1', '')}}"/> + <click stepKey="selectorParamWithASpace" selector="{{SampleSection.anotherTwoParamsElement('1', ' ')}}"/> </test> </tests> From a245731e509ecd378e89090a8143d94e73d5b56c Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Thu, 29 Nov 2018 10:13:24 -0600 Subject: [PATCH 46/63] MQE-1350: Add support for symlinked vendor/magento modules - Simplified fix to resolve the relative path to a full path. --- .../FunctionalTestingFramework/Util/ModuleResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php index 0741c48b4..d1574ffe6 100644 --- a/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php +++ b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php @@ -276,7 +276,7 @@ private function globRelevantPaths($testPath, $pattern) // Symlinks must be resolved otherwise they will not match Magento's filepath to the module $potentialSymlink = str_replace(DIRECTORY_SEPARATOR . $pattern, "", $codePath); if (is_link($potentialSymlink)) { - $codePath = readlink($potentialSymlink) . DIRECTORY_SEPARATOR . $pattern; + $codePath = realpath($potentialSymlink) . DIRECTORY_SEPARATOR . $pattern; } $mainModName = array_search($codePath, $allComponents) ?: basename(str_replace($pattern, '', $codePath)); @@ -554,8 +554,8 @@ private function getRegisteredModuleList() } array_walk($allComponents, function (&$value) { // Magento stores component paths with unix DIRECTORY_SEPARATOR, need to stay uniform and convert - $value .= '/Test/Mftf'; $value = realpath($value); + $value .= '/Test/Mftf'; }); return $allComponents; } catch (TestFrameworkException $e) { From bf2143d0e73eace7016175456db5ddd6eaa6cb54 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Thu, 6 Dec 2018 14:54:46 -0600 Subject: [PATCH 47/63] MQE-1372: If Suite before fails build must be RED - Added testIncomplete override to allure adapter, will mark incomplete tests as failed - Lifted runFailed functionality from extension into TestContextExtension to be able to write incomplete tests to the failed fail - Removed runFailed exception from etc version of Codeception.yml --- .../Resources/functionalSuiteHooks.txt | 2 +- etc/config/codeception.dist.yml | 1 - .../Allure/Adapter/MagentoAllureAdapter.php | 16 ++++++ .../Extension/TestContextExtension.php | 52 ++++++++++++++++++- .../Suite/views/SuiteClass.mustache | 2 +- 5 files changed, 69 insertions(+), 4 deletions(-) diff --git a/dev/tests/verification/Resources/functionalSuiteHooks.txt b/dev/tests/verification/Resources/functionalSuiteHooks.txt index 665f06a05..0a6dc463f 100644 --- a/dev/tests/verification/Resources/functionalSuiteHooks.txt +++ b/dev/tests/verification/Resources/functionalSuiteHooks.txt @@ -30,7 +30,7 @@ class functionalSuiteHooks extends \Codeception\GroupObject if ($this->preconditionFailure != null) { //if our preconditions fail, we need to mark all the tests as incomplete. - $e->getTest()->getMetadata()->setIncomplete($this->preconditionFailure); + $e->getTest()->getMetadata()->setIncomplete("SUITE PRECONDITION FAILED:" . PHP_EOL . $this->preconditionFailure); } } diff --git a/etc/config/codeception.dist.yml b/etc/config/codeception.dist.yml index a4ea0dcb5..3bf05bab5 100755 --- a/etc/config/codeception.dist.yml +++ b/etc/config/codeception.dist.yml @@ -12,7 +12,6 @@ settings: memory_limit: 1024M extensions: enabled: - - Codeception\Extension\RunFailed - Magento\FunctionalTestingFramework\Extension\TestContextExtension - Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter config: diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index e0fd32422..5be6e479c 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -10,6 +10,8 @@ use Yandex\Allure\Adapter\Event\StepStartedEvent; use Yandex\Allure\Adapter\Event\StepFinishedEvent; use Yandex\Allure\Adapter\Event\StepFailedEvent; +use Yandex\Allure\Adapter\Event\TestCaseFailedEvent; +use Codeception\Event\FailEvent; use Codeception\Event\SuiteEvent; use Codeception\Event\StepEvent; @@ -132,4 +134,18 @@ public function stepAfter(StepEvent $stepEvent = null) } $this->getLifecycle()->fire(new StepFinishedEvent()); } + + /** + * Override of parent method, fires a TestCaseFailedEvent if a test is marked as incomplete. + * + * @param FailEvent $failEvent + * @return void + */ + public function testIncomplete(FailEvent $failEvent) + { + $event = new TestCaseFailedEvent(); + $e = $failEvent->getFail(); + $message = $e->getMessage(); + $this->getLifecycle()->fire($event->withException($e)->withMessage($message)); + } } diff --git a/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php b/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php index 3895d9efd..4b77909a9 100644 --- a/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php +++ b/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php @@ -16,6 +16,7 @@ class TestContextExtension extends BaseExtension { const TEST_PHASE_AFTER = "_after"; + const TEST_FAILED_FILE = 'failed'; /** * Codeception Events Mapping to methods @@ -35,7 +36,8 @@ public function _initialize() Events::TEST_START => 'testStart', Events::TEST_FAIL => 'testFail', Events::STEP_AFTER => 'afterStep', - Events::TEST_END => 'testEnd' + Events::TEST_END => 'testEnd', + Events::RESULT_PRINT_AFTER => 'saveFailed' ]; self::$events = array_merge(parent::$events, $events); parent::_initialize(); @@ -170,4 +172,52 @@ public function afterStep(\Codeception\Event\StepEvent $e) { ErrorLogger::getInstance()->logErrors($this->getDriver(), $e); } + + /** + * Saves failed tests from last codecept run command into a file in _output directory + * Removes file if there were no failures in last run command + * @param \Codeception\Event\PrintResultEvent $e + * @return void + */ + public function saveFailed(\Codeception\Event\PrintResultEvent $e) + { + $file = $this->getLogDir() . self::TEST_FAILED_FILE; + $result = $e->getResult(); + $output = []; + + // Remove previous file regardless if we're writing a new file + if (is_file($file)) { + unlink($file); + } + + foreach ($result->failures() as $fail) { + $output[] = $this->localizePath(\Codeception\Test\Descriptor::getTestFullName($fail->failedTest())); + } + foreach ($result->errors() as $fail) { + $output[] = $this->localizePath(\Codeception\Test\Descriptor::getTestFullName($fail->failedTest())); + } + foreach ($result->notImplemented() as $fail) { + $output[] = $this->localizePath(\Codeception\Test\Descriptor::getTestFullName($fail->failedTest())); + } + + if (empty($output)) { + return; + } + + file_put_contents($file, implode("\n", $output)); + } + + /** + * Returns localized path to string, for writing failed file. + * @param string $path + * @return string + */ + protected function localizePath($path) + { + $root = realpath($this->getRootDir()) . DIRECTORY_SEPARATOR; + if (substr($path, 0, strlen($root)) == $root) { + return substr($path, strlen($root)); + } + return $path; + } } diff --git a/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache b/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache index 953db9d0c..58c0cbf0f 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache +++ b/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache @@ -31,7 +31,7 @@ class {{suiteName}} extends \Codeception\GroupObject if ($this->preconditionFailure != null) { //if our preconditions fail, we need to mark all the tests as incomplete. - $e->getTest()->getMetadata()->setIncomplete($this->preconditionFailure); + $e->getTest()->getMetadata()->setIncomplete("SUITE PRECONDITION FAILED:" . PHP_EOL . $this->preconditionFailure); } } From fe2feaec0218bf975c9e057677a63bd119f611f3 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Fri, 7 Dec 2018 10:10:00 -0600 Subject: [PATCH 48/63] MQE-1354: bug fix in command.php --- etc/config/command.php | 57 ++++++++++++------- .../Persist/Curl/WebapiExecutor.php | 27 +++++++-- .../Module/MagentoWebDriver.php | 3 + 3 files changed, 62 insertions(+), 25 deletions(-) diff --git a/etc/config/command.php b/etc/config/command.php index b24bafd31..55b9fd1e9 100644 --- a/etc/config/command.php +++ b/etc/config/command.php @@ -4,34 +4,51 @@ * See COPYING.txt for license details. */ -if (isset($_POST['command'])) { +require_once __DIR__ . '/../../../../app/bootstrap.php'; + +if (isset($_POST['token']) && isset($_POST['command'])) { + $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); + $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); + $tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class); + + $tokenPassedIn = urldecode($_POST['token']); $command = urldecode($_POST['command']); + if (array_key_exists("arguments", $_POST)) { - $arguments = urldecode($_POST['arguments']); + $arguments = escapeshellarg(urldecode($_POST['arguments'])); } else { $arguments = null; } - $php = PHP_BINDIR ? PHP_BINDIR . '/php' : 'php'; - $valid = validateCommand($command); - if ($valid) { - exec( - escapeCommand($php . ' -f ../../../../bin/magento ' . $command) . " $arguments" ." 2>&1", - $output, - $exitCode - ); - if ($exitCode == 0) { - http_response_code(202); + + // Token returned will be null if the token we passed in is invalid + $tokenFromMagento = $tokenModel->loadByToken($tokenPassedIn)->getToken(); + if (!empty($tokenFromMagento) && ($tokenFromMagento == $tokenPassedIn)) { + $php = PHP_BINDIR ? PHP_BINDIR . '/php' : 'php'; + $magentoBinary = $php . ' -f ../../../../bin/magento'; + $valid = validateCommand($magentoBinary, $command); + if ($valid) { + exec( + escapeCommand($magentoBinary . " $command" . " $arguments") . " 2>&1", + $output, + $exitCode + ); + if ($exitCode == 0) { + http_response_code(202); + } else { + http_response_code(500); + } + echo implode("\n", $output); } else { - http_response_code(500); + http_response_code(403); + echo "Given command not found valid in Magento CLI Command list."; } - echo implode("\n", $output); } else { - http_response_code(403); - echo "Given command not found valid in Magento CLI Command list."; + http_response_code(401); + echo("Command not unauthorized."); } } else { http_response_code(412); - echo("Command parameter is not set."); + echo("Required parameters are not set."); } /** @@ -55,13 +72,13 @@ function escapeCommand($command) /** * Checks magento list of CLI commands for given $command. Does not check command parameters, just base command. + * @param string $magentoBinary * @param string $command * @return bool */ -function validateCommand($command) +function validateCommand($magentoBinary, $command) { - $php = PHP_BINDIR ? PHP_BINDIR . '/php' : 'php'; - exec($php . ' -f ../../../../bin/magento list', $commandList); + exec($magentoBinary . ' list', $commandList); // Trim list of commands after first whitespace $commandList = array_map("trimAfterWhitespace", $commandList); return in_array(trimAfterWhitespace($command), $commandList); diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php index 16fef75f2..8b887beef 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php @@ -51,6 +51,13 @@ class WebapiExecutor extends AbstractExecutor implements CurlInterface */ private $storeCode; + /** + * Admin user auth token. + * + * @var string + */ + private $authToken; + /** * WebapiExecutor Constructor. * @@ -64,12 +71,13 @@ public function __construct($storeCode = null) } $this->storeCode = $storeCode; + $this->authToken = null; $this->transport = new CurlTransport(); $this->authorize(); } /** - * Returns the authorization token needed for some requests via REST call. + * Acquire and store the authorization token needed for REST requests. * * @return void * @throws TestFrameworkException @@ -83,10 +91,8 @@ protected function authorize() ]; $this->transport->write($authUrl, json_encode($authCreds), CurlInterface::POST, $this->headers); - $this->headers = array_merge( - ['Authorization: Bearer ' . str_replace('"', "", $this->read())], - $this->headers - ); + $this->authToken = str_replace('"', "", $this->read()); + $this->headers = array_merge(['Authorization: Bearer ' . $this->authToken], $this->headers); } /** @@ -159,4 +165,15 @@ public function getFormattedUrl($resource) $urlResult.= trim($resource, "/"); return $urlResult; } + + /** + * Return admin auth token. + * + * @throws TestFrameworkException + * @return string + */ + public function getAuthToken() + { + return $this->authToken; + } } diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 452a40bde..a15ed757e 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -482,10 +482,12 @@ public function magentoCLI($command, $arguments = null) ); $apiURL = $baseUrl . '/' . ltrim(getenv('MAGENTO_CLI_COMMAND_PATH'), '/'); + $restExecutor = new WebapiExecutor(); $executor = new CurlTransport(); $executor->write( $apiURL, [ + 'token' => $restExecutor->getAuthToken(), getenv('MAGENTO_CLI_COMMAND_PARAMETER') => $command, 'arguments' => $arguments ], @@ -493,6 +495,7 @@ public function magentoCLI($command, $arguments = null) [] ); $response = $executor->read(); + $restExecutor->close(); $executor->close(); return $response; } From 58311dae1231e798ee5b614d06c5073cd3bb86f1 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Mon, 10 Dec 2018 11:21:44 -0600 Subject: [PATCH 49/63] Fix code review issue --- .../static/Magento/Sniffs/Commenting/FunctionCommentSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php index 259a54408..5050d5f03 100644 --- a/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php +++ b/dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php @@ -460,7 +460,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum) { + foreach ($param['commentLines'] as $lineNum => $line) { if ($lineNum === 0 || $param['commentLines'][$lineNum]['indent'] === 0 ) { From b0c1f5aa103fe3421caffdb7eadafee567184362 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Mon, 10 Dec 2018 13:46:22 -0600 Subject: [PATCH 50/63] Update Verification tests according to introduced changes --- .../Resources/ActionGroupWithSectionAndDataAsArguments.txt | 2 +- dev/tests/verification/Resources/BasicFunctionalTest.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt index 18881c269..0ee49a80e 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt @@ -27,6 +27,6 @@ class ActionGroupWithSectionAndDataAsArgumentsCest */ public function ActionGroupWithSectionAndDataAsArguments(AcceptanceTester $I) { - $I->waitForElementVisible("#element .John"); + $I->waitForElementVisible("#element .John", 10); } } diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index 493d3c2c0..9970e81ec 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -126,7 +126,7 @@ class BasicFunctionalTestCest $I->moveMouseOver(".functionalTestSelector"); $I->openNewTab(); $I->pauseExecution(); - $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}); + $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); $I->pressKey("#page", "a"); $I->pressKey("#page", ['ctrl', 'a'],'new'); $I->pressKey("#page", ['shift', '111'],'1','x'); @@ -165,7 +165,7 @@ class BasicFunctionalTestCest $I->waitForElement(".functionalTestSelector", 30); $I->waitForElementNotVisible(".functionalTestSelector", 30); $I->waitForElementVisible(".functionalTestSelector", 30); - $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}); + $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); $I->waitForJS("someJsFunction", 30); $I->waitForText("someInput", 30, ".functionalTestSelector"); } From 092634a73106939b02e2b2ccc4c4c787aef8becc Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Wed, 12 Dec 2018 14:56:09 -0600 Subject: [PATCH 51/63] MQE-1354: bug fix in command.php --- etc/config/command.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/config/command.php b/etc/config/command.php index 55b9fd1e9..600025cf4 100644 --- a/etc/config/command.php +++ b/etc/config/command.php @@ -6,7 +6,7 @@ require_once __DIR__ . '/../../../../app/bootstrap.php'; -if (isset($_POST['token']) && isset($_POST['command'])) { +if (!empty($_POST['token']) && !empty($_POST['command'])) { $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); $tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class); @@ -14,8 +14,8 @@ $tokenPassedIn = urldecode($_POST['token']); $command = urldecode($_POST['command']); - if (array_key_exists("arguments", $_POST)) { - $arguments = escapeshellarg(urldecode($_POST['arguments'])); + if (!empty($_POST['arguments'])) { + $arguments = urldecode($_POST['arguments']); } else { $arguments = null; } From e2323a2e93ccebc88a6fca48c3fffc84064d28cb Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Wed, 12 Dec 2018 15:13:34 -0600 Subject: [PATCH 52/63] magento-research/pwa-tests#MQE-1382-WaitForReactPageLoad - Adding a new action for waitForReactPageLoad to the schema. - Adding basic structure for the new action to the MagentoWebDriver. --- .../Module/MagentoWebDriver.php | 15 +++++++++++++++ .../Test/etc/Actions/waitActions.xsd | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 452a40bde..a5641adcf 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -379,6 +379,21 @@ public function waitForPageLoad($timeout = null) $this->waitForLoadingMaskToDisappear($timeout); } + /** + * Wait for all React JavaScript to finish executing. + * + * @param integer $timeout + * @throws \Exception + * @return void + */ + public function waitForReactPageLoad($timeout = null) + { + $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; + + $this->waitForJS('return (!!Object.keys(document).filter(prop => /^_reactListenersID/.test(prop)).length) || (document.querySelector("[data-reactroot]") && Object.keys(rootEl).some(prop => /^__reactInternalInstance/.test(prop)));', $timeout); + $this->waitForJS("return document.readyState == 'complete';", $timeout); + } + /** * Wait for all visible loading masks to disappear. Gets all elements by mask selector, then loops over them. * diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd index 5350d9d3e..ad751d9e1 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd @@ -20,6 +20,7 @@ <xs:element type="waitForJSType" name="waitForJS" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForLoadingMaskToDisappearType" name="waitForLoadingMaskToDisappear" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForPageLoadType" name="waitForPageLoad" minOccurs="0" maxOccurs="unbounded"/> + <xs:element type="waitForReactPageLoadType" name="waitForReactPageLoad" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForTextType" name="waitForText" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:group> @@ -176,6 +177,20 @@ </xs:simpleContent> </xs:complexType> + <xs:complexType name="waitForReactPageLoadType"> + <xs:annotation> + <xs:documentation> + Waits up to given time for React page to have finished loading.. + </xs:documentation> + </xs:annotation> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute ref="time"/> + <xs:attributeGroup ref="commonActionAttributes"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="waitForTextType"> <xs:annotation> <xs:documentation> From d2312ef8c06100b2199f591d388279eac70e5d80 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Tue, 8 Jan 2019 14:23:46 -0600 Subject: [PATCH 53/63] magento-research/pwa-tests#MQE-1382-WaitForReactPageLoad - Switched gears with this attempt, created a waitForElementVisible action instead of a waitForReactPageLoad action. - Adding new action, DI updates and Actions updates. --- etc/di.xml | 2 +- .../Module/MagentoWebDriver.php | 37 ++++++++++++++++--- .../Test/etc/Actions/waitActions.xsd | 25 +++++++++++-- .../Util/TestGenerator.php | 2 + 4 files changed, 56 insertions(+), 10 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index 60faed3a0..bf002da7b 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -8,7 +8,7 @@ <!-- Entity value gets replaced in Dom.php before reading $xml --> <!DOCTYPE config [ - <!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSorted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|executeInSelenium|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pauseExecution|parseFloat|performOn|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl"> + <!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSorted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|executeInSelenium|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pauseExecution|parseFloat|performOn|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForJsElementNotVisible|waitForJsElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl"> ]> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd"> diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index a5641adcf..a9961bd7d 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -380,18 +380,45 @@ public function waitForPageLoad($timeout = null) } /** - * Wait for all React JavaScript to finish executing. + * Wait for an Element to NOT be visible using JavaScript. * - * @param integer $timeout + * @param null $selector + * @param null $timeout * @throws \Exception * @return void */ - public function waitForReactPageLoad($timeout = null) + public function waitForJsElementNotVisible($selector, $timeout = null) { $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; - $this->waitForJS('return (!!Object.keys(document).filter(prop => /^_reactListenersID/.test(prop)).length) || (document.querySelector("[data-reactroot]") && Object.keys(rootEl).some(prop => /^__reactInternalInstance/.test(prop)));', $timeout); - $this->waitForJS("return document.readyState == 'complete';", $timeout); + // Determine what type of Selector is used. + // Then use the correct JavaScript to locate the Element. + if (\Codeception\Util\Locator::isXPath($selector)) { + $this->waitForJS("return !document.evaluate(`$selector`, document);", $timeout); + } else { + $this->waitForJS("return !document.querySelector(`$selector`);", $timeout); + } + } + + /** + * Wait for an Element to be visible using JavaScript. + * + * @param null $selector + * @param null $timeout + * @throws \Exception + * @return void + */ + public function waitForJsElementVisible($selector, $timeout = null) + { + $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; + + // Determine what type of Selector is used. + // Then use the correct JavaScript to locate the Element. + if (\Codeception\Util\Locator::isXPath($selector)) { + $this->waitForJS("return !!document && !!document.evaluate(`$selector`, document);", $timeout); + } else { + $this->waitForJS("return !!document && !!document.querySelector(`$selector`);", $timeout); + } } /** diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd index ad751d9e1..f8aebcd49 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd @@ -20,7 +20,8 @@ <xs:element type="waitForJSType" name="waitForJS" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForLoadingMaskToDisappearType" name="waitForLoadingMaskToDisappear" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForPageLoadType" name="waitForPageLoad" minOccurs="0" maxOccurs="unbounded"/> - <xs:element type="waitForReactPageLoadType" name="waitForReactPageLoad" minOccurs="0" maxOccurs="unbounded"/> + <xs:element type="waitForJsElementNotVisibleType" name="waitForJsElementNotVisible" minOccurs="0" maxOccurs="unbounded"/> + <xs:element type="waitForJsElementVisibleType" name="waitForJsElementVisible" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForTextType" name="waitForText" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:group> @@ -166,7 +167,7 @@ <xs:complexType name="waitForPageLoadType"> <xs:annotation> <xs:documentation> - Waits up to given time for page to have finished loading.. + Waits up to given time for page to have finished loading. </xs:documentation> </xs:annotation> <xs:simpleContent> @@ -177,15 +178,31 @@ </xs:simpleContent> </xs:complexType> - <xs:complexType name="waitForReactPageLoadType"> + <xs:complexType name="waitForJsElementNotVisibleType"> <xs:annotation> <xs:documentation> - Waits up to given time for React page to have finished loading.. + Waits up to given time for a React Element to disappear from the screen using JavaScript. </xs:documentation> </xs:annotation> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute ref="time"/> + <xs:attribute ref="selector"/> + <xs:attributeGroup ref="commonActionAttributes"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType name="waitForJsElementVisibleType"> + <xs:annotation> + <xs:documentation> + Waits up to given time for a React Element to appear on the screen using JavaScript. + </xs:documentation> + </xs:annotation> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute ref="time"/> + <xs:attribute ref="selector"/> <xs:attributeGroup ref="commonActionAttributes"/> </xs:extension> </xs:simpleContent> diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 4113f96ee..643a2efcf 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -1045,6 +1045,8 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato case "waitForElement": case "waitForElementVisible": case "waitForElementNotVisible": + case "waitForJsElementVisible": + case "waitForJsElementNotVisible": $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $selector, $time); break; case "waitForPageLoad": From ea2a2c75e9a2d6dc1e20185bfa2b44a000184913 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Wed, 9 Jan 2019 10:11:38 -0600 Subject: [PATCH 54/63] magento-research/pwa-tests#MQE-1382-WaitForReactPageLoad - Renaming the new Actions to make it clear what they are for. Replaced "Js" with "Pwa". --- etc/di.xml | 2 +- .../Module/MagentoWebDriver.php | 8 ++++---- .../Test/etc/Actions/waitActions.xsd | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index bf002da7b..3e6313bf3 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -8,7 +8,7 @@ <!-- Entity value gets replaced in Dom.php before reading $xml --> <!DOCTYPE config [ - <!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSorted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|executeInSelenium|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pauseExecution|parseFloat|performOn|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForJsElementNotVisible|waitForJsElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl"> + <!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSorted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|executeInSelenium|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pauseExecution|parseFloat|performOn|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl"> ]> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd"> diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index a9961bd7d..d9f761896 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -380,14 +380,14 @@ public function waitForPageLoad($timeout = null) } /** - * Wait for an Element to NOT be visible using JavaScript. + * Wait for a PWA Element to NOT be visible using JavaScript. * * @param null $selector * @param null $timeout * @throws \Exception * @return void */ - public function waitForJsElementNotVisible($selector, $timeout = null) + public function waitForPwaElementNotVisible($selector, $timeout = null) { $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; @@ -401,14 +401,14 @@ public function waitForJsElementNotVisible($selector, $timeout = null) } /** - * Wait for an Element to be visible using JavaScript. + * Wait for a PWA Element to be visible using JavaScript. * * @param null $selector * @param null $timeout * @throws \Exception * @return void */ - public function waitForJsElementVisible($selector, $timeout = null) + public function waitForPwaElementVisible($selector, $timeout = null) { $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd index f8aebcd49..70b8201a1 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd @@ -20,8 +20,8 @@ <xs:element type="waitForJSType" name="waitForJS" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForLoadingMaskToDisappearType" name="waitForLoadingMaskToDisappear" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForPageLoadType" name="waitForPageLoad" minOccurs="0" maxOccurs="unbounded"/> - <xs:element type="waitForJsElementNotVisibleType" name="waitForJsElementNotVisible" minOccurs="0" maxOccurs="unbounded"/> - <xs:element type="waitForJsElementVisibleType" name="waitForJsElementVisible" minOccurs="0" maxOccurs="unbounded"/> + <xs:element type="waitForPwaElementNotVisibleType" name="waitForPwaElementNotVisible" minOccurs="0" maxOccurs="unbounded"/> + <xs:element type="waitForPwaElementVisibleType" name="waitForPwaElementVisible" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="waitForTextType" name="waitForText" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:group> @@ -178,10 +178,10 @@ </xs:simpleContent> </xs:complexType> - <xs:complexType name="waitForJsElementNotVisibleType"> + <xs:complexType name="waitForPwaElementNotVisibleType"> <xs:annotation> <xs:documentation> - Waits up to given time for a React Element to disappear from the screen using JavaScript. + Waits up to given time for a PWA Element to disappear from the screen using JavaScript. </xs:documentation> </xs:annotation> <xs:simpleContent> @@ -193,10 +193,10 @@ </xs:simpleContent> </xs:complexType> - <xs:complexType name="waitForJsElementVisibleType"> + <xs:complexType name="waitForPwaElementVisibleType"> <xs:annotation> <xs:documentation> - Waits up to given time for a React Element to appear on the screen using JavaScript. + Waits up to given time for a PWA Element to appear on the screen using JavaScript. </xs:documentation> </xs:annotation> <xs:simpleContent> From 149332a0c8c89700181d89f0616c71b652e16447 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Wed, 9 Jan 2019 13:35:02 -0600 Subject: [PATCH 55/63] magento-research/pwa-tests#MQE-1382-WaitForReactPageLoad - Updating the action name in the Generator file. --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 643a2efcf..abc62eb20 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -1045,8 +1045,8 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato case "waitForElement": case "waitForElementVisible": case "waitForElementNotVisible": - case "waitForJsElementVisible": - case "waitForJsElementNotVisible": + case "waitForPwaElementVisible": + case "waitForPwaElementNotVisible": $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $selector, $time); break; case "waitForPageLoad": From cbe914b68f1f0ff23ec0c2260d59ca30517c5537 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Thu, 10 Jan 2019 10:35:56 -0600 Subject: [PATCH 56/63] magento-research/pwa-tests#MQE-1382-WaitForReactPageLoad - Created a separate Class for the custom PWA actions. - Removed the custom PWA actions from MagentoWebDriver. --- .../Module/MagentoPwaWebDriver.php | 59 +++++++++++++++++++ .../Module/MagentoWebDriver.php | 42 ------------- 2 files changed, 59 insertions(+), 42 deletions(-) create mode 100644 src/Magento/FunctionalTestingFramework/Module/MagentoPwaWebDriver.php diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoPwaWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoPwaWebDriver.php new file mode 100644 index 000000000..98b13fe90 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoPwaWebDriver.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\FunctionalTestingFramework\Module; + +/** + * Class MagentoPwaActions + * + * Contains all custom PWA action functions to be used in PWA tests. + * + * @package Magento\FunctionalTestingFramework\Module + */ +class MagentoPwaWebDriver extends MagentoWebDriver +{ + /** + * Wait for a PWA Element to NOT be visible using JavaScript. + * + * @param null $selector + * @param null $timeout + * @throws \Exception + * @return void + */ + public function waitForPwaElementNotVisible($selector, $timeout = null) + { + $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; + + // Determine what type of Selector is used. + // Then use the correct JavaScript to locate the Element. + if (\Codeception\Util\Locator::isXPath($selector)) { + $this->waitForJS("return !document.evaluate(`$selector`, document);", $timeout); + } else { + $this->waitForJS("return !document.querySelector(`$selector`);", $timeout); + } + } + + /** + * Wait for a PWA Element to be visible using JavaScript. + * + * @param null $selector + * @param null $timeout + * @throws \Exception + * @return void + */ + public function waitForPwaElementVisible($selector, $timeout = null) + { + $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; + + // Determine what type of Selector is used. + // Then use the correct JavaScript to locate the Element. + if (\Codeception\Util\Locator::isXPath($selector)) { + $this->waitForJS("return !!document && !!document.evaluate(`$selector`, document);", $timeout); + } else { + $this->waitForJS("return !!document && !!document.querySelector(`$selector`);", $timeout); + } + } +} diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 386ca2344..a15ed757e 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -379,48 +379,6 @@ public function waitForPageLoad($timeout = null) $this->waitForLoadingMaskToDisappear($timeout); } - /** - * Wait for a PWA Element to NOT be visible using JavaScript. - * - * @param null $selector - * @param null $timeout - * @throws \Exception - * @return void - */ - public function waitForPwaElementNotVisible($selector, $timeout = null) - { - $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; - - // Determine what type of Selector is used. - // Then use the correct JavaScript to locate the Element. - if (\Codeception\Util\Locator::isXPath($selector)) { - $this->waitForJS("return !document.evaluate(`$selector`, document);", $timeout); - } else { - $this->waitForJS("return !document.querySelector(`$selector`);", $timeout); - } - } - - /** - * Wait for a PWA Element to be visible using JavaScript. - * - * @param null $selector - * @param null $timeout - * @throws \Exception - * @return void - */ - public function waitForPwaElementVisible($selector, $timeout = null) - { - $timeout = $timeout ?? $this->_getConfig()['pageload_timeout']; - - // Determine what type of Selector is used. - // Then use the correct JavaScript to locate the Element. - if (\Codeception\Util\Locator::isXPath($selector)) { - $this->waitForJS("return !!document && !!document.evaluate(`$selector`, document);", $timeout); - } else { - $this->waitForJS("return !!document && !!document.querySelector(`$selector`);", $timeout); - } - } - /** * Wait for all visible loading masks to disappear. Gets all elements by mask selector, then loops over them. * From f44f9758c0a64cdfe769cfccaa0e64f6f3f276d9 Mon Sep 17 00:00:00 2001 From: "Kristof, Fooman" <kristof@fooman.co.nz> Date: Wed, 16 Jan 2019 14:50:36 +1300 Subject: [PATCH 57/63] Allow = to be part of the secret value --- .../DataGenerator/Handlers/CredentialStore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/CredentialStore.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/CredentialStore.php index a28547d18..3f635a040 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/CredentialStore.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/CredentialStore.php @@ -131,7 +131,7 @@ private function encryptCredFileContents($credContents) continue; } - list($key, $value) = explode("=", $credValue); + list($key, $value) = explode("=", $credValue, 2); if (!empty($value)) { $encryptedCreds[$key] = openssl_encrypt( $value, From 7336d712184573b08369b067da00a4e1bdf49053 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Wed, 16 Jan 2019 16:12:37 -0600 Subject: [PATCH 58/63] MQE-1145: Update FrontendExecutor::authorize() method. --- .../DataGenerator/Persist/Curl/FrontendExecutor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php index 0a82e88a6..7e7485a82 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php @@ -82,7 +82,7 @@ public function __construct($customerEmail, $customerPassWord) private function authorize() { $url = $this->getBaseUrl() . 'customer/account/login/'; - $this->transport->write($url); + $this->transport->write($url, [], CurlInterface::GET); $this->read(); $url = $this->getBaseUrl() . 'customer/account/loginPost/'; From c80e1d3b4de48ba5c01044575e39c2a2fcb25174 Mon Sep 17 00:00:00 2001 From: Alex Calandra <calandra.aj@gmail.com> Date: Tue, 22 Jan 2019 14:01:53 -0600 Subject: [PATCH 59/63] MQE-1152: Remove redundant after execution for codeception 2.4.4 and update composer.json - Added Conditional for checking Codeception Version --- composer.json | 2 +- .../Extension/TestContextExtension.php | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 5a5f6d7c2..e0a3f52bb 100755 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0", "allure-framework/allure-codeception": "~1.3.0", "ext-curl": "*", - "codeception/codeception": "~2.3.4", + "codeception/codeception": "~2.3.4 || ~2.4.0 ", "consolidation/robo": "^1.0.0", "epfremme/swagger-php": "^2.0", "flow/jsonpath": ">0.2", diff --git a/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php b/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php index 4b77909a9..184a5eacf 100644 --- a/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php +++ b/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php @@ -16,6 +16,7 @@ class TestContextExtension extends BaseExtension { const TEST_PHASE_AFTER = "_after"; + const CODECEPT_AFTER_VERSION = "2.3.9"; const TEST_FAILED_FILE = 'failed'; /** @@ -69,7 +70,7 @@ public function testFail(\Codeception\Event\FailEvent $e) $this->runAfterBlock($e, $cest); } } - + /** * Codeception event listener function, triggered on test ending (naturally or by error). * @param \Codeception\Event\TestEvent $e @@ -117,13 +118,15 @@ private function runAfterBlock($e, $cest) try { $actorClass = $e->getTest()->getMetadata()->getCurrent('actor'); $I = new $actorClass($cest->getScenario()); - call_user_func(\Closure::bind( - function () use ($cest, $I) { - $cest->executeHook($I, 'after'); - }, - null, - $cest - )); + if (version_compare(Codeception\Codecept::VERSION, TestContextExtension::CODECEPT_AFTER_VERSION, "<=")) { + call_user_func(\Closure::bind( + function () use ($cest, $I) { + $cest->executeHook($I, 'after'); + }, + null, + $cest + )); + } } catch (\Exception $e) { // Do not rethrow Exception } From 3db00b9d7cedb290ae3fb71e0f36732bc50c9c8f Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Wed, 23 Jan 2019 15:39:58 -0600 Subject: [PATCH 60/63] MQE-1152: Remove redundant after execution for codeception 2.4.4 - added \ to codeception usage. --- .../Extension/TestContextExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php b/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php index 184a5eacf..467074097 100644 --- a/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php +++ b/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php @@ -118,7 +118,7 @@ private function runAfterBlock($e, $cest) try { $actorClass = $e->getTest()->getMetadata()->getCurrent('actor'); $I = new $actorClass($cest->getScenario()); - if (version_compare(Codeception\Codecept::VERSION, TestContextExtension::CODECEPT_AFTER_VERSION, "<=")) { + if (version_compare(\Codeception\Codecept::VERSION, TestContextExtension::CODECEPT_AFTER_VERSION, "<=")) { call_user_func(\Closure::bind( function () use ($cest, $I) { $cest->executeHook($I, 'after'); From e5a736a929e6f3983d5a50995d310def04590c2a Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Thu, 24 Jan 2019 15:47:16 -0600 Subject: [PATCH 61/63] MQE-1417: Changelog and Version Bump - Added 2.3.13 changelog and bumped version in composer/lock file --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ bin/mftf | 2 +- composer.json | 2 +- composer.lock | 7 ++++--- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e191adc..804ed527b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ Magento Functional Testing Framework Changelog ================================================ + +2.3.13 +----- +### Enhancements +* Traceability + * Failed test steps are now marked with a red `x` in the generated Allure report. + * A failed `suite` `<before>` now correctly causes subsequent tests to marked as `failed` instead of `skipped`. +* Customizability + * Added `waitForPwaElementVisible` and `waitForPwaElementNotVisible` actions. +* Modularity + * Added support for parsing of symlinked modules under `vendor`. + +### Fixes +* Fixed a PHP Fatal error that occurred if the given `MAGENTO_BASE_URL` responded with anything but a `200`. +* Fixed an issue where a test's `<after>` would run twice with Codeception `2.4.x` +* Fixed an issue where tests using `extends` would not correctly override parent test steps +* Test actions can now send an empty string to parameterized selectors. +* Refactored `dragAndDrop` test action to correctly use given `x` and `y` arguments. + +### GitHub Issues/Pull requests: +* [#297](https://github.com/magento/magento2-functional-testing-framework/pull/297) -- Allow = to be part of the secret value +* [#267](https://github.com/magento/magento2-functional-testing-framework/pull/267) -- Add PHPUnit missing in dependencies +* [#266](https://github.com/magento/magento2-functional-testing-framework/pull/266) -- General refactor: ext-curl dependency + review of singletones (refactor constructs) +* [#264](https://github.com/magento/magento2-functional-testing-framework/pull/264) -- Use custom Backend domain, refactoring to Executors responsible for calling HTTP endpoints +* [#258](https://github.com/magento/magento2-functional-testing-framework/pull/258) -- Removed unused variables in FunctionCommentSniff.php +* [#256](https://github.com/magento/magento2-functional-testing-framework/pull/256) -- Removed unused variables + 2.3.12 ----- ### Enhancements diff --git a/bin/mftf b/bin/mftf index b7d928c15..9aba5cbd0 100755 --- a/bin/mftf +++ b/bin/mftf @@ -29,7 +29,7 @@ try { try { $application = new Symfony\Component\Console\Application(); $application->setName('Magento Functional Testing Framework CLI'); - $application->setVersion('2.3.12'); + $application->setVersion('2.3.13'); /** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */ $commandList = new \Magento\FunctionalTestingFramework\Console\CommandList; foreach ($commandList->getCommands() as $command) { diff --git a/composer.json b/composer.json index e0a3f52bb..f1e67abcf 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": "2.3.12", + "version": "2.3.13", "license": "AGPL-3.0", "keywords": ["magento", "automation", "functional", "testing"], "config": { diff --git a/composer.lock b/composer.lock index bd89b0cfd..ce20aec87 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": "de6d553c95a5721a7d4f6515c7aa15b5", + "content-hash": "e8978028c326adbd983d1a6ef7294ae0", "packages": [ { "name": "allure-framework/allure-codeception", @@ -4125,7 +4125,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -5684,7 +5684,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0" + "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0", + "ext-curl": "*" }, "platform-dev": [] } From 3da7be59f9be3f68a436cb17dc7bca7e4d7bd2a9 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Mon, 28 Jan 2019 09:38:28 -0600 Subject: [PATCH 62/63] Revert "MQE-1185: MFTF DragAndDrop Action Is Not Using X, Y Offsets Correctly" This reverts commit 2fe867cf0f9afa7a207c9aed8d0bc097c4d4f504. --- .../Module/MagentoWebDriver.php | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index a15ed757e..93e6a5968 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -599,29 +599,23 @@ public function _before(TestInterface $test) */ public function dragAndDrop($source, $target, $xOffset = null, $yOffset = null) { - if ($xOffset === null && $yOffset === null) { - parent::dragAndDrop($source, $target); - } else { - $sNode = $this->matchFirstOrFail($this->baseElement, $source); - $tNode = $this->matchFirstOrFail($this->baseElement, $target); + if ($xOffset !== null || $yOffset !== null) { + $snodes = $this->matchFirstOrFail($this->baseElement, $source); + $tnodes = $this->matchFirstOrFail($this->baseElement, $target); - $sHeight = $sNode->getSize()->getHeight(); - $sWidth = $sNode->getSize()->getWidth(); + $targetX = intval($tnodes->getLocation()->getX() + $xOffset); + $targetY = intval($tnodes->getLocation()->getY() + $yOffset); - $travelX = intval($tNode->getLocation()->getX() - $sNode->getLocation()->getX() + $xOffset); - $travelY = intval($tNode->getLocation()->getY() - $sNode->getLocation()->getY() + $yOffset); + $travelX = intval($targetX - $snodes->getLocation()->getX()); + $travelY = intval($targetY - $snodes->getLocation()->getY()); $action = new WebDriverActions($this->webDriver); - if ($travelX >0 && $travelY >0 && $travelX < $sWidth && $travelY < $sHeight) { - // Perform separate action steps when dragging and dropping inside the source element boundary - $action->moveToElement($sNode)->perform(); - $action->clickAndHold($sNode)->perform(); - $action->moveByOffset($travelX, $travelY)->perform(); - $action->release()->perform(); - } else { - // Call dragAndDropBy otherwise - $action->dragAndDropBy($sNode, $travelX, $travelY)->perform(); - } + $action->moveToElement($snodes)->perform(); + $action->clickAndHold($snodes)->perform(); + $action->moveByOffset($travelX, $travelY)->perform(); + $action->release()->perform(); + } else { + parent::dragAndDrop($source, $target); } } From 2953a241ccb530cfafc8630b87268937160533c8 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Mon, 28 Jan 2019 09:40:01 -0600 Subject: [PATCH 63/63] MQE-1185: MFTF DragAndDrop Action Is Not Using X, Y Offsets Correctly - Removing fix line from ChangeLog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 804ed527b..2dc01e00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,6 @@ Magento Functional Testing Framework Changelog * Fixed an issue where a test's `<after>` would run twice with Codeception `2.4.x` * Fixed an issue where tests using `extends` would not correctly override parent test steps * Test actions can now send an empty string to parameterized selectors. -* Refactored `dragAndDrop` test action to correctly use given `x` and `y` arguments. ### GitHub Issues/Pull requests: * [#297](https://github.com/magento/magento2-functional-testing-framework/pull/297) -- Allow = to be part of the secret value