diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php
index 9b4224271d5818a45ec3df606ea635a18e694c41..3329f8aaf93c6b5d9a813f06de710f75634eb939 100644
--- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php
+++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php
@@ -77,17 +77,25 @@ class Checkbox extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra
     {
         $values = $this->_getValues();
         $value = $row->getData($this->getColumn()->getIndex());
+        $checked = '';
         if (is_array($values)) {
             $checked = in_array($value, $values) ? ' checked="checked"' : '';
         } else {
-            $checked = $value === $this->getColumn()->getValue() ? ' checked="checked"' : '';
+            $checkedValue = $this->getColumn()->getValue();
+            if ($checkedValue !== null) {
+                $checked = $value === $checkedValue ? ' checked="checked"' : '';
+            }
         }
 
+        $disabled = '';
         $disabledValues = $this->getColumn()->getDisabledValues();
         if (is_array($disabledValues)) {
             $disabled = in_array($value, $disabledValues) ? ' disabled="disabled"' : '';
         } else {
-            $disabled = $value === $this->getColumn()->getDisabledValue() ? ' disabled="disabled"' : '';
+            $disabledValue = $this->getColumn()->getDisabledValue();
+            if ($disabledValue !== null) {
+                $disabled = $value === $disabledValue ? ' disabled="disabled"' : '';
+            }
         }
 
         $this->setDisabled($disabled);
diff --git a/app/code/Magento/Backend/Model/Session/AdminConfig.php b/app/code/Magento/Backend/Model/Session/AdminConfig.php
index c3fa55ed8d0ad5b736c150177ba16880c181466a..155a9b09528fc1862222df8e54826edc36dce220 100644
--- a/app/code/Magento/Backend/Model/Session/AdminConfig.php
+++ b/app/code/Magento/Backend/Model/Session/AdminConfig.php
@@ -30,14 +30,14 @@ class AdminConfig extends Config
     protected $_frontNameResolver;
 
     /**
-     * @var \Magento\Store\Model\StoreManagerInterface
+     * @var \Magento\Backend\App\BackendAppList
      */
-    protected $_storeManager;
+    private $backendAppList;
 
     /**
-     * @var \Magento\Backend\App\BackendAppList
+     * @var \Magento\Backend\Model\UrlFactory
      */
-    private $backendAppList;
+    private $backendUrlFactory;
 
     /**
      * @param \Magento\Framework\ValidatorFactory $validatorFactory
@@ -49,7 +49,7 @@ class AdminConfig extends Config
      * @param string $scopeType
      * @param \Magento\Backend\App\BackendAppList $backendAppList
      * @param FrontNameResolver $frontNameResolver
-     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
+     * @param \Magento\Backend\Model\UrlFactory $backendUrlFactory
      * @param string $lifetimePath
      * @param string $sessionName
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -64,7 +64,7 @@ class AdminConfig extends Config
         $scopeType,
         \Magento\Backend\App\BackendAppList $backendAppList,
         FrontNameResolver $frontNameResolver,
-        \Magento\Store\Model\StoreManagerInterface $storeManager,
+        \Magento\Backend\Model\UrlFactory $backendUrlFactory,
         $lifetimePath = self::XML_PATH_COOKIE_LIFETIME,
         $sessionName = self::SESSION_NAME_ADMIN
     ) {
@@ -79,8 +79,8 @@ class AdminConfig extends Config
             $lifetimePath
         );
         $this->_frontNameResolver = $frontNameResolver;
-        $this->_storeManager = $storeManager;
         $this->backendAppList = $backendAppList;
+        $this->backendUrlFactory = $backendUrlFactory;
         $adminPath = $this->extractAdminPath();
         $this->setCookiePath($adminPath);
         $this->setName($sessionName);
@@ -95,7 +95,7 @@ class AdminConfig extends Config
     {
         $backendApp = $this->backendAppList->getCurrentApp();
         $cookiePath = null;
-        $baseUrl = parse_url($this->_storeManager->getStore()->getBaseUrl(), PHP_URL_PATH);
+        $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
         if (!$backendApp) {
             $cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();
             return $cookiePath;
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php b/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php
index 6b00b71e4c8517532503f064f7aa2009a6c6fbff..24baab2a0298e6e7f3bfdfe01ac4366d823204de 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php
@@ -29,9 +29,9 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
     private $objectManager;
 
     /**
-     * @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
+     * @var \Magento\Backend\Model\UrlFactory | \PHPUnit_Framework_MockObject_MockObject
      */
-    private $storeManagerMock;
+    private $backendUrlFactory;
 
     /**
      * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
@@ -56,13 +56,10 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
         $this->validatorFactory = $this->getMockBuilder('Magento\Framework\ValidatorFactory')
             ->disableOriginalConstructor()
             ->getMock();
-
-        $storeMock = $this->getMockBuilder('\Magento\Store\Model\Store')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
-        $this->storeManagerMock = $this->getMockForAbstractClass('\Magento\Store\Model\StoreManagerInterface');
-        $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
+        $backendUrl = $this->getMock('\Magento\Backend\Model\Url', [], [], '', false);
+        $backendUrl->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
+        $this->backendUrlFactory = $this->getMock('Magento\Backend\Model\UrlFactory', ['create'], [], '', false);
+        $this->backendUrlFactory->expects($this->any())->method('create')->willReturn($backendUrl);
 
         $this->filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false);
         $dirMock = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
@@ -99,7 +96,7 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
                 'validatorFactory' => $this->validatorFactory,
                 'request' => $this->requestMock,
                 'frontNameResolver' => $mockFrontNameResolver,
-                'storeManager' => $this->storeManagerMock,
+                'backendUrlFactory' => $this->backendUrlFactory,
                 'filesystem' => $this->filesystemMock,
             ]
         );
@@ -134,7 +131,7 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
                 'validatorFactory' => $this->validatorFactory,
                 'request' => $this->requestMock,
                 'sessionName' => $sessionName,
-                'storeManager' => $this->storeManagerMock,
+                'backendUrlFactory' => $this->backendUrlFactory,
                 'filesystem' => $this->filesystemMock,
             ]
         );
diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml
index fedec572af962a86661de9308ea78095fff09b64..41f6bf34afc8a9184e5bab7dca4e516e0c2055c4 100644
--- a/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml
+++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml
@@ -22,7 +22,7 @@ if (!isset($advancedLabel)) {
     $advancedLabel = __('Additional Settings');
 }
 
-$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset' . $element->getClass();
+$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset ' . $element->getClass();
 
 if ($isField) {
     $count = $element->getCountBasicChildren();
diff --git a/app/code/Magento/Braintree/Model/PaymentMethod.php b/app/code/Magento/Braintree/Model/PaymentMethod.php
index 8e14ed191e350097a62984c7570d667c149a077b..45171956e87bcf8832723f7b7dffeb90ea5f1f79 100644
--- a/app/code/Magento/Braintree/Model/PaymentMethod.php
+++ b/app/code/Magento/Braintree/Model/PaymentMethod.php
@@ -11,6 +11,7 @@ use \Braintree_Exception;
 use \Braintree_Transaction;
 use \Braintree_Result_Successful;
 use Magento\Framework\Exception\LocalizedException;
+use Magento\Sales\Model\Order\Payment\Transaction;
 use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
 use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
 use Magento\Payment\Model\InfoInterface;
@@ -648,6 +649,7 @@ class PaymentMethod extends \Magento\Payment\Model\Method\Cc
                 }
             }
 
+            // transaction should be voided if it not settled
             $canVoid = ($transaction->status === \Braintree_Transaction::AUTHORIZED
                 || $transaction->status === \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT);
             $result = $canVoid
@@ -655,6 +657,7 @@ class PaymentMethod extends \Magento\Payment\Model\Method\Cc
                 : $this->braintreeTransaction->refund($transactionId, $amount);
             $this->_debug($this->_convertObjToArray($result));
             if ($result->success) {
+                $payment->setTransactionId($transactionId . '-' . Transaction::TYPE_REFUND);
                 $payment->setIsTransactionClosed(true);
             } else {
                 throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php b/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php
index f8f0494c128672811a883a0f832ae464b5f663dc..e20af765062e3b3b0713c5732d5b67f8f3c279f3 100644
--- a/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php
@@ -8,6 +8,7 @@ namespace Magento\Braintree\Test\Unit\Model;
 
 use Magento\Braintree\Model\PaymentMethod;
 use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
+use Magento\Sales\Model\Order\Payment\Transaction;
 use \Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
 use Magento\Framework\Exception\LocalizedException;
 use \Braintree_Result_Successful;
@@ -2378,6 +2379,7 @@ class PaymentMethodTest extends \PHPUnit_Framework_TestCase
 
         $this->model->refund($paymentObject, $amount);
         $this->assertEquals(1, $paymentObject->getIsTransactionClosed());
+        $this->assertEquals($refundTransactionId . '-' .Transaction::TYPE_REFUND, $paymentObject->getTransactionId());
     }
 
     /**
diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml
index c27901cd4e8704fc7fdf044e47b8cc40db1a7e40..5610e082e1715e36dcecc8f7cc241bf1aeee2798 100644
--- a/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml
+++ b/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml
@@ -133,7 +133,7 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
             </div>
         </fieldset>
     <?php endif; ?>
-    <?php if($_useVault): ?>
+    <?php if($useVault): ?>
         <fieldset class="admin__fieldset hide_if_token_selected">
             <div id="<?php /* @noEscape */ echo $code; ?>_store_in_vault_div" style="text-align:left;" class="">
                 <input type="checkbox" title="<?php echo $block->escapeHtml(__('Save this card for future use')); ?>"
diff --git a/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml b/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml
index fd9ee17028bb6eae399fe70103f3f8e82933681f..467e2523e6162efa00389deb18ecfe9f5fa43f9a 100644
--- a/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml
+++ b/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml
@@ -19,7 +19,7 @@ $storedCards = $block->getCurrentCustomerStoredCards();
     <?php endif; ?>
 </div>
 <?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>
-<?php if (count($_storedCards)): ?>
+<?php if (count($storedCards)): ?>
     <table class="data-table" id="my-quotes-table">
         <col width="1" />
         <col width="1" />
diff --git a/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html
index f28cb33ceb4b1e1b13c85cd7d537fcf95377a434..a120355d9080ac35b377082eda8f1b4bd1076b16 100644
--- a/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html
+++ b/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html
@@ -80,7 +80,10 @@
                         <!-- ko if: (isCcDetectionEnabled())-->
                         <ul class="credit-card-types">
                             <!-- ko foreach: {data: getCcAvailableTypesValues(), as: 'item'} -->
-                            <li class="item" data-bind="css: {_active: $parent.selectedCardType() == item.value} ">
+                            <li class="item" data-bind="css: {
+                                                            _active: $parent.selectedCardType() == item.value,
+                                                            _inactive: $parent.selectedCardType() != null && $parent.selectedCardType() != item.value
+                                                            } ">
                                 <!--ko if: $parent.getIcons(item.value) -->
                                 <img data-bind="attr: {
                                     'src': $parent.getIcons(item.value).url,
diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml
index 3ab486011b5a660d3a2e28b05de7de8f321b322e..7bd251153314e365e0b9ed8c27de9939ac8f5a8a 100644
--- a/app/code/Magento/Catalog/etc/di.xml
+++ b/app/code/Magento/Catalog/etc/di.xml
@@ -494,6 +494,11 @@
             </argument>
         </arguments>
     </type>
+    <type name="Magento\Catalog\Console\Command\ImagesResizeCommand">
+        <arguments>
+            <argument name="productRepository" xsi:type="object">Magento\Catalog\Api\ProductRepositoryInterface\Proxy</argument>
+        </arguments>
+    </type>
     <type name="Magento\Framework\Config\View">
         <arguments>
             <argument name="xpath" xsi:type="array">
diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json
index 4c1eb56566a7f4c771d7667adcb3a7f79c73faf0..58ab73368af0ccef8200703206e9ec1d919ed57e 100644
--- a/app/code/Magento/Cookie/composer.json
+++ b/app/code/Magento/Cookie/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-cookie",
     "description": "N/A",
     "require": {
-        "php": "~5.4.11|~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/module-store": "1.0.0-beta",
         "magento/framework": "1.0.0-beta"
     },
diff --git a/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php b/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php
index 275b185492ea51d74e7625af89de766f95cd8a86..92bfb1d5c7fac309014d25396284b5f2aa50b401 100644
--- a/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php
+++ b/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php
@@ -40,7 +40,6 @@ class UpgradeHashAlgorithmCommand extends Command
     ) {
         parent::__construct();
         $this->customerCollectionFactory = $customerCollectionFactory;
-        $this->collection = $customerCollectionFactory->create();
         $this->encryptor = $encryptor;
     }
 
@@ -58,6 +57,7 @@ class UpgradeHashAlgorithmCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
+        $this->collection = $this->customerCollectionFactory->create();
         $this->collection->addAttributeToSelect('*');
         $customerCollection = $this->collection->getItems();
         /** @var $customer Customer */
diff --git a/app/code/Magento/Deploy/Model/Deployer.php b/app/code/Magento/Deploy/Model/Deployer.php
index cada5a4549aee90b4f18f6df5a2588dd37d82c25..60480c220e23ccc1762243ab61075bf7fb7aec7b 100644
--- a/app/code/Magento/Deploy/Model/Deployer.php
+++ b/app/code/Magento/Deploy/Model/Deployer.php
@@ -6,6 +6,7 @@
 
 namespace Magento\Deploy\Model;
 
+use Magento\Framework\View\Asset\PreProcessor\AlternativeSourceInterface;
 use Magento\Framework\App\ObjectManagerFactory;
 use Magento\Framework\App\View\Deployment\Version;
 use Magento\Framework\App\View\Asset\Publisher;
@@ -19,6 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface;
  * A service for deploying Magento static view files for production mode
  *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.UnusedLocalVariable)
  */
 class Deployer
 {
@@ -66,10 +68,18 @@ class Deployer
     protected $jsTranslationConfig;
 
     /**
+     * @var AlternativeSourceInterface[]
+     */
+    private $alternativeSources;
+
+    /**
+     * Constructor
+     *
      * @param Files $filesUtil
      * @param OutputInterface $output
      * @param Version\StorageInterface $versionStorage
      * @param JsTranslationConfig $jsTranslationConfig
+     * @param AlternativeSourceInterface[] $alternativeSources
      * @param bool $isDryRun
      */
     public function __construct(
@@ -77,6 +87,7 @@ class Deployer
         OutputInterface $output,
         Version\StorageInterface $versionStorage,
         JsTranslationConfig $jsTranslationConfig,
+        array $alternativeSources,
         $isDryRun = false
     ) {
         $this->filesUtil = $filesUtil;
@@ -85,6 +96,13 @@ class Deployer
         $this->isDryRun = $isDryRun;
         $this->jsTranslationConfig = $jsTranslationConfig;
         $this->parentTheme = [];
+
+        array_map(
+            function (AlternativeSourceInterface $alternative) {
+            },
+            $alternativeSources
+        );
+        $this->alternativeSources = $alternativeSources;
     }
 
     /**
@@ -124,6 +142,7 @@ class Deployer
                             'design' => $design,
                         ]
                     );
+                    /** @var \Magento\RequireJs\Model\FileManager $fileManager */
                     $fileManager = $this->objectManager->create(
                         'Magento\RequireJs\Model\FileManager',
                         [
@@ -148,11 +167,17 @@ class Deployer
                                     $this->findAncestors($area . Theme::THEME_PATH_SEPARATOR . $themePath)
                                 ))
                         ) {
-                            $this->deployFile($filePath, $area, $themePath, $locale, $module);
+                            $compiledFile = $this->deployFile($filePath, $area, $themePath, $locale, $module);
+                            if ($compiledFile !== '') {
+                                $this->deployFile($compiledFile, $area, $themePath, $locale, $module);
+                            }
                         }
                     }
                     foreach ($libFiles as $filePath) {
-                        $this->deployFile($filePath, $area, $themePath, $locale, null);
+                        $compiledFile = $this->deployFile($filePath, $area, $themePath, $locale, null);
+                        if ($compiledFile !== '') {
+                            $this->deployFile($compiledFile, $area, $themePath, $locale, null);
+                        }
                     }
                     if ($this->jsTranslationConfig->dictionaryEnabled()) {
                         $this->deployFile(
@@ -169,7 +194,7 @@ class Deployer
                 }
             }
         }
-        $this->output->writeln("=== Minify templates ===");
+        $this->output->writeln('=== Minify templates ===');
         $this->count = 0;
         foreach ($this->filesUtil->getPhtmlFiles(false, false) as $template) {
             $this->htmlMinifier->minify($template);
@@ -268,15 +293,25 @@ class Deployer
      * @param string $themePath
      * @param string $locale
      * @param string $module
-     * @return void
+     * @return string
+     * @throws \InvalidArgumentException
+     *
      * @SuppressWarnings(PHPMD.NPathComplexity)
      */
     private function deployFile($filePath, $area, $themePath, $locale, $module)
     {
-        $requestedPath = $filePath;
-        if (substr($filePath, -5) == '.less') {
-            $requestedPath = preg_replace('/.less$/', '.css', $filePath);
+        $compiledFile = '';
+        $extension = pathinfo($filePath, PATHINFO_EXTENSION);
+
+        foreach ($this->alternativeSources as $name => $alternative) {
+            if (in_array($extension, $alternative->getAlternativesExtensionsNames(), true)
+                && strpos(basename($filePath), '_') !== 0
+            ) {
+                $compiledFile = substr($filePath, 0, strlen($filePath) - strlen($extension) - 1);
+                $compiledFile = $compiledFile . '.' . $name;
+            }
         }
+
         $logMessage = "Processing file '$filePath' for area '$area', theme '$themePath', locale '$locale'";
         if ($module) {
             $logMessage .= ", module '$module'";
@@ -288,7 +323,7 @@ class Deployer
 
         try {
             $asset = $this->assetRepo->createAsset(
-                $requestedPath,
+                $filePath,
                 ['area' => $area, 'theme' => $themePath, 'locale' => $locale, 'module' => $module]
             );
             if ($this->output->isVeryVerbose()) {
@@ -303,18 +338,13 @@ class Deployer
                 $this->bundleManager->addAsset($asset);
             }
             $this->count++;
-        } catch (\Less_Exception_Compiler $e) {
-            $this->verboseLog(
-                "\tNotice: Could not parse LESS file '$filePath'. "
-                . "This may indicate that the file is incomplete, but this is acceptable. "
-                . "The file '$filePath' will be combined with another LESS file."
-            );
-            $this->verboseLog("\tCompiler error: " . $e->getMessage());
         } catch (\Exception $e) {
-            $this->output->writeln($e->getMessage() . " ($logMessage)");
+            $this->output->write('.');
             $this->verboseLog($e->getTraceAsString());
             $this->errorCount++;
         }
+
+        return $compiledFile;
     }
 
     /**
diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json
index 48b8e7f4ae081385d4623224c53b8fdfeb971a7e..691d71fb387070b5f0447d8c00a97b34fa76fedc 100644
--- a/app/code/Magento/Deploy/composer.json
+++ b/app/code/Magento/Deploy/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-deploy",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/framework": "1.0.0-beta",
         "magento/module-developer": "1.0.0-beta",
         "magento/module-store": "1.0.0-beta",
diff --git a/app/code/Magento/Deploy/etc/di.xml b/app/code/Magento/Deploy/etc/di.xml
index 9d0ed7220c62a84f0dec3c4baab07c7c49e11131..59fb508c691b53a6137a129bbcc2292acf752a3d 100644
--- a/app/code/Magento/Deploy/etc/di.xml
+++ b/app/code/Magento/Deploy/etc/di.xml
@@ -6,6 +6,13 @@
  */
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
+    <type name="Magento\Deploy\Model\Deployer">
+        <arguments>
+            <argument name="alternativeSources" xsi:type="array">
+                <item name="css" xsi:type="object">AlternativeSourceProcessors</item>
+            </argument>
+        </arguments>
+    </type>
     <type name="Magento\Framework\Console\CommandList">
         <arguments>
             <argument name="commands" xsi:type="array">
diff --git a/app/code/Magento/Developer/Console/Command/CssDeployCommand.php b/app/code/Magento/Developer/Console/Command/CssDeployCommand.php
index 4abf04b34f01f82ef58b214bf442202634949664..ac651b633d026790bfe6d6d3a50283303e00eaa1 100644
--- a/app/code/Magento/Developer/Console/Command/CssDeployCommand.php
+++ b/app/code/Magento/Developer/Console/Command/CssDeployCommand.php
@@ -6,6 +6,7 @@
 
 namespace Magento\Developer\Console\Command;
 
+use Magento\Framework\View\Asset\PreProcessor\Pool;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputOption;
@@ -17,7 +18,6 @@ use Magento\Framework\App\State;
 use Magento\Framework\View\Asset\Repository;
 use Magento\Framework\ObjectManagerInterface;
 use Magento\Framework\App\ObjectManager\ConfigLoader;
-use Magento\Framework\View\Asset\SourceFileGeneratorPool;
 use Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface;
 use Magento\Framework\App\Filesystem\DirectoryList;
 use Magento\Framework\Validator\Locale;
@@ -73,11 +73,6 @@ class CssDeployCommand extends Command
      */
     private $state;
 
-    /**
-     * @var SourceFileGeneratorPool
-     */
-    private $sourceFileGeneratorPool;
-
     /**
      * @var Source
      */
@@ -98,6 +93,11 @@ class CssDeployCommand extends Command
      */
     private $validator;
 
+    /**
+     * @var Pool
+     */
+    private $pool;
+
     /**
      * Inject dependencies
      *
@@ -106,10 +106,10 @@ class CssDeployCommand extends Command
      * @param ConfigLoader $configLoader
      * @param State $state
      * @param Source $assetSource
-     * @param SourceFileGeneratorPool $sourceFileGeneratorPoll
      * @param ChainFactoryInterface $chainFactory
      * @param Filesystem $filesystem
      * @param Locale $validator
+     * @param Pool $pool
      */
     public function __construct(
         ObjectManagerInterface $objectManager,
@@ -117,22 +117,22 @@ class CssDeployCommand extends Command
         ConfigLoader $configLoader,
         State $state,
         Source $assetSource,
-        SourceFileGeneratorPool $sourceFileGeneratorPoll,
         ChainFactoryInterface $chainFactory,
         Filesystem $filesystem,
-        Locale $validator
+        Locale $validator,
+        Pool $pool
     ) {
         $this->state = $state;
         $this->objectManager = $objectManager;
         $this->configLoader = $configLoader;
         $this->assetRepo = $assetRepo;
-        $this->sourceFileGeneratorPool = $sourceFileGeneratorPoll;
         $this->assetSource = $assetSource;
         $this->chainFactory = $chainFactory;
         $this->filesystem = $filesystem;
         $this->validator = $validator;
 
         parent::__construct();
+        $this->pool = $pool;
     }
 
     /**
@@ -203,8 +203,6 @@ class CssDeployCommand extends Command
         $this->state->setAreaCode($area);
         $this->objectManager->configure($this->configLoader->load($area));
 
-        $sourceFileGenerator = $this->sourceFileGeneratorPool->create($type);
-
         foreach ($input->getArgument(self::FILE_ARGUMENT) as $file) {
             $file .= '.' . $type;
 
@@ -233,14 +231,11 @@ class CssDeployCommand extends Command
                 ]
             );
 
-            $processedCoreFile = $sourceFileGenerator->generateFileTree($chain);
-
+            $this->pool->process($chain);
             $targetDir = $this->filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW);
-            $source = $rootDir->getRelativePath($processedCoreFile);
-            $destination = $asset->getPath();
-            $rootDir->copyFile($source, $destination, $targetDir);
+            $targetDir->writeFile($chain->getAsset()->getPath(), $chain->getContent());
 
-            $output->writeln("<info>Successfully processed dynamic stylesheet into CSS</info>");
+            $output->writeln('<info>Successfully processed dynamic stylesheet into CSS</info>');
         }
     }
 }
diff --git a/app/code/Magento/Developer/Test/Unit/Console/Command/CssDeployCommandTest.php b/app/code/Magento/Developer/Test/Unit/Console/Command/CssDeployCommandTest.php
index d274aa003133d2bd6a8bebc061113cb6e94cfd5d..0d930989e424eefbcd192c0c3ca33322c13ba06a 100644
--- a/app/code/Magento/Developer/Test/Unit/Console/Command/CssDeployCommandTest.php
+++ b/app/code/Magento/Developer/Test/Unit/Console/Command/CssDeployCommandTest.php
@@ -7,17 +7,20 @@
 namespace Magento\Developer\Test\Unit\Console\Command;
 
 use Magento\Framework\Filesystem;
+use Magento\Framework\View\Asset\PreProcessor\Pool;
 use Magento\Framework\View\Asset\Source;
 use Magento\Framework\App\State;
 use Magento\Framework\View\Asset\Repository;
 use Magento\Framework\ObjectManagerInterface;
 use Magento\Framework\App\ObjectManager\ConfigLoader;
-use Magento\Framework\View\Asset\SourceFileGeneratorPool;
 use Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface;
 use Magento\Developer\Console\Command\CssDeployCommand;
 use Symfony\Component\Console\Tester\CommandTester;
 use Magento\Framework\Validator\Locale;
 
+/**
+ * Class CssDeployCommandTest
+ */
 class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
 {
     /**
@@ -45,11 +48,6 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
      */
     private $state;
 
-    /**
-     * @var SourceFileGeneratorPool|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $sourceFileGeneratorPool;
-
     /**
      * @var Source|\PHPUnit_Framework_MockObject_MockObject
      */
@@ -70,6 +68,11 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
      */
     private $validator;
 
+    /**
+     * @var Pool|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $poolMock;
+
     public function setUp()
     {
         $this->objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface');
@@ -77,18 +80,14 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
         $this->configLoader = $this->getMock('Magento\Framework\App\ObjectManager\ConfigLoader', [], [], '', false);
         $this->state = $this->getMock('Magento\Framework\App\State', [], [], '', false);
         $this->assetSource = $this->getMock('Magento\Framework\View\Asset\Source', [], [], '', false);
-        $this->sourceFileGeneratorPool = $this->getMock(
-            'Magento\Framework\View\Asset\SourceFileGeneratorPool',
-            [],
-            [],
-            '',
-            false
-        );
         $this->chainFactory = $this->getMockForAbstractClass(
             'Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface'
         );
         $this->filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false);
         $this->validator = $this->getMock('Magento\Framework\Validator\Locale', [], [], '', false);
+        $this->poolMock = $this->getMockBuilder('Magento\Framework\View\Asset\PreProcessor\Pool')
+            ->disableOriginalConstructor()
+            ->getMock();
 
         $this->command = new CssDeployCommand(
             $this->objectManager,
@@ -96,10 +95,10 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
             $this->configLoader,
             $this->state,
             $this->assetSource,
-            $this->sourceFileGeneratorPool,
             $this->chainFactory,
             $this->filesystem,
-            $this->validator
+            $this->validator,
+            $this->poolMock
         );
     }
 
@@ -109,10 +108,6 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
 
         $this->configLoader->expects($this->once())->method('load')->with('frontend')->willReturn([]);
         $this->objectManager->expects($this->once())->method('configure');
-        $this->sourceFileGeneratorPool->expects($this->once())
-            ->method('create')
-            ->with('less')
-            ->willReturn($this->getMock('Magento\Framework\View\Asset\SourceFileGeneratorInterface'));
         $asset = $this->getMockForAbstractClass('Magento\Framework\View\Asset\LocalInterface');
         $asset->expects($this->once())->method('getContentType')->willReturn('type');
         $this->assetRepo->expects($this->once())
@@ -128,6 +123,10 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
             ->willReturn($asset);
         $this->assetSource->expects($this->once())->method('findSource')->willReturn('/dev/null');
 
+        $chainMock = $this->getMock('Magento\Framework\View\Asset\PreProcessor\Chain', [], [], '', false);
+        $assetMock = $this->getMockBuilder('Magento\Framework\View\Asset\LocalInterface')
+            ->getMockForAbstractClass();
+
         $this->chainFactory->expects($this->once())
             ->method('create')
             ->with(
@@ -137,8 +136,11 @@ class CssDeployCommandTest extends \PHPUnit_Framework_TestCase
                     'origContentType' => 'type',
                     'origAssetPath' => 'relative/path',
                 ]
-            )
-            ->willReturn($this->getMock('Magento\Framework\View\Asset\PreProcessor\Chain', [], [], '', false));
+            )->willReturn($chainMock);
+
+        $chainMock->expects(self::once())
+            ->method('getAsset')
+            ->willReturn($assetMock);
 
         $rootDir = $this->getMock('\Magento\Framework\Filesystem\Directory\WriteInterface', [], [], '', false);
         $this->filesystem->expects($this->at(0))->method('getDirectoryWrite')->willReturn($rootDir);
diff --git a/app/code/Magento/Developer/etc/di.xml b/app/code/Magento/Developer/etc/di.xml
index c43c9e06ca2cfe9e1eee412b80729f12d1079df7..a208ec7c5de01f26250b2a93d5d571732899c2d6 100644
--- a/app/code/Magento/Developer/etc/di.xml
+++ b/app/code/Magento/Developer/etc/di.xml
@@ -8,7 +8,7 @@
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     <preference for="Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface" type="Magento\Developer\Model\View\Asset\PreProcessor\DeveloperChainFactory"/>
     <preference for="Magento\Framework\Css\PreProcessor\ErrorHandlerInterface" type="Magento\Framework\Css\PreProcessor\ErrorHandler" />
-    <preference for="Magento\Framework\Css\PreProcessor\AdapterInterface" type="Magento\Framework\Css\PreProcessor\Adapter\Less\Oyejorge" />
+    <preference for="Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface" type="Magento\Framework\View\Asset\PreProcessor\Helper\Sort"/>
 
     <type name="Magento\Framework\View\Result\Page">
         <arguments>
@@ -45,52 +45,58 @@
         </arguments>
     </virtualType>
 
+    <virtualType name="viewFileFallbackResolver" type="Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Alternative"/>
 
-
-    <virtualType name="viewFileFallbackResolver" type="Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Alternative">
+    <virtualType name="AlternativeSourceProcessors" type="Magento\Framework\View\Asset\PreProcessor\AlternativeSource">
         <arguments>
-            <argument name="alternativeExtensions" xsi:type="array">
-                <item name="css" xsi:type="array">
-                    <item name="less" xsi:type="string">less</item>
+            <argument name="lockName" xsi:type="string">alternative-source-css</argument>
+            <argument name="lockerProcess" xsi:type="object">Magento\Framework\View\Asset\LockerProcess</argument>
+            <argument name="alternatives" xsi:type="array">
+                <item name="less" xsi:type="array">
+                    <item name="class" xsi:type="string">Magento\Framework\Css\PreProcessor\Adapter\Less\Processor</item>
                 </item>
             </argument>
         </arguments>
     </virtualType>
+
     <type name="Magento\Framework\View\Asset\PreProcessor\Pool">
         <arguments>
-            <argument name="preProcessors" xsi:type="array">
+            <argument name="defaultPreprocessor" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\Passthrough</argument>
+            <argument name="preprocessors" xsi:type="array">
                 <item name="less" xsi:type="array">
-                    <item name="css" xsi:type="array">
-                        <item name="less" xsi:type="string">Magento\Framework\Css\PreProcessor\Less</item>
-                        <item name="variable_notation" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\VariableNotation</item>
-                        <item name="module_notation" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\ModuleNotation</item>
-                        <item name="css_min" xsi:type="string">cssMinificationProcessor</item>
+                    <item name="magento_import" xsi:type="array">
+                        <item name="class" xsi:type="string">Magento\Framework\Css\PreProcessor\Instruction\MagentoImport</item>
                     </item>
-                    <item name="less" xsi:type="array">
-                        <item name="magento_import" xsi:type="string">Magento\Framework\Css\PreProcessor\Instruction\MagentoImport</item>
-                        <item name="import" xsi:type="string">Magento\Framework\Css\PreProcessor\Instruction\Import</item>
+                    <item name="import" xsi:type="array">
+                        <item name="after" xsi:type="string">magento_import</item>
+                        <item name="class" xsi:type="string">Magento\Framework\Css\PreProcessor\Instruction\Import</item>
                     </item>
                 </item>
                 <item name="css" xsi:type="array">
-                    <item name="css" xsi:type="array">
-                        <item name="variable_notation" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\VariableNotation</item>
-                        <item name="module_notation" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\ModuleNotation</item>
-                        <item name="css_min" xsi:type="string">cssMinificationProcessor</item>
+                    <item name="alternativeSource" xsi:type="array">
+                        <item name="class" xsi:type="string">AlternativeSourceProcessors</item>
+                    </item>
+                    <item name="variable_notation" xsi:type="array">
+                        <item name="after" xsi:type="string">alternativeSource</item>
+                        <item name="class" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\VariableNotation</item>
+                    </item>
+                    <item name="module_notation" xsi:type="array">
+                        <item name="after" xsi:type="string">variable_notation</item>
+                        <item name="class" xsi:type="string">Magento\Framework\View\Asset\PreProcessor\ModuleNotation</item>
+                    </item>
+                    <item name="css_min" xsi:type="array">
+                        <item name="after" xsi:type="string">module_notation</item>
+                        <item name="class" xsi:type="string">cssMinificationProcessor</item>
                     </item>
                 </item>
                 <item name="js" xsi:type="array">
-                    <item name="js" xsi:type="array">
-                        <item name="js_min" xsi:type="string">jsMinificationProcessor</item>
+                    <item name="js_min" xsi:type="array">
+                        <item name="class" xsi:type="string">jsMinificationProcessor</item>
                     </item>
                 </item>
             </argument>
         </arguments>
     </type>
-    <type name="Magento\Framework\Css\PreProcessor\Less">
-        <arguments>
-            <argument name="adapter" xsi:type="object">Magento\Framework\Css\PreProcessor\Adapter\Less\Oyejorge</argument>
-        </arguments>
-    </type>
 
     <type name="Magento\Framework\Css\PreProcessor\Instruction\MagentoImport">
         <arguments>
@@ -126,22 +132,4 @@
             <argument name="subDir" xsi:type="string">web</argument>
         </arguments>
     </virtualType>
-
-    <type name="Magento\Framework\View\Asset\SourceFileGeneratorPool">
-        <arguments>
-            <argument name="fileGeneratorTypes" xsi:type="array">
-                <item name="less" xsi:type="object">fileAssemblerFileGenerator</item>
-            </argument>
-        </arguments>
-    </type>
-    <virtualType name="fileAssemblerFileGenerator" type="Magento\Framework\Css\PreProcessor\FileGenerator">
-        <arguments>
-            <argument name="relatedGenerator" xsi:type="object">fileAssemblerRelatedFilesGenerator</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="fileAssemblerRelatedFilesGenerator" type="Magento\Developer\Model\Css\PreProcessor\FileGenerator\PublicationDecorator">
-        <arguments>
-            <argument name="publisher" xsi:type="object">developerPublisher</argument>
-        </arguments>
-    </virtualType>
 </config>
diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json
index 4bfa578ff8b5333214dbd2d0cfa435c0eb4cac6f..c8fccff51ad959d91664ed9eaf314689d8b967a3 100644
--- a/app/code/Magento/DownloadableImportExport/composer.json
+++ b/app/code/Magento/DownloadableImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-downloadable-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/module-catalog": "1.0.0-beta",
         "magento/module-import-export": "1.0.0-beta",
         "magento/module-catalog-import-export": "1.0.0-beta",
diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php
index ebe3d0d8e2974409158217668265124e261bc860..a3cb0a5999688c6ad09a2175663835b3333eea50 100644
--- a/app/code/Magento/Email/Model/Template/Filter.php
+++ b/app/code/Magento/Email/Model/Template/Filter.php
@@ -5,6 +5,8 @@
  */
 namespace Magento\Email\Model\Template;
 
+use Magento\Framework\View\Asset\ContentProcessorInterface;
+
 /**
  * Core Email Template Filter Model
  *
@@ -64,7 +66,7 @@ class Filter extends \Magento\Framework\Filter\Template
      *
      * @var int
      */
-    protected $_storeId = null;
+    protected $_storeId;
 
     /**
      * @var array
@@ -89,7 +91,7 @@ class Filter extends \Magento\Framework\Filter\Template
     /**
      * @var \Magento\Framework\Escaper
      */
-    protected $_escaper = null;
+    protected $_escaper;
 
     /**
      * Core store config
@@ -787,7 +789,7 @@ class Filter extends \Magento\Framework\Filter\Template
 
         $css = $this->getCssFilesContent([$params['file']]);
 
-        if (strpos($css, \Magento\Framework\Css\PreProcessor\AdapterInterface::ERROR_MESSAGE_PREFIX) !== false) {
+        if (strpos($css, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) !== false) {
             // Return compilation error wrapped in CSS comment
             return '/*' . PHP_EOL . $css . PHP_EOL . '*/';
         } elseif (!empty($css)) {
@@ -908,7 +910,7 @@ class Filter extends \Magento\Framework\Filter\Template
         if ($html && $cssToInline) {
             try {
                 // Don't try to compile CSS that has compilation errors
-                if (strpos($cssToInline, \Magento\Framework\Css\PreProcessor\AdapterInterface::ERROR_MESSAGE_PREFIX)
+                if (strpos($cssToInline, ContentProcessorInterface::ERROR_MESSAGE_PREFIX)
                     !== false
                 ) {
                     throw new \Magento\Framework\Exception\MailException(
diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php
index a21a6dbd30bf1b2c72d2c81b412d2c3bd9d321ab..cd7b55f4499e7a59564dfb73c94bfe0538b61d5f 100644
--- a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php
@@ -282,7 +282,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase
             ],
             'CSS with error does not get inlined' => [
                 '<html><p></p></html>',
-                \Magento\Framework\Css\PreProcessor\AdapterInterface::ERROR_MESSAGE_PREFIX,
+                \Magento\Framework\View\Asset\ContentProcessorInterface::ERROR_MESSAGE_PREFIX,
                 ['<html><p></p></html>'],
             ],
             'Ensure disableStyleBlocksParsing option is working' => [
diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json
index 590cc443f9032812b8beebe8b4bfb11287c45dc6..9a8aee83c4caec8fbe1996fc94247ef2e8e733c2 100644
--- a/app/code/Magento/EncryptionKey/composer.json
+++ b/app/code/Magento/EncryptionKey/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-encryption-key",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/module-config": "1.0.0-beta",
         "magento/module-backend": "1.0.0-beta",
         "magento/framework": "1.0.0-beta"
diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json
index c472be8a8fdac281ec2864811e986df0f73a4b40..de0198668102e1fa0bf39b3fcca9b1729c3da74f 100644
--- a/app/code/Magento/Marketplace/composer.json
+++ b/app/code/Magento/Marketplace/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-marketplace",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/framework": "1.0.0-beta",
         "magento/module-backend": "1.0.0-beta"
     },
diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json
index d3336380128e1d464495ca6ac7143b043fe806b9..8e8301f161e9a351a9d23222044980c3d9b19aab 100644
--- a/app/code/Magento/NewRelicReporting/composer.json
+++ b/app/code/Magento/NewRelicReporting/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-new-relic-reporting",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/module-store": "1.0.0-beta",
         "magento/module-backend": "1.0.0-beta",
         "magento/module-customer": "1.0.0-beta",
diff --git a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php
index fd04f1fe4ca2fbe28854f837b0a3323d70164473..d86d8df059161ffdf7b0b04bfde642c328a3a02f 100644
--- a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php
+++ b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php
@@ -76,6 +76,11 @@ class BuiltinPlugin
                 $this->kernel->process($result);
             }
         } else {
+            json_decode($result->getContent());
+            if (json_last_error() == JSON_ERROR_NONE) {
+                // reset profiler to avoid appending profiling stat to JSON response
+                \Magento\Framework\Profiler::reset();
+            }
             $this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'HIT', true);
         }
         return $result;
diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php
index 9e4102c889052f63cf2f358577d5059fa7aebc51..ae38b76db495f0e4fefbc1dd3763516ba55d0ef0 100644
--- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php
@@ -200,6 +200,7 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase
             $this->responseMock->expects($this->never())
                 ->method('setHeader');
         }
+        $this->responseMock->expects($this->once())->method('getContent');
         $this->assertSame(
             $this->responseMock,
             $this->plugin->aroundDispatch($this->frontControllerMock, $this->closure, $this->requestMock)
diff --git a/app/code/Magento/Payment/Gateway/Command/CommandPool.php b/app/code/Magento/Payment/Gateway/Command/CommandPool.php
index 6b1014d5aa76d9fefb8a1efb80583147067f2853..d1fc52a72378248b3a9cc87da3fd36d133924d93 100644
--- a/app/code/Magento/Payment/Gateway/Command/CommandPool.php
+++ b/app/code/Magento/Payment/Gateway/Command/CommandPool.php
@@ -18,17 +18,17 @@ class CommandPool implements CommandPoolInterface
     private $commands;
 
     /**
-     * @param array $commands
      * @param TMapFactory $tmapFactory
+     * @param array $commands
      */
     public function __construct(
-        array $commands,
-        TMapFactory $tmapFactory
+        TMapFactory $tmapFactory,
+        array $commands = []
     ) {
         $this->commands = $tmapFactory->create(
             [
                 'array' => $commands,
-                'type' => 'Magento\Payment\Gateway\CommandInterface'
+                'type' => CommandInterface::class
             ]
         );
     }
diff --git a/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php b/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php
index 0364336a2ea5e42df84c190359218276bd2aa168..b23964b064274e9e4d475c46a23d3448ff32024a 100644
--- a/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php
+++ b/app/code/Magento/Payment/Gateway/Config/ValueHandlerPool.php
@@ -21,12 +21,12 @@ class ValueHandlerPool implements \Magento\Payment\Gateway\Config\ValueHandlerPo
     private $handlers;
 
     /**
-     * @param array $handlers
      * @param TMapFactory $tmapFactory
+     * @param array $handlers
      */
     public function __construct(
-        array $handlers,
-        TMapFactory $tmapFactory
+        TMapFactory $tmapFactory,
+        array $handlers
     ) {
         if (!isset($handlers[self::DEFAULT_HANDLER])) {
             throw new \LogicException('Default handler should be provided.');
@@ -35,7 +35,7 @@ class ValueHandlerPool implements \Magento\Payment\Gateway\Config\ValueHandlerPo
         $this->handlers = $tmapFactory->create(
             [
                 'array' => $handlers,
-                'type' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface'
+                'type' => ValueHandlerInterface::class
             ]
         );
     }
diff --git a/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php b/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php
index 66584773b638dfdc05a233ff4db10a7b1272794f..43f39b2932b40b81f06b0788f7b22827fda9f2fc 100644
--- a/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php
+++ b/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php
@@ -19,17 +19,17 @@ class BuilderComposite implements BuilderInterface
     private $builders;
 
     /**
-     * @param array $builders
      * @param TMapFactory $tmapFactory
+     * @param array $builders
      */
     public function __construct(
-        array $builders,
-        TMapFactory $tmapFactory
+        TMapFactory $tmapFactory,
+        array $builders = []
     ) {
         $this->builders = $tmapFactory->create(
             [
                 'array' => $builders,
-                'type' => 'Magento\Payment\Gateway\Request\BuilderInterface'
+                'type' => BuilderInterface::class
             ]
         );
     }
diff --git a/app/code/Magento/Payment/Gateway/Response/HandlerChain.php b/app/code/Magento/Payment/Gateway/Response/HandlerChain.php
index 1425514e7e3fb87054fdb09690d49d53c0b52a72..6a45311d5eb897b0ec15794cccc838995b747c04 100644
--- a/app/code/Magento/Payment/Gateway/Response/HandlerChain.php
+++ b/app/code/Magento/Payment/Gateway/Response/HandlerChain.php
@@ -16,17 +16,17 @@ class HandlerChain implements HandlerInterface
     private $handlers;
 
     /**
-     * @param array $handlers
      * @param TMapFactory $tmapFactory
+     * @param array $handlers
      */
     public function __construct(
-        array $handlers,
-        TMapFactory $tmapFactory
+        TMapFactory $tmapFactory,
+        array $handlers = []
     ) {
         $this->handlers = $tmapFactory->create(
             [
                 'array' => $handlers,
-                'type' => 'Magento\Payment\Gateway\Response\HandlerInterface'
+                'type' => HandlerInterface::class
             ]
         );
     }
diff --git a/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php b/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php
index 6e7c5c8c0ab5cecf0031ebc87519306289ea40e2..b36ceed14bdfa991d9fad107e120bb4b312a5316 100644
--- a/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php
+++ b/app/code/Magento/Payment/Gateway/Validator/ValidatorComposite.php
@@ -18,18 +18,18 @@ class ValidatorComposite extends AbstractValidator
 
     /**
      * @param ResultInterfaceFactory $resultFactory
-     * @param array $validators
      * @param TMapFactory $tmapFactory
+     * @param array $validators
      */
     public function __construct(
         ResultInterfaceFactory $resultFactory,
-        array $validators,
-        TMapFactory $tmapFactory
+        TMapFactory $tmapFactory,
+        array $validators = []
     ) {
         $this->validators = $tmapFactory->create(
             [
                 'array' => $validators,
-                'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
+                'type' => ValidatorInterface::class
             ]
         );
         parent::__construct($resultFactory);
diff --git a/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php b/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php
index e2b746ea7334f480ef5fa3a83358081cea3289db..6697dd86c3d883ae85293b0307435820fb069e0e 100644
--- a/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php
+++ b/app/code/Magento/Payment/Gateway/Validator/ValidatorPool.php
@@ -17,17 +17,17 @@ class ValidatorPool implements \Magento\Payment\Gateway\Validator\ValidatorPoolI
     private $validators;
 
     /**
-     * @param array $validators
      * @param TMapFactory $tmapFactory
+     * @param array $validators
      */
     public function __construct(
-        array $validators,
-        TMapFactory $tmapFactory
+        TMapFactory $tmapFactory,
+        array $validators = []
     ) {
         $this->validators = $tmapFactory->create(
             [
                 'array' => $validators,
-                'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
+                'type' => ValidatorInterface::class
             ]
         );
     }
diff --git a/app/code/Magento/Payment/Model/Method/Logger.php b/app/code/Magento/Payment/Model/Method/Logger.php
index 7e7331b77df73d9f87624d733167eed0b9cdff08..47c91a25968ccb5560280e78659eebd892787308 100644
--- a/app/code/Magento/Payment/Model/Method/Logger.php
+++ b/app/code/Magento/Payment/Model/Method/Logger.php
@@ -41,21 +41,21 @@ class Logger
     /**
      * Logs payment related information used for debug
      *
-     * @param array $debugData
-     * @param array|null $debugReplaceKeys
-     * @param bool|null $debugFlag
+     * @param array $data
+     * @param array|null $maskKeys
+     * @param bool|null $forceDebug
      * @return void
      */
-    public function debug(array $debugData, array $debugReplaceKeys = null, $debugFlag = null)
+    public function debug(array $data, array $maskKeys = null, $forceDebug = null)
     {
-        $debugReplaceKeys = $debugReplaceKeys !== null ? $debugReplaceKeys : $this->getDebugReplaceFields();
-        $debugFlag = $debugFlag !== null ? $debugFlag : $this->isDebugOn();
-        if ($debugFlag === true && !empty($debugData) && !empty($debugReplaceKeys)) {
-            $debugData = $this->filterDebugData(
-                $debugData,
-                $debugReplaceKeys
+        $maskKeys = $maskKeys !== null ? $maskKeys : $this->getDebugReplaceFields();
+        $debugOn = $forceDebug !== null ? $forceDebug : $this->isDebugOn();
+        if ($debugOn === true) {
+            $data = $this->filterDebugData(
+                $data,
+                $maskKeys
             );
-            $this->logger->debug(var_export($debugData, true));
+            $this->logger->debug(var_export($data, true));
         }
     }
 
@@ -66,7 +66,7 @@ class Logger
      */
     private function getDebugReplaceFields()
     {
-        if ($this->config->getValue('debugReplaceKeys')) {
+        if ($this->config and $this->config->getValue('debugReplaceKeys')) {
             return explode(',', $this->config->getValue('debugReplaceKeys'));
         }
         return [];
@@ -79,7 +79,7 @@ class Logger
      */
     private function isDebugOn()
     {
-        return (bool)$this->config->getValue('debug');
+        return $this->config and (bool)$this->config->getValue('debug');
     }
 
     /**
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php
index 92394d8bb330ed66ed9fb6dc98f49666fb725155..7ab96f4474e497d197f4c91298e2e44430e5ccef 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php
@@ -6,6 +6,7 @@
 namespace Magento\Payment\Test\Unit\Gateway\Command;
 
 use Magento\Payment\Gateway\Command\CommandPool;
+use Magento\Payment\Gateway\CommandInterface;
 
 class CommandPoolTest extends \PHPUnit_Framework_TestCase
 {
@@ -26,7 +27,7 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase
             ->with(
                 [
                     'array' => ['Magento\Payment\Gateway\CommandInterface'],
-                    'type' => 'Magento\Payment\Gateway\CommandInterface'
+                    'type' => CommandInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -39,7 +40,7 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase
             ->with('command')
             ->willReturn($commandI);
 
-        $pool = new CommandPool(['Magento\Payment\Gateway\CommandInterface'], $tMapFactory);
+        $pool = new CommandPool($tMapFactory, ['Magento\Payment\Gateway\CommandInterface']);
 
         static::assertSame($commandI, $pool->get('command'));
     }
@@ -61,7 +62,7 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase
             ->with(
                 [
                     'array' => [],
-                    'type' => 'Magento\Payment\Gateway\CommandInterface'
+                    'type' => CommandInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -70,7 +71,7 @@ class CommandPoolTest extends \PHPUnit_Framework_TestCase
             ->with('command')
             ->willReturn(false);
 
-        $pool = new CommandPool([], $tMapFactory);
+        $pool = new CommandPool($tMapFactory, []);
         $pool->get('command');
     }
 }
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php
index 266128b42f6f9ee21b26c83e5e3caf0187163998..cac2d6c1c9d21b030c57b9cde07b8452b7b47e4b 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php
@@ -5,6 +5,7 @@
  */
 namespace Magento\Payment\Test\Unit\Gateway\Config;
 
+use Magento\Payment\Gateway\Config\ValueHandlerInterface;
 use Magento\Payment\Gateway\Config\ValueHandlerPool;
 
 class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase
@@ -19,7 +20,7 @@ class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase
 
         $tMapFactory->expects(static::never())
             ->method('create');
-        new ValueHandlerPool([], $tMapFactory);
+        new ValueHandlerPool($tMapFactory, []);
     }
 
     public function testGet()
@@ -46,7 +47,7 @@ class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase
                         ValueHandlerPool::DEFAULT_HANDLER => 'Magento\Payment\Gateway\Config\ValueHandlerInterface',
                         'some_value' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface'
                     ],
-                    'type' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface'
+                    'type' => ValueHandlerInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -68,11 +69,11 @@ class ValueHandlerPoolTest extends \PHPUnit_Framework_TestCase
             );
 
         $pool = new ValueHandlerPool(
+            $tMapFactory,
             [
                 ValueHandlerPool::DEFAULT_HANDLER => 'Magento\Payment\Gateway\Config\ValueHandlerInterface',
                 'some_value' => 'Magento\Payment\Gateway\Config\ValueHandlerInterface'
-            ],
-            $tMapFactory
+            ]
         );
         static::assertSame($someValueHandler, $pool->get('some_value'));
         static::assertSame($defaultHandler, $pool->get(ValueHandlerPool::DEFAULT_HANDLER));
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php
index e1e5ea547456a76f23629322b483718b5cf98e61..2c31c318db6780e30a087305e770fad38e181436 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php
@@ -6,6 +6,7 @@
 namespace Magento\Payment\Test\Unit\Gateway\Request;
 
 use Magento\Payment\Gateway\Request\BuilderComposite;
+use Magento\Payment\Gateway\Request\BuilderInterface;
 
 class BuilderCompositeTest extends \PHPUnit_Framework_TestCase
 {
@@ -24,7 +25,7 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase
             ->with(
                 [
                     'array' => [],
-                    'type' => 'Magento\Payment\Gateway\Request\BuilderInterface'
+                    'type' => BuilderInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -32,7 +33,7 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase
             ->method('getIterator')
             ->willReturn(new \ArrayIterator([]));
 
-        $builder = new BuilderComposite([], $tMapFactory);
+        $builder = new BuilderComposite($tMapFactory, []);
         static::assertEquals([], $builder->build([]));
     }
 
@@ -47,6 +48,7 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase
             'item' => 'gas cooker',
             'quantity' => 1
         ];
+
         $tMapFactory = $this->getMockBuilder('Magento\Framework\ObjectManager\TMapFactory')
             ->disableOriginalConstructor()
             ->setMethods(['create'])
@@ -96,7 +98,7 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase
                         'product' => 'Magento\Payment\Gateway\Request\BuilderInterface',
                         'magento' => 'Magento\Payment\Gateway\Request\BuilderInterface'
                     ],
-                    'type' => 'Magento\Payment\Gateway\Request\BuilderInterface'
+                    'type' => BuilderInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -105,12 +107,12 @@ class BuilderCompositeTest extends \PHPUnit_Framework_TestCase
             ->willReturn(new \ArrayIterator([$customerBuilder, $productBuilder, $magentoBuilder]));
 
         $builder = new BuilderComposite(
+            $tMapFactory,
             [
                 'customer' => 'Magento\Payment\Gateway\Request\BuilderInterface',
                 'product' => 'Magento\Payment\Gateway\Request\BuilderInterface',
                 'magento' => 'Magento\Payment\Gateway\Request\BuilderInterface'
-            ],
-            $tMapFactory
+            ]
         );
 
         static::assertEquals($expectedRequest, $builder->build([]));
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php
index c65a826a2624d79adff61fac919ce47385fac6ac..78891068b4cc07fd7a10aa9d80d333f65012cc83 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php
@@ -6,6 +6,7 @@
 namespace Magento\Payment\Test\Unit\Gateway\Response;
 
 use Magento\Payment\Gateway\Response\HandlerChain;
+use Magento\Payment\Gateway\Response\HandlerInterface;
 
 class HandlerChainTest extends \PHPUnit_Framework_TestCase
 {
@@ -31,7 +32,7 @@ class HandlerChainTest extends \PHPUnit_Framework_TestCase
                         'handler1' => 'Magento\Payment\Gateway\Response\HandlerInterface',
                         'handler2' => 'Magento\Payment\Gateway\Response\HandlerInterface'
                     ],
-                    'type' => 'Magento\Payment\Gateway\Response\HandlerInterface'
+                    'type' => HandlerInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -49,11 +50,11 @@ class HandlerChainTest extends \PHPUnit_Framework_TestCase
             ->with($handlingSubject, $response);
 
         $chain = new HandlerChain(
+            $tMapFactory,
             [
                 'handler1' => 'Magento\Payment\Gateway\Response\HandlerInterface',
                 'handler2' => 'Magento\Payment\Gateway\Response\HandlerInterface'
-            ],
-            $tMapFactory
+            ]
         );
         $chain->handle($handlingSubject, $response);
     }
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php
index 8528b65ac6cecf91bd5603009334a0b47f216137..27b589b02900d45d480fc32db141e075251dad92 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php
@@ -6,6 +6,7 @@
 namespace Magento\Payment\Test\Unit\Gateway\Validator;
 
 use Magento\Payment\Gateway\Validator\ValidatorComposite;
+use Magento\Payment\Gateway\Validator\ValidatorInterface;
 
 class ValidatorCompositeTest extends \PHPUnit_Framework_TestCase
 {
@@ -32,7 +33,7 @@ class ValidatorCompositeTest extends \PHPUnit_Framework_TestCase
                         'validator1' => 'Magento\Payment\Gateway\Validator\ValidatorInterface',
                         'validator2' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
                     ],
-                    'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
+                    'type' => ValidatorInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -82,11 +83,11 @@ class ValidatorCompositeTest extends \PHPUnit_Framework_TestCase
 
         $validatorComposite = new ValidatorComposite(
             $resultFactory,
+            $tMapFactory,
             [
                 'validator1' => 'Magento\Payment\Gateway\Validator\ValidatorInterface',
                 'validator2' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
-            ],
-            $tMapFactory
+            ]
         );
         static::assertSame($compositeResult, $validatorComposite->validate($validationSubject));
     }
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php
index becc387fab2d91b86cc6ba3b13954c8c0c29ae05..dc6ed060ab7bf2d86895d15b27a04e2d7638efcd 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php
@@ -5,6 +5,7 @@
  */
 namespace Magento\Payment\Test\Unit\Gateway\Validator;
 
+use Magento\Payment\Gateway\Validator\ValidatorInterface;
 use Magento\Payment\Gateway\Validator\ValidatorPool;
 
 class ValidatorPoolTest extends \PHPUnit_Framework_TestCase
@@ -26,7 +27,7 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase
             ->with(
                 [
                     'array' => ['validator' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'],
-                    'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
+                    'type' => ValidatorInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -40,8 +41,8 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase
             ->willReturn($commandI);
 
         $pool = new ValidatorPool(
-            ['validator' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'],
-            $tMapFactory
+            $tMapFactory,
+            ['validator' => 'Magento\Payment\Gateway\Validator\ValidatorInterface']
         );
 
         static::assertSame($commandI, $pool->get('validator'));
@@ -64,7 +65,7 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase
             ->with(
                 [
                     'array' => [],
-                    'type' => 'Magento\Payment\Gateway\Validator\ValidatorInterface'
+                    'type' => ValidatorInterface::class
                 ]
             )
             ->willReturn($tMap);
@@ -73,7 +74,7 @@ class ValidatorPoolTest extends \PHPUnit_Framework_TestCase
             ->with('validator')
             ->willReturn(false);
 
-        $pool = new ValidatorPool([], $tMapFactory);
+        $pool = new ValidatorPool($tMapFactory, []);
         $pool->get('validator');
     }
 }
diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php
index b56caf5903208f67a51713cef223b8602387a608..36cd63d8c6db69461de3d1a11b25f942cb36e505 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php
@@ -45,6 +45,20 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
         $this->logger->debug($debugData, $debugReplaceKeys, true);
     }
 
+    public function testDebugOnNoReplaceKeys()
+    {
+        $debugData =
+            [
+                'request' => ['data1' => '123', 'data2' => '123']
+            ];
+
+        $this->loggerMock->expects(static::once())
+            ->method('debug')
+            ->with(var_export($debugData, true));
+
+        $this->logger->debug($debugData, [], true);
+    }
+
     public function testDebugOff()
     {
         $debugData =
diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json
index 878f5c8dfefd02d7623023db544e2c8f52ac8d38..0ba900539c248226038ac89225340001a5e1e8ec 100644
--- a/app/code/Magento/Swagger/composer.json
+++ b/app/code/Magento/Swagger/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-swagger",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/framework": "1.0.0-beta"
     },
     "type": "magento2-module",
diff --git a/app/code/Magento/Translation/etc/di.xml b/app/code/Magento/Translation/etc/di.xml
index 4f8ccfd64333bf850bda4fd9653131f23ddb5100..05c7f766a452e694c648138db45d7835b9721dd2 100644
--- a/app/code/Magento/Translation/etc/di.xml
+++ b/app/code/Magento/Translation/etc/di.xml
@@ -63,22 +63,24 @@
             </argument>
         </arguments>
     </type>
+
     <type name="Magento\Framework\View\Asset\PreProcessor\Pool">
         <arguments>
-            <argument name="preProcessors" xsi:type="array">
+            <argument name="preprocessors" xsi:type="array">
                 <item name="js" xsi:type="array">
-                    <item name="js" xsi:type="array">
-                        <item name="js_translation" xsi:type="string">Magento\Translation\Model\Js\PreProcessor</item>
+                    <item name="js_translation" xsi:type="array">
+                        <item name="class" xsi:type="string">Magento\Translation\Model\Js\PreProcessor</item>
                     </item>
                 </item>
                 <item name="json" xsi:type="array">
-                    <item name="json" xsi:type="array">
-                        <item name="json_generation" xsi:type="string">Magento\Translation\Model\Json\PreProcessor</item>
+                    <item name="json_generation" xsi:type="array">
+                        <item name="class" xsi:type="string">Magento\Translation\Model\Json\PreProcessor</item>
                     </item>
                 </item>
             </argument>
         </arguments>
     </type>
+
     <type name="Magento\Framework\Console\CommandList">
         <arguments>
             <argument name="commands" xsi:type="array">
diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json
index c0543d01623a4f261d9db5e34c532b4bb3c106f4..cf3b3e25417384e931f35422d2ba46bd3751a4b4 100644
--- a/app/code/Magento/Variable/composer.json
+++ b/app/code/Magento/Variable/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-variable",
     "description": "N/A",
     "require": {
-        "php": "~5.4.11|~5.5.0|~5.6.0",
+        "php": "~5.5.0|~5.6.0|~7.0.0",
         "magento/module-backend": "1.0.0-beta",
         "magento/module-email": "1.0.0-beta",
         "magento/module-store": "1.0.0-beta",
diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less
index 3b4404bc0da1e9336efa2b62783dfb7c48e1bfa0..d9a3ab7292a8a53c423895f1483024a57520645e 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less
@@ -305,7 +305,7 @@ body._in-resize {
         width: 7rem;
         img {
             border: 1px solid @data-grid-td__border-color;
-            max-width: 5rem;
+            width: 5rem;
         }
     }
     .data-grid-multicheck-cell {
diff --git a/composer.json b/composer.json
index 0fa24640ae43b12e18e5f1a33654b4e88e8bdc0c..a9e71e4b11044065e63828380d9c3203185e9599 100644
--- a/composer.json
+++ b/composer.json
@@ -69,6 +69,7 @@
         "ext-intl": "*",
         "ext-xsl": "*",
         "ext-mbstring": "*",
+        "ext-openssl": "*",
         "sjparkinson/static-review": "~4.1",
         "fabpot/php-cs-fixer": "~1.2",
         "lusitanian/oauth": "~0.3 <=0.7.0"
diff --git a/composer.lock b/composer.lock
index 30da2611948979b879c9c4272ed8ec235595f617..9da039729694a59f2cb2ed8d294c322ed126c17a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "c4198e8a51c13b0d2c96bb54023cf2c6",
-    "content-hash": "444606690390cbbc73e906d61746c25d",
+    "hash": "80867d6202a3ae5d2f4c079e2cfd702f",
+    "content-hash": "41493176956dcfd2401ac1181d4d4782",
     "packages": [
         {
             "name": "braintree/braintree_php",
@@ -2571,16 +2571,16 @@
         },
         {
             "name": "fabpot/php-cs-fixer",
-            "version": "v1.10",
+            "version": "v1.10.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
-                "reference": "8e21b4fb32c4618a425817d9f0daf3d57a9808d1"
+                "reference": "12dbcd1462f1e3a5a96c6c7398af26b28e092a8a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/8e21b4fb32c4618a425817d9f0daf3d57a9808d1",
-                "reference": "8e21b4fb32c4618a425817d9f0daf3d57a9808d1",
+                "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/12dbcd1462f1e3a5a96c6c7398af26b28e092a8a",
+                "reference": "12dbcd1462f1e3a5a96c6c7398af26b28e092a8a",
                 "shasum": ""
             },
             "require": {
@@ -2621,7 +2621,7 @@
                 }
             ],
             "description": "A tool to automatically fix PHP code style",
-            "time": "2015-07-27 20:56:10"
+            "time": "2015-10-12 20:13:46"
         },
         {
             "name": "league/climate",
@@ -3941,6 +3941,7 @@
         "ext-iconv": "*",
         "ext-intl": "*",
         "ext-xsl": "*",
-        "ext-mbstring": "*"
+        "ext-mbstring": "*",
+        "ext-openssl": "*"
     }
 }
diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json
index 5f941b700f5402a510723d4e33ae4bfb570b8467..4e4d5972cd5001c9b7ee3d690a4b4107cb0995c7 100644
--- a/dev/tests/functional/composer.json
+++ b/dev/tests/functional/composer.json
@@ -1,6 +1,6 @@
 {
     "require": {
-        "magento/mtf": "1.0.0-rc35",
+        "magento/mtf": "1.0.0-rc36",
         "php": "~5.5.0|~5.6.0|~7.0.0",
         "phpunit/phpunit": "4.1.0",
         "phpunit/phpunit-selenium": ">=1.2"
diff --git a/dev/tests/functional/etc/events.xml b/dev/tests/functional/etc/events.xml
index e838968e1c2a20a92b0431055088cf24f249aded..b724c773b6c23b4a932ecdabcc0d8630ddeddba4 100644
--- a/dev/tests/functional/etc/events.xml
+++ b/dev/tests/functional/etc/events.xml
@@ -8,7 +8,39 @@
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="events.xsd">
     <preset name="base">
         <observer class="Magento\Mtf\System\Observer\WebapiResponse">
-            <tag name="webapi_failed"/>
+            <tag name="webapi_failed" />
+        </observer>
+    </preset>
+    <preset name="coverage" extends="base">
+        <observer class="Magento\Mtf\System\Observer\PageUrl">
+            <tag name="click_after"/>
+            <tag name="accept_alert_after"/>
+            <tag name="dismiss_alert_after"/>
+            <tag name="open_after"/>
+            <tag name="forward"/>
+            <tag name="back"/>
+        </observer>
+        <observer class="Magento\Mtf\System\Observer\AppState">
+            <tag name="app_state_applied"/>
+        </observer>
+        <observer class="Magento\Mtf\System\Observer\Log">
+            <tag name="exception"/>
+            <tag name="failure"/>
+            <tag name="execution" />
+        </observer>
+        <observer class="Magento\Mtf\System\Observer\SourceCode">
+            <tag name="exception"/>
+            <tag name="failure"/>
+        </observer>
+        <observer class="Magento\Mtf\System\Observer\Screenshot">
+            <tag name="exception"/>
+            <tag name="failure"/>
+        </observer>
+        <observer class="Magento\Mtf\System\Observer\CurlResponse">
+            <tag name="curl_failed"/>
+        </observer>
+        <observer class="Magento\Mtf\System\Observer\WebapiResponse">
+            <tag name="webapi_failed" />
         </observer>
     </preset>
 </config>
diff --git a/dev/tests/functional/lib/Magento/Mtf/Handler/Webapi.php b/dev/tests/functional/lib/Magento/Mtf/Handler/Webapi.php
index 443eafd1c256cd8b768da61bfa1589e3dfceb06d..f69225110c81fd0576fd29d431d2b5c807cbf1aa 100644
--- a/dev/tests/functional/lib/Magento/Mtf/Handler/Webapi.php
+++ b/dev/tests/functional/lib/Magento/Mtf/Handler/Webapi.php
@@ -13,7 +13,7 @@ use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator;
 /**
  * Abstract class for webapi handlers.
  */
-abstract class Webapi implements HandlerInterface
+abstract class Webapi extends Curl implements HandlerInterface
 {
     /**
      * Configuration parameters array.
diff --git a/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php b/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php
index e5b6c09f905383cb25fd2875245fc6100fd9f87d..26231f9fbef70df83c3585aae3538badcdd6e760 100644
--- a/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php
+++ b/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php
@@ -8,7 +8,7 @@ namespace Magento\Mtf\Page;
 use Magento\Mtf\Factory\Factory;
 
 /**
- * Class BackendPage
+ * Admin backend page.
  *
  * @SuppressWarnings(PHPMD.NumberOfChildren)
  */
@@ -19,13 +19,13 @@ class BackendPage extends Page
      *
      * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_backend_url'] . static::MCA;
+        $this->url = $_ENV['app_backend_url'] . static::MCA;
     }
 
     /**
-     * Open backend page and log in if needed
+     * Open backend page and log in if needed.
      *
      * @param array $params
      * @return $this
diff --git a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml
index 74541d4f5662e088e0aee224a14701b6ed7c4035..b41addebd2c627244cea76596130015d336c69d3 100644
--- a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml
@@ -6,12 +6,12 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
-    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest">
+    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="One page check out with Authorize.Net payment method.">
         <variation name="OnePageCheckoutAuthorizenetTestVariation1" summary="Check Out as a Guest with Authorize.Net and Offline Shipping method" ticketId="MAGETWO-12832">
             <data name="products" xsi:type="string">catalogProductSimple::product_10_dollar, configurableProduct::with_one_option, bundleProduct::bundle_fixed_100_dollar_product</data>
             <data name="taxRule" xsi:type="string">us_ca_ny_rule</data>
             <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="billingAddress/dataset" xsi:type="string">US_address_1</data>
+            <data name="shippingAddress/dataset" xsi:type="string">US_address_1</data>
             <data name="checkoutMethod" xsi:type="string">guest</data>
             <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
             <data name="shipping/shipping_method" xsi:type="string">Fixed</data>
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache/Grid.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache/Grid.php
new file mode 100644
index 0000000000000000000000000000000000000000..686e688a9acf36df25e5c193ab1530cf60759b7c
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache/Grid.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Backend\Test\Block\Cache;
+
+use Magento\Backend\Test\Block\Widget\Grid as ParentGrid;
+
+/**
+ * Backend Cache Management grid.
+ */
+class Grid extends ParentGrid
+{
+    /**
+     * Search for item and select it.
+     *
+     * @param array $filter
+     * @return void
+     * @throws \Exception
+     */
+    public function searchAndSelect(array $filter)
+    {
+        $selectItem = $this->getRow($filter, false)->find($this->selectItem);
+        if ($selectItem->isVisible()) {
+            $selectItem->click();
+        } else {
+            throw new \Exception('Searched item was not found.');
+        }
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php
index 302139354092fc6fdc2cb429056cbadfc1b016b3..1b8a503460cb66420e9bdd96081ec270807a7201 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php
@@ -49,7 +49,7 @@ class FormPageActions extends PageActions
      *
      * @var string
      */
-    protected $deleteButton = '#delete';
+    protected $deleteButton = '.delete';
 
     /**
      * Magento loader
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php
index b104c3230510c08d70f30d1d17d49be50cebd18d..c847513f244f25cfe2883f5393a1f7848c52cd46 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php
@@ -17,7 +17,7 @@ use Magento\Mtf\Client\BrowserInterface;
 use Magento\Mtf\Client\Element\SimpleElement;
 
 /**
- * Is used to represent any form with tabs on the page
+ * Is used to represent any form with tabs on the page.
  *
  * @SuppressWarnings(PHPMD.NumberOfChildren)
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -25,17 +25,26 @@ use Magento\Mtf\Client\Element\SimpleElement;
 class FormTabs extends Form
 {
     /**
+     * Tabs list.
+     *
      * @var array
      */
     protected $tabs = [];
 
     /**
-     * Fields which aren't assigned to any tab
+     * Fields which aren't assigned to any tab.
      *
      * @var array
      */
     protected $unassignedFields = [];
 
+    /**
+     * Page header selector.
+     *
+     * @var string
+     */
+    protected $header = 'header';
+
     /**
      * @constructor
      * @param SimpleElement $element
@@ -55,7 +64,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Initialize block
+     * Initialize block.
      */
     protected function init()
     {
@@ -63,7 +72,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Fill form with tabs
+     * Fill form with tabs.
      *
      * @param FixtureInterface $fixture
      * @param SimpleElement|null $element
@@ -76,7 +85,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Fill specified form with tabs
+     * Fill specified form with tabs.
      *
      * @param array $tabs
      * @param SimpleElement|null $element
@@ -91,14 +100,14 @@ class FormTabs extends Form
             $tab->fillFormTab($tabFields, $context);
         }
         if (!empty($this->unassignedFields)) {
-            $this->fillMissedFields($tabs);
+            $this->fillMissedFields();
         }
 
         return $this;
     }
 
     /**
-     * Fill fields which weren't found on filled tabs
+     * Fill fields which weren't found on filled tabs.
      *
      * @throws \Exception
      * @SuppressWarnings(PHPMD.UnusedLocalVariable)
@@ -130,7 +139,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Get data of the tabs
+     * Get data of the tabs.
      *
      * @param FixtureInterface|null $fixture
      * @param SimpleElement|null $element
@@ -163,7 +172,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Update form with tabs
+     * Update form with tabs.
      *
      * @param FixtureInterface $fixture
      * @return FormTabs
@@ -178,7 +187,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Create data array for filling tabs
+     * Create data array for filling tabs.
      *
      * @param FixtureInterface $fixture
      * @return array
@@ -194,7 +203,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Create data array for filling tabs (new fixture specification)
+     * Create data array for filling tabs (new fixture specification).
      *
      * @param InjectableFixture $fixture
      * @return array
@@ -217,7 +226,7 @@ class FormTabs extends Form
     }
 
     /**
-     * Create data array for filling tabs (deprecated fixture specification)
+     * Create data array for filling tabs (deprecated fixture specification).
      *
      * @param FixtureInterface $fixture
      * @return array
@@ -284,6 +293,7 @@ class FormTabs extends Form
      */
     public function openTab($tabName)
     {
+        $this->browser->find($this->header)->hover();
         $this->getTabElement($tabName)->click();
         return $this;
     }
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Tab.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Tab.php
index a4f434313fc12b49c2088d85d8b7e9b33fe1b54a..02afe0f2868972ce84ab7820b37d1aecdd7f4747 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Tab.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Tab.php
@@ -11,8 +11,7 @@ use Magento\Mtf\Client\Element\SimpleElement;
 use Magento\Mtf\Client\Locator;
 
 /**
- * Class Tab
- * Is used to represent any tab on the page
+ * Is used to represent any tab on the page.
  *
  * @SuppressWarnings(PHPMD.NumberOfChildren)
  */
@@ -23,24 +22,24 @@ class Tab extends AbstractForm
      *
      * @var string
      */
-    protected $mageErrorField = '//*[contains(@class,"field ")][.//*[@class="mage-error"]]';
+    protected $mageErrorField = '//fieldset/*[contains(@class,"field ")][.//*[contains(@class,"error")]]';
 
     /**
      * Fields label with mage error.
      *
      * @var string
      */
-    protected $mageErrorLabel = './label';
+    protected $mageErrorLabel = './/*[contains(@class,"label")]';
 
     /**
      * Mage error text.
      *
      * @var string
      */
-    protected $mageErrorText = './/*[@class="mage-error"]';
+    protected $mageErrorText = './/label[contains(@class,"error")]';
 
     /**
-     * Fill data to fields on tab
+     * Fill data to fields on tab.
      *
      * @param array $fields
      * @param SimpleElement|null $element
@@ -55,7 +54,7 @@ class Tab extends AbstractForm
     }
 
     /**
-     * Get data of tab
+     * Get data of tab.
      *
      * @param array|null $fields
      * @param SimpleElement|null $element
@@ -68,10 +67,11 @@ class Tab extends AbstractForm
     }
 
     /**
-     * Update data to fields on tab
+     * Update data to fields on tab.
      *
      * @param array $fields
      * @param SimpleElement|null $element
+     * @return void
      */
     public function updateFormTab(array $fields, SimpleElement $element = null)
     {
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php
new file mode 100644
index 0000000000000000000000000000000000000000..5492c69ef0b27568f4289cab588a9f8894a5d925
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Backend\Test\Constraint;
+
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\Backend\Test\Page\Adminhtml\AdminCache;
+
+/**
+ * Assert Cache is Invalidated and Refreshable.
+ */
+class AssertCacheIsRefreshableAndInvalidated extends AbstractConstraint
+{
+    /**
+     * Success message of refreshed cache.
+     */
+    const SUCCESS_MESSAGE = '%d cache type(s) refreshed.';
+
+    /**
+     * Assert Cache is Invalidated and Refreshable.
+     *
+     * @param AdminCache $adminCache
+     * @param array $cacheTags
+     * @return void
+     */
+    public function processAssert(AdminCache $adminCache, $cacheTags)
+    {
+        $items = [];
+        foreach ($cacheTags as $cacheTag) {
+            $items[] = [
+                'tags' => $cacheTag,
+                'status' => 'Invalidated'
+            ];
+        }
+
+        $adminCache->open();
+        $adminCache->getGridBlock()->massaction($items, 'Refresh');
+
+        \PHPUnit_Framework_Assert::assertEquals(
+            sprintf(self::SUCCESS_MESSAGE, count($items)),
+            $adminCache->getMessagesBlock()->getSuccessMessages(),
+            'Cache is Invalid and refreshable.'
+        );
+    }
+
+    /**
+     * Returns a string representation of the object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Cache is not Invalid or not refreshable.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php
index b262b81e09c0ebfdcef2d6ff555e9d756713aa8e..74290a5b8bb717edcaf889f9f16c29ee09710b11 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php
@@ -43,9 +43,9 @@ class AdminAuthLogin extends Page
     /**
      * Constructor.
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_backend_url'] . self::MCA;
+        $this->url = $_ENV['app_backend_url'] . self::MCA;
     }
 
     /**
@@ -56,7 +56,7 @@ class AdminAuthLogin extends Page
     public function getLoginBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendAdminLogin(
-            $this->_browser->find($this->loginBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->loginBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -68,7 +68,7 @@ class AdminAuthLogin extends Page
     public function getHeaderBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendPageHeader(
-            $this->_browser->find($this->headerBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->headerBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -79,7 +79,7 @@ class AdminAuthLogin extends Page
      */
     public function getMessagesBlock()
     {
-        return Factory::getBlockFactory()->getMagentoBackendMessages($this->_browser->find($this->messagesBlock));
+        return Factory::getBlockFactory()->getMagentoBackendMessages($this->browser->find($this->messagesBlock));
     }
 
     /**
@@ -89,7 +89,7 @@ class AdminAuthLogin extends Page
      */
     public function waitForHeaderBlock()
     {
-        $browser = $this->_browser;
+        $browser = $this->browser;
         $selector = $this->headerBlock;
         $browser->waitUntil(
             function () use ($browser, $selector) {
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml
index ed129a534adb77e2686f91a5dbd3723e39dbe7a4..3cdc372ff2c646d006e8627ae0cd100bdb1ffd8e 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml
@@ -10,6 +10,7 @@
         <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages .messages" strategy="css selector"/>
         <block name="actionsBlock" class="Magento\Backend\Test\Block\Cache" locator="div.page-actions" strategy="css selector"/>
         <block name="additionalBlock" class="Magento\Backend\Test\Block\Cache\Additional" locator="div.additional-cache-management" strategy="css selector"/>
+        <block name="gridBlock" class="Magento\Backend\Test\Block\Cache\Grid" locator="div#cache_grid" strategy="css selector"/>
         <block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal]" strategy="css selector"/>
     </page>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php
index 4a1ba08b8565e73dd84123bdd8f363c5b5cd794f..6af0253e217e3f51e47e9a5b4021869037bb00c2 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php
@@ -7,37 +7,56 @@
 namespace Magento\Catalog\Test\Block\Adminhtml\Category\Edit;
 
 use Magento\Backend\Test\Block\Widget\FormTabs;
-use Magento\Mtf\Factory\Factory;
+use Magento\Mtf\Client\Element\SimpleElement;
+use Magento\Mtf\Client\Locator;
+use Magento\Mtf\Fixture\FixtureInterface;
 
 /**
- * Class CategoryForm
- * Category container block
+ * Category container block.
  */
 class CategoryForm extends FormTabs
 {
     /**
-     * Save button
+     * Default sore switcher block locator.
      *
      * @var string
      */
-    protected $saveButton = '[data-ui-id=category-edit-form-save-button]';
+    protected $storeSwitcherBlock = '.store-switcher';
 
     /**
-     * Category Products grid
+     * Dropdown block locator.
      *
      * @var string
      */
-    protected $productsGridBlock = '#catalog_category_products';
+    protected $dropdownBlock = '.dropdown';
 
     /**
-     * Get Category edit form
+     *  Selector for confirm.
      *
-     * @return \Magento\Catalog\Test\Block\Adminhtml\Category\Tab\ProductGrid
+     * @var string
+     */
+    protected $confirmModal = '.confirm._show[data-role=modal]';
+
+    /**
+     * Fill form with tabs.
+     *
+     * @param FixtureInterface $fixture
+     * @param SimpleElement|null $element
+     * @return FormTabs
      */
-    public function getCategoryProductsGrid()
+    public function fill(FixtureInterface $fixture, SimpleElement $element = null)
     {
-        return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryTabProductGrid(
-            $this->_rootElement->find($this->productsGridBlock)
-        );
+        $tabs = $this->getFieldsByTabs($fixture);
+        if ($fixture->hasData('store_id')) {
+            $store = $fixture->getStoreId();
+            $storeSwitcherBlock = $this->browser->find($this->storeSwitcherBlock);
+            $storeSwitcherBlock->find($this->dropdownBlock, Locator::SELECTOR_CSS, 'liselectstore')->setValue($store);
+            $element = $this->browser->find($this->confirmModal);
+            /** @var \Magento\Ui\Test\Block\Adminhtml\Modal $modal */
+            $modal = $this->blockFactory->create('Magento\Ui\Test\Block\Adminhtml\Modal', ['element' => $element]);
+            $modal->acceptAlert();
+        }
+
+        return $this->fillTabs($tabs, $element);
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/PageActions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/PageActions.php
index 4c34c902a1689508e77de4266a8a323c31ba2f13..4389411c00650ec202aa49418c3d2d22f3f85eb6 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/PageActions.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/PageActions.php
@@ -9,8 +9,7 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Category\Edit;
 use Magento\Backend\Test\Block\FormPageActions;
 
 /**
- * Class PageActions
- * Category page actions
+ * Category page actions.
  */
 class PageActions extends FormPageActions
 {
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab.php
index 8b7671c7d719406d0e7b25c82bab846daa3dcdd2..b86fc8430b45e4610d9413f6c5a537968295e7cb 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab.php
@@ -6,16 +6,23 @@
 
 namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit;
 
+use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\AdvancedPricingTab\OptionTier;
 use Magento\Mtf\Client\Element\SimpleElement;
 
 /**
- * Class AdvancedPricingTab
- * Product advanced pricing tab
+ * Product advanced pricing tab.
  */
 class AdvancedPricingTab extends ProductTab
 {
     /**
-     * Class name 'Subform' of the main tab form
+     * Locator for Tier Price block.
+     *
+     * @var string
+     */
+    protected $tierPrice = '#attribute-tier_price-container';
+
+    /**
+     * Class name 'Subform' of the main tab form.
      *
      * @var array
      */
@@ -24,7 +31,7 @@ class AdvancedPricingTab extends ProductTab
     ];
 
     /**
-     * Fill 'Advanced price' product form on tab
+     * Fill 'Advanced price' product form on tab.
      *
      * @param array $fields
      * @param SimpleElement|null $element
@@ -61,7 +68,7 @@ class AdvancedPricingTab extends ProductTab
     }
 
     /**
-     * Get data of tab
+     * Get data of tab.
      *
      * @param array|null $fields
      * @param SimpleElement|null $element
@@ -96,4 +103,17 @@ class AdvancedPricingTab extends ProductTab
 
         return $formData;
     }
+
+    /**
+     * Get Tier Price block.
+     *
+     * @return OptionTier
+     */
+    public function getTierPriceForm()
+    {
+        return $this->blockFactory->create(
+            'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\AdvancedPricingTab\OptionTier',
+            ['element' => $this->_rootElement->find($this->tierPrice)]
+        );
+    }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab/OptionTier.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab/OptionTier.php
index 7dc90c88899bb8f1318dd7141c257c1aafc6eef8..53417ecace24bbd18dbfbe4b34862699f1019407 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab/OptionTier.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/AdvancedPricingTab/OptionTier.php
@@ -7,23 +7,31 @@
 namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\AdvancedPricingTab;
 
 use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\AbstractOptions;
+use Magento\Customer\Test\Fixture\CustomerGroup;
 use Magento\Mtf\Client\Element\SimpleElement;
+use Magento\Mtf\Client\Locator;
 
 /**
- * Class OptionTier
- * Form 'Tier prices' on the 'Advanced Pricing' tab
+ * Form 'Tier prices' on the 'Advanced Pricing' tab.
  */
 class OptionTier extends AbstractOptions
 {
     /**
-     * 'Add Tier' button selector
+     * 'Add Tier' button selector.
      *
      * @var string
      */
     protected $buttonFormLocator = "#tiers_table tfoot button";
 
     /**
-     * Fill product form 'Tier price'
+     * Locator for Customer Group element.
+     *
+     * @var string
+     */
+    protected $customerGroup = '//*[contains(@name, "[cust_group]")]';
+
+    /**
+     * Fill product form 'Tier price'.
      *
      * @param array $fields
      * @param SimpleElement $element
@@ -34,4 +42,18 @@ class OptionTier extends AbstractOptions
         $this->_rootElement->find($this->buttonFormLocator)->click();
         return parent::fillOptions($fields, $element);
     }
+
+    /**
+     * Check whether Customer Group is visible.
+     *
+     * @param CustomerGroup $customerGroup
+     * @return bool
+     */
+    public function isVisibleCustomerGroup(CustomerGroup $customerGroup)
+    {
+        $this->_rootElement->find($this->buttonFormLocator)->click();
+
+        $options = $this->_rootElement->find($this->customerGroup, Locator::SELECTOR_XPATH)->getText();
+        return false !== strpos($options, $customerGroup->getCustomerGroupCode());
+    }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php
index eec1be1fcf543149fbcc08a034fa02628c4065c2..ea1a27a09e26292c9a81f23f6cb9f7f07e4c407e 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php
@@ -32,13 +32,6 @@ class Sidebar extends ListCompare
      */
     protected $clearAll = '#compare-clear-all';
 
-    /**
-     * Selector for alert.
-     *
-     * @var string
-     */
-    protected $alertModal = '._show[data-role=modal]';
-
     /**
      * Get compare products block content.
      *
@@ -86,9 +79,6 @@ class Sidebar extends ListCompare
             }
         );
         $this->_rootElement->find($this->clearAll)->click();
-        $element = $this->browser->find($this->alertModal);
-        /** @var \Magento\Ui\Test\Block\Adminhtml\Modal $modal */
-        $modal = $this->blockFactory->create('Magento\Ui\Test\Block\Adminhtml\Modal', ['element' => $element]);
-        $modal->acceptAlert();
+        $this->browser->acceptAlert();
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Grouped/AssociatedProducts/Search/Grid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Grouped/AssociatedProducts/Search/Grid.php
index e8dc06003db01756a30cd7a4be1c7565e0be7557..fb9acfa2da5da610ed8b7719255bf4c4b27b04ce 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Grouped/AssociatedProducts/Search/Grid.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Grouped/AssociatedProducts/Search/Grid.php
@@ -9,19 +9,26 @@ namespace Magento\Catalog\Test\Block\Product\Grouped\AssociatedProducts\Search;
 use Magento\Backend\Test\Block\Widget\Grid as GridInterface;
 
 /**
- * Class Grid
+ * Associated products grid.
  */
 class Grid extends GridInterface
 {
     /**
-     * 'Add Selected Products' button
+     * 'Add Selected Products' button.
      *
      * @var string
      */
     protected $addProducts = 'button.add';
 
     /**
-     * Filters array mapping
+     * An element locator which allows to select entities in grid.
+     *
+     * @var string
+     */
+    protected $selectItem = '[data-column=entity_id] input';
+
+    /**
+     * Filters array mapping.
      *
      * @var array
      */
@@ -35,18 +42,7 @@ class Grid extends GridInterface
     ];
 
     /**
-     * Initialize block elements
-     * 
-     * @return void
-     */
-    protected function _init()
-    {
-        parent::_init();
-        $this->selectItem = "[data-column=entity_id] input";
-    }
-
-    /**
-     * Press 'Add Selected Products' button
+     * Press 'Add Selected Products' button.
      * 
      * @return void
      */
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryBreadcrumbs.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryBreadcrumbs.php
new file mode 100644
index 0000000000000000000000000000000000000000..f85d76989b0c5d555f791726b7728e127116170f
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryBreadcrumbs.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Catalog\Test\Constraint;
+
+use Magento\Catalog\Test\Fixture\Category;
+use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
+use Magento\Mtf\Client\BrowserInterface;
+use Magento\Mtf\Constraint\AbstractConstraint;
+
+/**
+ * Assert that displayed breadcrumbs on category page equals to passed from fixture.
+ */
+class AssertCategoryBreadcrumbs extends AbstractConstraint
+{
+    /**
+     * Name of home page.
+     */
+    const HOME_PAGE = 'Home';
+
+    /**
+     * Browser instance.
+     *
+     * @var BrowserInterface
+     */
+    protected $browser;
+
+    /**
+     * Assert that displayed breadcrumbs on category page equals to passed from fixture.
+     *
+     * @param BrowserInterface $browser
+     * @param Category $category
+     * @param CatalogCategoryView $catalogCategoryView
+     * @return void
+     */
+    public function processAssert(
+        BrowserInterface $browser,
+        Category $category,
+        CatalogCategoryView $catalogCategoryView
+    ) {
+        $this->browser = $browser;
+        $this->openCategory($category);
+
+        $breadcrumbs = $this->getBreadcrumbs($category);
+        $pageBreadcrumbs = $catalogCategoryView->getBreadcrumbs()->getText();
+        \PHPUnit_Framework_Assert::assertEquals(
+            $breadcrumbs,
+            $pageBreadcrumbs,
+            'Wrong breadcrumbs of category page.'
+            . "\nExpected: " . $breadcrumbs
+            . "\nActual: " . $pageBreadcrumbs
+        );
+    }
+
+    /**
+     * Open category.
+     *
+     * @param Category $category
+     * @return void
+     */
+    protected function openCategory(Category $category)
+    {
+        $categoryUrlKey = [];
+
+        while ($category) {
+            $categoryUrlKey[] = $category->hasData('url_key')
+                ? strtolower($category->getUrlKey())
+                : trim(strtolower(preg_replace('#[^0-9a-z%]+#i', '-', $category->getName())), '-');
+
+            $category = $category->getDataFieldConfig('parent_id')['source']->getParentCategory();
+            if ($category !== null && 1 == $category->getParentId()) {
+                $category = null;
+            }
+        }
+        $categoryUrlKey = $_ENV['app_frontend_url'] . implode('/', array_reverse($categoryUrlKey)) . '.html';
+
+        $this->browser->open($categoryUrlKey);
+    }
+
+    /**
+     * Prepare and return category breadcrumbs.
+     *
+     * @param Category $category
+     * @return string
+     */
+    protected function getBreadcrumbs(Category $category)
+    {
+        $breadcrumbs = [];
+
+        while ($category) {
+            $breadcrumbs[] = $category->getName();
+
+            $category = $category->getDataFieldConfig('parent_id')['source']->getParentCategory();
+            if ($category !== null && 1 == $category->getParentId()) {
+                $category = null;
+            }
+        }
+        $breadcrumbs[] = self::HOME_PAGE;
+
+        return implode(' ', array_reverse($breadcrumbs));
+    }
+
+    /**
+     * Returns a string representation of the object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Breadcrumbs on category page equals to passed from fixture.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php
index def6490e3bf2734e78252c8fffa7c51181114626..992fdc6c76702b19ca178e4d4b2f67653b9d6d0e 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php
@@ -19,7 +19,7 @@ use Magento\Mtf\Fixture\FixtureFactory;
 class AssertCategoryPage extends AbstractConstraint
 {
     /**
-     * CMS Block display mode
+     * CMS Block display mode.
      *
      * @var array
      */
@@ -29,14 +29,14 @@ class AssertCategoryPage extends AbstractConstraint
     ];
 
     /**
-     * Category view page
+     * Category view page.
      *
      * @var CatalogCategoryView
      */
     protected $categoryViewPage;
 
     /**
-     * Browser instance
+     * Browser instance.
      *
      * @var BrowserInterface
      */
@@ -68,6 +68,8 @@ class AssertCategoryPage extends AbstractConstraint
     }
 
     /**
+     * Prepare comparison data.
+     *
      * @param FixtureFactory $fixtureFactory
      * @param Category $category
      * @param Category $initialCategory
@@ -92,21 +94,30 @@ class AssertCategoryPage extends AbstractConstraint
     }
 
     /**
-     * Get category url to open
+     * Get category url to open.
      *
      * @param Category $category
      * @return string
      */
     protected function getCategoryUrl(Category $category)
     {
-        $categoryUrlKey = $category->hasData('url_key')
-            ? strtolower($category->getUrlKey())
-            : trim(strtolower(preg_replace('#[^0-9a-z%]+#i', '-', $category->getName())), '-');
-        return $_ENV['app_frontend_url'] . $categoryUrlKey . '.html';
+        $categoryUrlKey = [];
+        while ($category) {
+            $categoryUrlKey[] = $category->hasData('url_key')
+                ? strtolower($category->getUrlKey())
+                : trim(strtolower(preg_replace('#[^0-9a-z%]+#i', '-', $category->getName())), '-');
+
+            $category = $category->getDataFieldConfig('parent_id')['source']->getParentCategory();
+            if (1 == $category->getParentId()) {
+                $category = null;
+            }
+        }
+
+        return $_ENV['app_frontend_url'] . implode('/', array_reverse($categoryUrlKey)) . '.html';
     }
 
     /**
-     * Assert category general information
+     * Assert category general information.
      *
      * @param Category $category
      * @param array $categoryData
@@ -147,7 +158,7 @@ class AssertCategoryPage extends AbstractConstraint
     }
 
     /**
-     * Assert category display settings
+     * Assert category display settings.
      *
      * @param Category $category
      * @param array $categoryData
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryWithCustomStoreOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryWithCustomStoreOnFrontend.php
new file mode 100644
index 0000000000000000000000000000000000000000..a448fcaa3f18d9e6fe8e70bb1c71f1ae0ba185a0
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryWithCustomStoreOnFrontend.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Catalog\Test\Constraint;
+
+use Magento\Catalog\Test\Fixture\Category;
+use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
+use Magento\Mtf\Client\BrowserInterface;
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\Cms\Test\Page\CmsIndex;
+
+/**
+ * Assert that category name is different on different store view.
+ */
+class AssertCategoryWithCustomStoreOnFrontend extends AbstractConstraint
+{
+    /**
+     * Assert that category name is different on different store view.
+     *
+     * @param BrowserInterface $browser
+     * @param CatalogCategoryView $categoryView
+     * @param Category $category
+     * @param Category $initialCategory
+     * @param CmsIndex $cmsIndex
+     * @return void
+     */
+    public function processAssert(
+        BrowserInterface $browser,
+        CatalogCategoryView $categoryView,
+        Category $category,
+        Category $initialCategory,
+        CmsIndex $cmsIndex
+    ) {
+        $cmsIndex->open();
+        $cmsIndex->getLinksBlock()->waitWelcomeMessage();
+        $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
+        \PHPUnit_Framework_Assert::assertEquals(
+            $initialCategory->getName(),
+            $categoryView->getTitleBlock()->getTitle(),
+            'Wrong category name is displayed for default store.'
+        );
+
+        $store = $category->getDataFieldConfig('store_id')['source']->store->getName();
+        $cmsIndex->getStoreSwitcherBlock()->selectStoreView($store);
+        $cmsIndex->getLinksBlock()->waitWelcomeMessage();
+        $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
+        \PHPUnit_Framework_Assert::assertEquals(
+            $category->getName(),
+            $categoryView->getTitleBlock()->getTitle(),
+            'Wrong category name is displayed for ' . $store
+        );
+    }
+
+    /**
+     * Returns a string representation of the object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Category name is different on different store view.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml
index 2c5e23a9099b79bee01f5aee1d92ff8440029b1c..975ae3ed0e70dfaaed4f4fcbd69acbd541c840a5 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml
@@ -41,5 +41,6 @@
         <field name="landing_page" group="display_setting" source="Magento\Catalog\Test\Fixture\Category\LandingPage" />
         <field name="display_mode" group="display_setting" />
         <field name="category_products" group="category_products" source="Magento\Catalog\Test\Fixture\Category\CategoryProducts" />
+        <field name="store_id" group="null" source="Magento\Catalog\Test\Fixture\Category\StoreId" />
     </fixture>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/StoreId.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/StoreId.php
new file mode 100644
index 0000000000000000000000000000000000000000..981a7499f5835e004a5981db6c91cc15ffd3df40
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/StoreId.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Catalog\Test\Fixture\Category;
+
+use Magento\Mtf\Fixture\DataSource;
+use Magento\Mtf\Fixture\FixtureFactory;
+use Magento\Store\Test\Fixture\Store;
+use Magento\Store\Test\Fixture\StoreGroup;
+
+/**
+ * Category store id scope.
+ */
+class StoreId extends DataSource
+{
+    /**
+     * Store fixture.
+     *
+     * @var Store
+     */
+    public $store;
+
+    /**
+     * @constructor
+     * @param FixtureFactory $fixtureFactory
+     * @param array $params
+     * @param array $data [optional]
+     */
+    public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = [])
+    {
+        $this->params = $params;
+
+        if (isset($data['dataset'])) {
+            $store = $fixtureFactory->createByCode('store', $data);
+            /** @var Store $store */
+            if (!$store->getStoreId()) {
+                $store->persist();
+            }
+            $this->store = $store;
+            $this->data = $store->getGroupId() . '/' . $store->getName();
+        } else {
+            $this->data = $data;
+        }
+    }
+
+    /**
+     * Return Store fixture.
+     *
+     * @return Store
+     */
+    public function getStore()
+    {
+        return $this->store;
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php
index 169eb6805b3d38d984a20863933a6cc3f33d0272..3a2520083bc2077130053e4dd789ebf007b94269 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php
@@ -58,6 +58,9 @@ class Curl extends AbstractCurl implements CatalogProductAttributeInterface
      */
     public function persist(FixtureInterface $fixture = null)
     {
+        if ($fixture->hasData('attribute_id')) {
+            return ['attribute_id' => $fixture->getData('attribute_id')];
+        }
         $data = $this->replaceMappingData($fixture->getData());
         $data['frontend_label'] = [0 => $data['frontend_label']];
 
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategory.php
index d79e8a0823236362443b37c1bec76d6cb4ccb094..ec71bb91ffa152fbb5e2384f3f349a917752c38d 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategory.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategory.php
@@ -50,10 +50,12 @@ class CatalogCategory extends Page
 
     /**
      * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_backend_url'] . self::MCA;
+        $this->url = $_ENV['app_backend_url'] . self::MCA;
     }
 
     /**
@@ -78,7 +80,7 @@ class CatalogCategory extends Page
     public function getFormBlock()
     {
         return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryEditCategoryForm(
-            $this->_browser->find($this->formBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->formBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -90,7 +92,7 @@ class CatalogCategory extends Page
     public function getTreeBlock()
     {
         return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryTree(
-            $this->_browser->find($this->treeBlock, Locator::SELECTOR_CSS, 'tree'),
+            $this->browser->find($this->treeBlock, Locator::SELECTOR_CSS, 'tree'),
             $this->getTemplateBlock()
         );
     }
@@ -103,7 +105,7 @@ class CatalogCategory extends Page
     public function getMessagesBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendMessages(
-            $this->_browser->find($this->messagesBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->messagesBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -115,7 +117,7 @@ class CatalogCategory extends Page
     public function getTemplateBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendTemplate(
-            $this->_browser->find($this->templateBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->templateBlock, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryEdit.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryEdit.php
index 110b175a7d09edbf55d2195cae3799342f59b441..6a2938edc0b96f6840227b90bc7d7927a757bcdf 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryEdit.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryEdit.php
@@ -61,9 +61,9 @@ class CatalogCategoryEdit extends Page
      *
      * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_backend_url'] . self::MCA;
+        $this->url = $_ENV['app_backend_url'] . self::MCA;
     }
 
     /**
@@ -88,7 +88,7 @@ class CatalogCategoryEdit extends Page
     public function getFormBlock()
     {
         return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryEditCategoryForm(
-            $this->_browser->find($this->formBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->formBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -100,7 +100,7 @@ class CatalogCategoryEdit extends Page
     public function getTreeBlock()
     {
         return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryTree(
-            $this->_browser->find($this->treeBlock, Locator::SELECTOR_CSS),
+            $this->browser->find($this->treeBlock, Locator::SELECTOR_CSS),
             $this->getTemplateBlock()
         );
     }
@@ -113,7 +113,7 @@ class CatalogCategoryEdit extends Page
     public function getMessagesBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendMessages(
-            $this->_browser->find($this->messagesBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->messagesBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -125,7 +125,7 @@ class CatalogCategoryEdit extends Page
     public function getTemplateBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendTemplate(
-            $this->_browser->find($this->templateBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->templateBlock, Locator::SELECTOR_CSS)
         );
     }
 
@@ -137,7 +137,7 @@ class CatalogCategoryEdit extends Page
     public function getPageActionsBlock()
     {
         return Factory::getBlockFactory()->getMagentoBackendFormPageActions(
-            $this->_browser->find($this->pageActionsBlock)
+            $this->browser->find($this->pageActionsBlock)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryView.xml
index 45839712e35c673123d36d46d33b1aaa8b869979..730724269f29e3d1135170eff024443d09eb6528 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryView.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryView.xml
@@ -8,6 +8,7 @@
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
     <page name="CatalogCategoryView" area="Category" mca="catalog/category/view" module="Magento_Catalog">
         <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper h1.page-title .base" strategy="css selector"/>
+        <block name="breadcrumbs" class="Magento\Theme\Test\Block\Html\Breadcrumbs" locator=".breadcrumbs" strategy="css selector"/>
         <block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector"/>
         <block name="viewBlock" class="Magento\Catalog\Test\Block\Category\View" locator="#maincontent" strategy="css selector"/>
         <block name="listProductBlock" class="Magento\Catalog\Test\Block\Product\ListProduct" locator=".products.wrapper.grid" strategy="css selector"/>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml
index 9ef0bcfd31196057111439f69587c7f090dc53b0..83a4e691faf571985168d2ae572460d9ae889b13 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml
@@ -13,6 +13,46 @@
             <field name="is_required" xsi:type="string">No</field>
         </dataset>
 
+        <dataset name="quantity_and_stock_status">
+            <field name="attribute_id" xsi:type="number">113</field>
+            <field name="frontend_label" xsi:type="string">Quantity</field>
+            <field name="attribute_code" xsi:type="string">quantity_and_stock_status</field>
+            <field name="frontend_input" xsi:type="string">Dropdown</field>
+            <field name="is_required" xsi:type="string">No</field>
+            <field name="options" xsi:type="array">
+                <item name="0" xsi:type="array">
+                    <item name="is_default" xsi:type="string">Yes</item>
+                    <item name="admin" xsi:type="string">In Stock</item>
+                    <item name="view" xsi:type="string">In Stock</item>
+                </item>
+                <item name="1" xsi:type="array">
+                    <item name="is_default" xsi:type="string">No</item>
+                    <item name="admin" xsi:type="string">Out of Stock</item>
+                    <item name="view" xsi:type="string">Out of Stock</item>
+                </item>
+            </field>
+        </dataset>
+
+        <dataset name="tax_class_id">
+            <field name="attribute_id" xsi:type="number">172</field>
+            <field name="frontend_label" xsi:type="string">Tax Class</field>
+            <field name="attribute_code" xsi:type="string">tax_class_id</field>
+            <field name="frontend_input" xsi:type="string">Dropdown</field>
+            <field name="is_required" xsi:type="string">No</field>
+            <field name="options" xsi:type="array">
+                <item name="0" xsi:type="array">
+                    <item name="is_default" xsi:type="string">No</item>
+                    <item name="admin" xsi:type="string">None</item>
+                    <item name="view" xsi:type="string">None</item>
+                </item>
+                <item name="1" xsi:type="array">
+                    <item name="is_default" xsi:type="string">Yes</item>
+                    <item name="admin" xsi:type="string">Taxable Goods</item>
+                    <item name="view" xsi:type="string">Taxable Goods</item>
+                </item>
+            </field>
+        </dataset>
+
         <dataset name="attribute_type_text_field">
             <field name="frontend_label" xsi:type="string">attribute_text%isolation%</field>
             <field name="attribute_code" xsi:type="string">attribute_text%isolation%</field>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml
index 6be4a2275e35365d10655a382d0fdb93b265f618..8a2df347d213ab64af57163d6f9a4bf0c4bec3b0 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml
@@ -42,6 +42,7 @@
             <field name="name" xsi:type="string">Product \&#39;!@#$%^&amp;*()+:;\\|}{][?=-~` %isolation%</field>
             <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>
             <field name="is_virtual" xsi:type="string">No</field>
+            <field name="product_has_weight" xsi:type="string">Yes</field>
             <field name="weight" xsi:type="string">1</field>
             <field name="quantity_and_stock_status" xsi:type="array">
                 <item name="qty" xsi:type="string">25</item>
@@ -73,6 +74,7 @@
                 <item name="qty" xsi:type="string">25</item>
                 <item name="is_in_stock" xsi:type="string">In Stock</item>
             </field>
+            <field name="product_has_weight" xsi:type="string">Yes</field>
             <field name="weight" xsi:type="string">1</field>
             <field name="price" xsi:type="array">
                 <item name="value" xsi:type="string">560</item>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml
index f621b1c38c1693e721fdba38a6dd362173ace094..9cdfded386641ff0a5d20d1a9ed50aee4349282d 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml
@@ -61,5 +61,15 @@
             <field name="is_active" xsi:type="string">Yes</field>
             <field name="include_in_menu" xsi:type="string">Yes</field>
         </dataset>
+
+        <dataset name="two_nested_category">
+            <field name="name" xsi:type="string">Category%isolation%</field>
+            <field name="url_key" xsi:type="string">category-%isolation%</field>
+            <field name="parent_id" xsi:type="array">
+                <item name="dataset" xsi:type="string">default_subcategory</item>
+            </field>
+            <field name="is_active" xsi:type="string">Yes</field>
+            <field name="include_in_menu" xsi:type="string">Yes</field>
+        </dataset>
     </repository>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml
index 555443367b77b8e3b043c0c97abc349cb32c9818..0c2a2bf3e4be4f0ea15de4f023817080a0cd3c5c 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml
@@ -149,5 +149,17 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
         </variation>
+        <variation name="CreateCategoryEntityTestVariation10">
+            <data name="description" xsi:type="string">Create category with three nesting</data>
+            <data name="addCategory" xsi:type="string">addSubcategory</data>
+            <data name="category/data/parent_id/dataset" xsi:type="string">two_nested_category</data>
+            <data name="category/data/name" xsi:type="string">Category%isolation%</data>
+            <data name="category/data/url_key" xsi:type="string">Category%isolation%</data>
+            <data name="category/data/is_active" xsi:type="string">Yes</data>
+            <data name="category/data/description" xsi:type="string">Category Required</data>
+            <data name="category/data/available_product_listing_config" xsi:type="string">Yes</data>
+            <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" />
+            <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryBreadcrumbs" />
+        </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml
index 2c108c67f39758a85b6b8aaff63250f3ca6b1e8d..a28b5e16ab25d676e779dfc30d46ea93ad2393f2 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml
@@ -46,5 +46,11 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForm" />
         </variation>
+        <variation name="UpdateCategoryEntityTestVariation4" summary="Update Category with custom Store View.">
+            <data name="category/data/store_id/dataset" xsi:type="string">custom</data>
+            <data name="category/data/name" xsi:type="string">Category %isolation%</data>
+            <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" />
+            <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryWithCustomStoreOnFrontend" />
+        </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml
index f46eff7dac4b8327c03897fbc0a3cbf41d78c166..97aee8c72ce214831cfb85b0cf9364031e8b3060 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml
@@ -271,7 +271,6 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
-            <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" />
         </variation>
         <variation name="CreateSimpleProductEntityTestVariation16">
             <data name="description" xsi:type="string">Create product with tax class and check absent special price</data>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml
index 395b421268e0bf96b0be6b9210fc3522e4e8ce54..dc3aadb36e7f531a80690bd9be70883b2f792d75 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml
@@ -76,7 +76,6 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
-            <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" />
         </variation>
         <variation name="CreateVirtualProductEntityTestVariation6">
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml
index 3c3dda5716404d0881365783bb907a9536359bdf..b967e6f87b9f6aef7248b117e07ec8da47d7c4cb 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml
@@ -118,7 +118,6 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" />
-            <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" />
         </variation>
@@ -210,7 +209,6 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" />
-            <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" />
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml
index 03cf25cfa8abe5a3886f025398dd4427231b3fb6..b945d770fe82d5992ca0a769a3da02da2da2a10d 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml
@@ -58,6 +58,7 @@
             <data name="productAttribute/data/used_for_sort_by" xsi:type="string">Yes</data>
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm" />
+            <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductByAttribute" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUsedInSortOnFrontend" />
             <constraint name="Magento\CatalogRule\Test\Constraint\AssertProductAttributeIsUsedPromoRules" />
@@ -69,8 +70,11 @@
             <data name="productAttribute/data/is_required" xsi:type="string">Yes</data>
             <data name="productAttribute/data/attribute_code" xsi:type="string">attr_yesno_%isolation%</data>
             <data name="productAttribute/data/is_global" xsi:type="string">Global</data>
+            <data name="productAttribute/data/is_searchable" xsi:type="string">Yes</data>
+            <data name="productAttribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data>
             <data name="productAttribute/data/default_value_yesno" xsi:type="string">No</data>
             <data name="productAttribute/data/manage_frontend_label" xsi:type="string">Yes/No_Global</data>
+            <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductByAttribute" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" />
@@ -100,6 +104,7 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsComparable" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterable" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterableInSearch" />
+            <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductByAttribute" />
             <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAttributeSearchableByLabel" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeOptionsOnProductForm" />
         </variation>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php
index 8429c349f0cfe3ad3ffd6e16d33ae27cb665fe05..755ff5eb886e3548425a84dec20644430f4b9330 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php
@@ -8,8 +8,10 @@ namespace Magento\Catalog\Test\TestCase\ProductAttribute;
 
 use Magento\Catalog\Test\Fixture\CatalogAttributeSet;
 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
+use Magento\Catalog\Test\Fixture\CatalogProductSimple;
 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeIndex;
 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeNew;
+use Magento\Mtf\Fixture\FixtureFactory;
 use Magento\Mtf\TestCase\Injectable;
 
 /**
@@ -36,6 +38,24 @@ class UpdateProductAttributeEntityTest extends Injectable
     const DOMAIN = 'MX';
     /* end tags */
 
+    /**
+     * Factory for fixtures.
+     *
+     * @var FixtureFactory
+     */
+    protected $fixtureFactory;
+
+    /**
+     * Prepare data.
+     *
+     * @param FixtureFactory $fixtureFactory
+     * @return void
+     */
+    public function __prepare(FixtureFactory $fixtureFactory)
+    {
+        $this->fixtureFactory = $fixtureFactory;
+    }
+
     /**
      * Run UpdateProductAttributeEntity test
      *
@@ -44,14 +64,16 @@ class UpdateProductAttributeEntityTest extends Injectable
      * @param CatalogAttributeSet $productTemplate
      * @param CatalogProductAttributeIndex $attributeIndex
      * @param CatalogProductAttributeNew $attributeNew
-     * @return void
+     * @param CatalogProductSimple $productSimple
+     * @return array
      */
     public function testUpdateProductAttribute(
         CatalogProductAttribute $productAttributeOriginal,
         CatalogProductAttribute $attribute,
         CatalogAttributeSet $productTemplate,
         CatalogProductAttributeIndex $attributeIndex,
-        CatalogProductAttributeNew $attributeNew
+        CatalogProductAttributeNew $attributeNew,
+        CatalogProductSimple $productSimple
     ) {
         //Precondition
         $productTemplate->persist();
@@ -66,5 +88,42 @@ class UpdateProductAttributeEntityTest extends Injectable
         $attributeIndex->getGrid()->searchAndOpen($filter);
         $attributeNew->getAttributeForm()->fill($attribute);
         $attributeNew->getPageActions()->save();
+        $attribute = $this->prepareAttribute($attribute, $productAttributeOriginal);
+        $productSimple->persist();
+
+        return ['product' => $this->prepareProduct($productSimple, $attribute, $productTemplate)];
+    }
+
+    /**
+     * Prepare product data.
+     *
+     * @param CatalogProductSimple $product
+     * @param CatalogProductAttribute $attribute
+     * @param CatalogAttributeSet $productTemplate
+     * @return CatalogProductSimple
+     */
+    protected function prepareProduct($product, $attribute, $productTemplate)
+    {
+        $data = [
+            'attribute_set_id' => ['attribute_set' => $productTemplate],
+            'custom_attribute' => $attribute
+        ];
+        $data = array_merge($data, $product->getData());
+
+        return $this->fixtureFactory->createByCode('catalogProductSimple', ['data' => $data]);
+    }
+
+    /**
+     * Prepare attribute data.
+     *
+     * @param CatalogProductAttribute $attribute
+     * @param CatalogProductAttribute $productAttributeOriginal
+     * @return CatalogProductAttribute
+     */
+    protected function prepareAttribute($attribute, $productAttributeOriginal)
+    {
+        $attributeData = array_merge($attribute->getData(), $productAttributeOriginal->getData());
+
+        return $this->fixtureFactory->createByCode('catalogProductAttribute', ['data' => $attributeData]);
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml
index 11b2cbcd6b5c08205f747562fae7f395e954edc5..63dabf015796e34f589b4ac24a2ac9188da26507 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml
@@ -34,6 +34,7 @@
             <data name="attribute/data/options/dataset" xsi:type="string">default</data>
             <data name="attribute/data/is_required" xsi:type="string">Yes</data>
             <data name="attribute/data/is_global" xsi:type="string">Global</data>
+            <data name="attribute/data/default_value_text" xsi:type="string">attribute_edited%isolation%</data>
             <data name="attribute/data/is_unique" xsi:type="string">Yes</data>
             <data name="attribute/data/is_searchable" xsi:type="string">Yes</data>
             <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data>
@@ -49,5 +50,16 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" />
         </variation>
+        <variation name="UpdateProductAttributeEntityTestVariation3">
+            <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data>
+            <data name="productAttributeOriginal/dataset" xsi:type="string">tax_class_id</data>
+            <data name="attribute/data/is_searchable" xsi:type="string">Yes</data>
+            <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data>
+            <data name="cacheTags" xsi:type="array">
+                <item name="0" xsi:type="string">FPC</item>
+            </data>
+            <constraint name="Magento\Backend\Test\Constraint\AssertCacheIsRefreshableAndInvalidated" />
+            <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductByAttribute" />
+        </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php
index e022906b29b18a8f6bb1d651fa717fff2a88666a..3d5aa19186cec9f6a342ae492fd60df73e1b6f38 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php
@@ -8,6 +8,8 @@ namespace Magento\Catalog\Test\TestStep;
 
 use Magento\Catalog\Test\Fixture\CatalogAttributeSet;
 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
+use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit;
+use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetEdit;
 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex;
 use Magento\Mtf\Fixture\FixtureFactory;
@@ -46,6 +48,20 @@ class AddAttributeToProductTemplateStep implements TestStepInterface
      */
     protected $productTemplate;
 
+    /**
+     * Catalog Product Index page.
+     *
+     * @var CatalogProductIndex
+     */
+    protected $catalogProductIndex;
+
+    /**
+     * Catalog Product Edit page.
+     *
+     * @var CatalogProductEdit
+     */
+    protected $catalogProductEdit;
+
     /**
      * @constructor
      * @param CatalogProductSetIndex $catalogProductSetIndex
@@ -53,19 +69,25 @@ class AddAttributeToProductTemplateStep implements TestStepInterface
      * @param CatalogProductAttribute $attribute
      * @param CatalogAttributeSet $productTemplate
      * @param FixtureFactory $fixtureFactory
+     * @param CatalogProductIndex $catalogProductIndex
+     * @param CatalogProductEdit $catalogProductEdit
      */
     public function __construct(
         CatalogProductSetIndex $catalogProductSetIndex,
         CatalogProductSetEdit $catalogProductSetEdit,
         CatalogProductAttribute $attribute,
         CatalogAttributeSet $productTemplate,
-        FixtureFactory $fixtureFactory
+        FixtureFactory $fixtureFactory,
+        CatalogProductIndex $catalogProductIndex,
+        CatalogProductEdit $catalogProductEdit
     ) {
         $this->catalogProductSetIndex = $catalogProductSetIndex;
         $this->catalogProductSetEdit = $catalogProductSetEdit;
         $this->attribute = $attribute;
         $this->productTemplate = $productTemplate;
         $this->fixtureFactory = $fixtureFactory;
+        $this->catalogProductIndex = $catalogProductIndex;
+        $this->catalogProductEdit = $catalogProductEdit;
     }
 
     /**
@@ -87,10 +109,14 @@ class AddAttributeToProductTemplateStep implements TestStepInterface
                 'dataset' => 'product_with_category_with_anchor',
                 'data' => [
                     'attribute_set_id' => ['attribute_set' => $this->productTemplate],
+                    'custom_attribute' => $this->attribute
                 ],
             ]
         );
-        $product->persist();
+        $this->catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
+        $productForm = $this->catalogProductEdit->getProductForm();
+        $productForm->fill($product);
+        $this->catalogProductEdit->getFormPageActions()->save();
 
         return ['product' => $product];
     }
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml
index c02f461a875785a48b4312fcd154f2ac302b6e85..92c41c11a06ef9e15ec3f1f2fa85775387f59ee3 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml
@@ -151,4 +151,9 @@
             <argument name="severity" xsi:type="string">high</argument>
         </arguments>
     </type>
+    <type name="Magento\Catalog\Test\Constraint\AssertCategoryWithCustomStoreOnFrontend">
+        <arguments>
+            <argument name="severity" xsi:type="string">low</argument>
+        </arguments>
+    </type>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php
index 62b27d30a0738c08ee576c1caae308cc01afade3..2a3f2883b1921f179c3e965da6e76efbf12f4927 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php
@@ -8,8 +8,6 @@ namespace Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit;
 
 use Magento\Backend\Test\Block\Widget\FormTabs;
 use Magento\Mtf\Client\Element\SimpleElement;
-use Magento\Mtf\Client\Element;
-use Magento\Mtf\Client\Locator;
 use Magento\Mtf\Fixture\FixtureInterface;
 
 /**
@@ -17,20 +15,6 @@ use Magento\Mtf\Fixture\FixtureInterface;
  */
 class PromoForm extends FormTabs
 {
-    /**
-     * Add button.
-     *
-     * @var string
-     */
-    protected $addButton = '.rule-param-new-child a';
-
-    /**
-     * Locator for Customer Segment Conditions.
-     *
-     * @var string
-     */
-    protected $conditionFormat = '//*[@id="conditions__1__new_child"]//option[contains(.,"%s")]';
-
     /**
      * Fill form with tabs.
      *
@@ -71,19 +55,4 @@ class PromoForm extends FormTabs
 
         return $tabs;
     }
-
-    /**
-     * Check if attribute is available in conditions.
-     *
-     * @param string $name
-     * @return bool
-     */
-    public function isAttributeInConditions($name)
-    {
-        $this->_rootElement->find($this->addButton)->click();
-        return $this->_rootElement->find(
-            sprintf($this->conditionFormat, $name),
-            Locator::SELECTOR_XPATH
-        )->isVisible();
-    }
 }
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml
index bf5b8646097f9fdf54a34380908bf83fe1d7ab08..1b940ba5bab4e4f1d33b46c4bdb110b0aa4ec264 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.xml
@@ -7,7 +7,7 @@
 -->
 <tabs>
     <rule_information>
-        <class>\Magento\Backend\Test\Block\Widget\Tab</class>
+        <class>\Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Tab\RuleInformation</class>
         <selector>#promo_catalog_edit_tabs_main_section</selector>
         <strategy>css selector</strategy>
         <fields>
@@ -25,7 +25,7 @@
         </fields>
     </rule_information>
     <conditions>
-        <class>\Magento\Backend\Test\Block\Widget\Tab</class>
+        <class>Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Tab\Conditions</class>
         <selector>#promo_catalog_edit_tabs_conditions_section</selector>
         <strategy>css selector</strategy>
         <fields>
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php
index 2ad3ea93baad5a58d2bac8b5abe954c3e26c6046..049cde37bf28979b6a34c01448fe9d70eada3c44 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php
@@ -6,42 +6,41 @@
 
 namespace Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Tab;
 
-use Magento\Mtf\Factory\Factory;
+use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
+use Magento\Mtf\Client\Locator;
 use Magento\Backend\Test\Block\Widget\Tab;
-use Magento\Mtf\Client\Element\SimpleElement;
 
 /**
- * Class Conditions
- * Form Tab for specifying catalog price rule conditions
- *
+ * Form Tab for specifying catalog price rule conditions.
  */
 class Conditions extends Tab
 {
     /**
-     * Rule conditions block selector
+     * Add button.
      *
      * @var string
      */
-    protected $ruleConditions = '#rule_conditions_fieldset';
+    protected $addButton = '.rule-param-new-child a';
 
     /**
-     * Fill condition options
+     * Locator for specific conditions.
      *
-     * @param array $fields
-     * @param SimpleElement|null $element
-     * @return void
+     * @var string
      */
-    public function fillFormTab(array $fields, SimpleElement $element = null)
-    {
-        $data = $this->dataMapping($fields);
+    protected $conditionFormat = '//*[@id="conditions__1__new_child"]//option[contains(.,"%s")]';
 
-        $conditionsBlock = Factory::getBlockFactory()->getMagentoCatalogRuleConditions(
-            $element->find($this->ruleConditions)
-        );
-        $conditionsBlock->clickAddNew();
-
-        $conditionsBlock->selectCondition($data['condition_type']['value']);
-        $conditionsBlock->clickEllipsis();
-        $conditionsBlock->selectConditionValue($data['condition_value']['value']);
+    /**
+     * Check if attribute is available in conditions.
+     *
+     * @param CatalogProductAttribute $attribute
+     * @return bool
+     */
+    public function isAttributeInConditions(CatalogProductAttribute $attribute)
+    {
+        $this->_rootElement->find($this->addButton)->click();
+        return $this->_rootElement->find(
+            sprintf($this->conditionFormat, $attribute->getFrontendLabel()),
+            Locator::SELECTOR_XPATH
+        )->isVisible();
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/RuleInformation.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/RuleInformation.php
new file mode 100644
index 0000000000000000000000000000000000000000..e4beb9105661c5c6c1e8017c7908869e2c1a3b07
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Tab/RuleInformation.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Tab;
+
+use Magento\Customer\Test\Fixture\CustomerGroup;
+use Magento\Backend\Test\Block\Widget\Tab;
+
+/**
+ * Rule Information tab.
+ */
+class RuleInformation extends Tab
+{
+    /**
+     * Locator for Customer Group element.
+     *
+     * @var string
+     */
+    protected $customerGroup = '#rule_customer_group_ids';
+
+    /**
+     * Check whether Customer Group is visible.
+     *
+     * @param CustomerGroup $customerGroup
+     * @return bool
+     */
+    public function isVisibleCustomerGroup(CustomerGroup $customerGroup)
+    {
+        $options = $this->_rootElement->find($this->customerGroup)->getText();
+        return false !== strpos($options, $customerGroup->getCustomerGroupCode());
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php
index c0d88eac2804e23a07c77dd111413992d5e1b79b..89b72240318f5d7da2592cd1b2dce55f2ab8baf1 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php
@@ -8,6 +8,7 @@ namespace Magento\CatalogRule\Test\Constraint;
 
 use Magento\Mtf\Constraint\AbstractConstraint;
 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
+use Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Tab\Conditions;
 use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleNew;
 use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleIndex;
 
@@ -33,8 +34,10 @@ class AssertProductAttributeIsUsedPromoRules extends AbstractConstraint
         $catalogRuleIndex->getGridPageActions()->addNew();
         $catalogRuleNew->getEditForm()->openTab('conditions');
 
+        /** @var Conditions $conditionsTab */
+        $conditionsTab = $catalogRuleNew->getEditForm()->getTab('conditions');
         \PHPUnit_Framework_Assert::assertTrue(
-            $catalogRuleNew->getEditForm()->isAttributeInConditions($attribute->getFrontendLabel()),
+            $conditionsTab->isAttributeInConditions($attribute),
             'Product attribute can\'t be used on promo rules conditions.'
         );
     }
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php
index 12412122501f2b81d5105404a0425b707ad14997..8cf299da48d7de0b86f06d397f033bb108ad87a1 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php
@@ -10,19 +10,19 @@ use Magento\Mtf\Fixture\FixtureFactory;
 use Magento\Mtf\TestStep\TestStepInterface;
 
 /**
- * Creating catalog rule
+ * Creating catalog rule.
  */
 class CreateCatalogRuleStep implements TestStepInterface
 {
     /**
-     * Catalog Rule dataset name
+     * Catalog Rule dataset name.
      *
      * @var string
      */
     protected $catalogRule;
 
     /**
-     * Factory for Fixture
+     * Factory for Fixture.
      *
      * @var FixtureFactory
      */
@@ -36,7 +36,7 @@ class CreateCatalogRuleStep implements TestStepInterface
     protected $deleteAllCatalogRule;
 
     /**
-     * Preparing step properties
+     * Preparing step properties.
      *
      * @constructor
      * @param FixtureFactory $fixtureFactory
@@ -51,7 +51,7 @@ class CreateCatalogRuleStep implements TestStepInterface
     }
 
     /**
-     * Create catalog rule
+     * Create catalog rule.
      *
      * @return array
      */
@@ -76,6 +76,8 @@ class CreateCatalogRuleStep implements TestStepInterface
      */
     public function cleanup()
     {
-        $this->deleteAllCatalogRule->run();
+        if ($this->catalogRule != '-') {
+            $this->deleteAllCatalogRule->run();
+        }
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Date.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Date.php
new file mode 100644
index 0000000000000000000000000000000000000000..c4ef4cb26ddea24d7156c0e1a89aff6c153023a5
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Date.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute;
+
+use Magento\Mtf\Block\Form as BaseForm;
+use Magento\Mtf\Fixture\FixtureInterface;
+use Magento\Mtf\Client\Element\SimpleElement;
+
+/**
+ * Advanced search form with custom Date attribute.
+ */
+class Date extends BaseForm
+{
+    /**
+     * Selector for date from input.
+     *
+     * @var string
+     */
+    protected $dateFromSelector = '[name="%s[from]"]';
+
+    /**
+     * Selector for date to input.
+     *
+     * @var string
+     */
+    protected $dateToSelector = '[name="%s[to]"]';
+
+    /**
+     * Fill the root form.
+     *
+     * @param FixtureInterface $fixture
+     * @param SimpleElement|null $element
+     * @param array|null $mapping
+     * @return $this
+     */
+    public function fill(FixtureInterface $fixture, SimpleElement $element = null, array $mapping = null)
+    {
+        $data = $fixture->getData();
+
+        // Mapping
+        $mapping = $this->dataMapping($data, $mapping);
+        $attribute = $fixture->getDataFieldConfig('custom_attribute')['source']->getAttribute();
+        $mappingDate['custom_attribute']['from'] = $mapping['custom_attribute'];
+        $mappingDate['custom_attribute']['to'] = $mapping['custom_attribute'];
+        $attributeCode = $attribute->getAttributeCode();
+        $mappingDate['custom_attribute']['from']['selector'] = sprintf($this->dateFromSelector, $attributeCode);
+        $mappingDate['custom_attribute']['to']['selector'] = sprintf($this->dateToSelector, $attributeCode);
+
+        $this->_fill($mappingDate, $element);
+
+        return $this;
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Select.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Select.php
new file mode 100644
index 0000000000000000000000000000000000000000..a7aee1dadc90b7917f628475bd02ea4c322cf08e
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Select.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute;
+
+use Magento\Mtf\Block\Form as BaseForm;
+use Magento\Mtf\Fixture\FixtureInterface;
+use Magento\Mtf\Client\Element\SimpleElement;
+
+/**
+ * Advanced search form with custom Select attribute.
+ */
+class Select extends BaseForm
+{
+    /**
+     * Selector for select.
+     *
+     * @var string
+     */
+    protected $selectSelector = '[name="%s"]';
+
+    /**
+     * Fill the root form.
+     *
+     * @param FixtureInterface $fixture
+     * @param SimpleElement|null $element
+     * @param array|null $mapping
+     * @return $this
+     */
+    public function fill(FixtureInterface $fixture, SimpleElement $element = null, array $mapping = null)
+    {
+        $attribute = $fixture->getDataFieldConfig('custom_attribute')['source']->getAttribute();
+        $mapping['custom_attribute']['selector'] = sprintf($this->selectSelector, $attribute->getAttributeCode());
+        $mapping['custom_attribute']['input'] = 'select';
+        $this->_fill($mapping, $element);
+
+        return $this;
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Text.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Text.php
new file mode 100644
index 0000000000000000000000000000000000000000..5beb76c1d06badf33366477fbbe0cec69c963c21
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/CustomAttribute/Text.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute;
+
+use Magento\Mtf\Block\Form as BaseForm;
+use Magento\Mtf\Fixture\FixtureInterface;
+use Magento\Mtf\Client\Element\SimpleElement;
+
+/**
+ * Advanced search form with custom Text attribute.
+ */
+class Text extends BaseForm
+{
+    /**
+     * Selector for text input.
+     *
+     * @var string
+     */
+    protected $inputSelector = '[name="%s"]';
+
+    /**
+     * Fill the root form.
+     *
+     * @param FixtureInterface $fixture
+     * @param SimpleElement|null $element
+     * @param array|null $mapping
+     * @return $this
+     */
+    public function fill(FixtureInterface $fixture, SimpleElement $element = null, array $mapping = null)
+    {
+        $attribute = $fixture->getDataFieldConfig('custom_attribute')['source']->getAttribute();
+        $mapping['custom_attribute']['selector'] = sprintf($this->inputSelector, $attribute->getAttributeCode());
+        $this->_fill($mapping, $element);
+
+        return $this;
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php
index 0f2a69ae8e95e038f909b74375a5e9683df2c26a..f70152800ba752b3b2703d31b957108399784646 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php
@@ -6,6 +6,7 @@
 
 namespace Magento\CatalogSearch\Test\Block\Advanced;
 
+use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
 use Magento\Mtf\Block\Form as ParentForm;
 use Magento\Mtf\Client\Element;
 use Magento\Mtf\Client\Locator;
@@ -45,6 +46,13 @@ class Form extends ParentForm
      */
     protected $labelSelector = 'label';
 
+    /**
+     * Selector for custom attribute.
+     *
+     * @var string
+     */
+    protected $customAttributeSelector = 'div[class*="%s"]';
+
     /**
      * Submit search form.
      *
@@ -73,27 +81,24 @@ class Form extends ParentForm
 
         // Mapping
         $mapping = $this->dataMapping($data);
-        $this->_fill($mapping, $element);
+        $attributeType = $attributeCode = '';
+        if ($fixture->hasData('custom_attribute')) {
+            /** @var CatalogProductAttribute $attribute */
+            $attribute = $fixture->getDataFieldConfig('custom_attribute')['source']->getAttribute();
+            $attributeType = $attribute->getFrontendInput();
+            $attributeCode = $attribute->getAttributeCode();
+        }
+        if ($this->hasRender($attributeType)) {
+            $element = $this->_rootElement->find(sprintf($this->customAttributeSelector, $attributeCode));
+            $arguments = ['fixture' => $fixture, 'element' => $element, 'mapping' => $mapping];
+            $this->callRender($attributeType, 'fill', $arguments);
+        } else {
+            $this->_fill($mapping, $element);
+        }
 
         return $this;
     }
 
-    /**
-     * Fill form with custom fields.
-     * (for End To End Tests)
-     *
-     * @param FixtureInterface $fixture
-     * @param array $fields
-     * @param SimpleElement $element
-     */
-    public function fillCustom(FixtureInterface $fixture, array $fields, SimpleElement $element = null)
-    {
-        $data = $fixture->getData('fields');
-        $dataForMapping = array_intersect_key($data, array_flip($fields));
-        $mapping = $this->dataMapping($dataForMapping);
-        $this->_fill($mapping, $element);
-    }
-
     /**
      * Get form fields.
      *
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.xml
index ee3886f04ef7e47c77bd78cb75eaa6798979e58f..01642bfd697ae5cd268b5b603e47029fb344e9ca 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.xml
@@ -25,9 +25,5 @@
         <price_to>
             <selector>#price_to</selector>
         </price_to>
-        <tax_class_id>
-            <selector>#tax_class_id</selector>
-            <input>select</input>
-        </tax_class_id>
     </fields>
-</mapping>
\ No newline at end of file
+</mapping>
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchNoResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchNoResult.php
new file mode 100644
index 0000000000000000000000000000000000000000..caf6de9b9e87d24e486cf5bd2bfbf3dfd80c2722
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchNoResult.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\CatalogSearch\Test\Constraint;
+
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\CatalogSearch\Test\Page\AdvancedResult;
+
+/**
+ * Advanced Search without results.
+ */
+class AssertAdvancedSearchNoResult extends AbstractConstraint
+{
+    /**
+     * Text for error messages.
+     */
+    const ERROR_MESSAGE = 'We can\'t find any items matching these search criteria. Modify your search';
+
+    /**
+     * Assert that Advanced Search without results.
+     *
+     * @param AdvancedResult $resultPage
+     * @return void
+     */
+    public function processAssert(AdvancedResult $resultPage)
+    {
+        \PHPUnit_Framework_Assert::assertTrue(
+            $resultPage->getSearchResultBlock()->isVisibleMessages(self::ERROR_MESSAGE),
+            "The error message '" . self::ERROR_MESSAGE . "' is not visible."
+        );
+    }
+
+    /**
+     * Returns a string representation of successful assertion.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Error message is visible.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductByAttribute.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductByAttribute.php
new file mode 100644
index 0000000000000000000000000000000000000000..17686b94f919df0a8ba6a7c67ce0da19628efc8a
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductByAttribute.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\CatalogSearch\Test\Constraint;
+
+use Magento\Catalog\Test\Fixture\CatalogProductSimple;
+use Magento\CatalogSearch\Test\Page\AdvancedSearch;
+use Magento\Cms\Test\Page\CmsIndex;
+use Magento\Mtf\Fixture\FixtureFactory;
+use Magento\Mtf\Fixture\InjectableFixture;
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\CatalogSearch\Test\Page\CatalogsearchResult;
+
+/**
+ * Assert that product attribute is searchable on Frontend.
+ */
+class AssertAdvancedSearchProductByAttribute extends AbstractConstraint
+{
+    /**
+     * Factory for fixtures.
+     *
+     * @var FixtureFactory
+     */
+    protected $fixtureFactory;
+
+    /**
+     * Assert that product attribute is searchable on Frontend.
+     *
+     * @param CmsIndex $cmsIndex
+     * @param InjectableFixture $product
+     * @param AdvancedSearch $searchPage
+     * @param CatalogsearchResult $catalogSearchResult
+     * @param FixtureFactory $fixtureFactory
+     * @return void
+     */
+    public function processAssert(
+        CmsIndex $cmsIndex,
+        InjectableFixture $product,
+        AdvancedSearch $searchPage,
+        CatalogsearchResult $catalogSearchResult,
+        FixtureFactory $fixtureFactory
+    ) {
+        $this->fixtureFactory = $fixtureFactory;
+        $cmsIndex->open();
+        $cmsIndex->getFooterBlock()->openAdvancedSearch();
+        $searchForm = $searchPage->getForm();
+        $productSearch = $this->prepareFixture($product);
+
+        $searchForm->fill($productSearch);
+        $searchForm->submit();
+        $isVisible = $catalogSearchResult->getListProductBlock()->getProductItem($product)->isVisible();
+        while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) {
+            $isVisible = $catalogSearchResult->getListProductBlock()->getProductItem($product)->isVisible();
+        }
+
+        \PHPUnit_Framework_Assert::assertTrue($isVisible, 'Product attribute is not searchable on Frontend.');
+    }
+
+    /**
+     * Preparation of fixture data before comparing.
+     *
+     * @param InjectableFixture $productSearch
+     * @return CatalogProductSimple
+     */
+    protected function prepareFixture(InjectableFixture $productSearch)
+    {
+        $customAttribute = $productSearch->getDataFieldConfig('custom_attribute')['source']->getAttribute();
+        return $this->fixtureFactory->createByCode(
+            'catalogProductSimple',
+            ['data' => ['custom_attribute' => $customAttribute]]
+        );
+    }
+
+    /**
+     * Returns string representation of object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Product attribute is searchable on Frontend.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedSearch.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedSearch.xml
index f4e3ce23e3e9525c76ffa97d3e6531a29d377fe1..0ad76850c06151772b8a516d3c0e1f67e7c1f2ac 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedSearch.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedSearch.xml
@@ -6,8 +6,14 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd">
-  <page name="AdvancedSearch" mca="catalogsearch/advanced" module="Magento_CatalogSearch">
-    <block name="form" class="Magento\CatalogSearch\Test\Block\Advanced\Form" locator=".form.search.advanced" strategy="css selector"/>
-    <block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector"/>
-  </page>
+    <page name="AdvancedSearch" mca="catalogsearch/advanced" module="Magento_CatalogSearch">
+        <block name="form" class="Magento\CatalogSearch\Test\Block\Advanced\Form" locator=".form.search.advanced" strategy="css selector">
+            <render name="Date" class="Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute\Date" />
+            <render name="Multiple Select" class="Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute\Select" />
+            <render name="Yes/No" class="Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute\Select" />
+            <render name="Text Field" class="Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute\Text" />
+            <render name="Dropdown" class="Magento\CatalogSearch\Test\Block\Advanced\CustomAttribute\Select" />
+        </block>
+        <block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector" />
+    </page>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml
index 06d89946b5e1fcefc4c8c7e5f2bd5a19ee8f53d5..d36c3f5eb51fe785d7c947ba986a5917c97b4bd7 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml
@@ -111,5 +111,10 @@
             <data name="productSearch/data/price/value/price_to" xsi:type="string">50</data>
             <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult" />
         </variation>
+        <variation name="AdvancedSearchEntityTestVariation14">
+            <data name="description" xsi:type="string">Negative product search</data>
+            <data name="productSearch/data/name" xsi:type="string">Negative_product_search</data>
+            <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchNoResult" />
+        </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php
index 663a88d34b66cc410e3106a693340fdb4e1af367..8b2bfcbd56d4f4f3b90a03d9ecdad7b39d322efd 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php
@@ -10,83 +10,82 @@ use Magento\Mtf\Block\Block;
 use Magento\Mtf\Client\Locator;
 
 /**
- * Class Totals
- * Cart totals block
+ * Cart totals block.
  */
 class Totals extends Block
 {
     /**
-     * Grand total search mask
+     * Grand total search mask.
      *
      * @var string
      */
     protected $grandTotal = '.grand.totals .price';
 
     /**
-     * Grand total search mask
+     * Grand total search mask.
      *
      * @var string
      */
     protected $grandTotalExclTax = '.totals.grand.excl span';
 
     /**
-     * Grand total search mask
+     * Grand total search mask.
      *
      * @var string
      */
     protected $grandTotalInclTax = '.totals.grand.incl span';
 
     /**
-     * Subtotal search mask
+     * Subtotal search mask.
      *
      * @var string
      */
     protected $subtotal = '.totals.sub .price';
 
     /**
-     * Subtotal search mask
+     * Subtotal search mask.
      *
      * @var string
      */
     protected $subtotalExclTax = '.totals.sub.excl .price';
 
     /**
-     * Subtotal search mask
+     * Subtotal search mask.
      *
      * @var string
      */
     protected $subtotalInclTax = '.totals.sub.incl .price';
 
     /**
-     * Tax search mask
+     * Tax search mask.
      *
      * @var string
      */
     protected $tax = '.totals-tax span';
 
     /**
-     * Get shipping price selector
+     * Get shipping price selector.
      *
      * @var string
      */
     protected $shippingPriceSelector = '.shipping.excl .price';
 
     /**
-     * Get discount
+     * Get discount.
      *
      * @var string
      */
     protected $discount = '[class=totals] .amount .price';
 
     /**
-     * Get shipping price including tax selector
+     * Get shipping price including tax selector.
      *
      * @var string
      */
     protected $shippingPriceInclTaxSelector = '.shipping.incl .price';
 
     /**
-     * Get shipping price block selector
+     * Get shipping price block selector.
      *
      * @var string
      */
@@ -97,10 +96,10 @@ class Totals extends Block
      *
      * @var string
      */
-    protected $blockWaitElement = '._block-content-loading';
+    protected $blockWaitElement = '.loading-mask';
 
     /**
-     * Get Grand Total Text
+     * Get Grand Total Text.
      *
      * @return string
      */
@@ -111,7 +110,7 @@ class Totals extends Block
     }
 
     /**
-     * Get Grand Total Text
+     * Get Grand Total Text.
      *
      * @return string|null
      */
@@ -122,7 +121,7 @@ class Totals extends Block
     }
 
     /**
-     * Get Grand Total Text
+     * Get Grand Total Text.
      *
      * @return string|null
      */
@@ -133,7 +132,7 @@ class Totals extends Block
     }
 
     /**
-     * Get Tax text from Order Totals
+     * Get Tax text from Order Totals.
      *
      * @return string|null
      */
@@ -144,7 +143,7 @@ class Totals extends Block
     }
 
     /**
-     * Check that Tax is visible
+     * Check that Tax is visible.
      *
      * @return bool
      */
@@ -154,7 +153,7 @@ class Totals extends Block
     }
 
     /**
-     * Get Subtotal text
+     * Get Subtotal text.
      *
      * @return string
      */
@@ -165,7 +164,7 @@ class Totals extends Block
     }
 
     /**
-     * Get Subtotal text
+     * Get Subtotal text.
      *
      * @return string|null
      */
@@ -176,7 +175,7 @@ class Totals extends Block
     }
 
     /**
-     * Get Subtotal text
+     * Get Subtotal text.
      *
      * @return string|null
      */
@@ -187,7 +186,7 @@ class Totals extends Block
     }
 
     /**
-     * Method that escapes currency symbols
+     * Method that escapes currency symbols.
      *
      * @param string $price
      * @return string|null
@@ -199,7 +198,7 @@ class Totals extends Block
     }
 
     /**
-     * Get discount
+     * Get discount.
      *
      * @return string|null
      */
@@ -210,7 +209,7 @@ class Totals extends Block
     }
 
     /**
-     * Get shipping price
+     * Get shipping price.
      *
      * @return string|null
      */
@@ -221,7 +220,7 @@ class Totals extends Block
     }
 
     /**
-     * Get shipping price
+     * Get shipping price.
      *
      * @return string|null
      */
@@ -232,7 +231,7 @@ class Totals extends Block
     }
 
     /**
-     * Is visible shipping price block
+     * Is visible shipping price block.
      *
      * @return bool
      */
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.php
index ffa5b1d91cb77912933faa89da83dc0e26bf332d..a90e1f3e4ce99e9b33d7acfa60a102839af38635 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.php
@@ -20,7 +20,7 @@ class Billing extends Form
      *
      * @var string
      */
-    protected $updateButtonSelector = '.action-toolbar .action-update';
+    protected $updateButtonSelector = '.action.action-update';
 
     /**
      * Wait element.
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.xml
index a00c55ccbc2e9f437c950ffd5b1a83b9c631afb6..b86b6378e26f8d58935df71f5bddef99141cedf0 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.xml
@@ -9,22 +9,40 @@
     <wrapper>billingAddress</wrapper>
     <fields>
         <email>
-            <selector>[name='customerDetails[email]']</selector>
+            <selector>./ancestor::*[contains(@class, 'checkout-payment-method')]//input[contains(@name, 'username')]</selector>
+            <strategy>xpath</strategy>
         </email>
-        <firstname />
-        <lastname />
-        <company />
+        <firstname>
+            <selector>input[name*=firstname]</selector>
+        </firstname>
+        <lastname>
+            <selector>input[name*=lastname]</selector>
+        </lastname>
+        <company>
+            <selector>input[name*=company]</selector>
+        </company>
         <street>
-            <selector>[name='billingAddress[street][0]']</selector>
+            <selector>input[name*='street[0]']</selector>
         </street>
-        <city />
+        <city>
+            <selector>input[name*=city]</selector>
+        </city>
         <region_id>
+            <selector>select[name*=region_id]</selector>
             <input>select</input>
         </region_id>
-        <postcode />
+        <region>
+            <selector>input[name*=region]</selector>
+        </region>
+        <postcode>
+            <selector>input[name*=postcode]</selector>
+        </postcode>
         <country_id>
+            <selector>select[name*=country_id]</selector>
             <input>select</input>
         </country_id>
-        <telephone />
+        <telephone>
+            <selector>input[name*=telephone]</selector>
+        </telephone>
     </fields>
 </mapping>
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertEstimateShippingAndTax.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertEstimateShippingAndTax.php
index 66a4f25834be097f80142a8d4f12c9a516c2d0f8..b55f6fb7edcd995945847c36d2dc7aeabe9b5f2d 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertEstimateShippingAndTax.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertEstimateShippingAndTax.php
@@ -10,6 +10,7 @@ use Magento\Checkout\Test\Fixture\Cart;
 use Magento\Checkout\Test\Page\CheckoutCart;
 use Magento\Mtf\Constraint\AbstractConstraint;
 use Magento\Mtf\ObjectManager;
+use Magento\Mtf\System\Event\EventManagerInterface;
 
 /**
  * Assert that grand total is equal to expected.
@@ -54,6 +55,7 @@ class AssertEstimateShippingAndTax extends AbstractConstraint
     /**
      * @constructor
      * @param ObjectManager $objectManager
+     * @param EventManagerInterface $eventManager
      * @param AssertSubtotalInShoppingCart $assertSubtotalInShoppingCart
      * @param AssertGrandTotalInShoppingCart $assertGrandTotalInShoppingCart
      * @param AssertTaxInShoppingCart $assertTaxInShoppingCart
@@ -61,12 +63,13 @@ class AssertEstimateShippingAndTax extends AbstractConstraint
      */
     public function __construct(
         ObjectManager $objectManager,
+        EventManagerInterface $eventManager,
         AssertSubtotalInShoppingCart $assertSubtotalInShoppingCart,
         AssertGrandTotalInShoppingCart $assertGrandTotalInShoppingCart,
         AssertTaxInShoppingCart $assertTaxInShoppingCart,
         AssertShippingInShoppingCart $assertShippingInShoppingCart
     ) {
-        parent::__construct($objectManager);
+        parent::__construct($objectManager, $eventManager);
         $this->assertSubtotalInShoppingCart = $assertSubtotalInShoppingCart;
         $this->assertGrandTotalInShoppingCart = $assertGrandTotalInShoppingCart;
         $this->assertTaxInShoppingCart = $assertTaxInShoppingCart;
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutOnepage.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutOnepage.xml
index 397bd616ea313f806aa447e3daa210da2285ba10..fadf354d75dfb624e34fa1de1a7da9152330222f 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutOnepage.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutOnepage.xml
@@ -6,11 +6,12 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd">
-  <page name="CheckoutOnepage" mca="checkout" module="Magento_Checkout">
-    <block name="loginBlock" class="Magento\Checkout\Test\Block\Onepage\Login" locator="[data-role='email-with-possible-login']" strategy="css selector"/>
-    <block name="shippingBlock" class="Magento\Checkout\Test\Block\Onepage\Shipping" locator="#checkout-step-shipping" strategy="css selector"/>
-    <block name="shippingMethodBlock" class="Magento\Checkout\Test\Block\Onepage\Shipping\Method" locator="#checkout-step-shipping_method" strategy="css selector"/>
-    <block name="paymentBlock" class="Magento\Checkout\Test\Block\Onepage\Payment" locator="#checkout-step-payment" strategy="css selector"/>
-    <block name="reviewBlock" class="Magento\Checkout\Test\Block\Onepage\Review" locator=".opc-block-summary" strategy="css selector"/>
-  </page>
+    <page name="CheckoutOnepage" mca="checkout" module="Magento_Checkout">
+        <block name="loginBlock" class="Magento\Checkout\Test\Block\Onepage\Login" locator="[data-role='email-with-possible-login']" strategy="css selector" />
+        <block name="shippingBlock" class="Magento\Checkout\Test\Block\Onepage\Shipping" locator="#checkout-step-shipping" strategy="css selector" />
+        <block name="shippingMethodBlock" class="Magento\Checkout\Test\Block\Onepage\Shipping\Method" locator="#checkout-step-shipping_method" strategy="css selector" />
+        <block name="paymentBlock" class="Magento\Checkout\Test\Block\Onepage\Payment" locator="#checkout-step-payment" strategy="css selector" />
+        <block name="reviewBlock" class="Magento\Checkout\Test\Block\Onepage\Review" locator=".opc-block-summary" strategy="css selector" />
+        <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator=".page.messages" strategy="css selector" />
+    </page>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php
index 6d9516684512359904181b06d7899f8af8f7021e..7fdc478b1da5e32eef412b7f7ab961cf6b1fcbb7 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php
@@ -42,7 +42,6 @@ class OnePageCheckoutTest extends Scenario
     const MVP = 'yes';
     const DOMAIN = 'CS';
     const TEST_TYPE = 'acceptance_test, 3rd_party_test';
-    const TO_MAINTAIN = 'yes';
     /* end tags */
 
     /**
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
index 696bf1324beea2c303bda0496702588f2b70be3a..0b86f927eef12cf2d40a17024d4b7bf17fdb29da 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
@@ -9,16 +9,15 @@
     <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="OnePageCheckout within Offline Payment Methods" ticketId="MAGETWO-27485">
         <variation name="OnePageCheckoutTestVariation1" summary="Checkout as UK guest with virtual product using coupon for not logged in customers">
             <data name="products" xsi:type="string">catalogProductVirtual::default</data>
-            <data name="salesRule" xsi:type="string">active_sales_rule_with_percent_price_discount_coupon</data>
-            <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="billingAddress/dataset" xsi:type="string">UK_address</data>
-            <data name="checkoutMethod" xsi:type="string">guest</data>
+            <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups</data>
+            <data name="customer/dataset" xsi:type="string">customer_UK_1_default_billing_address</data>
+            <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">5.00</item>
             </data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Invoice, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Cancel, Hold, Invoice, Edit</data>
             <data name="configData" xsi:type="string">checkmo_specificcountry_gb</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
@@ -29,8 +28,8 @@
             <data name="products" xsi:type="string">catalogProductSimple::default</data>
             <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups</data>
             <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="billingAddress/dataset" xsi:type="string">US_address_1</data>
             <data name="checkoutMethod" xsi:type="string">guest</data>
+            <data name="shippingAddress/dataset" xsi:type="string">US_address_1</data>
             <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
             <data name="shipping/shipping_method" xsi:type="string">Fixed</data>
             <data name="prices" xsi:type="array">
@@ -38,24 +37,26 @@
             </data>
             <data name="payment/method" xsi:type="string">banktransfer</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Cancel, Hold, Ship, Invoice, Edit</data>
             <data name="configData" xsi:type="string">banktransfer</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
         </variation>
-        <variation name="OnePageCheckoutTestVariation3" summary="Checkout as UK guest with virtual product">
-            <data name="products" xsi:type="string">catalogProductVirtual::default</data>
+        <variation name="OnePageCheckoutTestVariation3" summary="Checkout as UK guest with simple product">
+            <data name="products" xsi:type="string">catalogProductSimple::default</data>
             <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="billingAddress/dataset" xsi:type="string">UK_address</data>
             <data name="checkoutMethod" xsi:type="string">guest</data>
+            <data name="shippingAddress/dataset" xsi:type="string">UK_address</data>
+            <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
+            <data name="shipping/shipping_method" xsi:type="string">Fixed</data>
             <data name="prices" xsi:type="array">
-                <item name="grandTotal" xsi:type="string">10.00</item>
+                <item name="grandTotal" xsi:type="string">565.00</item>
             </data>
             <data name="payment/method" xsi:type="string">banktransfer</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Invoice, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Cancel, Hold, Ship, Invoice, Edit</data>
             <data name="configData" xsi:type="string">banktransfer_specificcountry_gb</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
@@ -65,8 +66,8 @@
         <variation name="OnePageCheckoutTestVariation4" summary="One Page Checkout Products with Special Prices" ticketId="MAGETWO-12429">
             <data name="products" xsi:type="string">catalogProductSimple::product_with_special_price, configurableProduct::product_with_special_price</data>
             <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="shippingAddress/dataset" xsi:type="string">US_address_1_without_email</data>
             <data name="checkoutMethod" xsi:type="string">login</data>
+            <data name="shippingAddress/dataset" xsi:type="string">US_address_1_without_email</data>
             <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
             <data name="shipping/shipping_method" xsi:type="string">Fixed</data>
             <data name="prices" xsi:type="array">
@@ -85,8 +86,8 @@
         <variation name="OnePageCheckoutTestVariation5" summary="Guest Checkout using Check/Money Order and Free Shipping with Prices/Taxes Verifications" ticketId="MAGETWO-12412">
             <data name="products" xsi:type="string">catalogProductSimple::product_10_dollar, configurableProduct::with_one_option, bundleProduct::bundle_fixed_100_dollar_product</data>
             <data name="taxRule" xsi:type="string">us_ca_ny_rule</data>
-            <data name="shippingAddress/dataset" xsi:type="string">US_address_1</data>
             <data name="checkoutMethod" xsi:type="string">guest</data>
+            <data name="shippingAddress/dataset" xsi:type="string">US_address_1</data>
             <data name="shipping/shipping_service" xsi:type="string">Free Shipping</data>
             <data name="shipping/shipping_method" xsi:type="string">Free</data>
             <data name="prices" xsi:type="array">
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php
index a07445f3eee83cf3d6d3b542c04921c4880f8f8e..24b1999344084474cf3954fb4aeed7b712283f44 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php
@@ -62,11 +62,13 @@ class Content extends Tab
     /**
      * Clicking in content tab 'Insert Variable' button.
      *
+     * @param SimpleElement $element [optional]
      * @return void
      */
-    public function clickInsertVariable()
+    public function clickInsertVariable(SimpleElement $element = null)
     {
-        $addVariableButton = $this->_rootElement->find($this->addVariableButton);
+        $context = $element === null ? $this->_rootElement : $element;
+        $addVariableButton = $context->find($this->addVariableButton);
         if ($addVariableButton->isVisible()) {
             $addVariableButton->click();
         }
@@ -75,11 +77,13 @@ class Content extends Tab
     /**
      * Clicking in content tab 'Insert Widget' button.
      *
+     * @param SimpleElement $element [optional]
      * @return void
      */
-    public function clickInsertWidget()
+    public function clickInsertWidget(SimpleElement $element = null)
     {
-        $addWidgetButton = $this->_rootElement->find($this->addWidgetButton);
+        $context = $element === null ? $this->_rootElement : $element;
+        $addWidgetButton = $context->find($this->addWidgetButton);
         if ($addWidgetButton->isVisible()) {
             $addWidgetButton->click();
         }
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php
index 0ce3f511d5732c8cae18a3f24fc59f156a751587..31a9d22a1530389c41b257a990ae67e8e57c228e 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php
@@ -25,14 +25,19 @@ class Content extends DataSource
      */
     protected $fixtureFactory;
 
+    /**
+     * Repository factory.
+     *
+     * @var RepositoryFactory
+     */
+    protected $repositoryFactory;
+
     /**
      * @constructor
      * @param RepositoryFactory $repositoryFactory
      * @param FixtureFactory $fixtureFactory
      * @param array $params
      * @param array $data
-     *
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
      */
     public function __construct(
         RepositoryFactory $repositoryFactory,
@@ -41,37 +46,62 @@ class Content extends DataSource
         array $data = []
     ) {
         $this->fixtureFactory = $fixtureFactory;
+        $this->repositoryFactory = $repositoryFactory;
         $this->params = $params;
         $this->data = $data;
-        if (isset($data['widget']['dataset']) && isset($this->params['repository'])) {
-            $this->data['widget']['dataset'] = $repositoryFactory->get($this->params['repository'])->get(
-                $data['widget']['dataset']
+        $this->prepareSourceData();
+    }
+
+    /**
+     * Prepare source data.
+     *
+     * @return void
+     */
+    protected function prepareSourceData()
+    {
+        if (isset($this->data['widget']['dataset']) && isset($this->params['repository'])) {
+            $this->data['widget']['dataset'] = $this->repositoryFactory->get($this->params['repository'])->get(
+                $this->data['widget']['dataset']
             );
-            foreach ($this->data['widget']['dataset'] as $key => $widget) {
-                if (isset($widget['chosen_option']['category_path'])
-                    && !isset($widget['chosen_option']['filter_sku'])
-                ) {
-                    $category = $this->createCategory($widget);
-                    $categoryName = $category->getData('name');
-                    $this->data['widget']['dataset'][$key]['chosen_option']['category_path'] = $categoryName;
-                }
-                if (isset($widget['chosen_option']['category_path']) && isset($widget['chosen_option']['filter_sku'])) {
-                    $product = $this->createProduct($widget);
-                    $categoryName = $product->getCategoryIds()[0]['name'];
-                    $productSku = $product->getData('sku');
-                    $this->data['widget']['dataset'][$key]['chosen_option']['category_path'] = $categoryName;
-                    $this->data['widget']['dataset'][$key]['chosen_option']['filter_sku'] = $productSku;
-                }
-                if ($widget['widget_type'] == 'Catalog New Products List') {
-                    $this->createProduct();
-                }
-                if ($widget['widget_type'] == 'CMS Static Block') {
-                    $block = $this->createBlock($widget);
-                    $blockIdentifier = $block->getIdentifier();
-                    $this->data['widget']['dataset'][$key]['chosen_option']['filter_identifier'] = $blockIdentifier;
-                }
+            $this->data = array_merge($this->data, $this->prepareWidgetData($this->data['widget']));
+        }
+    }
+
+    /**
+     * Prepare widget data for the source.
+     *
+     * @param array $widgets
+     * @return array
+     */
+    protected function prepareWidgetData(array $widgets)
+    {
+        $data = [];
+        foreach ($widgets['dataset'] as $key => $widget) {
+            if (isset($widget['chosen_option']['category_path'])
+                && !isset($widget['chosen_option']['filter_sku'])
+            ) {
+                $category = $this->createCategory($widget);
+                $categoryName = $category->getData('name');
+                $data['widget']['dataset'][$key]['chosen_option']['category_path'] = $categoryName;
+            }
+            if (isset($widget['chosen_option']['category_path']) && isset($widget['chosen_option']['filter_sku'])) {
+                $product = $this->createProduct($widget);
+                $categoryName = $product->getCategoryIds()[0]['name'];
+                $productSku = $product->getData('sku');
+                $data['widget']['dataset'][$key]['chosen_option']['category_path'] = $categoryName;
+                $data['widget']['dataset'][$key]['chosen_option']['filter_sku'] = $productSku;
+            }
+            if ($widget['widget_type'] == 'Catalog New Products List') {
+                $this->createProduct();
+            }
+            if ($widget['widget_type'] == 'CMS Static Block') {
+                $block = $this->createBlock($widget);
+                $blockIdentifier = $block->getIdentifier();
+                $data['widget']['dataset'][$key]['chosen_option']['filter_identifier'] = $blockIdentifier;
             }
         }
+
+        return $data;
     }
 
     /**
diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml
index 2fd3b20f3769c10a79c4b97290b34470f712cc82..25540646b7181e36757d4daa927c40038f00dd1f 100644
--- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml
+++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml
@@ -38,6 +38,37 @@
             </field>
         </dataset>
 
+        <dataset name="configurable_with_qty_1">
+            <field name="name" xsi:type="string">Test configurable product %isolation%</field>
+            <field name="sku" xsi:type="string">sku_test_configurable_product_%isolation%</field>
+            <field name="price" xsi:type="array">
+                <item name="value" xsi:type="string">40</item>
+            </field>
+            <field name="weight" xsi:type="string">30</field>
+            <field name="product_has_weight" xsi:type="string">Yes</field>
+            <field name="status" xsi:type="string">Product online</field>
+            <field name="visibility" xsi:type="string">Catalog, Search</field>
+            <field name="tax_class_id" xsi:type="array">
+                <item name="dataset" xsi:type="string">taxable_goods</item>
+            </field>
+            <field name="url_key" xsi:type="string">configurable-product-%isolation%</field>
+            <field name="configurable_attributes_data" xsi:type="array">
+                <item name="dataset" xsi:type="string">default</item>
+            </field>
+            <field name="quantity_and_stock_status" xsi:type="array">
+                <item name="is_in_stock" xsi:type="string">In Stock</item>
+            </field>
+            <field name="website_ids" xsi:type="array">
+                <item name="0" xsi:type="string">Main Website</item>
+            </field>
+            <field name="attribute_set_id" xsi:type="array">
+                <item name="dataset" xsi:type="string">default</item>
+            </field>
+            <field name="checkout_data" xsi:type="array">
+                <item name="dataset" xsi:type="string">configurable_options_with_qty_1</item>
+            </field>
+        </dataset>
+
         <dataset name="product_with_special_price">
             <field name="name" xsi:type="string">Test configurable product %isolation%</field>
             <field name="sku" xsi:type="string">sku_test_configurable_product_%isolation%</field>
diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml
index 4f058ad0611c0f5eff12d181acb7607d920361a5..5b7d919c0f3566d90f76cde53355e902f0184a44 100644
--- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml
+++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml
@@ -28,6 +28,27 @@
             </field>
         </dataset>
 
+        <dataset name="configurable_options_with_qty_1">
+            <field name="options" xsi:type="array">
+                <item name="configurable_options" xsi:type="array">
+                    <item name="0" xsi:type="array">
+                        <item name="title" xsi:type="string">attribute_key_0</item>
+                        <item name="value" xsi:type="string">option_key_0</item>
+                    </item>
+                    <item name="1" xsi:type="array">
+                        <item name="title" xsi:type="string">attribute_key_1</item>
+                        <item name="value" xsi:type="string">option_key_1</item>
+                    </item>
+                </item>
+            </field>
+            <field name="qty" xsi:type="string">1</field>
+            <field name="cartItem" xsi:type="array">
+                <item name="price" xsi:type="string">40</item>
+                <item name="qty" xsi:type="string">1</item>
+                <item name="subtotal" xsi:type="string">40</item>
+            </field>
+        </dataset>
+
         <dataset name="configurable_update_mini_shopping_cart">
             <field name="options" xsi:type="array">
                 <item name="configurable_options" xsi:type="array">
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php
index 2a33378d7c701fb7d2552175647a2df47297beeb..30f762335acbaefda343c9219849a89656ab1e96 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php
@@ -141,4 +141,21 @@ class CustomerForm extends FormTabs
 
         return $this;
     }
+
+    /**
+     * Get array of label => js error text.
+     *
+     * @return array
+     */
+    public function getJsErrors()
+    {
+        $tabs = ['account_information', 'addresses'];
+        $jsErrors = [];
+        foreach ($tabs as $tabName) {
+            $tab = $this->getTab($tabName);
+            $this->openTab($tabName);
+            $jsErrors = array_merge($jsErrors, $tab->getJsErrors());
+        }
+        return $jsErrors;
+    }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendBackButton.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendBackButton.php
new file mode 100644
index 0000000000000000000000000000000000000000..6d372387341161713199d9814ad18e23ad35fb31
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendBackButton.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
+use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit;
+
+/**
+ * Asserts that "Back" button works on customer edit page.
+ */
+class AssertCustomerBackendBackButton extends AbstractConstraint
+{
+    /**
+     * Asserts that "Back" button works on customer edit page (returns to customers grid).
+     *
+     * @param CustomerIndexEdit $customerEditPage
+     * @param CustomerIndex $customerGridPage
+     * @return void
+     */
+    public function processAssert(CustomerIndexEdit $customerEditPage, CustomerIndex $customerGridPage)
+    {
+        $customerEditPage->getPageActionsBlock()->back();
+        \PHPUnit_Framework_Assert::assertTrue(
+            $customerGridPage->getCustomerGridBlock()->isVisible(),
+            'Clicking on "Back" button does not redirect to customers grid.'
+        );
+    }
+
+    /**
+     * Returns a string representation of the object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return '"Back" button on customer edit page redirects to customers grid.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php
new file mode 100644
index 0000000000000000000000000000000000000000..27394f8e074ecc7fc0238a58285d8d4ed364fd16
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
+use Magento\Mtf\Constraint\AbstractConstraint;
+
+/**
+ * Asserts duplicate error message on saving backend customer.
+ */
+class AssertCustomerBackendDuplicateErrorMessage extends AbstractConstraint
+{
+    /**
+     * Error save message text.
+     */
+    const ERROR_SAVE_MESSAGE = 'A customer with the same email already exists in an associated website.';
+
+    /**
+     * Asserts that error message is displayed while creating customer with the same email.
+     *
+     * @param CustomerIndex $customerIndexPage
+     * @return void
+     */
+    public function processAssert(CustomerIndex $customerIndexPage)
+    {
+        $actualMessage = $customerIndexPage->getMessagesBlock()->getErrorMessages();
+        \PHPUnit_Framework_Assert::assertEquals(
+            self::ERROR_SAVE_MESSAGE,
+            $actualMessage,
+            'Wrong error message is displayed.'
+            . "\nExpected: " . self::ERROR_SAVE_MESSAGE
+            . "\nActual: " . $actualMessage
+        );
+    }
+
+    /**
+     * Returns a string representation of the object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Assert that error duplicated message is displayed.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendRequiredFields.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendRequiredFields.php
new file mode 100644
index 0000000000000000000000000000000000000000..802b24652594a21440d6f4cc747a5677322d1e9a
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendRequiredFields.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew;
+use Magento\Mtf\Constraint\AbstractConstraint;
+
+/**
+ * Assert required fields on customer form.
+ */
+class AssertCustomerBackendRequiredFields extends AbstractConstraint
+{
+    /**
+     * Expected message.
+     */
+    const REQUIRE_MESSAGE = 'This is a required field.';
+
+    /**
+     * Assert required fields on customer form.
+     *
+     * @param CustomerIndexNew $customerNewPage
+     * @param array $expectedRequiredFields
+     * @return void
+     */
+    public function processAssert(CustomerIndexNew $customerNewPage, array $expectedRequiredFields)
+    {
+        $actualRequiredFields = $customerNewPage->getCustomerForm()->getJsErrors();
+        foreach ($expectedRequiredFields as $field) {
+            \PHPUnit_Framework_Assert::assertTrue(
+                isset($actualRequiredFields[$field]),
+                "Field '$field' is not highlighted with an JS error."
+            );
+            \PHPUnit_Framework_Assert::assertEquals(
+                self::REQUIRE_MESSAGE,
+                $actualRequiredFields[$field],
+                "Field '$field' is not highlighted as required."
+            );
+        }
+    }
+
+    /**
+     * Return string representation of object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'All required fields on customer form are highlighted.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php
new file mode 100644
index 0000000000000000000000000000000000000000..5f49cbee1e5a45870804c7d99b704a9916c3c97a
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\Customer\Test\Fixture\CustomerGroup;
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Tab\RuleInformation;
+use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex;
+use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteNew;
+
+/**
+ * Assert that customer group find on cart price rule page.
+ */
+class AssertCustomerGroupOnCartPriceRuleForm extends AbstractConstraint
+{
+    /**
+     * Assert that customer group find on cart price rule page.
+     *
+     * @param PromoQuoteIndex $promoQuoteIndex
+     * @param PromoQuoteNew $promoQuoteNew
+     * @param CustomerGroup $customerGroup
+     * @return void
+     */
+    public function processAssert(
+        PromoQuoteIndex $promoQuoteIndex,
+        PromoQuoteNew $promoQuoteNew,
+        CustomerGroup $customerGroup
+    ) {
+        $promoQuoteIndex->open();
+        $promoQuoteIndex->getGridPageActions()->addNew();
+        $promoQuoteNew->getSalesRuleForm()->openTab('rule_information');
+
+        /** @var RuleInformation $ruleInformationTab */
+        $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getTab('rule_information');
+        \PHPUnit_Framework_Assert::assertTrue(
+            $ruleInformationTab->isVisibleCustomerGroup($customerGroup),
+            "Customer group {$customerGroup->getCustomerGroupCode()} not in cart price rule page."
+        );
+    }
+
+    /**
+     * Success assert of customer group find on cart price rule page.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Customer group find on cart price rule page.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php
new file mode 100644
index 0000000000000000000000000000000000000000..15fac430dc6855fd60efe6d53e38f54d32bd58e3
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleIndex;
+use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleNew;
+use Magento\Customer\Test\Fixture\CustomerGroup;
+use Magento\Mtf\Constraint\AbstractConstraint;
+use Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Tab\RuleInformation;
+
+/**
+ * Assert that customer group find on catalog price rule page.
+ */
+class AssertCustomerGroupOnCatalogPriceRuleForm extends AbstractConstraint
+{
+    /**
+     * Assert that customer group find on catalog price rule page.
+     *
+     * @param CatalogRuleIndex $catalogRuleIndex
+     * @param CatalogRuleNew $catalogRuleNew
+     * @param CustomerGroup $customerGroup
+     * @return void
+     */
+    public function processAssert(
+        CatalogRuleIndex $catalogRuleIndex,
+        CatalogRuleNew $catalogRuleNew,
+        CustomerGroup $customerGroup
+    ) {
+        $catalogRuleIndex->open();
+        $catalogRuleIndex->getGridPageActions()->addNew();
+        $catalogRuleNew->getEditForm()->openTab('rule_information');
+
+        /** @var RuleInformation $ruleInformationTab */
+        $ruleInformationTab = $catalogRuleNew->getEditForm()->getTab('rule_information');
+        \PHPUnit_Framework_Assert::assertTrue(
+            $ruleInformationTab->isVisibleCustomerGroup($customerGroup),
+            "Customer group {$customerGroup->getCustomerGroupCode()} not in catalog price rule page."
+        );
+    }
+
+    /**
+     * Success assert of customer group find on catalog price rule page.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Customer group find on catalog price rule page.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php
index d0f38165dea70abbc733a66ba53d78a752e7e214..0ab32aa443c909c663ff4b1363b9cf34cf48a79b 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php
@@ -14,12 +14,12 @@ use Magento\Mtf\Constraint\AbstractConstraint;
 use Magento\Mtf\Fixture\FixtureFactory;
 
 /**
- * Class AssertCustomerGroupOnCustomerForm
+ * Assert that customer group find on account information page.
  */
 class AssertCustomerGroupOnCustomerForm extends AbstractConstraint
 {
     /**
-     * Assert that customer group find on account information page
+     * Assert that customer group find on account information page.
      *
      * @param FixtureFactory $fixtureFactory
      * @param CustomerGroup $customerGroup
@@ -53,12 +53,12 @@ class AssertCustomerGroupOnCustomerForm extends AbstractConstraint
 
         \PHPUnit_Framework_Assert::assertTrue(
             empty($diff),
-            "Customer group {$customerGroup->getCustomerGroupCode()} not in customer form."
+            "Customer group {$customerGroup->getCustomerGroupCode()} not in account information page."
         );
     }
 
     /**
-     * Success assert of customer group find on account information page
+     * Success assert of customer group find on account information page.
      *
      * @return string
      */
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnProductForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnProductForm.php
new file mode 100644
index 0000000000000000000000000000000000000000..f783c4b4ea6254eb3f458490bb9b0f28c5960172
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnProductForm.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\AdvancedPricingTab;
+use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
+use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew;
+use Magento\Customer\Test\Fixture\CustomerGroup;
+use Magento\Mtf\Constraint\AbstractConstraint;
+
+/**
+ * Assert that customer group find on product page.
+ */
+class AssertCustomerGroupOnProductForm extends AbstractConstraint
+{
+    /**
+     * Assert that customer group find on product page.
+     *
+     * @param CatalogProductIndex $catalogProductIndex
+     * @param CatalogProductNew $catalogProductNew
+     * @param CustomerGroup $customerGroup
+     * @return void
+     */
+    public function processAssert(
+        CatalogProductIndex $catalogProductIndex,
+        CatalogProductNew $catalogProductNew,
+        CustomerGroup $customerGroup
+    ) {
+        $catalogProductIndex->open();
+        $catalogProductIndex->getGridPageActionBlock()->addProduct();
+        $catalogProductNew->getProductForm()->openTab('advanced-pricing');
+
+        /** @var AdvancedPricingTab $advancedPricingTab */
+        $advancedPricingTab = $catalogProductNew->getProductForm()->getTab('advanced-pricing');
+        \PHPUnit_Framework_Assert::assertTrue(
+            $advancedPricingTab->getTierPriceForm()->isVisibleCustomerGroup($customerGroup),
+            "Customer group {$customerGroup->getCustomerGroupCode()} not in tier price form on product page."
+        );
+    }
+
+    /**
+     * Success assert of customer group find on product page.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return 'Customer group find on product page.';
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerLogout.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerLogout.php
new file mode 100644
index 0000000000000000000000000000000000000000..0db06b1df1ab5e5972511d25410fcf91ab7bbd3d
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerLogout.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\Constraint;
+
+use Magento\Cms\Test\Page\CmsIndex;
+use Magento\Customer\Test\Page\CustomerAccountIndex;
+use Magento\Mtf\Constraint\AbstractConstraint;
+
+/**
+ * Assert that customer success log out.
+ */
+class AssertCustomerLogout extends AbstractConstraint
+{
+    /**
+     * Logout page title.
+     */
+    const LOGOUT_PAGE_TITLE = 'You are signed out';
+
+    /**
+     * Home page title.
+     */
+    const HOME_PAGE_TITLE = 'Home Page';
+
+    /**
+     * Assert that customer success log out.
+     *
+     * @param CustomerAccountIndex $customerAccountIndex
+     * @param CmsIndex $cmsIndex
+     * @return void
+     */
+    public function processAssert(CustomerAccountIndex $customerAccountIndex, CmsIndex $cmsIndex)
+    {
+        $customerAccountIndex->open();
+        $cmsIndex->getCmsPageBlock()->waitPageInit();
+
+        $cmsIndex->getLinksBlock()->openLink('Sign Out');
+        $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::LOGOUT_PAGE_TITLE);
+        $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::HOME_PAGE_TITLE);
+        $cmsIndex->getCmsPageBlock()->waitPageInit();
+        \PHPUnit_Framework_Assert::assertTrue(
+            $cmsIndex->getLinksBlock()->isLinkVisible('Sign In'),
+            "Customer wasn't logged out."
+        );
+    }
+
+    /**
+     * Returns a string representation of the object.
+     *
+     * @return string
+     */
+    public function toString()
+    {
+        return "Customer is successfully log out.";
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php
index 13d0cdae0112ff60c9f15ef7ae8665e5174340b2..bf70b9806347fbe9f410a2dba27ce1d283114b2f 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php
@@ -10,15 +10,14 @@ use Magento\Customer\Test\Page\CustomerAccountCreate;
 use Magento\Mtf\Constraint\AbstractConstraint;
 
 /**
- * Class AssertCustomerSuccessRegisterMessage
- *
+ * Assert that success message is displayed after customer registered on frontend.
  */
 class AssertCustomerSuccessRegisterMessage extends AbstractConstraint
 {
     const SUCCESS_MESSAGE = 'Thank you for registering with Main Website Store.';
 
     /**
-     * Assert that success message is displayed after customer registered on frontend
+     * Assert that success message is displayed after customer registered on frontend.
      *
      * @param CustomerAccountCreate $registerPage
      * @return void
@@ -36,7 +35,7 @@ class AssertCustomerSuccessRegisterMessage extends AbstractConstraint
     }
 
     /**
-     * Text of success register message is displayed
+     * Text of success register message is displayed.
      *
      * @return string
      */
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Webapi.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Webapi.php
index 1934bc456d92061105b2faae79919f69de35293f..44485d16264c614c31992ed1bb9061346ac30c5d 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Webapi.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Webapi.php
@@ -26,6 +26,11 @@ class Webapi extends AbstractWebapi implements CustomerInterface
      * @var array
      */
     protected $mappingData = [
+        'gender' => [
+            'Male' => 1,
+            'Female' => 2,
+            'Not Specified' => 3
+        ],
         'country_id' => [
             'United States' => 'US',
             'United Kingdom' => 'GB'
@@ -70,7 +75,7 @@ class Webapi extends AbstractWebapi implements CustomerInterface
      */
     protected function prepareData(Customer $customer)
     {
-        $data['customer'] = $customer->getData();
+        $data['customer'] = $this->replaceMappingData($customer->getData());
         $data['customer']['group_id'] = $this->getCustomerGroup($customer);
         $data['password'] = $data['customer']['password'];
         unset($data['customer']['password']);
@@ -105,7 +110,6 @@ class Webapi extends AbstractWebapi implements CustomerInterface
             return $data;
         }
         foreach ($data['customer']['address'] as $key => $addressData) {
-            $addressData['country_id'] = $this->mappingData['country_id'][$addressData['country_id']];
             $addressData = $this->prepareRegionData($addressData);
             $addressData = $this->prepareStreetData($addressData);
             $addressData = $this->prepareDefaultAddressData($addressData);
@@ -132,7 +136,7 @@ class Webapi extends AbstractWebapi implements CustomerInterface
         }
         if (isset($addressData['region_id'])) {
             $addressData['region'] = [
-                'region_id' => $this->mappingData['region_id'][$addressData['region_id']]
+                'region_id' => $addressData['region_id']
             ];
             unset($addressData['region_id']);
         }
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php
index 90b432c8d47acde1326078a623e26c5389675c07..249e0e30184e91df88fa7e02c9232f96479d8825 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php
@@ -11,32 +11,31 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
- * Class DefaultAddress
- * Default address page
+ * Default address page.
  */
 class DefaultAddress extends Page
 {
     /**
-     * URL for customer Dashboard
+     * URL for customer Dashboard.
      */
     const MCA = 'customer/address/index';
 
     /**
-     * Selector for default address block
+     * Selector for default address block.
      *
      * @var string
      */
     protected $defaultAddressesSelector = '.block-addresses-default';
 
     /**
-     * Get default addresses block
+     * Get default addresses block.
      *
      * @return \Magento\Customer\Test\Block\Account\AddressesDefault
      */
     public function getDefaultAddresses()
     {
         return Factory::getBlockFactory()->getMagentoCustomerAccountAddressesDefault(
-            $this->_browser->find($this->defaultAddressesSelector, Locator::SELECTOR_CSS)
+            $this->browser->find($this->defaultAddressesSelector, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountForgotPassword.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountForgotPassword.php
index ff129b94eb17217dfd85f29dadac635191f7e87c..0d0364d8238196fe030849dc82aa9fff50539894 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountForgotPassword.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountForgotPassword.php
@@ -11,36 +11,41 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
+ * Customer forgot password page.
  */
 class CustomerAccountForgotPassword extends Page
 {
     /**
-     * URL for reset customer password
+     * URL for reset customer password.
      */
     const MCA = 'customer/account/forgotpassword';
 
     /**
+     * Forgot password form.
+     *
      * @var string
      */
     protected $forgotPasswordForm = '#form-validate';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_frontend_url'] . self::MCA;
+        $this->url = $_ENV['app_frontend_url'] . self::MCA;
     }
 
     /**
-     * Get Customer Forgot Password form
+     * Get Customer Forgot Password form.
      *
      * @return \Magento\Customer\Test\Block\Form\ForgotPassword
      */
     public function getForgotPasswordForm()
     {
         return Factory::getBlockFactory()->getMagentoCustomerFormForgotPassword(
-            $this->_browser->find(
+            $this->browser->find(
                 $this->forgotPasswordForm,
                 Locator::SELECTOR_CSS
             )
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountLogout.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountLogout.php
index 2f73386919242c92c8d1e2a30ea557d5ab4f7625..e9584762883d0088d6174b97d7933dc0f729f841 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountLogout.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountLogout.php
@@ -9,22 +9,22 @@ namespace Magento\Customer\Test\Page;
 use Magento\Mtf\Page\Page;
 
 /**
- * Class CustomerAccountLogout
  * Customer frontend logout page.
- *
  */
 class CustomerAccountLogout extends Page
 {
     /**
-     * URL for customer logout
+     * URL for customer logout.
      */
     const MCA = 'customer/account/logout';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_frontend_url'] . self::MCA;
+        $this->url = $_ENV['app_frontend_url'] . self::MCA;
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAddressEdit.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAddressEdit.php
index f217c900d0b65c267bc633b91272f5d9e7a3e983..53a2867b16ac7648df018152ae87531276a818a9 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAddressEdit.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAddressEdit.php
@@ -12,39 +12,40 @@ use Magento\Mtf\Page\Page;
 
 /**
  * Customer Address Edit page.
- *
  */
 class CustomerAddressEdit extends Page
 {
     /**
-     * URL for Customer Address Edit page
+     * URL for Customer Address Edit page.
      */
     const MCA = 'customer/address/edit';
 
     /**
-     * Customer Address Edit form
+     * Customer Address Edit form.
      *
      * @var string
      */
     protected $editForm = '#form-validate';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_frontend_url'] . self::MCA;
+        $this->url = $_ENV['app_frontend_url'] . self::MCA;
     }
 
     /**
-     * Get Customer Address Edit form
+     * Get Customer Address Edit form.
      *
      * @return \Magento\Customer\Test\Block\Address\Edit
      */
     public function getEditForm()
     {
         return Factory::getBlockFactory()->getMagentoCustomerAddressEdit(
-            $this->_browser->find($this->editForm, Locator::SELECTOR_CSS)
+            $this->browser->find($this->editForm, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml
index bca31130341c1d56f8ea3d42274b079abc5c0cf0..1acc4414058840ebade67dc21edf491933ff3175 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml
@@ -159,7 +159,6 @@
             <field name="country_id" xsi:type="string">United Kingdom</field>
             <field name="region" xsi:type="string">London</field>
             <field name="telephone" xsi:type="string">444-44-444-44</field>
-            <field name="fax" xsi:type="string">444-44-444-44</field>
             <field name="default_billing" xsi:type="string">Yes</field>
             <field name="default_shipping" xsi:type="string">Yes</field>
         </dataset>
@@ -175,7 +174,6 @@
             <field name="country_id" xsi:type="string">United Kingdom</field>
             <field name="region" xsi:type="string">London</field>
             <field name="telephone" xsi:type="string">444-44-444-44</field>
-            <field name="fax" xsi:type="string">444-44-444-44</field>
         </dataset>
 
         <dataset name="UK_address_without_email">
@@ -188,7 +186,6 @@
             <field name="country_id" xsi:type="string">United Kingdom</field>
             <field name="region" xsi:type="string">London</field>
             <field name="telephone" xsi:type="string">444-44-444-44</field>
-            <field name="fax" xsi:type="string">444-44-444-44</field>
         </dataset>
 
         <dataset name="UK_address_with_VAT">
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml
index 4ee4ba83044c39be4d3827259e827b47bf3069f4..1b89235517ffefd6e2d11dcd2c9922290949ebfd 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml
@@ -96,5 +96,44 @@
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessSaveMessage" />
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendFormTitle" />
         </variation>
+        <variation name="CreateCustomerBackendEntityTestVariation7" summary="Create customer with custom customer group">
+            <data name="customerAction" xsi:type="string">saveAndContinue</data>
+            <data name="customer/data/website_id" xsi:type="string">Main Website</data>
+            <data name="customer/data/group_id/dataset" xsi:type="string">customer_group_retail_customer</data>
+            <data name="customer/data/firstname" xsi:type="string">John%isolation%</data>
+            <data name="customer/data/lastname" xsi:type="string">Doe%isolation%</data>
+            <data name="customer/data/email" xsi:type="string">JohnDoe%isolation%@example.com</data>
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessSaveMessage" />
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendBackButton" />
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForm" />
+        </variation>
+        <variation name="CreateCustomerBackendEntityTestVariation8" summary="Verify required fields on Account Information tab.">
+            <data name="customerAction" xsi:type="string">save</data>
+            <data name="customer/data/website_id" xsi:type="string">Main Website</data>
+            <data name="customer/data/group_id/dataset" xsi:type="string">General</data>
+            <data name="expectedRequiredFields" xsi:type="array">
+                <item name="0" xsi:type="string">First Name</item>
+                <item name="1" xsi:type="string">Last Name</item>
+                <item name="2" xsi:type="string">Email</item>
+            </data>
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendRequiredFields" />
+        </variation>
+        <variation name="CreateCustomerBackendEntityTestVariation9" summary="Verify required fields on Addresses tab.">
+            <data name="customerAction" xsi:type="string">save</data>
+            <data name="customer/data/website_id" xsi:type="string">Main Website</data>
+            <data name="customer/data/group_id/dataset" xsi:type="string">General</data>
+            <data name="customer/data/firstname" xsi:type="string">John%isolation%</data>
+            <data name="customer/data/lastname" xsi:type="string">Doe%isolation%</data>
+            <data name="customer/data/email" xsi:type="string">JohnDoe%isolation%@example.com</data>
+            <data name="address/data/company" xsi:type="string">Magento</data>
+            <data name="expectedRequiredFields" xsi:type="array">
+                <item name="2" xsi:type="string">Street Address</item>
+                <item name="3" xsi:type="string">City</item>
+                <item name="4" xsi:type="string">Country</item>
+                <item name="5" xsi:type="string">Zip/Postal Code</item>
+                <item name="6" xsi:type="string">Phone Number</item>
+            </data>
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendRequiredFields" />
+        </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml
index b50e80215cceb426cf2b75d621c69cfdb375b450..1294aafbdc2812bbb723e374b17d3cb81303b65c 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml
@@ -13,6 +13,9 @@
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage" />
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid" />
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupOnCustomerForm" />
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupOnProductForm" />
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupOnCatalogPriceRuleForm" />
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupOnCartPriceRuleForm" />
         </variation>
         <variation name="CreateCustomerGroupEntityTestVariation2">
             <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">retail_customer</data>
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.php
new file mode 100644
index 0000000000000000000000000000000000000000..f3721ef7b36598fdc7bb3eed2cc10d0f11c1f4b8
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Customer\Test\TestCase;
+
+use Magento\Mtf\TestCase\Injectable;
+use Magento\Customer\Test\Fixture\Customer;
+use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
+use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew;
+
+/**
+ * Precondition:
+ * 1. Customer is created.
+ *
+ * Steps:
+ * 1. Log in as default admin user.
+ * 2. Go to Customers > All Customers.
+ * 3. Press "Add New Customer" button.
+ * 4. Fill form with data from previously created customer.
+ * 5. Click "Save Customer" button.
+ * 6. Perform all assertions.
+ *
+ * @ZephyrId MAGETWO-43685
+ */
+class CreateExistingCustomerBackendEntity extends Injectable
+{
+    /* tags */
+    const MVP = 'yes';
+    const DOMAIN = 'CS';
+    /* end tags */
+
+    /**
+     * Customer index page.
+     *
+     * @var CustomerIndex
+     */
+    protected $pageCustomerIndex;
+
+    /**
+     * New customer page.
+     *
+     * @var CustomerIndexNew
+     */
+    protected $pageCustomerIndexNew;
+
+    /**
+     * Inject customer pages.
+     *
+     * @param CustomerIndex $pageCustomerIndex
+     * @param CustomerIndexNew $pageCustomerIndexNew
+     * @return void
+     */
+    public function __inject(
+        CustomerIndex $pageCustomerIndex,
+        CustomerIndexNew $pageCustomerIndexNew
+    ) {
+        $this->pageCustomerIndex = $pageCustomerIndex;
+        $this->pageCustomerIndexNew = $pageCustomerIndexNew;
+    }
+
+    /**
+     * Create customer on backend.
+     *
+     * @param Customer $customer
+     * @return void
+     */
+    public function test(Customer $customer)
+    {
+        // Precondition
+        $customer->persist();
+
+        // Steps
+        $this->pageCustomerIndex->open();
+        $this->pageCustomerIndex->getPageActionsBlock()->addNew();
+        $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer);
+        $this->pageCustomerIndexNew->getPageActionsBlock()->save();
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.xml
new file mode 100644
index 0000000000000000000000000000000000000000..2c711d79991b719385af229a2dad11e8726aebbb
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+ -->
+<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
+    <testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerBackendEntity" summary="Create Existing Customer from Backend" ticketId="MAGETWO-43685">
+        <variation name="CreateExistingCustomerBackendEntity1" summary="Create existing customer on Backend.">
+            <data name="customer/dataset" xsi:type="string">default</data>
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendDuplicateErrorMessage" />
+        </variation>
+    </testCase>
+</config>
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php
index 8d89091816aa5a217f385b50ce31bbd0fb205ac7..a5ac5b76883196e9fc41c9cb496a84e4228654a9 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php
@@ -9,7 +9,7 @@ namespace Magento\Customer\Test\TestCase;
 use Magento\Customer\Test\Fixture\Customer;
 use Magento\Customer\Test\Page\CustomerAccountCreate;
 use Magento\Cms\Test\Page\CmsIndex;
-use Magento\Customer\Test\Page\CustomerAccountLogout;
+use Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep;
 use Magento\Mtf\TestCase\Injectable;
 
 /**
@@ -32,40 +32,49 @@ class RegisterCustomerFrontendEntityTest extends Injectable
     /* end tags */
 
     /**
+     * Customer registry page.
+     *
      * @var CustomerAccountCreate
      */
     protected $customerAccountCreate;
 
     /**
-     * @var CustomerAccountLogout
+     * Cms page.
+     *
+     * @var CmsIndex $cmsIndex
      */
-    protected $customerAccountLogout;
+    protected $cmsIndex;
 
     /**
-     * @var CmsIndex $cmsIndex
+     * Customer log out step.
+     *
+     * @var LogoutCustomerOnFrontendStep
      */
-    protected $cmsIndex;
+    protected $logoutCustomerOnFrontendStep;
 
     /**
+     * Inject data.
+     *
      * @param CustomerAccountCreate $customerAccountCreate
-     * @param CustomerAccountLogout $customerAccountLogout
      * @param CmsIndex $cmsIndex
+     * @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontendStep
+     * @return void
      */
     public function __inject(
         CustomerAccountCreate $customerAccountCreate,
-        CustomerAccountLogout $customerAccountLogout,
-        CmsIndex $cmsIndex
+        CmsIndex $cmsIndex,
+        LogoutCustomerOnFrontendStep $logoutCustomerOnFrontendStep
     ) {
-        $this->customerAccountLogout = $customerAccountLogout;
         $this->customerAccountCreate = $customerAccountCreate;
         $this->cmsIndex = $cmsIndex;
-        $this->customerAccountLogout->open();
+        $this->logoutCustomerOnFrontendStep = $logoutCustomerOnFrontendStep;
     }
 
     /**
      * Create Customer account on Storefront.
      *
      * @param Customer $customer
+     * @return void
      */
     public function test(Customer $customer)
     {
@@ -76,12 +85,12 @@ class RegisterCustomerFrontendEntityTest extends Injectable
     }
 
     /**
-     * Logout customer from frontend account
+     * Logout customer from frontend account.
      *
-     * return void
+     * @return void
      */
     public function tearDown()
     {
-        $this->customerAccountLogout->open();
+        $this->logoutCustomerOnFrontendStep->run();
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml
index ba55d1feb8d4fb7bd959d6b0f3a04af9a8f1b142..f9db269ee2b0f190d8455158a01de6bc730d9bf7 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml
@@ -7,8 +7,7 @@
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
     <testCase name="Magento\Customer\Test\TestCase\RegisterCustomerFrontendEntityTest" summary="Register New Customer" ticketId="MAGETWO-23546">
-        <variation name="RegisterCustomerFrontendEntityTestVariation1">
-            <data name="description" xsi:type="string">Register new customer</data>
+        <variation name="RegisterCustomerFrontendEntityTestVariation1" summary="Register new customer">
             <data name="customer/data/firstname" xsi:type="string">john</data>
             <data name="customer/data/lastname" xsi:type="string">doe</data>
             <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data>
@@ -17,9 +16,9 @@
             <data name="customer/data/password_confirmation" xsi:type="string">123123q</data>
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessRegisterMessage" />
             <constraint name="Magento\Customer\Test\Constraint\AssertCustomerInGrid" />
+            <constraint name="Magento\Customer\Test\Constraint\AssertCustomerLogout" />
         </variation>
-        <variation name="RegisterCustomerFrontendEntityTestVariation2">
-            <data name="description" xsi:type="string">Register new customer with subscribing</data>
+        <variation name="RegisterCustomerFrontendEntityTestVariation2" summary="Register new customer with subscribing">
             <data name="customer/data/firstname" xsi:type="string">john</data>
             <data name="customer/data/lastname" xsi:type="string">doe</data>
             <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data>
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php
index 63399666bbc44a8ccd21371b6df5c5813bb2cf3e..4c536396af65adc8783011519df7a187f79ac8b3 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php
@@ -15,11 +15,6 @@ use Magento\Customer\Test\Page\CustomerAccountIndex;
  */
 class LogoutCustomerOnFrontendStep implements TestStepInterface
 {
-    /**
-     * Logout page title.
-     */
-    const LOGOUT_PAGE_TITLE = 'You are signed out.';
-
     /**
      * Cms index page.
      *
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml
index f314e6315e00d2c643046da954f22f16fc76719f..dcee2b9bd421f90a6fc72de9d14308a9bcc53b4e 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml
@@ -41,4 +41,19 @@
             <argument name="severity" xsi:type="string">high</argument>
         </arguments>
     </type>
+    <type name="Magento\Customer\Test\Constraint\AssertCustomerBackendBackButton">
+        <arguments>
+            <argument name="severity" xsi:type="string">middle</argument>
+        </arguments>
+    </type>
+    <type name="Magento\Customer\Test\Constraint\AssertCustomerBackendDuplicateErrorMessage">
+        <arguments>
+            <argument name="severity" xsi:type="string">middle</argument>
+        </arguments>
+    </type>
+    <type name="Magento\Customer\Test\Constraint\AssertCustomerBackendRequiredFields">
+        <arguments>
+            <argument name="severity" xsi:type="string">middle</argument>
+        </arguments>
+    </type>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml
index a9e54ed517058c2711cdc2096426944a0a04be6f..5b8bedaf9b977de4d992588095a8625f1d5ca0ed 100644
--- a/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml
@@ -6,22 +6,22 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
-    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest">
+    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="OnePageCheckout within Offline Payment Method and DHL shipping method">
         <variation name="OnePageCheckoutDhlTestVariation1" summary="Use DHL International (EU) Online Shipping Carrier on Checkout as a Registered Customer" ticketId="MAGETWO-12850">
             <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data>
             <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="customer/dataset" xsi:type="string">customer_DE</data>
             <data name="address/dataset" xsi:type="string">DE_address</data>
-            <data name="billingAddress/dataset" xsi:type="string">customer_DE</data>
+            <data name="shippingAddress/dataset" xsi:type="string">customer_DE</data>
             <data name="shipping/shipping_service" xsi:type="string">DHL</data>
             <data name="shipping/shipping_method" xsi:type="string">Express worldwide</data>
             <data name="cart/data/shipping_method" xsi:type="string">Express worldwide</data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="configData" xsi:type="string">checkmo, dhl_eu, shipping_origin_CH, config_base_currency_ch</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
-            <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/>
-            <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid"/>
-            <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/>
+            <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
+            <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid" />
+            <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" />
         </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml
index 5c8e12cbb0e1a2ed8bb50c24311a3af37987acb0..89234e4b9a12c71824d2c7017e485202f061a813 100644
--- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml
@@ -276,7 +276,6 @@
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" />
             <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm" />
             <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
-            <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" />
         </variation>
         <variation name="CreateDownloadableProductEntityTestVariation15">
             <data name="description" xsi:type="string">Create product with tier price</data>
diff --git a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml
index d53852fef4800cd19fa6adbf896c89cf29c983c6..580de1cac6f912292b16b8973f23376f4aad5282 100644
--- a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml
@@ -6,37 +6,38 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
-    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest">
+    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="OnePageCheckout within Offline Payment Method and Fedex shipping method">
         <variation name="OnePageCheckoutFedexTestVariation1" summary="Check Out as Guest using FedEx with US shipping origin and UK customer">
             <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data>
             <data name="checkoutMethod" xsi:type="string">guest</data>
             <data name="customer/dataset" xsi:type="string">default</data>
             <data name="address/dataset" xsi:type="string">UK_address</data>
-            <data name="billingAddress/dataset" xsi:type="string">UK_address</data>
+            <data name="shippingAddress/dataset" xsi:type="string">UK_address</data>
             <data name="shipping/shipping_service" xsi:type="string">Federal Express</data>
             <data name="shipping/shipping_method" xsi:type="string">International Economy</data>
             <data name="cart/data/shipping_method" xsi:type="string">International Economy</data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="configData" xsi:type="string">checkmo, fedex, shipping_origin_US_CA</data>
-            <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/>
-            <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid"/>
-            <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/>
+            <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
+            <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
+            <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid" />
+            <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" />
         </variation>
         <variation name="OnePageCheckoutFedexTestVariation2" summary="Use FedEx Online Shipping Carrier on Checkout as a Registered Customer" ticketId="MAGETWO-12849">
             <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data>
             <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="customer/dataset" xsi:type="string">customer_DE</data>
             <data name="address/dataset" xsi:type="string">DE_address</data>
-            <data name="billingAddress/dataset" xsi:type="string">customer_DE</data>
+            <data name="shippingAddress/dataset" xsi:type="string">customer_DE</data>
             <data name="shipping/shipping_service" xsi:type="string">Federal Express</data>
             <data name="shipping/shipping_method" xsi:type="string">Ground</data>
             <data name="cart/data/shipping_method" xsi:type="string">Ground</data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="configData" xsi:type="string">checkmo, fedex, shipping_origin_US_CA</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
-            <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/>
-            <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid"/>
-            <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/>
+            <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
+            <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid" />
+            <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" />
         </variation>
     </testCase>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php
deleted file mode 100644
index e3c8e2bd1dbd4dc687469b7fe8a005419c5c0bd9..0000000000000000000000000000000000000000
--- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\GroupedProduct\Test\Constraint;
-
-use Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage;
-use Magento\Catalog\Test\Page\Product\CatalogProductView;
-use Magento\GroupedProduct\Test\Fixture\GroupedProduct;
-use Magento\Mtf\Client\BrowserInterface;
-
-/**
- * Class AssertGroupedPriceOnGroupedProductPage
- * Assert that displayed grouped price on grouped product page equals passed from fixture
- */
-class AssertGroupedPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage
-{
-    /**
-     * Format error message
-     *
-     * @var string
-     */
-    protected $errorMessage = 'This "%s" product\'s grouped price on product page NOT equals passed from fixture.';
-
-    /**
-     * Successful message
-     *
-     * @var string
-     */
-    protected $successfulMessage = 'Displayed grouped price on grouped product page equals to passed from a fixture.';
-
-    /**
-     * Assert that displayed grouped price on grouped product page equals passed from fixture
-     *
-     * @param CatalogProductView $catalogProductView
-     * @param GroupedProduct $product
-     * @param AssertProductGroupedPriceOnProductPage $groupedPrice
-     * @param BrowserInterface $browser
-     * @return void
-     */
-    public function processAssert(
-        CatalogProductView $catalogProductView,
-        GroupedProduct $product,
-        AssertProductGroupedPriceOnProductPage $groupedPrice,
-        BrowserInterface $browser
-    ) {
-        $this->processAssertPrice($product, $catalogProductView, $groupedPrice, $browser);
-    }
-}
diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutAddressNewShipping.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutAddressNewShipping.php
index 37d0cda809996a05b6edb2791d3941b4d3df95c8..746296b32c10871d07722f73ee411aed0539d936 100644
--- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutAddressNewShipping.php
+++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutAddressNewShipping.php
@@ -11,41 +11,41 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
- * class MultishippingCheckoutAddressNewShipping
- * Create Shipping Address page
- *
+ * Create Shipping Address page.
  */
 class MultishippingCheckoutAddressNewShipping extends Page
 {
     /**
-     * URL for new shipping address page
+     * URL for new shipping address page.
      */
     const MCA = 'multishipping/checkout_address/newShipping';
 
     /**
-     * Form for edit customer address
+     * Form for edit customer address.
      *
      * @var string
      */
     protected $editBlock = '#form-validate';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_frontend_url'] . self::MCA;
+        $this->url = $_ENV['app_frontend_url'] . self::MCA;
     }
 
     /**
-     * Get form for edit customer address
+     * Get form for edit customer address.
      *
      * @return \Magento\Customer\Test\Block\Address\Edit
      */
     public function getEditBlock()
     {
         return Factory::getBlockFactory()->getMagentoCustomerAddressEdit(
-            $this->_browser->find($this->editBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->editBlock, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutCart.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutCart.php
index acbd1375dbbbbf5f9af4b52828c061878c17a245..3a3e1981636a3987f778815f8db5e2a1f5faa730 100644
--- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutCart.php
+++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutCart.php
@@ -11,32 +11,31 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
- * class MultishippingCheckoutCart
- *
+ * Multishipping checkout cart page.
  */
 class MultishippingCheckoutCart extends Page
 {
     /**
-     * URL for multishipping checkout cart page
+     * URL for multishipping checkout cart page.
      */
     const MCA = 'multishipping/checkout/cart';
 
     /**
-     * Multishipping cart link block
+     * Multishipping cart link block.
      *
      * @var string
      */
     protected $multishippingLinkBlock = '.action.multicheckout';
 
     /**
-     * Get multishipping cart link block
+     * Get multishipping cart link block.
      *
      * @return \Magento\Multishipping\Test\Block\Checkout\Link
      */
     public function getMultishippingLinkBlock()
     {
         return Factory::getBlockFactory()->getMagentoMultishippingCheckoutLink(
-            $this->_browser->find($this->multishippingLinkBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->multishippingLinkBlock, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutLogin.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutLogin.php
index cb233ab410587cadaee367a117261a67347c9eef..8c0a07f7dfb717059f76efb1cc774b2126586d57 100644
--- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutLogin.php
+++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutLogin.php
@@ -11,39 +11,41 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
- * Multishipping login page
+ * Multishipping login page.
  */
 class MultishippingCheckoutLogin extends Page
 {
     /**
-     * URL for multishipping login page
+     * URL for multishipping login page.
      */
     const MCA = 'multishipping/checkout/login';
 
     /**
-     * Form for customer login
+     * Form for customer login.
      *
      * @var string
      */
     protected $loginBlock = '.login-container';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_frontend_url'] . self::MCA;
+        $this->url = $_ENV['app_frontend_url'] . self::MCA;
     }
 
     /**
-     * Get form for customer login
+     * Get form for customer login.
      *
      * @return \Magento\Customer\Test\Block\Form\Login
      */
     public function getLoginBlock()
     {
         return Factory::getBlockFactory()->getMagentoCustomerFormLogin(
-            $this->_browser->find($this->loginBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->loginBlock, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutRegister.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutRegister.php
index 4b858c8514a5f7452d2461b476ff13687e5999c4..757848308d76ea2de1442885f84de76d251b4e9e 100644
--- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutRegister.php
+++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Page/MultishippingCheckoutRegister.php
@@ -11,41 +11,41 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
- * class MultishippingCheckoutRegister
- * Register new customer while performing multishipping addresses checkout
- *
+ * Register new customer while performing multishipping addresses checkout.
  */
 class MultishippingCheckoutRegister extends Page
 {
     /**
-     * URL for register customer page
+     * URL for register customer page.
      */
     const MCA = 'multishipping/checkout/register';
 
     /**
-     * Customer register block form
+     * Customer register block form.
      *
      * @var string
      */
     protected $registerBlock = '#form-validate';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $_ENV['app_frontend_url'] . self::MCA;
+        $this->url = $_ENV['app_frontend_url'] . self::MCA;
     }
 
     /**
-     * Get customer register block form
+     * Get customer register block form.
      *
      * @return \Magento\Customer\Test\Block\Form\Register
      */
     public function getRegisterBlock()
     {
         return Factory::getBlockFactory()->getMagentoCustomerFormRegister(
-            $this->_browser->find($this->registerBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->registerBlock, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Subscriber/Grid.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Subscriber/Grid.php
index 093740233986417f69c4572734a2adf739c17bdc..9c2f66542e902a7198c8014073ee1f70f88596f1 100644
--- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Subscriber/Grid.php
+++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Subscriber/Grid.php
@@ -7,13 +7,12 @@
 namespace Magento\Newsletter\Test\Block\Adminhtml\Subscriber;
 
 /**
- * Newsletter subscribers grid
- *
+ * Newsletter subscribers grid.
  */
-class Grid extends \Magento\Ui\Test\Block\Adminhtml\DataGrid
+class Grid extends \Magento\Backend\Test\Block\Widget\Grid
 {
     /**
-     * Filters array mapping
+     * Filters array mapping.
      *
      * @var array
      */
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php
index df6e3fb9662d455e69f22dbe3b8238b743c143eb..0bf83c62bc8a22e1a9d4c797632e680857921a66 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php
@@ -10,22 +10,22 @@ use Magento\Reports\Test\Page\Adminhtml\SalesInvoiceReport;
 use Magento\Sales\Test\Fixture\OrderInjectable;
 use Magento\Mtf\Constraint\AbstractConstraint;
 use Magento\Mtf\ObjectManager;
+use Magento\Mtf\System\Event\EventManagerInterface;
 
 /**
- * Class AbstractAssertInvoiceReportResult
- * Abstract assert for search in invoice report grid
+ * Abstract assert for search in invoice report grid.
  */
 abstract class AbstractAssertInvoiceReportResult extends AbstractConstraint
 {
     /**
-     * Invoice report page
+     * Invoice report page.
      *
      * @var SalesInvoiceReport
      */
     protected $salesInvoiceReport;
 
     /**
-     * Order
+     * Order.
      *
      * @var OrderInjectable
      */
@@ -34,16 +34,20 @@ abstract class AbstractAssertInvoiceReportResult extends AbstractConstraint
     /**
      * @constructor
      * @param ObjectManager $objectManager
+     * @param EventManagerInterface $eventManager
      * @param SalesInvoiceReport $salesInvoiceReport
      */
-    public function __construct(ObjectManager $objectManager, SalesInvoiceReport $salesInvoiceReport)
-    {
-        parent::__construct($objectManager);
+    public function __construct(
+        ObjectManager $objectManager,
+        EventManagerInterface $eventManager,
+        SalesInvoiceReport $salesInvoiceReport
+    ) {
+        parent::__construct($objectManager, $eventManager);
         $this->salesInvoiceReport = $salesInvoiceReport;
     }
 
     /**
-     * Search in invoice report grid
+     * Search in invoice report grid.
      *
      * @param array $invoiceReport
      * @return void
@@ -57,7 +61,7 @@ abstract class AbstractAssertInvoiceReportResult extends AbstractConstraint
     }
 
     /**
-     * Prepare expected result
+     * Prepare expected result.
      *
      * @param array $expectedInvoiceData
      * @return array
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php
index 2a1942e9f7254b0ff6bfba751f5f17f073e160ca..f034bbb2c52b7b34ed7e061a882a71d78a8e67fa 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Actions.php
@@ -10,108 +10,107 @@ use Magento\Mtf\Block\Block;
 use Magento\Mtf\Client\Locator;
 
 /**
- * Class Actions
- * Order actions block
+ * Order actions block.
  */
 class Actions extends Block
 {
     /**
-     * 'Back' button
+     * 'Back' button.
      *
      * @var string
      */
     protected $back = '#back';
 
     /**
-     * 'Edit' button
+     * 'Edit' button.
      *
      * @var string
      */
     protected $edit = '#order_edit';
 
     /**
-     * 'Cancel' button
+     * 'Cancel' button.
      *
      * @var string
      */
-    protected $cancel = '#order_cancel';
+    protected $cancel = '[id$=cancel-button]';
 
     /**
-     * 'Send Email' button
+     * 'Send Email' button.
      *
      * @var string
      */
     protected $sendEmail = '#send_notification';
 
     /**
-     * 'Void' button
+     * 'Void' button.
      *
      * @var string
      */
     protected $void = '#void_payment';
 
     /**
-     * 'Hold' button
+     * 'Hold' button.
      *
      * @var string
      */
-    protected $hold = '#order_hold';
+    protected $hold = '[id$=hold-button]';
 
     /**
-     * 'Invoice' button
+     * 'Invoice' button.
      *
      * @var string
      */
     protected $invoice = '#order_invoice';
 
     /**
-     * 'Reorder' button
+     * 'Reorder' button.
      *
      * @var string
      */
     protected $reorder = '#order_reorder';
 
     /**
-     * 'Ship' button
+     * 'Ship' button.
      *
      * @var string
      */
     protected $ship = '#order_ship';
 
     /**
-     * 'Credit Memo' button on the order page
+     * 'Credit Memo' button on the order page.
      *
      * @var string
      */
     protected $orderCreditMemo = '#order_creditmemo';
 
     /**
-     * 'Credit Memo' button on the order invoice page
+     * 'Credit Memo' button on the order invoice page.
      *
      * @var string
      */
     protected $orderInvoiceCreditMemo = '#capture';
 
     /**
-     * 'Refund' button
+     * 'Refund' button.
      *
      * @var string
      */
     protected $refund = '.submit-button.refund';
 
     /**
-     * 'Refund Offline' button
+     * 'Refund Offline' button.
      *
      * @var string
      */
     protected $refundOffline = '.submit-button';
 
     /**
-     * General button selector
+     * General button selector.
      *
      * @var string
      */
-    protected $button = 'button[data-ui-id$="%s-button"]';
+    protected $button = '//button[@title="%s"]';
 
     /**
      * Selector for confirm.
@@ -121,7 +120,7 @@ class Actions extends Block
     protected $confirmModal = '.confirm._show[data-role=modal]';
 
     /**
-     * Ship order
+     * Ship order.
      *
      * @return void
      */
@@ -131,7 +130,7 @@ class Actions extends Block
     }
 
     /**
-     * Invoice order
+     * Invoice order.
      *
      * @return void
      */
@@ -141,7 +140,7 @@ class Actions extends Block
     }
 
     /**
-     * Reorder order
+     * Reorder order.
      *
      * @return void
      */
@@ -151,7 +150,7 @@ class Actions extends Block
     }
 
     /**
-     * Go back
+     * Go back.
      *
      * @return void
      */
@@ -161,7 +160,7 @@ class Actions extends Block
     }
 
     /**
-     * Edit order
+     * Edit order.
      *
      * @return void
      */
@@ -171,7 +170,7 @@ class Actions extends Block
     }
 
     /**
-     * Cancel order
+     * Cancel order.
      *
      * @return void
      */
@@ -185,7 +184,7 @@ class Actions extends Block
     }
 
     /**
-     * Send email
+     * Send email.
      *
      * @return void
      */
@@ -195,7 +194,7 @@ class Actions extends Block
     }
 
     /**
-     * Void order
+     * Void order.
      *
      * @return void
      */
@@ -205,7 +204,7 @@ class Actions extends Block
     }
 
     /**
-     * Hold order
+     * Hold order.
      *
      * @return void
      */
@@ -215,7 +214,7 @@ class Actions extends Block
     }
 
     /**
-     * Order credit memo
+     * Order credit memo.
      *
      * @return void
      */
@@ -225,7 +224,7 @@ class Actions extends Block
     }
 
     /**
-     * Order invoice credit memo
+     * Order invoice credit memo.
      *
      * @return void
      */
@@ -235,7 +234,7 @@ class Actions extends Block
     }
 
     /**
-     * Refund order
+     * Refund order.
      *
      * @return void
      */
@@ -245,7 +244,7 @@ class Actions extends Block
     }
 
     /**
-     * Refund offline order
+     * Refund offline order.
      *
      * @return void
      */
@@ -255,14 +254,13 @@ class Actions extends Block
     }
 
     /**
-     * Check if action button is visible
+     * Check if action button is visible.
      *
      * @param string $buttonName
      * @return bool
      */
     public function isActionButtonVisible($buttonName)
     {
-        $buttonName = str_replace(' ', '-', strtolower($buttonName));
-        return $this->_rootElement->find(sprintf($this->button, $buttonName))->isVisible();
+        return $this->_rootElement->find(sprintf($this->button, $buttonName), Locator::SELECTOR_XPATH)->isVisible();
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php
index 9ba84f6a064de3ee1cedc9d86ed6c3fc49d3b0f5..0c8fecdff10e4cbeb2c419bf1aa76997529a8287 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php
@@ -11,22 +11,22 @@ use Magento\Cms\Test\Page\CmsIndex;
 use Magento\Customer\Test\Fixture\Customer;
 use Magento\Mtf\Constraint\AbstractConstraint;
 use Magento\Mtf\ObjectManager;
+use Magento\Mtf\System\Event\EventManagerInterface;
 
 /**
- * Abstract Class AbstractAssertOrderOnFrontend
- * Abstract class for frontend asserts
+ * Abstract class for frontend asserts.
  */
 abstract class AbstractAssertOrderOnFrontend extends AbstractConstraint
 {
     /**
-     * Cms index page
+     * Cms index page.
      *
      * @var CmsIndex
      */
     protected $cmsIndex;
 
     /**
-     * Customer account index page
+     * Customer account index page.
      *
      * @var CustomerAccountIndex
      */
@@ -35,21 +35,23 @@ abstract class AbstractAssertOrderOnFrontend extends AbstractConstraint
     /**
      * @constructor
      * @param ObjectManager $objectManager
+     * @param EventManagerInterface $eventManager
      * @param CmsIndex $cmsIndex
      * @param CustomerAccountIndex $customerAccountIndex
      */
     public function __construct(
         ObjectManager $objectManager,
+        EventManagerInterface $eventManager,
         CmsIndex $cmsIndex,
         CustomerAccountIndex $customerAccountIndex
     ) {
-        parent::__construct($objectManager);
+        parent::__construct($objectManager, $eventManager);
         $this->cmsIndex = $cmsIndex;
         $this->customerAccountIndex = $customerAccountIndex;
     }
 
     /**
-     * Login customer and open Order page
+     * Login customer and open Order page.
      *
      * @param Customer $customer
      * @return void
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php
index 6baff36cc94ebc9f8a23103474da4070105190b5..4ce59a74583bfef397c8756bb0b1bc4bbe0797cd 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php
@@ -29,7 +29,7 @@ class AssertCreditMemoButton extends AbstractConstraint
         $orderIndex->open();
         $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
         \PHPUnit_Framework_Assert::assertTrue(
-            $salesOrderView->getPageActions()->isActionButtonVisible('CreditMemo'),
+            $salesOrderView->getPageActions()->isActionButtonVisible('Credit Memo'),
             'Credit memo button is absent on order view page.'
         );
     }
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php
index ed8806f44c61642cfd56bdf2fd9644d5ac2c8b7b..d9e935600ba18bea3a6040b9977d214ee112a9b3 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php
@@ -29,7 +29,7 @@ class AssertNoCreditMemoButton extends AbstractConstraint
         $orderIndex->open();
         $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
         \PHPUnit_Framework_Assert::assertFalse(
-            $salesOrderView->getPageActions()->isActionButtonVisible('CreditMemo'),
+            $salesOrderView->getPageActions()->isActionButtonVisible('Credit Memo'),
             'Credit memo button is present on order view page.'
         );
     }
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php
index 352f752784045a12c0f3549332fbf48832a82844..28f2387011d6256f58065389ec272026f197f417 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesOrderShipmentNew.php
@@ -11,41 +11,41 @@ use Magento\Mtf\Factory\Factory;
 use Magento\Mtf\Page\Page;
 
 /**
- * Class SalesOrder
- * Manage orders page
- *
+ * Manage orders page.
  */
 class SalesOrderShipmentNew extends Page
 {
     /**
-     * URL for manage orders page
+     * URL for manage orders page.
      */
     const MCA = 'sales/order/shipment/new';
 
     /**
-     * Shipment totals block
+     * Shipment totals block.
      *
      * @var string
      */
     protected $totalsBlock = '.order-totals';
 
     /**
-     * Custom constructor
+     * Init page. Set page url.
+     *
+     * @return void
      */
-    protected function _init()
+    protected function initUrl()
     {
-        $this->_url = $this->_url = $_ENV['app_backend_url'] . self::MCA;
+        $this->url = $_ENV['app_backend_url'] . self::MCA;
     }
 
     /**
-     * Get shipment totals
+     * Get shipment totals.
      *
      * @return \Magento\Sales\Test\Block\Adminhtml\Order\Shipment\Totals
      */
     public function getTotalsBlock()
     {
         return Factory::getBlockFactory()->getMagentoSalesAdminhtmlOrderShipmentTotals(
-            $this->_browser->find($this->totalsBlock, Locator::SELECTOR_CSS)
+            $this->browser->find($this->totalsBlock, Locator::SELECTOR_CSS)
         );
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml
index c6a9fa03bb5c07a546cb0d2981de62a76cf5bda0..a073396e9136d11a91dacbce00ed0f8c9e4c77ca 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml
@@ -20,7 +20,7 @@
             </data>
             <data name="payment/method" xsi:type="string">cashondelivery</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit</data>
             <data name="configData" xsi:type="string">cashondelivery</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
@@ -39,7 +39,7 @@
             </data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Invoice, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Email, Hold, Invoice, Edit</data>
             <data name="configData" xsi:type="string">checkmo_specificcountry_gb</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
@@ -60,7 +60,7 @@
             </data>
             <data name="payment/method" xsi:type="string">banktransfer</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Email, Hold, Reorder, Invoice, Edit</data>
             <data name="configData" xsi:type="string">banktransfer</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
@@ -80,7 +80,7 @@
             </data>
             <data name="payment/method" xsi:type="string">banktransfer</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Invoice, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Email, Hold, Invoice, Edit</data>
             <data name="configData" xsi:type="string">freeshipping_specificcountry_gb, banktransfer</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
@@ -102,7 +102,7 @@
             <data name="payment/method" xsi:type="string">purchaseorder</data>
             <data name="payment/po_number" xsi:type="string">123456</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Notification, Hold, Invoice, Reorder, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Email, Hold, Invoice, Reorder, Edit</data>
             <data name="configData" xsi:type="string">purchaseorder</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml
index facb72b9d308636e7e0c994bbb40fe0b940cff35..1ad7453a1253f2f7a835e71ad21c95921c6341d2 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml
@@ -14,7 +14,7 @@
         </variation>
         <variation name="MoveLastOrderedProductsOnOrderPageTestVariation2">
             <data name="order/dataset" xsi:type="string">default</data>
-            <data name="order/data/entity_id/products" xsi:type="string">configurableProduct::default</data>
+            <data name="order/data/entity_id/products" xsi:type="string">configurableProduct::configurable_with_qty_1</data>
             <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" />
         </variation>
     </testCase>
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveProductsInComparedOnOrderPageTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveProductsInComparedOnOrderPageTest.xml
index fd66961ecdb5743c649d4290b8a017fc381fe911..ef57ce932a9ca91222ac849df7637c0caf7fd2b9 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveProductsInComparedOnOrderPageTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveProductsInComparedOnOrderPageTest.xml
@@ -12,7 +12,7 @@
             <constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />
         </variation>
         <variation name="MoveProductsInComparedOnOrderPageTestVariation2">
-            <data name="products" xsi:type="string">configurableProduct::default,configurableProduct::default</data>
+            <data name="products" xsi:type="string">configurableProduct::configurable_with_qty_1,configurableProduct::configurable_with_qty_1</data>
             <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" />
         </variation>
     </testCase>
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.xml
index b37eb5a0a491dae3d6ece0e53a1e1cbde5362ba1..1ffaa89fc60462eefe40dbd9207279888df31e63 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.xml
@@ -11,8 +11,8 @@
             <data name="products" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />
         </variation>
-        <variation name="MoveRecentlyComparedProductsOnOrderPageTestVariation2" firstConstraint="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" method="test">
-            <data name="products" xsi:type="string">configurableProduct::default,configurableProduct::default</data>
+        <variation name="MoveRecentlyComparedProductsOnOrderPageTestVariation2">
+            <data name="products" xsi:type="string">configurableProduct::configurable_with_qty_1,configurableProduct::configurable_with_qty_1</data>
             <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" />
         </variation>
     </testCase>
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml
index c82da591595d335f0985ef72ed9e73f6fee22d41..d03339663c03c8967d6091669e7cf47ea8ca1f84 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml
@@ -12,7 +12,7 @@
             <constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />
         </variation>
         <variation name="MoveShoppingCartProductsOnOrderPageTestVariation2" firstConstraint="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" method="test">
-            <data name="product" xsi:type="string">configurableProduct::default</data>
+            <data name="product" xsi:type="string">configurableProduct::configurable_with_qty_1</data>
             <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" />
         </variation>
     </testCase>
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml
index fb43e4a85b4c9e8fc672be041ab7f7ce9ad220da..6d9ff785a5df99181f1103e1a091c906ca6851ce 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml
@@ -21,7 +21,7 @@
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="previousOrderStatus" xsi:type="string">Pending</data>
             <data name="status" xsi:type="string">Pending</data>
-            <data name="orderButtonsAvailable" xsi:type="string">Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit</data>
+            <data name="orderButtonsAvailable" xsi:type="string">Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid" />
             <constraint name="Magento\Sales\Test\Constraint\AssertReorderStatusIsCorrect" />
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Tab/RuleInformation.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Tab/RuleInformation.php
index 4c4b9a024af41424445ce09d25fab26e43787919..22168f005697e3c4ce86068ac9b1ae9ed25d6b18 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Tab/RuleInformation.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Tab/RuleInformation.php
@@ -7,6 +7,7 @@
 namespace Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Tab;
 
 use Magento\Backend\Test\Block\Widget\Tab;
+use Magento\Customer\Test\Fixture\CustomerGroup;
 use Magento\Mtf\Client\Element\SimpleElement;
 
 /**
@@ -14,6 +15,13 @@ use Magento\Mtf\Client\Element\SimpleElement;
  */
 class RuleInformation extends Tab
 {
+    /**
+     * Locator for Customer Group element.
+     *
+     * @var string
+     */
+    protected $customerGroup = '#rule_customer_group_ids';
+
     /**
      * Get data of tab.
      *
@@ -31,4 +39,16 @@ class RuleInformation extends Tab
         }
         return $this->_getData($data, $element);
     }
+
+    /**
+     * Check whether Customer Group is visible.
+     *
+     * @param CustomerGroup $customerGroup
+     * @return bool
+     */
+    public function isVisibleCustomerGroup(CustomerGroup $customerGroup)
+    {
+        $options = $this->_rootElement->find($this->customerGroup)->getText();
+        return false !== strpos($options, $customerGroup->getCustomerGroupCode());
+    }
 }
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php
index 49fedf0d5d16dd7b214105d42fb4cab24e55aaa8..3e21afe5ef91b67f6f992fce191a9ab3783b97c5 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php
@@ -49,6 +49,7 @@ class ApplySalesRuleOnFrontendStep implements TestStepInterface
     {
         if ($this->salesRule !== null) {
             $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->salesRule->getCouponCode());
+            $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
         }
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php
index 56db436ccb68d969073310fe69e0278936c1ef75..ad0d2fbe86454c8c0e19a63dc46057125ceef5ec 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php
@@ -77,6 +77,8 @@ class CreateSalesRuleStep implements TestStepInterface
      */
     public function cleanup()
     {
-        $this->deleteAllSalesRule->run();
+        if ($this->salesRule !== null) {
+            $this->deleteAllSalesRule->run();
+        }
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php
index e85ce0c7b0e2eb4813224bf75d487f741717b29e..1b915560f211f3a033d1dbb7e750bf1a0c69638e 100644
--- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php
+++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php
@@ -11,15 +11,15 @@ use Magento\Sales\Test\Fixture\OrderInjectable;
 use Magento\Shipping\Test\Page\Adminhtml\SalesShipmentView;
 use Magento\Shipping\Test\Page\Adminhtml\ShipmentIndex;
 use Magento\Mtf\ObjectManager;
+use Magento\Mtf\System\Event\EventManagerInterface;
 
 /**
- * Class AssertShipmentItems
- * Assert shipment items on shipment view page
+ * Assert shipment items on shipment view page.
  */
 class AssertShipmentItems extends AbstractAssertItems
 {
     /**
-     * Shipment index page
+     * Shipment index page.
      *
      * @var ShipmentIndex
      */
@@ -28,16 +28,20 @@ class AssertShipmentItems extends AbstractAssertItems
     /**
      * @constructor
      * @param ObjectManager $objectManager
+     * @param EventManagerInterface $eventManager
      * @param ShipmentIndex $shipmentIndex
      */
-    public function __construct(ObjectManager $objectManager, ShipmentIndex $shipmentIndex)
-    {
-        parent::__construct($objectManager);
+    public function __construct(
+        ObjectManager $objectManager,
+        EventManagerInterface $eventManager,
+        ShipmentIndex $shipmentIndex
+    ) {
+        parent::__construct($objectManager, $eventManager);
         $this->shipmentPage = $shipmentIndex;
     }
 
     /**
-     * Assert shipped products are represented on shipment view page
+     * Assert shipped products are represented on shipment view page.
      *
      * @param SalesShipmentView $orderShipmentView
      * @param OrderInjectable $order
@@ -56,7 +60,7 @@ class AssertShipmentItems extends AbstractAssertItems
     }
 
     /**
-     * Process assert
+     * Process assert.
      *
      * @param OrderInjectable $order
      * @param array $ids
@@ -85,7 +89,7 @@ class AssertShipmentItems extends AbstractAssertItems
     }
 
     /**
-     * Returns a string representation of the object
+     * Returns a string representation of the object.
      *
      * @return string
      */
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Block/Adminhtml/Rule/Edit/TaxRate.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Block/Adminhtml/Rule/Edit/TaxRate.php
index 30ee53017146c24b9afebd9546848862a80fa03b..4c06dede0433d327fc106acfc7cb45fa4f3b55c2 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/Block/Adminhtml/Rule/Edit/TaxRate.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Block/Adminhtml/Rule/Edit/TaxRate.php
@@ -9,20 +9,19 @@ namespace Magento\Tax\Test\Block\Adminhtml\Rule\Edit;
 use Magento\Mtf\Block\Form as FormInterface;
 
 /**
- * Class TaxRate
- * Tax rate block
+ * Tax rate block.
  */
 class TaxRate extends FormInterface
 {
     /**
-     * 'Save' button on dialog window for creating new tax rate
+     * 'Save' button on dialog window for creating new tax rate.
      *
      * @var string
      */
-    protected $saveTaxRate = '#tax-rule-edit-apply-button';
+    protected $saveTaxRate = '.action-save';
 
     /**
-     * Clicking 'Save' button on dialog window for creating new tax rate
+     * Clicking 'Save' button on dialog window for creating new tax rate.
      *
      * @return void
      */
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php
index 51caa4822fa60fd38b18c1df6c132bfa8ec876e0..e66cdb00918e84cfe6d415ca30a4284220203c54 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php
@@ -17,65 +17,65 @@ use Magento\Mtf\Constraint\AbstractConstraint;
 use Magento\Mtf\Fixture\FixtureFactory;
 
 /**
- * Abstract class for implementing assert applying
+ * Abstract class for implementing assert applying.
  */
 abstract class AssertTaxRuleApplying extends AbstractConstraint
 {
     /**
-     * Initial tax rule
+     * Initial tax rule.
      *
      * @var TaxRule
      */
     protected $initialTaxRule;
 
     /**
-     * Tax rule
+     * Tax rule.
      *
      * @var TaxRule
      */
     protected $taxRule;
 
     /**
-     * Product simple
+     * Product simple.
      *
      * @var CatalogProductSimple
      */
     protected $productSimple;
 
     /**
-     * Checkout cart page
+     * Checkout cart page.
      *
      * @var CheckoutCart
      */
     protected $checkoutCart;
 
     /**
-     * Shipping carrier and method
+     * Shipping carrier and method.
      *
      * @var array
      */
     protected $shipping;
 
     /**
-     * Tax Rule name
+     * Tax Rule name.
      *
      * @var string
      */
     protected $taxRuleCode;
 
     /**
-     * Implementation assert
+     * Implementation assert.
      *
      * @return void
      */
     abstract protected function assert();
 
     /**
-     * 1. Creating product simple with custom tax product class
-     * 2. Log In as customer
-     * 3. Add product to shopping cart
-     * 4. Estimate Shipping and Tax
-     * 5. Implementation assert
+     * 1. Creating product simple with custom tax product class.
+     * 2. Log In as customer.
+     * 3. Add product to shopping cart.
+     * 4. Estimate Shipping and Tax.
+     * 5. Implementation assert.
      *
      * @param FixtureFactory $fixtureFactory
      * @param TaxRule $taxRule
@@ -136,9 +136,7 @@ abstract class AssertTaxRuleApplying extends AbstractConstraint
         $catalogProductView->getMessagesBlock()->waitSuccessMessage();
         // Estimate Shipping and Tax
         $checkoutCart->open();
-        $checkoutCart->getShippingBlock()->openEstimateShippingAndTax();
-        $checkoutCart->getShippingBlock()->fill($address);
-        $checkoutCart->getShippingBlock()->clickGetQuote();
+        $checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address);
         $checkoutCart->getShippingBlock()->selectShippingMethod($shipping);
         $this->assert();
     }
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php
index a587216002ed8a933341ddf30fa10d8f24af1a1a..f2e786edf23583abad54fbd5b48569da77a8104b 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php
@@ -80,6 +80,8 @@ class CreateTaxRuleStep implements TestStepInterface
      */
     public function cleanup()
     {
-        $this->deleteAllTaxRule->run();
+        if ($this->taxRule !== null) {
+            $this->deleteAllTaxRule->run();
+        }
     }
 }
diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Breadcrumbs.php b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Breadcrumbs.php
new file mode 100644
index 0000000000000000000000000000000000000000..a5ef31b35849452127662a99594506d909e1bf4e
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Breadcrumbs.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Theme\Test\Block\Html;
+
+use Magento\Mtf\Block\Block;
+
+/**
+ * Page breadcrumbs block.
+ */
+class Breadcrumbs extends Block
+{
+    /**
+     * Get breadcrumbs content of current page.
+     *
+     * @return string
+     */
+    public function getText()
+    {
+        return $this->_rootElement->getText();
+    }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php
index 3375541068cb1264e5054958cc449dc7871bc8b9..31f1a6fd97bacaafcffca6775ef6f637b9650129 100644
--- a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php
+++ b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php
@@ -75,8 +75,11 @@ class Links extends Block
      */
     public function isLinkVisible($linkTitle)
     {
-        $this->expandCustomerMenu();
-        return $this->_rootElement->find(sprintf($this->link, $linkTitle), Locator::SELECTOR_XPATH)->isVisible();
+        $link = $this->_rootElement->find(sprintf($this->link, $linkTitle), Locator::SELECTOR_XPATH);
+        if (!$link->isVisible()) {
+            $this->expandCustomerMenu();
+        }
+        return $link->isVisible();
     }
 
     /**
diff --git a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml
index 6c3a76c5c99865bdc9bede513bd8ea350dd469b7..d739d5bae2626b28189928338119d49e0c37972b 100644
--- a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml
@@ -6,12 +6,12 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
-    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest">
+    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="OnePageCheckout within Offline Payment Methods and UPS shipping method.">
         <variation name="OnePageCheckoutUpsTestVariation1" summary="Use UPS Online Shipping Carrier on Checkout as a Registered Customer" ticketId="MAGETWO-12848">
             <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data>
             <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="billingAddress/dataset" xsi:type="string">US_address_1</data>
+            <data name="shippingAddress/dataset" xsi:type="string">US_address_1_without_email</data>
             <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data>
             <data name="shipping/shipping_method" xsi:type="string">UPS Ground</data>
             <data name="cart/data/shipping_method" xsi:type="string">UPS Ground</data>
@@ -27,12 +27,13 @@
             <data name="checkoutMethod" xsi:type="string">guest</data>
             <data name="customer/dataset" xsi:type="string">default</data>
             <data name="address/dataset" xsi:type="string">UK_address</data>
-            <data name="billingAddress/dataset" xsi:type="string">UK_address</data>
+            <data name="shippingAddress/dataset" xsi:type="string">UK_address</data>
             <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data>
             <data name="shipping/shipping_method" xsi:type="string">UPS Worldwide Expedited</data>
             <data name="cart/data/shipping_method" xsi:type="string">UPS Worldwide Expedited</data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="configData" xsi:type="string">checkmo, ups, shipping_origin_US_CA</data>
+            <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid"/>
             <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/>
diff --git a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml
index 7f049503781c6dd1ed7d4a5dee78fb57d79ad746..cf2ad50688a9e7c1535cb5cdffb191fa1b8154b6 100644
--- a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml
@@ -6,12 +6,12 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
-    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest">
+    <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="OnePageCheckout within Offline Payment Methods and USPS shipping method.">
         <variation name="OnePageCheckoutUspsTestVariation1" summary="Use USPS Online Shipping Carrier on Checkout as a Registered Customer" ticketId="MAGETWO-12444">
             <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data>
             <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="customer/dataset" xsi:type="string">default</data>
-            <data name="billingAddress/dataset" xsi:type="string">US_address_1</data>
+            <data name="shippingAddress/dataset" xsi:type="string">US_address_1_without_email</data>
             <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data>
             <data name="shipping/shipping_method" xsi:type="string">Priority Mail 1-Day</data>
             <data name="cart/data/shipping_method" xsi:type="string">Priority Mail 1-Day</data>
@@ -27,12 +27,13 @@
             <data name="checkoutMethod" xsi:type="string">guest</data>
             <data name="customer/dataset" xsi:type="string">default</data>
             <data name="address/dataset" xsi:type="string">UK_address</data>
-            <data name="billingAddress/dataset" xsi:type="string">UK_address</data>
+            <data name="shippingAddress/dataset" xsi:type="string">UK_address</data>
             <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data>
             <data name="shipping/shipping_method" xsi:type="string">Priority Mail International</data>
             <data name="cart/data/shipping_method" xsi:type="string">Priority Mail International</data>
             <data name="payment/method" xsi:type="string">checkmo</data>
             <data name="configData" xsi:type="string">checkmo, usps, shipping_origin_US_CA</data>
+            <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid"/>
             <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/>
diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php
index fbc90ac30f4c6da05143fd0391520237c2aaf580..ed282c1793d1c2d7836bee5daab7d28d371fe8c3 100644
--- a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php
@@ -19,7 +19,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase
     /**
      * @var \Magento\Email\Model\Template\Filter
      */
-    protected $model = null;
+    protected $model;
 
     /**
      * @var \Magento\TestFramework\ObjectManager
@@ -270,7 +270,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase
             'File with compilation error results in error message' => [
                 TemplateTypesInterface::TYPE_HTML,
                 'file="css/file-with-error.css"',
-                \Magento\Framework\Css\PreProcessor\AdapterInterface::ERROR_MESSAGE_PREFIX,
+                \Magento\Framework\View\Asset\ContentProcessorInterface::ERROR_MESSAGE_PREFIX,
             ],
         ];
     }
@@ -356,7 +356,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase
             ],
             'Developer mode - File with compilation error results in error message' => [
                 '<html><p></p> {{inlinecss file="css/file-with-error.css"}}</html>',
-                \Magento\Framework\Css\PreProcessor\AdapterInterface::ERROR_MESSAGE_PREFIX,
+                \Magento\Framework\View\Asset\ContentProcessorInterface::ERROR_MESSAGE_PREFIX,
                 false,
             ],
         ];
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php
deleted file mode 100644
index 399f0b7a44bfda7cde4a3623a6042edc372d3c71..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Framework\Css\PreProcessor\Adapter\Less;
-
-use Magento\Framework\App\State;
-
-/**
- * Oyejorge adapter model
- */
-class OyejorgeTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var Oyejorge
-     */
-    protected $model;
-
-    /**
-     * @var \Magento\Framework\App\State
-     */
-    protected $state;
-
-    public function setUp()
-    {
-        $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
-        $this->model = $objectManager->create('Magento\Framework\Css\PreProcessor\Adapter\Less\Oyejorge');
-        $this->state = $objectManager->get('Magento\Framework\App\State');
-    }
-
-    public function testProcess()
-    {
-        $sourceFilePath = realpath(__DIR__ . '/_files/oyejorge.less');
-        $expectedCss = ($this->state->getMode() === State::MODE_DEVELOPER)
-            ? file_get_contents(__DIR__ . '/_files/oyejorge_dev.css')
-            : file_get_contents(__DIR__ . '/_files/oyejorge.css');
-        $actualCss = ($this->model->process($sourceFilePath));
-
-        $this->assertEquals($this->cutCopyrights($expectedCss), $actualCss);
-    }
-
-    /**
-     * Cuts copyrights from css source
-     *
-     * @param string $cssSource
-     * @return string
-     */
-    private function cutCopyrights($cssSource)
-    {
-        $copyright = <<<'TAG'
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-
-TAG;
-        return (string)str_replace($copyright, '', $cssSource);
-
-    }
-}
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/cache/lib/nested/import.less b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/cache/lib/nested/import.less
deleted file mode 100644
index 0b6a8af1a5130a6d19a8d976dff524408c5b15bf..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/cache/lib/nested/import.less
+++ /dev/null
@@ -1,6 +0,0 @@
-// /**
-//  * Copyright © 2015 Magento. All rights reserved.
-//  * See COPYING.txt for license details.
-//  */
-
-h1 { background-color: red; }
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/cache/lib/oyejorge.less b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/cache/lib/oyejorge.less
deleted file mode 100644
index c71bb050df796ac1f963b2bd62a024c020f8c0c8..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/cache/lib/oyejorge.less
+++ /dev/null
@@ -1,6 +0,0 @@
-// /**
-//  * Copyright © 2015 Magento. All rights reserved.
-//  * See COPYING.txt for license details.
-//  */
-
-@import "nested/import.less";
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/nested/import.less b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/nested/import.less
deleted file mode 100644
index 2e284b2e8eb87a22b92b769e67086265962d3822..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/nested/import.less
+++ /dev/null
@@ -1,6 +0,0 @@
-// /**
-//  * Copyright © 2015 Magento. All rights reserved.
-//  * See COPYING.txt for license details.
-//  */
-
-@body-bg-img: url(Magento_Theme::validation_advice_bg.gif);
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge.css b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge.css
deleted file mode 100644
index bcf1aa406b5edaa5723cf3584be8e8896fb7cbf8..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-#header{color: #4d926f}h2{color: #4d926f}#header{-webkit-border-radius: 5px;-moz-border-radius: 5px;-ms-border-radius: 5px;-o-border-radius: 5px;border-radius: 5px}#footer{-webkit-border-radius: 10px;-moz-border-radius: 10px;-ms-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px}#header h1{font-size: 26px;font-weight: bold}#header p{font-size: 12px}#header p a{text-decoration: none}#header p a:hover{border-width: 1px}#header{color: #333;border-left: 1px;border-right: 2px}#footer{color: #141;border-color: #7d2717}body{background-image: url(Magento_Theme::validation_advice_bg.gif)}
\ No newline at end of file
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge.less b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge.less
deleted file mode 100644
index 58914770c2f5de25e75cfd0fc38524fd61d31959..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge.less
+++ /dev/null
@@ -1,74 +0,0 @@
-// /**
-//  * Copyright © 2015 Magento. All rights reserved.
-//  * See COPYING.txt for license details.
-//  */
-
-// Variables
-
-@color: #4D926F;
-
-#header {
-  color: @color;
-}
-
-h2 {
-  color: @color;
-}
-
-// Mixins
-
-.rounded-corners (@radius: 5px) {
-  -webkit-border-radius: @radius;
-  -moz-border-radius: @radius;
-  -ms-border-radius: @radius;
-  -o-border-radius: @radius;
-  border-radius: @radius;
-}
-
-#header {
-  .rounded-corners;
-}
-
-#footer {
-  .rounded-corners(10px);
-}
-
-// Nested Rules
-
-#header {
-  h1 {
-    font-size: 26px;
-    font-weight: bold;
-  }
-  p { font-size: 12px;
-    a {
-      text-decoration: none;
-      &:hover {
-        border-width: 1px;
-      }
-    }
-  }
-}
-
-// Functions & Operations
-
-@the-border: 1px;
-@base-color: #111;
-@red:        #842210;
-
-#header {
-  color: (@base-color * 3);
-  border-left: @the-border;
-  border-right: (@the-border * 2);
-}
-
-#footer {
-  color: (@base-color + #003300);
-  border-color: desaturate(@red, 10%);
-}
-
-@import "nested/import.less";
-
-body {
-  background-image: @body-bg-img;
-}
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge_dev.css b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge_dev.css
deleted file mode 100644
index 0e70c6da760dbc6c5b39775e940f619daa8910db..0000000000000000000000000000000000000000
--- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/_files/oyejorge_dev.css
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-#header {
-  color: #4d926f;
-}
-h2 {
-  color: #4d926f;
-}
-#header {
-  -webkit-border-radius: 5px;
-  -moz-border-radius: 5px;
-  -ms-border-radius: 5px;
-  -o-border-radius: 5px;
-  border-radius: 5px;
-}
-#footer {
-  -webkit-border-radius: 10px;
-  -moz-border-radius: 10px;
-  -ms-border-radius: 10px;
-  -o-border-radius: 10px;
-  border-radius: 10px;
-}
-#header h1 {
-  font-size: 26px;
-  font-weight: bold;
-}
-#header p {
-  font-size: 12px;
-}
-#header p a {
-  text-decoration: none;
-}
-#header p a:hover {
-  border-width: 1px;
-}
-#header {
-  color: #333333;
-  border-left: 1px;
-  border-right: 2px;
-}
-#footer {
-  color: #114411;
-  border-color: #7d2717;
-}
-body {
-  background-image: url(Magento_Theme::validation_advice_bg.gif);
-}
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/composer3.json b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/composer3.json
index 436ee0afe3eb6e42dae48d57e59774fced9ac23e..d8c398fe8f3b096e0c6e2f3648d57dba2da96fc6 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/composer3.json
+++ b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/composer3.json
@@ -2,7 +2,7 @@
     "name": "magento/module-module1",
     "description": "N/A",
     "require": {
-        "php": "~5.5.0|~5.6.0"
+        "php": "~5.5.0|~5.6.0|~7.0.0"
     },
     "type": "magento2-module",
     "version": "0.1.0-alpha103"
diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php
index 530d99c68dcdfbfa1feeaaee620ba570a10deb2e..215df89727a1decb4e2587f2ddf31c7d5e2a6308 100644
--- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php
+++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php
@@ -154,6 +154,7 @@ class ComposerTest extends \PHPUnit_Framework_TestCase
                 $xml = simplexml_load_file("$dir/etc/module.xml");
                 $this->assertConsistentModuleName($xml, $json->name);
                 $this->assertDependsOnPhp($json->require);
+                $this->assertPhpVersionInSync($json->name, $json->require->php);
                 $this->assertDependsOnFramework($json->require);
                 $this->assertRequireInSync($json);
                 $this->assertAutoload($json);
@@ -166,12 +167,14 @@ class ComposerTest extends \PHPUnit_Framework_TestCase
             case 'magento2-theme':
                 $this->assertRegExp('/^magento\/theme-(?:adminhtml|frontend)(\-[a-z0-9_]+)+$/', $json->name);
                 $this->assertDependsOnPhp($json->require);
+                $this->assertPhpVersionInSync($json->name, $json->require->php);
                 $this->assertDependsOnFramework($json->require);
                 $this->assertRequireInSync($json);
                 break;
             case 'magento2-library':
                 $this->assertDependsOnPhp($json->require);
                 $this->assertRegExp('/^magento\/framework*/', $json->name);
+                $this->assertPhpVersionInSync($json->name, $json->require->php);
                 $this->assertRequireInSync($json);
                 $this->assertAutoload($json);
                 break;
@@ -277,6 +280,22 @@ class ComposerTest extends \PHPUnit_Framework_TestCase
         );
     }
 
+    /**
+     * Assert that PHP versions in root composer.json and Magento component's composer.json are not out of sync
+     *
+     * @param string $name
+     * @param string $phpVersion
+     */
+    private function assertPhpVersionInSync($name, $phpVersion)
+    {
+        $this->assertEquals(
+            self::$rootJson['require']['php'],
+            $phpVersion,
+            "PHP version {$phpVersion} in component {$name} is inconsistent with version "
+            . self::$rootJson['require']['php'] . ' in root composer.json'
+        );
+    }
+
     /**
      * Make sure requirements of components are reflected in root composer.json
      *
diff --git a/lib/internal/Magento/Framework/App/ErrorHandler.php b/lib/internal/Magento/Framework/App/ErrorHandler.php
index 59119102e6955a742beb3398588d305b663b7ab8..99eaab78f51b8a9194d6ae18d3a26754b86fffa9 100644
--- a/lib/internal/Magento/Framework/App/ErrorHandler.php
+++ b/lib/internal/Magento/Framework/App/ErrorHandler.php
@@ -51,17 +51,11 @@ class ErrorHandler
             return false;
         }
 
-        if (strpos($errorStr, 'Automatically populating $HTTP_RAW_POST_DATA is deprecated') !== false) {
-            // this warning should be suppressed as it is a known bug in php 5.6.0 https://bugs.php.net/bug.php?id=66763
-            // and workaround suggested here (http://php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data)
-            // is not compatible with HHVM
-            return false;
-        }
-
         $errorNo = $errorNo & error_reporting();
         if ($errorNo == 0) {
             return false;
         }
+
         $msg = isset($this->errorPhrases[$errorNo]) ? $this->errorPhrases[$errorNo] : "Unknown error ({$errorNo})";
         $msg .= ": {$errorStr} in {$errorFile} on line {$errorLine}";
         throw new \Exception($msg);
diff --git a/lib/internal/Magento/Framework/App/Http.php b/lib/internal/Magento/Framework/App/Http.php
index 897985cc0982b52298fed8665e9ba7ac518b347e..f87e64ea889377b1dcedd146ca96092bdc025faf 100644
--- a/lib/internal/Magento/Framework/App/Http.php
+++ b/lib/internal/Magento/Framework/App/Http.php
@@ -184,9 +184,12 @@ class Http implements \Magento\Framework\AppInterface
             $this->_response->setRedirect($setupInfo->getUrl());
             $this->_response->sendHeaders();
         } else {
-            $newMessage = $exception->getMessage() . "\nNOTE: web setup wizard is not accessible.\n"
-                . 'In order to install, use Magento Setup CLI or configure web access to the following directory: '
-                . $setupInfo->getDir($projectRoot);
+            $newMessage = $exception->getMessage() . "\nNOTE: You cannot install Magento using the Setup Wizard "
+                . "because the Magento setup directory cannot be accessed. \n"
+                . 'You can install Magento using either the command line or you must restore access '
+                . 'to the following directory: ' . $setupInfo->getDir($projectRoot) . "\n";
+            $newMessage .= 'If you are using the sample nginx configuration, please go to '
+                . $this->_request->getScheme(). '://' . $this->_request->getHttpHost() . $setupInfo->getUrl();
             throw new \Exception($newMessage, 0, $exception);
         }
     }
diff --git a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php
index c2c928b2376efe8589e86741e5fa8d3df1c4966b..44258c7f135ce0e122f3a63d6f0fe1fd26737fe4 100644
--- a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php
+++ b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php
@@ -48,7 +48,7 @@ class ComponentRegistrar implements ComponentRegistrarInterface
         if (isset(self::$paths[$type][$componentName])) {
             throw new \LogicException('\'' . $componentName . '\' component already exists');
         } else {
-            self::$paths[$type][$componentName] = $path;
+            self::$paths[$type][$componentName] = str_replace('\\', '/', $path);
         }
     }
 
diff --git a/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php b/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php
index 5bb8e80888b6b6e2be74875430165d6e7c0e6169..4fbeaecc85d18ad7c22f386ecfd00d838d5b904d 100644
--- a/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php
+++ b/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php
@@ -97,4 +97,9 @@ class ConfigOptionsListConstants
      * Key for modules
      */
     const KEY_MODULES = 'modules';
+
+    /**
+     * Size of random string generated for store's encryption key
+     */
+    const STORE_KEY_RANDOM_STRING_SIZE = 32;
 }
diff --git a/lib/internal/Magento/Framework/Controller/Result/Json.php b/lib/internal/Magento/Framework/Controller/Result/Json.php
index f1d480efec72e9ec8b610e4209bb581cbf1cb773..bc3855448ccc264e16b34f061518a3e0507998cd 100644
--- a/lib/internal/Magento/Framework/Controller/Result/Json.php
+++ b/lib/internal/Magento/Framework/Controller/Result/Json.php
@@ -63,6 +63,8 @@ class Json extends AbstractResult
      */
     protected function render(ResponseInterface $response)
     {
+        // reset profiler to avoid appending profiling stat to JSON response
+        \Magento\Framework\Profiler::reset();
         $this->translateInline->processResponseBody($this->json, true);
         $response->representJson($this->json);
         return $this;
diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Oyejorge.php b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Oyejorge.php
deleted file mode 100644
index eed8d0555341be43c29d3fe7f05452b08ebd7783..0000000000000000000000000000000000000000
--- a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Oyejorge.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Framework\Css\PreProcessor\Adapter\Less;
-
-use Magento\Framework\App\State;
-
-/**
- * Oyejorge adapter model
- */
-class Oyejorge implements \Magento\Framework\Css\PreProcessor\AdapterInterface
-{
-    /**
-     * @var \Psr\Log\LoggerInterface
-     */
-    protected $logger;
-
-    /**
-     * @var \Magento\Framework\App\State
-     */
-    protected $appState;
-
-    /**
-     * @param \Psr\Log\LoggerInterface $logger
-     * @param State $appState
-     */
-    public function __construct(
-        \Psr\Log\LoggerInterface $logger,
-        State $appState
-    ) {
-        $this->logger = $logger;
-        $this->appState = $appState;
-    }
-
-    /**
-     * @param string $sourceFilePath
-     * @return string
-     */
-    public function process($sourceFilePath)
-    {
-        $options = ['relativeUrls' => false, 'compress' => $this->appState->getMode() !== State::MODE_DEVELOPER];
-        try {
-            $parser = new \Less_Parser($options);
-            $parser->parseFile($sourceFilePath, '');
-            return $parser->getCss();
-        } catch (\Exception $e) {
-            $errorMessage = self::ERROR_MESSAGE_PREFIX . $e->getMessage();
-            $this->logger->critical($errorMessage);
-            return $errorMessage;
-        }
-    }
-}
diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php
new file mode 100644
index 0000000000000000000000000000000000000000..26cb1ce21d66a979dc2c97ba5db99db8d8d4890d
--- /dev/null
+++ b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\Css\PreProcessor\Adapter\Less;
+
+use Psr\Log\LoggerInterface;
+use Magento\Framework\App\State;
+use Magento\Framework\View\Asset\File;
+use Magento\Framework\View\Asset\Source;
+use Magento\Framework\Css\PreProcessor\File\Temporary;
+use Magento\Framework\View\Asset\ContentProcessorInterface;
+
+/**
+ * Class Processor
+ */
+class Processor implements ContentProcessorInterface
+{
+    /**
+     * @var LoggerInterface
+     */
+    private $logger;
+
+    /**
+     * @var State
+     */
+    private $appState;
+
+    /**
+     * @var Source
+     */
+    private $assetSource;
+
+    /**
+     * @var Temporary
+     */
+    private $temporaryFile;
+
+    /**
+     * Constructor
+     *
+     * @param LoggerInterface $logger
+     * @param State $appState
+     * @param Source $assetSource
+     * @param Temporary $temporaryFile
+     */
+    public function __construct(
+        LoggerInterface $logger,
+        State $appState,
+        Source $assetSource,
+        Temporary $temporaryFile
+    ) {
+        $this->logger = $logger;
+        $this->appState = $appState;
+        $this->assetSource = $assetSource;
+        $this->temporaryFile = $temporaryFile;
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function processContent(File $asset)
+    {
+        try {
+            $parser = new \Less_Parser(
+                [
+                    'relativeUrls' => false,
+                    'compress' => $this->appState->getMode() !== State::MODE_DEVELOPER
+                ]
+            );
+
+            $content = $this->assetSource->getContent($asset);
+
+            if (trim($content) === '') {
+                return '';
+            }
+
+            $tmpFilePath = $this->temporaryFile->createFile($asset->getPath(), $content);
+            $parser->parseFile($tmpFilePath, '');
+
+            $content = $parser->getCss();
+
+            return $content;
+        } catch (\Exception $e) {
+            $errorMessage = self::ERROR_MESSAGE_PREFIX . $e->getMessage();
+            $this->logger->critical($errorMessage);
+
+            return $errorMessage;
+        }
+    }
+}
diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/AdapterInterface.php b/lib/internal/Magento/Framework/Css/PreProcessor/AdapterInterface.php
deleted file mode 100644
index b2b230bc30233add74cc614f0f820a70cd352dc4..0000000000000000000000000000000000000000
--- a/lib/internal/Magento/Framework/Css/PreProcessor/AdapterInterface.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Framework\Css\PreProcessor;
-
-/**
- * Css pre-processor adapter interface
- */
-interface AdapterInterface
-{
-    const ERROR_MESSAGE_PREFIX = 'CSS compilation from source ';
-
-    /**
-     * @param string $sourceFilePath
-     * @return string
-     */
-    public function process($sourceFilePath);
-}
diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/FileGenerator.php b/lib/internal/Magento/Framework/Css/PreProcessor/FileGenerator.php
deleted file mode 100644
index ff69af61e354c142422430e601222fbacdfc8173..0000000000000000000000000000000000000000
--- a/lib/internal/Magento/Framework/Css/PreProcessor/FileGenerator.php
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Framework\Css\PreProcessor;
-
-use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\Framework\View\Asset\PreProcessor\Chain;
-use Magento\Framework\View\Asset\SourceFileGeneratorInterface;
-
-/**
- * Class FileGenerator
- * @package Magento\Framework\Css
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class FileGenerator implements SourceFileGeneratorInterface
-{
-    /**
-     * Max execution (locking) time for generation process (in seconds)
-     */
-    const MAX_LOCK_TIME = 300;
-
-    /**
-     * Lock file, if exists shows that process is locked
-     */
-    const LOCK_FILE = 'css.lock';
-
-    /**
-     * @var \Magento\Framework\Filesystem\Directory\WriteInterface
-     */
-    protected $tmpDirectory;
-
-    /**
-     * @var \Magento\Framework\View\Asset\Repository
-     */
-    private $assetRepo;
-
-    /**
-     * @var \Magento\Framework\View\Asset\Source
-     */
-    private $assetSource;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\Instruction\MagentoImport
-     */
-    private $magentoImportProcessor;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\Instruction\Import
-     */
-    private $importProcessor;
-
-    /**
-     * @var FileGenerator\RelatedGenerator
-     */
-    private $relatedGenerator;
-
-    /**
-     * @var Config
-     */
-    private $config;
-
-    /**
-     * @var File\Temporary
-     */
-    private $temporaryFile;
-
-    /**
-     * @param \Magento\Framework\Filesystem $filesystem
-     * @param \Magento\Framework\View\Asset\Repository $assetRepo
-     * @param \Magento\Framework\Css\PreProcessor\Instruction\MagentoImport $magentoImportProcessor
-     * @param \Magento\Framework\Css\PreProcessor\Instruction\Import $importProcessor
-     * @param \Magento\Framework\View\Asset\Source $assetSource
-     * @param FileGenerator\RelatedGenerator $relatedGenerator
-     * @param Config $config
-     * @param File\Temporary $temporaryFile
-     */
-    public function __construct(
-        \Magento\Framework\Filesystem $filesystem,
-        \Magento\Framework\View\Asset\Repository $assetRepo,
-        \Magento\Framework\Css\PreProcessor\Instruction\MagentoImport $magentoImportProcessor,
-        \Magento\Framework\Css\PreProcessor\Instruction\Import $importProcessor,
-        \Magento\Framework\View\Asset\Source $assetSource,
-        \Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator $relatedGenerator,
-        Config $config,
-        File\Temporary $temporaryFile
-    ) {
-        $this->tmpDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
-        $this->assetRepo = $assetRepo;
-        $this->assetSource = $assetSource;
-
-        $this->magentoImportProcessor = $magentoImportProcessor;
-        $this->importProcessor = $importProcessor;
-        $this->relatedGenerator = $relatedGenerator;
-        $this->config = $config;
-        $this->temporaryFile = $temporaryFile;
-    }
-
-    /**
-     * Create a tree of self-sustainable files and return the topmost source file,
-     * ready for passing to 3rd party library
-     *
-     * @param Chain $chain
-     * @return string Absolute path of generated topmost source file
-     */
-    public function generateFileTree(Chain $chain)
-    {
-        /**
-         * wait if generation process has already started
-         */
-        while ($this->isProcessLocked()) {
-            sleep(1);
-        }
-        $lockFilePath = $this->config->getMaterializationRelativePath() . '/' . self::LOCK_FILE;
-        $this->tmpDirectory->writeFile($lockFilePath, time());
-
-        $this->magentoImportProcessor->process($chain);
-        $this->importProcessor->process($chain);
-        $this->relatedGenerator->generate($this->importProcessor);
-
-        $contentType = $chain->getContentType();
-        $relativePath = preg_replace('#\.css$#', '.' . $contentType, $chain->getAsset()->getPath());
-        $tmpFilePath = $this->temporaryFile->createFile($relativePath, $chain->getContent());
-
-        $this->tmpDirectory->delete($lockFilePath);
-        return $tmpFilePath;
-    }
-
-    /**
-     * Check whether generation process has already locked
-     *
-     * @return bool
-     */
-    protected function isProcessLocked()
-    {
-        $lockFilePath = $this->config->getMaterializationRelativePath() . '/' . self::LOCK_FILE;
-        if ($this->tmpDirectory->isExist($lockFilePath)) {
-            $lockTime = time() - (int)$this->tmpDirectory->readFile($lockFilePath);
-            if ($lockTime >= self::MAX_LOCK_TIME) {
-                $this->tmpDirectory->delete($lockFilePath);
-                return false;
-            }
-            return true;
-        }
-        return false;
-    }
-}
diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php b/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php
index 158d022f78a0ef33c07eff29d164294ab2db9c3f..2559c32270373ee30d03ab3a518a632ed27ace52 100644
--- a/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php
+++ b/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php
@@ -11,6 +11,7 @@ namespace Magento\Framework\Css\PreProcessor\Instruction;
 use Magento\Framework\View\Asset\LocalInterface;
 use Magento\Framework\View\Asset\NotationResolver;
 use Magento\Framework\View\Asset\PreProcessorInterface;
+use Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator;
 
 /**
  * @import instruction preprocessor
@@ -34,11 +35,22 @@ class Import implements PreProcessorInterface
     protected $relatedFiles = [];
 
     /**
+     * @var RelatedGenerator
+     */
+    private $relatedFileGenerator;
+
+    /**
+     * Constructor
+     *
      * @param NotationResolver\Module $notationResolver
+     * @param RelatedGenerator $relatedFileGenerator
      */
-    public function __construct(NotationResolver\Module $notationResolver)
-    {
+    public function __construct(
+        NotationResolver\Module $notationResolver,
+        RelatedGenerator $relatedFileGenerator
+    ) {
         $this->notationResolver = $notationResolver;
+        $this->relatedFileGenerator = $relatedFileGenerator;
     }
 
     /**
@@ -54,6 +66,7 @@ class Import implements PreProcessorInterface
         $content = $this->removeComments($chain->getContent());
 
         $processedContent = preg_replace_callback(self::REPLACE_PATTERN, $replaceCallback, $content);
+        $this->relatedFileGenerator->generate($this);
 
         if ($processedContent !== $content) {
             $chain->setContent($processedContent);
diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Less.php b/lib/internal/Magento/Framework/Css/PreProcessor/Less.php
deleted file mode 100644
index 4bdbbcf31a58e7093b87becf7c5dc9ab0d7cd1c6..0000000000000000000000000000000000000000
--- a/lib/internal/Magento/Framework/Css/PreProcessor/Less.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Framework\Css\PreProcessor;
-
-use Magento\Framework\View\Asset\PreProcessorInterface;
-
-class Less implements PreProcessorInterface
-{
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\FileGenerator
-     */
-    protected $fileGenerator;
-
-    /**
-     * @var AdapterInterface
-     */
-    protected $adapter;
-
-    /**
-     * @param \Magento\Framework\Css\PreProcessor\FileGenerator $fileGenerator
-     * @param AdapterInterface $adapter
-     */
-    public function __construct(
-        \Magento\Framework\Css\PreProcessor\FileGenerator $fileGenerator,
-        AdapterInterface $adapter
-    ) {
-        $this->fileGenerator = $fileGenerator;
-        $this->adapter = $adapter;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function process(\Magento\Framework\View\Asset\PreProcessor\Chain $chain)
-    {
-        $chain->setContentType('less');
-        $tmpFile = $this->fileGenerator->generateFileTree($chain);
-        $cssContent = $this->adapter->process($tmpFile);
-        $cssTrimmedContent = trim($cssContent);
-        if (!empty($cssTrimmedContent)) {
-            $chain->setContent($cssContent);
-        }
-        $chain->setContentType('css');
-    }
-}
diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/FileGeneratorTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/FileGeneratorTest.php
deleted file mode 100644
index 4f034c16360776c8e5d7344943725bfba4b4a190..0000000000000000000000000000000000000000
--- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/FileGeneratorTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Framework\Css\Test\Unit\PreProcessor;
-
-class FileGeneratorTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\Instruction\Import|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $import;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\Instruction\MagentoImport|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $magentoImport;
-
-    /**
-     * @var \Magento\Framework\Filesystem\Directory\WriteInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $tmpDirectory;
-
-    /**
-     * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $rootDirectory;
-
-    /**
-     * @var \Magento\Framework\View\Asset\Repository|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $assetRepo;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\FileGenerator
-     */
-    private $object;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $relatedGenerator;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\Config|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $config;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\File\Temporary|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $temporaryFile;
-
-    protected function setUp()
-    {
-        $this->tmpDirectory = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
-        $this->rootDirectory = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface');
-        $this->rootDirectory->expects($this->any())
-            ->method('getRelativePath')
-            ->will($this->returnArgument(0));
-        $this->rootDirectory->expects($this->any())
-            ->method('readFile')
-            ->will(
-                $this->returnCallback(
-                    function ($file) {
-                        return "content of '$file'";
-                    }
-                )
-            );
-        $filesystem = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false);
-        $filesystem->expects($this->once())
-            ->method('getDirectoryWrite')
-            ->will($this->returnValue($this->tmpDirectory));
-        $this->assetRepo = $this->getMock('\Magento\Framework\View\Asset\Repository', [], [], '', false);
-        $this->magentoImport = $this->getMock(
-            'Magento\Framework\Css\PreProcessor\Instruction\MagentoImport',
-            [],
-            [],
-            '',
-            false
-        );
-        $this->import = $this->getMock(
-            'Magento\Framework\Css\PreProcessor\Instruction\Import',
-            [],
-            [],
-            '',
-            false
-        );
-
-        $assetSource = $this->getMock(
-            'Magento\Framework\View\Asset\Source',
-            [],
-            [],
-            '',
-            false
-        );
-
-        $this->relatedGenerator = $this->getMockBuilder(
-            'Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator'
-        )
-            ->disableOriginalConstructor()
-            ->setMethods([])
-            ->getMock();
-        $this->config = $this->getMockBuilder('Magento\Framework\Css\PreProcessor\Config')
-            ->disableOriginalConstructor()
-            ->setMethods([])
-            ->getMock();
-        $this->temporaryFile = $this->getMockBuilder('Magento\Framework\Css\PreProcessor\File\Temporary')
-            ->disableOriginalConstructor()
-            ->setMethods([])
-            ->getMock();
-        $this->object = new \Magento\Framework\Css\PreProcessor\FileGenerator(
-            $filesystem,
-            $this->assetRepo,
-            $this->magentoImport,
-            $this->import,
-            $assetSource,
-            $this->relatedGenerator,
-            $this->config,
-            $this->temporaryFile
-        );
-    }
-
-    public function testGenerateFileTree()
-    {
-        $lessDirectory = 'path/to/less';
-        $expectedContent = 'updated content';
-        $expectedRelativePath = 'some/file.less';
-        $expectedPath = $lessDirectory . '/some/file.less';
-
-
-        $asset = $this->getMock('Magento\Framework\View\Asset\File', [], [], '', false);
-        $chain = $this->getMock('Magento\Framework\View\Asset\PreProcessor\Chain', [], [], '', false);
-
-        $this->config->expects($this->any())
-            ->method('getLessDirectory')
-            ->willReturn($lessDirectory);
-        $this->tmpDirectory->expects($this->once())
-            ->method('isExist')
-            ->willReturn(true);
-
-        $this->magentoImport->expects($this->once())
-            ->method('process')
-            ->with($chain);
-        $this->import->expects($this->once())
-            ->method('process')
-            ->with($chain);
-        $this->relatedGenerator->expects($this->once())
-            ->method('generate')
-            ->with($this->import);
-
-        $asset->expects($this->once())
-            ->method('getPath')
-            ->will($this->returnValue('some/file.css'));
-        $chain->expects($this->once())
-            ->method('getContent')
-            ->willReturn($expectedContent);
-        $chain->expects($this->once())
-            ->method('getAsset')
-            ->willReturn($asset);
-        $chain->expects($this->once())
-            ->method('getContentType')
-            ->willReturn('less');
-
-        $this->temporaryFile->expects($this->once())
-            ->method('createFile')
-            ->with(
-                $expectedRelativePath,
-                $expectedContent
-            )
-            ->willReturn($expectedPath);
-
-        $this->assertSame($expectedPath, $this->object->generateFileTree($chain));
-    }
-}
diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php
index 6be802eaf35dc19ab8238a39fa0856ae4f1eb6c6..b5959faaf5d9e016847f7f2c3c6f729941cd6fc8 100644
--- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php
+++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php
@@ -8,6 +8,12 @@
 
 namespace Magento\Framework\Css\Test\Unit\PreProcessor\Instruction;
 
+use Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator;
+use Magento\Framework\Css\PreProcessor\Instruction\Import;
+
+/**
+ * Class ImportTest
+ */
 class ImportTest extends \PHPUnit_Framework_TestCase
 {
     /**
@@ -21,18 +27,29 @@ class ImportTest extends \PHPUnit_Framework_TestCase
     private $asset;
 
     /**
-     * @var \Magento\Framework\Css\PreProcessor\Instruction\Import
+     * @var Import
      */
     private $object;
 
+    /**
+     * @var RelatedGenerator
+     */
+    private $relatedFileGeneratorMock;
+
     protected function setUp()
     {
+
         $this->notationResolver = $this->getMock(
             '\Magento\Framework\View\Asset\NotationResolver\Module', [], [], '', false
         );
         $this->asset = $this->getMock('\Magento\Framework\View\Asset\File', [], [], '', false);
         $this->asset->expects($this->any())->method('getContentType')->will($this->returnValue('css'));
-        $this->object = new \Magento\Framework\Css\PreProcessor\Instruction\Import($this->notationResolver);
+
+        $this->relatedFileGeneratorMock = $this->getMockBuilder(RelatedGenerator::class)
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $this->object = new Import($this->notationResolver, $this->relatedFileGeneratorMock);
     }
 
     /**
diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/LessTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/LessTest.php
deleted file mode 100644
index 4b13f6d09411d4dd948f39e14d5449d374e19b58..0000000000000000000000000000000000000000
--- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/LessTest.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Framework\Css\Test\Unit\PreProcessor;
-
-use Magento\Framework\View\Asset\PreProcessor\Chain;
-
-class LessTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\FileGenerator|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $fileGenerator;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $adapter;
-
-    /**
-     * @var Chain
-     */
-    private $chain;
-
-    /**
-     * @var \Magento\Framework\Css\PreProcessor\Less
-     */
-    private $object;
-
-    protected function setUp()
-    {
-        $this->fileGenerator = $this->getMock('\Magento\Framework\Css\PreProcessor\FileGenerator', [], [], '', false);
-        $this->adapter = $this->getMockForAbstractClass('\Magento\Framework\Css\PreProcessor\AdapterInterface');
-        $asset = $this->getMockForAbstractClass('\Magento\Framework\View\Asset\LocalInterface');
-        $asset->expects($this->once())->method('getContentType')->will($this->returnValue('origType'));
-        $this->chain = new Chain($asset, 'original content', 'origType', 'origPath');
-        $this->object = new \Magento\Framework\Css\PreProcessor\Less($this->fileGenerator, $this->adapter);
-    }
-
-    public function testProcess()
-    {
-        $expectedContent = 'updated content';
-        $tmpFile = 'tmp/file.ext';
-        $this->fileGenerator->expects($this->once())
-            ->method('generateFileTree')
-            ->with($this->chain)
-            ->will($this->returnValue($tmpFile));
-        $this->adapter->expects($this->once())
-            ->method('process')
-            ->with($tmpFile)
-            ->will($this->returnValue($expectedContent));
-        $this->object->process($this->chain);
-        $this->assertEquals($expectedContent, $this->chain->getContent());
-        $this->assertEquals('css', $this->chain->getContentType());
-    }
-}
diff --git a/lib/internal/Magento/Framework/DB/Ddl/Table.php b/lib/internal/Magento/Framework/DB/Ddl/Table.php
index a623ba4c0fb3398a107d72140fe711adfa19b946..0b168e4c94a50cddc3ebbf59ef9c796f1d652c73 100644
--- a/lib/internal/Magento/Framework/DB/Ddl/Table.php
+++ b/lib/internal/Magento/Framework/DB/Ddl/Table.php
@@ -310,8 +310,8 @@ class Table
             case self::TYPE_DECIMAL:
             case self::TYPE_NUMERIC:
                 $match = [];
-                $scale = 10;
-                $precision = 0;
+                $scale = 0;
+                $precision = 10;
                 // parse size value
                 if (is_array($size)) {
                     if (count($size) == 2) {
diff --git a/lib/internal/Magento/Framework/Math/Random.php b/lib/internal/Magento/Framework/Math/Random.php
index 03c0727efd26e5938e3b3f2c74bcab7131777050..8ed28cb6021a976337e2e8b9cd6da0c5a98d724c 100644
--- a/lib/internal/Magento/Framework/Math/Random.php
+++ b/lib/internal/Magento/Framework/Math/Random.php
@@ -24,9 +24,10 @@ class Random
     /**
      * Get random string
      *
-     * @param int         $length
+     * @param int $length
      * @param null|string $chars
      * @return string
+     * @throws \Magento\Framework\Exception\LocalizedException
      */
     public function getRandomString($length, $chars = null)
     {
@@ -53,12 +54,9 @@ class Random
             }
             fclose($fp);
         } else {
-            // fallback to mt_rand() if all else fails
-            mt_srand(10000000 * (double)microtime());
-            for ($i = 0, $lc = strlen($chars) - 1; $i < $length; $i++) {
-                $rand = mt_rand(0, $lc); // random integer from 0 to $lc
-                $str .= $chars[$rand]; // random character in $chars
-            }
+            throw new \Magento\Framework\Exception\LocalizedException(
+                new \Magento\Framework\Phrase("Please make sure you have 'openssl' extension installed")
+            );
         }
 
         return $str;
@@ -70,6 +68,7 @@ class Random
      * @param $min [optional]
      * @param $max [optional]
      * @return int A random integer value between min (or 0) and max
+     * @throws \Magento\Framework\Exception\LocalizedException
      */
     public static function getRandomNumber($min = 0, $max = null)
     {
@@ -91,9 +90,9 @@ class Random
             $offset = abs(hexdec($hex) % $range); // random integer from 0 to $range
             fclose($fp);
         } else {
-            // fallback to mt_rand() if all else fails
-            mt_srand(mt_rand() + (100000000 * microtime()) % PHP_INT_MAX);
-            return mt_rand($min, $max); // random integer from $min to $max
+            throw new \Magento\Framework\Exception\LocalizedException(
+                new \Magento\Framework\Phrase("Please make sure you have 'openssl' extension installed")
+            );
         }
 
         return $min + $offset; // random integer from $min to $max
diff --git a/lib/internal/Magento/Framework/View/Asset/ContentProcessorInterface.php b/lib/internal/Magento/Framework/View/Asset/ContentProcessorInterface.php
new file mode 100644
index 0000000000000000000000000000000000000000..a7df2aad78c42c00b8b2c96530f53e796b610ff2
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/ContentProcessorInterface.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset;
+
+use Magento\Framework\View\Asset\File;
+
+/**
+ * Interface ContentProcessorInterface
+ */
+interface ContentProcessorInterface
+{
+    /**
+     * Error prefix
+     */
+    const ERROR_MESSAGE_PREFIX = 'Compilation from source: ';
+
+    /**
+     * Process file content
+     *
+     * @param File $asset
+     * @return string
+     */
+    public function processContent(File $asset);
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/LockerProcess.php b/lib/internal/Magento/Framework/View/Asset/LockerProcess.php
new file mode 100644
index 0000000000000000000000000000000000000000..3f07c9b0ab23a1b5292f9f9b6e5ac3d46f5fde22
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/LockerProcess.php
@@ -0,0 +1,111 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset;
+
+use Magento\Framework\Filesystem;
+use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\Exception\FileSystemException;
+use Magento\Framework\Filesystem\Directory\WriteInterface;
+
+/**
+ * Class LockerProcess
+ */
+class LockerProcess implements LockerProcessInterface
+{
+    /**
+     * File extension lock
+     */
+    const LOCK_EXTENSION = '.lock';
+
+    /**
+     * Max execution (locking) time for process (in seconds)
+     */
+    const MAX_LOCK_TIME = 30;
+
+    /**
+     * @var Filesystem
+     */
+    private $filesystem;
+
+    /**
+     * @var string
+     */
+    private $lockFilePath;
+
+    /**
+     * @var WriteInterface
+     */
+    private $tmpDirectory;
+
+    /**
+     * Constructor
+     *
+     * @param Filesystem $filesystem
+     */
+    public function __construct(Filesystem $filesystem)
+    {
+        $this->filesystem = $filesystem;
+    }
+
+    /**
+     * @inheritdoc
+     * @throws FileSystemException
+     */
+    public function lockProcess($lockName)
+    {
+        $this->tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
+        $this->lockFilePath = $this->getFilePath($lockName);
+
+        while ($this->isProcessLocked()) {
+            sleep(1);
+        }
+
+        $this->tmpDirectory->writeFile($this->lockFilePath, time());
+
+    }
+
+    /**
+     * @inheritdoc
+     * @throws FileSystemException
+     */
+    public function unlockProcess()
+    {
+        $this->tmpDirectory->delete($this->lockFilePath);
+    }
+
+    /**
+     * Check whether generation process has already locked
+     *
+     * @return bool
+     * @throws FileSystemException
+     */
+    private function isProcessLocked()
+    {
+        if ($this->tmpDirectory->isExist($this->lockFilePath)) {
+            $lockTime = (int) $this->tmpDirectory->readFile($this->lockFilePath);
+            if ((time() - $lockTime) >= self::MAX_LOCK_TIME) {
+                $this->tmpDirectory->delete($this->lockFilePath);
+
+                return false;
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Get name of lock file
+     *
+     * @param string $name
+     * @return string
+     */
+    private function getFilePath($name)
+    {
+        return DirectoryList::TMP . DIRECTORY_SEPARATOR . $name . self::LOCK_EXTENSION;
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/LockerProcessInterface.php b/lib/internal/Magento/Framework/View/Asset/LockerProcessInterface.php
new file mode 100644
index 0000000000000000000000000000000000000000..d719653a5f18d74e6592072e1acf7fa71adb8310
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/LockerProcessInterface.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset;
+
+/**
+ * Interface LockerProcessInterface
+ */
+interface LockerProcessInterface
+{
+    /**
+     * @param string $lockName
+     * @return void
+     */
+    public function lockProcess($lockName);
+
+    /**
+     * @return void
+     */
+    public function unlockProcess();
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php
new file mode 100644
index 0000000000000000000000000000000000000000..d727bd9fa40598dba7c3cf65330c8da88155d361
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php
@@ -0,0 +1,161 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset\PreProcessor;
+
+use Magento\Framework\Filesystem;
+use Magento\Framework\ObjectManagerInterface;
+use Magento\Framework\View\Asset\File\FallbackContext;
+use Magento\Framework\View\Asset\LockerProcessInterface;
+use Magento\Framework\View\Asset\ContentProcessorInterface;
+use Magento\Framework\View\Asset\PreProcessor\AlternativeSource\AssetBuilder;
+
+/**
+ * Class AlternativeSource
+ */
+class AlternativeSource implements AlternativeSourceInterface
+{
+    /**
+     * The key name of the processor class
+     */
+    const PROCESSOR_CLASS = 'class';
+
+    /**
+     * @var Helper\SortInterface
+     */
+    private $sorter;
+
+    /**
+     * @var array
+     */
+    private $alternatives;
+
+    /**
+     * @var ObjectManagerInterface
+     */
+    private $objectManager;
+
+    /**
+     * @var array
+     */
+    private $alternativesSorted;
+
+    /**
+     * @var LockerProcessInterface
+     */
+    private $lockerProcess;
+
+    /**
+     * @var string
+     */
+    private $lockName;
+
+    /**
+     * @var AssetBuilder
+     */
+    private $assetBuilder;
+
+    /**
+     * Constructor
+     *
+     * @param ObjectManagerInterface $objectManager
+     * @param LockerProcessInterface $lockerProcess
+     * @param Helper\SortInterface $sorter
+     * @param AssetBuilder $assetBuilder
+     * @param string $lockName
+     * @param array $alternatives
+     */
+    public function __construct(
+        ObjectManagerInterface $objectManager,
+        LockerProcessInterface $lockerProcess,
+        Helper\SortInterface $sorter,
+        AssetBuilder $assetBuilder,
+        $lockName,
+        array $alternatives = []
+    ) {
+        $this->objectManager = $objectManager;
+        $this->lockerProcess = $lockerProcess;
+        $this->sorter = $sorter;
+        $this->alternatives = $alternatives;
+        $this->lockName = $lockName;
+        $this->assetBuilder = $assetBuilder;
+    }
+
+    /**
+     * @inheritdoc
+     * @throws \UnexpectedValueException
+     */
+    public function process(Chain $chain)
+    {
+        $path = $chain->getAsset()->getFilePath();
+        $content = $chain->getContent();
+        if (trim($content) !== '') {
+            return;
+        }
+
+        try {
+            $this->lockerProcess->lockProcess($this->lockName . sprintf('%x', crc32($path . $content)));
+
+            $module = $chain->getAsset()->getModule();
+
+            /** @var  FallbackContext $context */
+            $context = $chain->getAsset()->getContext();
+            $chain->setContent($this->processContent($path, $content, $module, $context));
+        } finally {
+            $this->lockerProcess->unlockProcess();
+        }
+    }
+
+    /**
+     * Preparation of content for the destination file
+     *
+     * @param string $path
+     * @param string $content
+     * @param string $module
+     * @param FallbackContext $context
+     * @return string
+     * @throws \UnexpectedValueException
+     */
+    private function processContent($path, $content, $module, FallbackContext $context)
+    {
+        if ($this->alternativesSorted === null) {
+            $this->alternativesSorted = $this->sorter->sort($this->alternatives);
+        }
+
+        foreach ($this->alternativesSorted as $name => $alternative) {
+            $asset = $this->assetBuilder->setArea($context->getAreaCode())
+                ->setTheme($context->getThemePath())
+                ->setLocale($context->getLocale())
+                ->setModule($module)
+                ->setPath(preg_replace(
+                    '#\.' . preg_quote(pathinfo($path, PATHINFO_EXTENSION)) . '$#',
+                    '.' . $name,
+                    $path
+                ))->build();
+
+            $processor = $this->objectManager->get($alternative[self::PROCESSOR_CLASS]);
+            if (!$processor  instanceof ContentProcessorInterface) {
+                throw new \UnexpectedValueException(
+                    '"' . $alternative[self::PROCESSOR_CLASS] . '" has to implement the ContentProcessorInterface.'
+                );
+            }
+            $content = $processor->processContent($asset);
+
+            if (trim($content) !== '') {
+                return $content;
+            }
+        }
+
+        return $content;
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function getAlternativesExtensionsNames()
+    {
+        return array_keys($this->alternatives);
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource/AssetBuilder.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource/AssetBuilder.php
new file mode 100644
index 0000000000000000000000000000000000000000..79f13bb5632a44cb8f959d8577f22f600f9c8755
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource/AssetBuilder.php
@@ -0,0 +1,134 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset\PreProcessor\AlternativeSource;
+
+use Magento\Framework\View\Asset\File;
+use Magento\Framework\View\Asset\Repository;
+
+/**
+ * Class AssetBuilder
+ */
+class AssetBuilder
+{
+    /**
+     * @var string
+     */
+    private $area;
+
+    /**
+     * @var string
+     */
+    private $theme;
+
+    /**
+     * @var string
+     */
+    private $locale;
+
+    /**
+     * @var string
+     */
+    private $module;
+
+    /**
+     * @var string
+     */
+    private $path;
+
+    /**
+     * @var Repository
+     */
+    private $repository;
+
+    /**
+     * Constructor
+     *
+     * @param Repository $repository
+     */
+    public function __construct(Repository $repository)
+    {
+        $this->repository = $repository;
+    }
+
+    /**
+     * Set area
+     *
+     * @param string $area
+     * @return $this
+     */
+    public function setArea($area)
+    {
+        $this->area = $area;
+        return $this;
+    }
+
+    /**
+     * Set theme
+     *
+     * @param string $theme
+     * @return $this
+     */
+    public function setTheme($theme)
+    {
+        $this->theme = $theme;
+        return $this;
+    }
+
+    /**
+     * Set locale
+     *
+     * @param string $locale
+     * @return $this
+     */
+    public function setLocale($locale)
+    {
+        $this->locale = $locale;
+        return $this;
+    }
+
+    /**
+     * Set module
+     *
+     * @param string $module
+     * @return $this
+     */
+    public function setModule($module)
+    {
+        $this->module = $module;
+        return $this;
+    }
+
+    /**
+     * Set path
+     *
+     * @param string $path
+     * @return $this
+     */
+    public function setPath($path)
+    {
+        $this->path = $path;
+        return $this;
+    }
+
+    /**
+     * @return File
+     */
+    public function build()
+    {
+        $params = [
+            'area' => $this->area,
+            'theme' => $this->theme,
+            'locale' => $this->locale,
+            'module' => $this->module,
+        ];
+
+        $asset = $this->repository->createAsset($this->path, $params);
+
+        unset($this->path, $this->module, $this->locale, $this->theme, $this->area);
+
+        return $asset;
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSourceInterface.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSourceInterface.php
new file mode 100644
index 0000000000000000000000000000000000000000..43a20b74809449bd401fff2e119292a99910b60b
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSourceInterface.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset\PreProcessor;
+
+use Magento\Framework\View\Asset\PreProcessorInterface;
+
+/**
+ * Interface AlternativeSourceInterface
+ */
+interface AlternativeSourceInterface extends PreProcessorInterface
+{
+    /**
+     * Get extensions names of alternatives
+     *
+     * @return string[]
+     */
+    public function getAlternativesExtensionsNames();
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Helper/Sort.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Helper/Sort.php
new file mode 100644
index 0000000000000000000000000000000000000000..a2a4c1d8f2b5eca6f53cbdb87634a1a0e11aec4a
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Helper/Sort.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset\PreProcessor\Helper;
+
+use Magento\Framework\Phrase;
+
+/**
+ * Class Sort
+ */
+class Sort implements SortInterface
+{
+    /**
+     * Name of directive
+     */
+    const DIRECTIVE = 'after';
+
+    /**
+     * Key of name items
+     */
+    const NEXT_KEY = 'next';
+
+    /**
+     * @var array
+     */
+    private $result;
+
+    /**
+     * @var array
+     */
+    private $array;
+
+    /**
+     * @inheritdoc
+     */
+    public function sort(array $array)
+    {
+        $this->result = [];
+        $this->array = $array;
+
+        $nodes = [];
+        $structure = [];
+        foreach ($this->array as $name => $item) {
+            $nodes[$name] = isset($nodes[$name]) ? $nodes[$name] : [self::NEXT_KEY => null];
+            if (isset($item[self::DIRECTIVE])) {
+                $nodes[$item[self::DIRECTIVE]][self::NEXT_KEY][$name] = &$nodes[$name];
+                continue;
+            }
+            $structure[$name] = &$nodes[$name];
+        }
+
+        $this->fillResult($structure);
+
+        return $this->result;
+    }
+
+    /**
+     * @param array $structure
+     * @return void
+     */
+    private function fillResult(array $structure)
+    {
+        foreach ($structure as $name => $item) {
+            $this->result[$name] = $this->array[$name];
+            if (!empty($item[self::NEXT_KEY])) {
+                $this->fillResult($item[self::NEXT_KEY]);
+            }
+        }
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Helper/SortInterface.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Helper/SortInterface.php
new file mode 100644
index 0000000000000000000000000000000000000000..130add1da0108caadbd72af45badbc56e00eb1b6
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Helper/SortInterface.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Asset\PreProcessor\Helper;
+
+/**
+ * Interface SortInterface
+ */
+interface SortInterface
+{
+    /**
+     * Sorting an array by directive
+     * [
+     *     'name-1' => ['after' => 'xxx', 'data' => [...]]
+     *     'name-2' => ['after' => 'xxx', 'data' => [...]]
+     * ]
+     * @param array $array
+     * @return array
+     */
+    public function sort(array $array);
+}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Pool.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Pool.php
index 7a8fee000db446c8348d4442dd86bac57d57192f..ee891d96720762ffa50a6ee4edb57acf0736232a 100644
--- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Pool.php
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Pool.php
@@ -14,24 +14,51 @@ use Magento\Framework\View\Asset\PreProcessorInterface;
  */
 class Pool
 {
+    const PREPROCESSOR_CLASS = 'class';
+
     /**
-     * @var ObjectManagerInterface
+     * @var array
      */
-    private $objectManager;
+    private $preprocessors;
 
     /**
      * @var array
      */
-    private $preProcessorClasses = [];
+    private $instances;
+
+    /**
+     * @var Helper\SortInterface
+     */
+    private $sorter;
+
+    /**
+     * @var string
+     */
+    private $defaultPreprocessor;
 
     /**
+     * @var ObjectManagerInterface
+     */
+    private $objectManager;
+
+    /**
+     * Constructor
+     *
      * @param ObjectManagerInterface $objectManager
-     * @param array $preProcessors
+     * @param Helper\SortInterface $sorter
+     * @param string $defaultPreprocessor
+     * @param array $preprocessors
      */
-    public function __construct(ObjectManagerInterface $objectManager, array $preProcessors = [])
-    {
+    public function __construct(
+        ObjectManagerInterface $objectManager,
+        Helper\SortInterface $sorter,
+        $defaultPreprocessor,
+        array $preprocessors = []
+    ) {
+        $this->preprocessors = $preprocessors;
+        $this->sorter = $sorter;
+        $this->defaultPreprocessor = $defaultPreprocessor;
         $this->objectManager = $objectManager;
-        $this->preProcessorClasses = $preProcessors;
     }
 
     /**
@@ -42,9 +69,8 @@ class Pool
      */
     public function process(Chain $chain)
     {
-        $fromType = $chain->getOrigContentType();
-        $toType = $chain->getTargetContentType();
-        foreach ($this->getPreProcessors($fromType, $toType) as $preProcessor) {
+        $type = $chain->getTargetContentType();
+        foreach ($this->getPreProcessors($type) as $preProcessor) {
             $preProcessor->process($chain);
         }
     }
@@ -52,28 +78,35 @@ class Pool
     /**
      * Retrieve preProcessors by types
      *
-     * @param string $fromType
-     * @param string $toType
+     * @param string $type
      * @return PreProcessorInterface[]
+     * @throws \UnexpectedValueException
      */
-    private function getPreProcessors($fromType, $toType)
+    private function getPreProcessors($type)
     {
-        $preProcessors = [];
-        if (isset($this->preProcessorClasses[$fromType]) && isset($this->preProcessorClasses[$fromType][$toType])) {
-            $preProcessors = $this->preProcessorClasses[$fromType][$toType];
+        if (isset($this->instances[$type])) {
+            return $this->instances[$type];
+        }
+
+        if (isset($this->preprocessors[$type])) {
+            $preprocessors = $this->sorter->sort($this->preprocessors[$type]);
         } else {
-            $preProcessors[] = 'Magento\Framework\View\Asset\PreProcessor\Passthrough';
+            $preprocessors = [
+                'default' => [self::PREPROCESSOR_CLASS => $this->defaultPreprocessor]
+            ];
         }
 
-        $processorInstances = [];
-        foreach ($preProcessors as $preProcessor) {
-            $processorInstance = $this->objectManager->get($preProcessor);
-            if (!$processorInstance instanceof PreProcessorInterface) {
-                throw new \UnexpectedValueException("{$preProcessor} has to implement the PreProcessorInterface.");
+        $this->instances[$type] = [];
+        foreach ($preprocessors as $preprocessor) {
+            $instance = $this->objectManager->get($preprocessor[self::PREPROCESSOR_CLASS]);
+            if (!$instance instanceof PreProcessorInterface) {
+                throw new \UnexpectedValueException(
+                    '"' . $preprocessor[self::PREPROCESSOR_CLASS] . '" has to implement the PreProcessorInterface.'
+                );
             }
-            $processorInstances[] = $processorInstance;
+            $this->instances[$type][] = $instance;
         }
 
-        return $processorInstances;
+        return $this->instances[$type];
     }
 }
diff --git a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Alternative.php b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Alternative.php
index f943656b1cd92a2a0da9803d84a129a3593b3c6e..c8872027ad2af919f455ca7afd7fe3801e6dc9b6 100644
--- a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Alternative.php
+++ b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Alternative.php
@@ -30,7 +30,7 @@ class Alternative extends Simple
     public function __construct(
         Filesystem $filesystem,
         \Magento\Framework\View\Design\Fallback\RulePool $rulePool,
-        array $alternativeExtensions
+        array $alternativeExtensions = []
     ) {
         foreach ($alternativeExtensions as $extension => $newExtensions) {
             if (!is_string($extension) || !is_array($newExtensions)) {
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..8cd6a99610b09619e3d3feb14c779065757e7ffd
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Test\Unit\Asset;
+
+use Magento\Framework\Filesystem;
+use Magento\Framework\View\Asset\LockerProcess;
+use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\Filesystem\Directory\WriteInterface;
+
+/**
+ * Class LockerProcessTest
+ *
+ * @see \Magento\Framework\View\Asset\LockerProcess
+ */
+class LockerProcessTest extends \PHPUnit_Framework_TestCase
+{
+    const LOCK_NAME = 'test-lock';
+
+    /**
+     * @var string
+     */
+    private $fileName;
+
+    /**
+     * @var LockerProcess
+     */
+    private $lockerProcess;
+
+    /**
+     * @var Filesystem|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $filesystemMock;
+
+    /**
+     * Set up
+     */
+    protected function setUp()
+    {
+        $this->fileName = DirectoryList::TMP . DIRECTORY_SEPARATOR . self::LOCK_NAME . LockerProcess::LOCK_EXTENSION;
+
+        $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $this->lockerProcess = new LockerProcess($this->filesystemMock);
+    }
+
+    /**
+     * Test for lockProcess method
+     *
+     * @param string $method
+     *
+     * @dataProvider dataProviderTestLockProcess
+     */
+    public function testLockProcess($method)
+    {
+        $this->filesystemMock->expects(self::once())
+            ->method('getDirectoryWrite')
+            ->with(DirectoryList::VAR_DIR)
+            ->willReturn($this->$method());
+
+        $this->lockerProcess->lockProcess(self::LOCK_NAME);
+    }
+
+    /**
+     * Test for unlockProcess method
+     */
+    public function testUnlockProcess()
+    {
+        $this->filesystemMock->expects(self::once())
+            ->method('getDirectoryWrite')
+            ->with(DirectoryList::VAR_DIR)
+            ->willReturn($this->getTmpDirectoryMockFalse(1));
+
+        $this->lockerProcess->lockProcess(self::LOCK_NAME);
+        $this->lockerProcess->unlockProcess();
+    }
+
+    /**
+     * @return array
+     */
+    public function dataProviderTestLockProcess()
+    {
+        return [
+            ['method' => 'getTmpDirectoryMockTrue'],
+            ['method' => 'getTmpDirectoryMockFalse']
+        ];
+    }
+
+    /**
+     * @return WriteInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected function getTmpDirectoryMockTrue()
+    {
+        $tmpDirectoryMock = $this->getTmpDirectoryMock();
+
+        $tmpDirectoryMock->expects(self::atLeastOnce())
+            ->method('isExist')
+            ->with($this->fileName)
+            ->willReturn(true);
+
+        $tmpDirectoryMock->expects(self::atLeastOnce())
+            ->method('readFile')
+            ->with($this->fileName)
+            ->willReturn(time() - 25);
+
+
+        $tmpDirectoryMock->expects(self::once())
+            ->method('writeFile')
+            ->with($this->fileName, self::matchesRegularExpression('#\d+#'));
+
+        return $tmpDirectoryMock;
+    }
+
+    /**
+     * @param int $exactly
+     * @return WriteInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected function getTmpDirectoryMockFalse($exactly = 0)
+    {
+        $tmpDirectoryMock = $this->getTmpDirectoryMock();
+
+        $tmpDirectoryMock->expects(self::atLeastOnce())
+            ->method('isExist')
+            ->with($this->fileName)
+            ->willReturn(false);
+
+        $tmpDirectoryMock->expects(self::never())
+            ->method('readFile');
+
+        $tmpDirectoryMock->expects(self::exactly($exactly))
+            ->method('delete')
+            ->with($this->fileName);
+
+        $tmpDirectoryMock->expects(self::once())
+            ->method('writeFile')
+            ->with($this->fileName, self::matchesRegularExpression('#\d+#'));
+
+        return $tmpDirectoryMock;
+    }
+
+    /**
+     * @return WriteInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getTmpDirectoryMock()
+    {
+        $tmpDirectoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\WriteInterface')
+            ->getMockForAbstractClass();
+
+        return $tmpDirectoryMock;
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/ProcessorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/ProcessorTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..5989389bdd2d50b3d2137e62a84801845ee6a33d
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/ProcessorTest.php
@@ -0,0 +1,185 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Test\Unit\Asset\PreProcessor\Adapter\Less;
+
+use Psr\Log\LoggerInterface;
+use Magento\Framework\App\State;
+use Magento\Framework\View\Asset\File;
+use Magento\Framework\View\Asset\Source;
+use Magento\Framework\Css\PreProcessor\File\Temporary;
+use Magento\Framework\Css\PreProcessor\Adapter\Less\Processor;
+
+/**
+ * Class ProcessorTest
+ */
+class ProcessorTest extends \PHPUnit_Framework_TestCase
+{
+    const TEST_CONTENT = 'test-content';
+
+    const ASSET_PATH = 'test-path';
+
+    const TMP_PATH_LESS = '_file/test.less';
+
+    const TMP_PATH_CSS = '_file/test.css';
+
+    const ERROR_MESSAGE = 'Test exception';
+
+    /**
+     * @var Processor
+     */
+    private $processor;
+
+    /**
+     * @var LoggerInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $loggerMock;
+
+    /**
+     * @var State|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $appStateMock;
+
+    /**
+     * @var Source|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $assetSourceMock;
+
+    /**
+     * @var Temporary|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $temporaryFileMock;
+
+    /**
+     * Set up
+     */
+    protected function setUp()
+    {
+        $this->loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface')
+            ->getMockForAbstractClass();
+        $this->appStateMock = $this->getMockBuilder('Magento\Framework\App\State')
+            ->disableOriginalConstructor()
+            ->getMock();
+        $this->assetSourceMock = $this->getMockBuilder('Magento\Framework\View\Asset\Source')
+            ->disableOriginalConstructor()
+            ->getMock();
+        $this->temporaryFileMock = $this->getMockBuilder('Magento\Framework\Css\PreProcessor\File\Temporary')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $this->processor = new Processor(
+            $this->loggerMock,
+            $this->appStateMock,
+            $this->assetSourceMock,
+            $this->temporaryFileMock
+        );
+    }
+
+    /**
+     * Test for processContent method (exception)
+     */
+    public function testProcessContentException()
+    {
+        $assetMock = $this->getAssetMock();
+
+        $this->appStateMock->expects(self::once())
+            ->method('getMode')
+            ->willReturn(State::MODE_DEVELOPER);
+
+        $this->assetSourceMock->expects(self::once())
+            ->method('getContent')
+            ->with($assetMock)
+            ->willThrowException(new \Exception(self::ERROR_MESSAGE));
+
+        $this->loggerMock->expects(self::once())
+            ->method('critical')
+            ->with(Processor::ERROR_MESSAGE_PREFIX . self::ERROR_MESSAGE);
+
+        $this->temporaryFileMock->expects(self::never())
+            ->method('createFile');
+
+        $assetMock->expects(self::never())
+            ->method('getPath');
+
+        $content = $this->processor->processContent($assetMock);
+
+        self::assertEquals(Processor::ERROR_MESSAGE_PREFIX . self::ERROR_MESSAGE, $content);
+    }
+
+    /**
+     * Test for processContent method (empty content)
+     */
+    public function testProcessContentEmpty()
+    {
+        $assetMock = $this->getAssetMock();
+
+        $this->appStateMock->expects(self::once())
+            ->method('getMode')
+            ->willReturn(State::MODE_DEVELOPER);
+
+        $this->assetSourceMock->expects(self::once())
+            ->method('getContent')
+            ->with($assetMock)
+            ->willReturn('');
+
+        $this->temporaryFileMock->expects(self::never())
+            ->method('createFile');
+
+        $assetMock->expects(self::never())
+            ->method('getPath');
+
+        $this->loggerMock->expects(self::never())
+            ->method('critical');
+
+        $this->processor->processContent($assetMock);
+    }
+
+    /**
+     * Test for processContent method (not empty content)
+     */
+    public function testProcessContentNotEmpty()
+    {
+        $assetMock = $this->getAssetMock();
+
+        $this->appStateMock->expects(self::once())
+            ->method('getMode')
+            ->willReturn(State::MODE_DEVELOPER);
+
+        $this->assetSourceMock->expects(self::once())
+            ->method('getContent')
+            ->with($assetMock)
+            ->willReturn(self::TEST_CONTENT);
+
+        $this->temporaryFileMock->expects(self::once())
+            ->method('createFile')
+            ->with(self::ASSET_PATH, self::TEST_CONTENT)
+            ->willReturn(__DIR__ . '/' . self::TMP_PATH_LESS);
+
+        $assetMock->expects(self::once())
+            ->method('getPath')
+            ->willReturn(self::ASSET_PATH);
+
+        $this->loggerMock->expects(self::never())
+            ->method('critical');
+
+        $clearSymbol = ["\n", "\r", "\t", ' '];
+        self::assertEquals(
+            trim(str_replace($clearSymbol, '', file_get_contents(__DIR__ . '/' . self::TMP_PATH_CSS))),
+            trim(str_replace($clearSymbol, '', $this->processor->processContent($assetMock)))
+        );
+    }
+
+    /**
+     * @return File|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getAssetMock()
+    {
+        $assetMock = $this->getMockBuilder('Magento\Framework\View\Asset\File')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        return $assetMock;
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/_file/test.css b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/_file/test.css
new file mode 100644
index 0000000000000000000000000000000000000000..7c30a79a3a75110b9504ce41bbcbc33155284668
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/_file/test.css
@@ -0,0 +1,19 @@
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+body {
+   background: #333333;
+   color: #454545;
+}
+a {
+   color: #ff9900;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+   color: #333333;
+}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/_file/test.less b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/_file/test.less
new file mode 100644
index 0000000000000000000000000000000000000000..6ecc83aa9dae673f78e64c3c43423b852505e0be
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Adapter/Less/_file/test.less
@@ -0,0 +1,19 @@
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+@color-orange: #ff9900;
+@color-gray_light: #cccccc;
+@color-black_dark: #333333;
+@color-black_medium: #454545;
+
+body {
+  background: @color-black_dark;
+  color: @color-black_medium;
+}
+a {
+  color:@color-orange;
+}
+h1, h2, h3, h4, h5, h6 {
+  color: @color-black_dark;
+}
\ No newline at end of file
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..2c3591ffbb6f294f5d52757121de9bbb00b2158f
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php
@@ -0,0 +1,363 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Test\Unit\Asset\PreProcessor;
+
+use Magento\Framework\Filesystem;
+use Magento\Framework\View\Asset\File;
+use Magento\Framework\ObjectManagerInterface;
+use Magento\Framework\View\Asset\LocalInterface;
+use Magento\Framework\View\Asset\PreProcessor\Chain;
+use Magento\Framework\View\Asset\File\FallbackContext;
+use Magento\Framework\View\Asset\LockerProcessInterface;
+use Magento\Framework\View\Asset\ContentProcessorInterface;
+use Magento\Framework\View\Asset\PreProcessor\AlternativeSource;
+use Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface;
+use Magento\Framework\View\Asset\PreProcessor\AlternativeSource\AssetBuilder;
+
+/**
+ * Class AlternativeSourceTest
+ *
+ * @see \Magento\Framework\View\Asset\PreProcessor\AlternativeSource
+ */
+class AlternativeSourceTest extends \PHPUnit_Framework_TestCase
+{
+    const AREA = 'test-area';
+
+    const THEME = 'test-theme';
+
+    const LOCALE = 'test-locale';
+
+    const FILE_PATH = 'test-file';
+
+    const MODULE = 'test-module';
+
+    const NEW_CONTENT = 'test-new-content';
+
+    /**
+     * @var SortInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $sorterMock;
+
+    /**
+     * @var ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $objectManagerMock;
+
+    /**
+     * @var LockerProcessInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $lockerProcessMock;
+
+    /**
+     * @var AssetBuilder|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $assetBuilderMock;
+
+    /**
+     * @var ContentProcessorInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $alternativeMock;
+
+    /**
+     * Set up
+     */
+    protected function setUp()
+    {
+        $this->sorterMock = $this->getMockBuilder('Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface')
+            ->getMockForAbstractClass();
+        $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')
+            ->getMockForAbstractClass();
+        $this->lockerProcessMock = $this->getMockBuilder('Magento\Framework\View\Asset\LockerProcessInterface')
+            ->getMockForAbstractClass();
+        $this->assetBuilderMock = $this->getMockBuilder(
+            'Magento\Framework\View\Asset\PreProcessor\AlternativeSource\AssetBuilder'
+        )->disableOriginalConstructor()
+            ->getMock();
+        $this->alternativeMock = $this->getMockBuilder('Magento\Framework\View\Asset\ContentProcessorInterface')
+            ->getMockForAbstractClass();
+    }
+
+    /**
+     * Run test for process method (exception)
+     */
+    public function testProcessException()
+    {
+        $alternatives = [
+            'processor' => [
+                AlternativeSource::PROCESSOR_CLASS => 'stdClass'
+            ]
+        ];
+
+        $this->lockerProcessMock->expects(self::once())
+            ->method('lockProcess')
+            ->with(self::isType('string'));
+        $this->lockerProcessMock->expects(self::once())
+            ->method('unlockProcess');
+
+        $this->sorterMock->expects(self::once())
+            ->method('sort')
+            ->with($alternatives)
+            ->willReturn($alternatives);
+
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setArea')
+            ->with(self::AREA)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setTheme')
+            ->with(self::THEME)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setLocale')
+            ->with(self::LOCALE)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setModule')
+            ->with(self::MODULE)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setPath')
+            ->with(self::FILE_PATH)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('build')
+            ->willReturn($this->getAssetNew());
+
+        $this->objectManagerMock->expects(self::once())
+            ->method('get')
+            ->with('stdClass')
+            ->willReturn(new \stdClass());
+
+        $alternativeSource = new AlternativeSource(
+            $this->objectManagerMock,
+            $this->lockerProcessMock,
+            $this->sorterMock,
+            $this->assetBuilderMock,
+            'lock',
+            $alternatives
+        );
+        try {
+            $alternativeSource->process($this->getChainMockExpects('', 0));
+        } catch (\UnexpectedValueException $e) {
+            self::assertInstanceOf('\UnexpectedValueException', $e);
+        }
+    }
+
+    /**
+     * Run test for process method
+     */
+    public function testProcess()
+    {
+        $alternatives = [
+            'processor' => [
+                AlternativeSource::PROCESSOR_CLASS => 'Magento\Framework\View\Asset\ContentProcessorInterface'
+            ]
+        ];
+
+        $this->lockerProcessMock->expects(self::once())
+            ->method('lockProcess')
+            ->with(self::isType('string'));
+        $this->lockerProcessMock->expects(self::once())
+            ->method('unlockProcess');
+
+        $this->sorterMock->expects(self::once())
+            ->method('sort')
+            ->with($alternatives)
+            ->willReturn($alternatives);
+
+        $assetMock = $this->getAssetNew();
+
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setArea')
+            ->with(self::AREA)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setTheme')
+            ->with(self::THEME)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setLocale')
+            ->with(self::LOCALE)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setModule')
+            ->with(self::MODULE)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('setPath')
+            ->with(self::FILE_PATH)
+            ->willReturnSelf();
+        $this->assetBuilderMock->expects(self::once())
+            ->method('build')
+            ->willReturn($assetMock);
+
+        $this->objectManagerMock->expects(self::once())
+            ->method('get')
+            ->with('Magento\Framework\View\Asset\ContentProcessorInterface')
+            ->willReturn($this->getProcessorMock($assetMock));
+
+        $alternativeSource = new AlternativeSource(
+            $this->objectManagerMock,
+            $this->lockerProcessMock,
+            $this->sorterMock,
+            $this->assetBuilderMock,
+            'lock',
+            $alternatives
+        );
+
+        $alternativeSource->process($this->getChainMockExpects());
+    }
+
+    /**
+     * Run test for process method (content not empty)
+     */
+    public function testProcessContentNotEmpty()
+    {
+        $chainMock = $this->getChainMock();
+        $assetMock = $this->getAssetMock();
+
+        $chainMock->expects(self::once())
+            ->method('getContent')
+            ->willReturn('test-content');
+
+        $chainMock->expects(self::once())
+            ->method('getAsset')
+            ->willReturn($assetMock);
+
+        $this->lockerProcessMock->expects(self::never())
+            ->method('lockProcess');
+        $this->lockerProcessMock->expects(self::never())
+            ->method('unlockProcess');
+
+        $alternativeSource = new AlternativeSource(
+            $this->objectManagerMock,
+            $this->lockerProcessMock,
+            $this->sorterMock,
+            $this->assetBuilderMock,
+            'lock',
+            []
+        );
+
+        $alternativeSource->process($chainMock);
+    }
+
+    /**
+     * @param \PHPUnit_Framework_MockObject_MockObject $asset
+     * @return ContentProcessorInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getProcessorMock($asset)
+    {
+        $processorMock = $this->getMockBuilder('Magento\Framework\View\Asset\ContentProcessorInterface')
+            ->getMockForAbstractClass();
+
+        $processorMock->expects(self::once())
+            ->method('processContent')
+            ->with($asset)
+            ->willReturn(self::NEW_CONTENT);
+
+        return $processorMock;
+    }
+
+    /**
+     * @return Chain|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getChainMock()
+    {
+        $chainMock = $this->getMockBuilder('Magento\Framework\View\Asset\PreProcessor\Chain')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        return $chainMock;
+    }
+
+    /**
+     * @param string $content
+     * @param int $contentExactly
+     * @return Chain|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getChainMockExpects($content = '', $contentExactly = 1)
+    {
+        $chainMock = $this->getChainMock();
+
+        $chainMock->expects(self::once())
+            ->method('getContent')
+            ->willReturn($content);
+        $chainMock->expects(self::exactly(3))
+            ->method('getAsset')
+            ->willReturn($this->getAssetMockExpects());
+        $chainMock->expects(self::exactly($contentExactly))
+            ->method('setContent')
+            ->willReturn(self::NEW_CONTENT);
+
+        return $chainMock;
+    }
+
+    /**
+     * @return File|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getAssetNew()
+    {
+        $assetMock = $this->getMockBuilder('Magento\Framework\View\Asset\File')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        return $assetMock;
+    }
+
+    /**
+     * @return LocalInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getAssetMock()
+    {
+        $assetMock = $this->getMockBuilder('Magento\Framework\View\Asset\LocalInterface')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        return $assetMock;
+    }
+
+    /**
+     * @return LocalInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getAssetMockExpects()
+    {
+        $assetMock = $this->getAssetMock();
+
+        $assetMock->expects(self::once())
+            ->method('getContext')
+            ->willReturn($this->getContextMock());
+        $assetMock->expects(self::once())
+            ->method('getFilePath')
+            ->willReturn(self::FILE_PATH);
+        $assetMock->expects(self::once())
+            ->method('getModule')
+            ->willReturn(self::MODULE);
+
+        return $assetMock;
+    }
+
+    /**
+     * @return FallbackContext|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getContextMock()
+    {
+        $contextMock = $this->getMockBuilder('Magento\Framework\View\Asset\File\FallbackContext')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $contextMock->expects(self::once())
+            ->method('getAreaCode')
+            ->willReturn(self::AREA);
+        $contextMock->expects(self::once())
+            ->method('getThemePath')
+            ->willReturn(self::THEME);
+        $contextMock->expects(self::once())
+            ->method('getLocale')
+            ->willReturn(self::LOCALE);
+
+        return $contextMock;
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..35e043143266047e8ec3e579409ab0a1ce1f9713
--- /dev/null
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php
@@ -0,0 +1,195 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Framework\View\Test\Unit\Asset\PreProcessor\Helper;
+
+use Magento\Framework\View\Asset\PreProcessor\Helper\Sort;
+
+/**
+ * Class SortTest
+ *
+ * @see \Magento\Framework\View\Asset\PreProcessor\Helper\Sorter2
+ */
+class SortTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @param array $arrayData
+     * @param array $expected
+     *
+     * @dataProvider dataProviderTestSorting
+     */
+    public function testSorting(array $arrayData, array $expected, $message)
+    {
+        $sorter = new Sort();
+
+        $result = $sorter->sort($arrayData);
+
+        static::assertEquals($expected, array_keys($result), $message);
+    }
+
+    /**
+     * @return array
+     *
+     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+     */
+    public function dataProviderTestSorting()
+    {
+        return [
+            [
+                'arrayData' => [
+                    'name-1' => [ // 2
+                        'after' => 'name-3',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-2' => [ // 0
+                        'processor' => new \stdClass()
+                    ],
+                    'name-3' => [ // 1
+                        'after' => 'name-2',
+                        'processor' => new \stdClass()
+                    ],
+                ],
+                'expected' => [
+                    'name-2', 'name-3', 'name-1'
+                ],
+                'message' => 'variation-1',
+            ],
+            [
+                'arrayData' => [
+                    'name-1' => [ // 3
+                        'after' => 'name-6',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-2' => [ // 1
+                        'processor' => new \stdClass()
+                    ],
+                    'name-3' => [ // 6
+                        'after' => 'name-5',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-4' => [ // 4
+                        'after' => 'name-1',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-5' => [ // 5
+                        'after' => 'name-4',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-6' => [ // 2
+                        'after' => 'name-2',
+                        'processor' => new \stdClass()
+                    ],
+                ],
+                'expected' => [
+                    'name-2', 'name-6', 'name-1', 'name-4', 'name-5', 'name-3'
+                ],
+                'message' => 'variation-2',
+            ],
+            [
+                'arrayData' => [
+                    'name-1' => [ // 3
+                        'after' => 'name-6',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-3' => [ // 6
+                        'after' => 'name-5',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-4' => [ // 4
+                        'after' => 'name-1',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-5' => [ // 5
+                        'after' => 'name-4',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-6' => [ // 2
+                        'after' => 'name-2',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-2' => [ // 1
+                        'processor' => new \stdClass()
+                    ],
+                ],
+                'expected' => [
+                    'name-2', 'name-6', 'name-1', 'name-4', 'name-5', 'name-3'
+                ],
+                'message' => 'variation-3',
+            ],
+            [
+                'arrayData' => [
+                    'name-1' => [ // 3
+                        'after' => 'name-6',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-2' => [ // 1
+                        'processor' => new \stdClass()
+                    ],
+                    'name-3' => [ // 6
+                        'after' => 'name-5',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-4' => [ // 4
+                        'after' => 'name-1',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-5' => [ // 5
+                        'after' => 'name-4',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-6' => [ // 2
+                        'after' => 'name-2',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-7' => [ // end
+                        'processor' => new \stdClass()
+                    ],
+                    'name-8' => [ // end
+                        'processor' => new \stdClass()
+                    ],
+                ],
+                'expected' => [
+                    'name-2', 'name-6', 'name-1', 'name-4', 'name-5', 'name-3', 'name-7', 'name-8'
+                ],
+                'message' => 'variation-4',
+            ],
+            [
+                'arrayData' => [
+                    'name-1' => [ // xxx
+                        'after' => 'name-6',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-2' => [ // 1
+                        'processor' => new \stdClass()
+                    ],
+                    'name-3' => [ // xxx
+                        'after' => 'name-XXX',
+                        'processor' => new \stdClass()
+                    ]
+                ],
+                'expected' => ['name-2'],
+                'message' => 'variation-5',
+            ],
+            [
+                'arrayData' => [
+                    'name-1' => [ // xxx
+                        'after' => 'name-3',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-2' => [ // xxx
+                        'after' => 'name-1',
+                        'processor' => new \stdClass()
+                    ],
+                    'name-3' => [ // xxx
+                        'after' => 'name-2',
+                        'processor' => new \stdClass()
+                    ]
+                ],
+                'expected' => [],
+                'message' => 'variation-6',
+            ],
+        ];
+    }
+}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php
index eb41418aaefed37555ce5aa5b0114b19dc8a8a23..d7fd211ef79493d7728f4f208a1c4b405dcf4bde 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php
@@ -6,127 +6,181 @@
 
 namespace Magento\Framework\View\Test\Unit\Asset\PreProcessor;
 
-use \Magento\Framework\View\Asset\PreProcessor\Pool;
+use Magento\Framework\ObjectManagerInterface;
+use Magento\Framework\View\Asset\PreProcessor\Pool;
+use Magento\Framework\View\Asset\PreProcessor\Chain;
+use Magento\Framework\View\Asset\PreProcessorInterface;
+use Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface;
 
+/**
+ * Class PoolTest
+ *
+ * @see \Magento\Framework\View\Asset\PreProcessor\Pool
+ */
 class PoolTest extends \PHPUnit_Framework_TestCase
 {
+    const DEFAULT_PREPROCESSOR = 'defaul/preprocessor';
+
+    const CONTENT_TYPE = 'test-type';
+
+    const PREPROCESSOR_CLASS = 'Magento\Framework\View\Asset\PreProcessorInterface';
+
     /**
-     * @var \Magento\Framework\View\Asset\PreProcessor\Pool
+     * @var ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $processorPool;
+    private $objectManagerMock;
 
     /**
-     * @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+     * @var SortInterface|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $objectManager;
+    private $sorterMock;
 
     /**
-     * @var \Magento\Framework\View\Asset\PreProcessor\Chain|\PHPUnit_Framework_MockObject_MockObject
+     * Set up
+     *
+     * @return void
      */
-    protected $processorChain;
-
-    protected function setUp()
+    public function setUp()
     {
-        $this->objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface');
+        $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')
+            ->getMockForAbstractClass();
+        $this->sorterMock = $this->getMockBuilder('Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface')
+            ->getMockForAbstractClass();
+    }
 
-        $this->processorChain = $this->getMockBuilder('Magento\Framework\View\Asset\PreProcessor\Chain')
+    /**
+     * @return Chain|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getChainMock($type)
+    {
+        /** @var Chain|\PHPUnit_Framework_MockObject_MockObject $chainMock */
+        $chainMock = $this->getMockBuilder('Magento\Framework\View\Asset\PreProcessor\Chain')
             ->disableOriginalConstructor()
-            ->setMethods([])
             ->getMock();
 
-        $this->processorPool = new Pool(
-            $this->objectManager,
-            [
-                'less' => [
-                    'css' =>
-                        [
-                            'Magento\Framework\Css\PreProcessor\Less',
-                            'Magento\Framework\View\Asset\PreProcessor\VariableNotation',
-                            'Magento\Framework\View\Asset\PreProcessor\ModuleNotation',
-                        ],
-                    'less' =>
-                        [
-                            'Magento\Framework\Css\PreProcessor\Instruction\MagentoImport',
-                            'Magento\Framework\Css\PreProcessor\Instruction\Import',
-                        ],
-                ],
-                'css' => [
-                    'css' => [
-                        'Magento\Framework\View\Asset\PreProcessor\VariableNotation',
-                        'Magento\Framework\View\Asset\PreProcessor\ModuleNotation',
-                    ]
-                ],
+        $chainMock->expects(self::once())
+            ->method('getTargetContentType')
+            ->willReturn($type);
+
+        return $chainMock;
+    }
+
+    /**
+     * @param Chain|\PHPUnit_Framework_MockObject_MockObject $chainMock
+     * @return PreProcessorInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getPreprocessorMock($chainMock)
+    {
+        /** @var PreProcessorInterface|\PHPUnit_Framework_MockObject_MockObject $preprocessorMock */
+        $preprocessorMock = $this->getMockBuilder(self::PREPROCESSOR_CLASS)
+            ->getMockForAbstractClass();
+
+        $preprocessorMock->expects(self::once())
+            ->method('process')
+            ->with($chainMock);
+
+        return $preprocessorMock;
+    }
+
+    /**
+     * Run test for process method
+     */
+    public function testProcess()
+    {
+        $preprocessors = [
+            self::CONTENT_TYPE => [
+                'test' => [
+                    Pool::PREPROCESSOR_CLASS => self::PREPROCESSOR_CLASS
+                ]
             ]
+        ];
+
+        $pool = new Pool(
+            $this->objectManagerMock,
+            $this->sorterMock,
+            self::DEFAULT_PREPROCESSOR,
+            $preprocessors
         );
+
+        $this->sorterMock->expects(self::once())
+            ->method('sort')
+            ->with($preprocessors[self::CONTENT_TYPE])
+            ->willReturn($preprocessors[self::CONTENT_TYPE]);
+
+        $chainMock = $this->getChainMock(self::CONTENT_TYPE);
+
+        $this->objectManagerMock->expects(self::once())
+            ->method('get')
+            ->with(self::PREPROCESSOR_CLASS)
+            ->willReturn($this->getPreprocessorMock($chainMock));
+
+        $pool->process($chainMock);
     }
 
     /**
-     * @param string $sourceContentType
-     * @param string $targetContentType
-     * @param array $expectedResult
-     *
-     * @dataProvider getPreProcessorsDataProvider
+     * Run test for process method (default preprocessor)
      */
-    public function testProcess($sourceContentType, $targetContentType, array $expectedResult)
+    public function testProcessDefault()
     {
+        $preprocessors = [
+            'bad-type' => [],
+        ];
 
-        $this->processorChain->expects($this->any())
-            ->method('getOrigContentType')
-            ->willReturn($sourceContentType);
-        $this->processorChain->expects($this->any())
-            ->method('getTargetContentType')
-            ->willReturn($targetContentType);
-        $processorMaps = [];
-        foreach ($expectedResult as $processor) {
-            $processorMock = $this->getMock($processor, ['process'], [], '', false);
-            $processorMock->expects($this->any())
-                ->method('process')
-                ->with($this->processorChain);
-            $processorMaps[] = [$processor, $processorMock];
-        }
-        $this->objectManager
-            ->expects(static::atLeastOnce())
+        $pool = new Pool(
+            $this->objectManagerMock,
+            $this->sorterMock,
+            self::DEFAULT_PREPROCESSOR,
+            $preprocessors
+        );
+
+        $this->sorterMock->expects(self::never())
+            ->method('sort');
+
+        $chainMock = $this->getChainMock(self::CONTENT_TYPE);
+
+        $this->objectManagerMock->expects(self::once())
             ->method('get')
-            ->willReturnMap($processorMaps);
+            ->with(self::DEFAULT_PREPROCESSOR)
+            ->willReturn($this->getPreprocessorMock($chainMock));
 
-        $this->processorPool->process($this->processorChain);
+        $pool->process($chainMock);
     }
 
-    public function getPreProcessorsDataProvider()
+    /**
+     * Run test for process method (exception)
+     *
+     * @expectedException \UnexpectedValueException
+     * @expectedExceptionMessage "stdClass" has to implement the PreProcessorInterface.
+     */
+    public function testProcessBadInterface()
     {
-        return [
-            'css => css' => [
-                'css', 'css',
-                [
-                    'Magento\Framework\View\Asset\PreProcessor\VariableNotation',
-                    'Magento\Framework\View\Asset\PreProcessor\ModuleNotation',
-                ],
-            ],
-            //all undefined types will be processed by Passthrough preprocessor
-            'css => less' => [
-                'css', 'less',
-                ['Magento\Framework\View\Asset\PreProcessor\Passthrough'],
-            ],
-            'less => css' => [
-                'less', 'css',
-                [
-                    'Magento\Framework\Css\PreProcessor\Less',
-                    'Magento\Framework\View\Asset\PreProcessor\VariableNotation',
-                    'Magento\Framework\View\Asset\PreProcessor\ModuleNotation',
-                ],
-            ],
-            'less => less' => [
-                'less', 'less',
-                [
-                    'Magento\Framework\Css\PreProcessor\Instruction\MagentoImport',
-                    'Magento\Framework\Css\PreProcessor\Instruction\Import',
-                ],
-            ],
-            //all undefined types will be processed by Passthrough preprocessor
-            'txt => log (undefined)' => [
-                'txt', 'log',
-                ['Magento\Framework\View\Asset\PreProcessor\Passthrough'],
-            ],
+        $preprocessors = [
+            self::CONTENT_TYPE => [
+                'test' => [
+                    Pool::PREPROCESSOR_CLASS => 'stdClass'
+                ]
+            ]
         ];
+
+        $pool = new Pool(
+            $this->objectManagerMock,
+            $this->sorterMock,
+            self::DEFAULT_PREPROCESSOR,
+            $preprocessors
+        );
+
+        $this->sorterMock->expects(self::once())
+            ->method('sort')
+            ->with($preprocessors[self::CONTENT_TYPE])
+            ->willReturn($preprocessors[self::CONTENT_TYPE]);
+
+        $chainMock = $this->getChainMock(self::CONTENT_TYPE);
+
+        $this->objectManagerMock->expects(self::once())
+            ->method('get')
+            ->with('stdClass')
+            ->willReturn(new \stdClass());
+
+        $pool->process($chainMock);
     }
 }
diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json
index 061a0f9c765c68772f18406aa59a0f1bb77a6eb8..3e39db19a43cf4ace7b87d7d46ad2970be4add27 100644
--- a/lib/internal/Magento/Framework/composer.json
+++ b/lib/internal/Magento/Framework/composer.json
@@ -17,6 +17,7 @@
         "ext-curl": "*",
         "ext-iconv": "*",
         "ext-gd": "*",
+        "ext-openssl": "*",
         "lib-libxml": "*",
         "ext-xsl": "*"
     },
diff --git a/nginx.conf.sample b/nginx.conf.sample
index 137ef8205deda016379d2b4a2abd4f103f8f9882..d1fae8af249431a258df786406c23f9be30a17a6 100644
--- a/nginx.conf.sample
+++ b/nginx.conf.sample
@@ -36,7 +36,7 @@ location /setup {
         include        fastcgi_params;
     }
 
-    location ~ /setup/(?!pub/). {
+    location ~ ^/setup/(?!pub/). {
         deny all;
     }
 }
@@ -44,7 +44,7 @@ location /setup {
 location /update {
     root $MAGE_ROOT;
 
-    location ~ /update/index.php {
+    location ~ ^/update/index.php {
         fastcgi_pass   fastcgi_backend;
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
@@ -52,7 +52,7 @@ location /update {
     }
 
     # deny everything but index.php
-    location ~ /update/(?!pub/). {
+    location ~ ^/update/(?!pub/). {
         deny all;
     }
 }
diff --git a/setup/pub/magento/setup/create-admin-account.js b/setup/pub/magento/setup/create-admin-account.js
index 423ef0a341f8e86db3bc7c91e2427725054c2f10..ecd31b3459fa1535bf70cac879818382444000b5 100644
--- a/setup/pub/magento/setup/create-admin-account.js
+++ b/setup/pub/magento/setup/create-admin-account.js
@@ -18,16 +18,17 @@ angular.module('create-admin-account', ['ngStorage'])
                 return;
             }
             var p = $scope.admin.password;
-            if (p.length >= 6 && p.match(/[\d]+/) && p.match(/[a-z]+/) && p.match(/[A-Z]+/) && p.match(/[!@#$%^*()_\/\\\-\+=]+/)) {
+            var MIN_ADMIN_PASSWORD_LENGTH = 7;
+            if (p.length >= MIN_ADMIN_PASSWORD_LENGTH && p.match(/[\d]+/) && p.match(/[a-z]+/) && p.match(/[A-Z]+/) && p.match(/[!@#$%^*()_\/\\\-\+=]+/)) {
                 $scope.admin.passwordStatus.class = 'strong';
                 $scope.admin.passwordStatus.label = 'Strong';
-            } else if (p.length >= 6 && p.match(/[\d]+/) && p.match(/[a-z]+/) && p.match(/[A-Z]+/)) {
+            } else if (p.length >= MIN_ADMIN_PASSWORD_LENGTH && p.match(/[\d]+/) && p.match(/[a-z]+/) && p.match(/[A-Z]+/)) {
                 $scope.admin.passwordStatus.class = 'good';
                 $scope.admin.passwordStatus.label = 'Good';
-            } else if (p.length >= 6 && p.match(/[\d]+/) && p.match(/[a-zA-Z]+/)) {
+            } else if (p.length >= MIN_ADMIN_PASSWORD_LENGTH && p.match(/[\d]+/) && p.match(/[a-zA-Z]+/)) {
                 $scope.admin.passwordStatus.class = 'fair';
                 $scope.admin.passwordStatus.label = 'Fair';
-            } else if (p.length >= 6) {
+            } else if (p.length >= MIN_ADMIN_PASSWORD_LENGTH) {
                 $scope.admin.passwordStatus.class = 'weak';
                 $scope.admin.passwordStatus.label = 'Weak';
             } else {
diff --git a/setup/pub/magento/setup/readiness-check.js b/setup/pub/magento/setup/readiness-check.js
index f2b8cf9e48c5f3a1e4cb63d86cdec1249756ab75..d150e2f5cb1376818e275bde259daa02961965f5 100644
--- a/setup/pub/magento/setup/readiness-check.js
+++ b/setup/pub/magento/setup/readiness-check.js
@@ -112,6 +112,7 @@ angular.module('readiness-check', [])
             'php-version': {
                 url:'index.php/environment/php-version',
                 params: $scope.actionFrom,
+                useGet: true,
                 show: function() {
                     $scope.startProgress();
                     $scope.version.visible = true;
@@ -129,6 +130,7 @@ angular.module('readiness-check', [])
             'php-settings': {
                 url:'index.php/environment/php-settings',
                 params: $scope.actionFrom,
+                useGet: true,
                 show: function() {
                     $scope.startProgress();
                     $scope.settings.visible = true;
@@ -146,6 +148,7 @@ angular.module('readiness-check', [])
             'php-extensions': {
                 url:'index.php/environment/php-extensions',
                 params: $scope.actionFrom,
+                useGet: true,
                 show: function() {
                     $scope.startProgress();
                     $scope.extensions.visible = true;
@@ -285,11 +288,25 @@ angular.module('readiness-check', [])
 
         $scope.query = function(item) {
             if (item.params) {
-                return $http.post(item.url, item.params)
-                    .success(function(data) { item.process(data) })
-                    .error(function(data, status) {
-                        item.fail();
-                    });
+                if (item.useGet === true) {
+                    // The http request type has been changed from POST to GET for a reason. The POST request
+                    // results in PHP throwing a warning regards to 'always_populate_raw_post_data'
+                    // being incorrectly set to a value different than -1. This warning is throw during the initial
+                    // boot up sequence when POST request is received before the control gets transferred over to
+                    // the Magento customer error handler, hence not catchable. To avoid that warning, the HTTP
+                    // request type is being changed from POST to GET for select queries. Those queries are:
+                    // (1) PHP Version Check (2) PHP Settings Check and (3) PHP Extensions Check.
+
+                    item.url = item.url + '?type=' + item.params;
+                } else {
+                    return $http.post(item.url, item.params)
+                        .success(function (data) {
+                            item.process(data)
+                        })
+                        .error(function (data, status) {
+                            item.fail();
+                        });
+                }
             }
             // setting 1 minute timeout to prevent system from timing out
             return $http.get(item.url, {timeout: 60000})
diff --git a/setup/src/Magento/Setup/Controller/Environment.php b/setup/src/Magento/Setup/Controller/Environment.php
index 57c8a509abadf2ca6ce2d64f69ebf397d56959b9..ac646bcbceff322156bef1fb5379352eaa22a0ff 100644
--- a/setup/src/Magento/Setup/Controller/Environment.php
+++ b/setup/src/Magento/Setup/Controller/Environment.php
@@ -111,7 +111,8 @@ class Environment extends AbstractActionController
      */
     public function phpVersionAction()
     {
-        $type = $this->getRequest()->getContent();
+        $type = $this->getRequest()->getQuery('type');
+
         $data = [];
         if ($type == ReadinessCheckInstaller::INSTALLER) {
             $data = $this->phpReadinessCheck->checkPhpVersion();
@@ -128,7 +129,8 @@ class Environment extends AbstractActionController
      */
     public function phpSettingsAction()
     {
-        $type = $this->getRequest()->getContent();
+        $type = $this->getRequest()->getQuery('type');
+
         $data = [];
         if ($type == ReadinessCheckInstaller::INSTALLER) {
             $data = $this->phpReadinessCheck->checkPhpSettings();
@@ -145,7 +147,8 @@ class Environment extends AbstractActionController
      */
     public function phpExtensionsAction()
     {
-        $type = $this->getRequest()->getContent();
+        $type = $this->getRequest()->getQuery('type');
+
         $data = [];
         if ($type == ReadinessCheckInstaller::INSTALLER) {
             $data = $this->phpReadinessCheck->checkPhpExtensions();
diff --git a/setup/src/Magento/Setup/Model/ConfigGenerator.php b/setup/src/Magento/Setup/Model/ConfigGenerator.php
index db1e6727b703f2bf7cae32b9c0c45007c21e80c9..812cbd1830a38c71f1bcfbebfcd2120915984e1e 100644
--- a/setup/src/Magento/Setup/Model/ConfigGenerator.php
+++ b/setup/src/Magento/Setup/Model/ConfigGenerator.php
@@ -98,7 +98,7 @@ class ConfigGenerator
             if ($currentKey === null) {
                 $configData->set(
                     ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY,
-                    md5($this->random->getRandomString(10))
+                    md5($this->random->getRandomString(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE))
                 );
             }
         }
diff --git a/setup/src/Magento/Setup/Model/PhpReadinessCheck.php b/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
index a7b0b923216b21fd50366d168fd32766356052eb..b6bed9a9d1cb26c3d5076c4a153884b4dbfc61b0 100644
--- a/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
+++ b/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
@@ -95,7 +95,8 @@ class PhpReadinessCheck
         $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS;
 
         $settings = array_merge(
-            $this->checkXDebugNestedLevel()
+            $this->checkXDebugNestedLevel(),
+            $this->checkPopulateRawPostSetting()
         );
 
         foreach ($settings as $setting) {
@@ -178,4 +179,47 @@ class PhpReadinessCheck
 
         return $data;
     }
+
+    /**
+     * Checks if PHP version >= 5.6.0 and always_populate_raw_post_data is set to -1
+     *
+     * Beginning PHP 7.0, support for 'always_populate_raw_post_data' is going to removed.
+     * And beginning PHP 5.6, a deprecated message is displayed if 'always_populate_raw_post_data'
+     * is set to a value other than -1.
+     *
+     * @return array
+     */
+    private function checkPopulateRawPostSetting()
+    {
+        // HHVM does not support 'always_populate_raw_post_data' to be set to -1
+        if (defined('HHVM_VERSION')) {
+            return [];
+        }
+
+        $data = [];
+        $error = false;
+        $iniSetting = intVal(ini_get('always_populate_raw_post_data'));
+
+        if (version_compare(PHP_VERSION, '5.6.0') >= 0 && $iniSetting !== -1) {
+            $error = true;
+        }
+
+        $message = sprintf(
+            'Your PHP Version is %s, but always_populate_raw_post_data = %d.
+ 	        $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will stop the installer from running.
+	        Please open your php.ini file and set always_populate_raw_post_data to -1.
+ 	        If you need more help please call your hosting provider.
+ 	        ',
+            PHP_VERSION,
+            intVal(ini_get('always_populate_raw_post_data'))
+        );
+
+        $data['always_populate_raw_post_data'] = [
+            'message' => $message,
+            'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
+            'error' => $error
+        ];
+
+        return $data;
+    }
 }
diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php
index fc3fee7684e9ea15f76998244ed84678e72ff947..e34be41d76be26d8f7976af10d205171b1968dd1 100644
--- a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php
@@ -109,8 +109,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
         $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent);
         $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent);
         $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
-        $content = ReadinessCheckInstaller::INSTALLER;
-        $request->expects($this->any())->method('getContent')->willReturn($content);
+        $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckInstaller::INSTALLER);
         $this->phpReadinessCheck->expects($this->once())->method('checkPhpVersion');
         $this->environment->setEvent($mvcEvent);
         $this->environment->dispatch($request, $response);
@@ -128,8 +127,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
         $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent);
         $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent);
         $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
-        $content = ReadinessCheckUpdater::UPDATER;
-        $request->expects($this->any())->method('getContent')->willReturn($content);
+        $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckUpdater::UPDATER);
         $this->phpReadinessCheck->expects($this->never())->method('checkPhpVersion');
         $read = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface', [], '', false);
         $this->filesystem->expects($this->once())->method('getDirectoryRead')->willReturn($read);
@@ -152,8 +150,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
         $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent);
         $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent);
         $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
-        $content = ReadinessCheckInstaller::INSTALLER;
-        $request->expects($this->any())->method('getContent')->willReturn($content);
+        $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckInstaller::INSTALLER);
         $this->phpReadinessCheck->expects($this->once())->method('checkPhpSettings');
         $this->environment->setEvent($mvcEvent);
         $this->environment->dispatch($request, $response);
@@ -171,8 +168,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
         $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent);
         $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent);
         $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
-        $content = ReadinessCheckUpdater::UPDATER;
-        $request->expects($this->any())->method('getContent')->willReturn($content);
+        $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckUpdater::UPDATER);
         $this->phpReadinessCheck->expects($this->never())->method('checkPhpSettings');
         $read = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface', [], '', false);
         $this->filesystem->expects($this->once())->method('getDirectoryRead')->willReturn($read);
@@ -195,8 +191,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
         $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent);
         $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent);
         $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
-        $content = ReadinessCheckInstaller::INSTALLER;
-        $request->expects($this->any())->method('getContent')->willReturn($content);
+        $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckInstaller::INSTALLER);
         $this->phpReadinessCheck->expects($this->once())->method('checkPhpExtensions');
         $this->environment->setEvent($mvcEvent);
         $this->environment->dispatch($request, $response);
@@ -214,8 +209,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
         $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent);
         $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent);
         $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
-        $content = ReadinessCheckUpdater::UPDATER;
-        $request->expects($this->any())->method('getContent')->willReturn($content);
+        $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckUpdater::UPDATER);
         $this->phpReadinessCheck->expects($this->never())->method('checkPhpExtensions');
         $read = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface', [], '', false);
         $this->filesystem->expects($this->once())->method('getDirectoryRead')->willReturn($read);
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
index 098e210824389a8848265a9d2b072d53fa24fd2d..0364f22e3b400003d81fd23651634da2bfd3e684 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
@@ -6,8 +6,8 @@
 
 namespace Magento\Setup\Test\Unit\Model;
 
-use Magento\Backend\Setup\ConfigOptionsList as BackendConfigOptionsList;
-use Magento\Framework\Config\ConfigOptionsListConstants as SetupConfigOptionsList;
+use Magento\Backend\Setup\ConfigOptionsList;
+use Magento\Framework\Config\ConfigOptionsListConstants;
 use \Magento\Setup\Model\Installer;
 use Magento\Framework\App\Filesystem\DirectoryList;
 use Magento\Framework\Filesystem\DriverPool;
@@ -137,10 +137,10 @@ class InstallerTest extends \PHPUnit_Framework_TestCase
      * @var array
      */
     private static $dbConfig = [
-        SetupConfigOptionsList::KEY_HOST => '127.0.0.1',
-        SetupConfigOptionsList::KEY_NAME => 'magento',
-        SetupConfigOptionsList::KEY_USER => 'magento',
-        SetupConfigOptionsList::KEY_PASSWORD => '',
+        ConfigOptionsListConstants::KEY_HOST => '127.0.0.1',
+        ConfigOptionsListConstants::KEY_NAME => 'magento',
+        ConfigOptionsListConstants::KEY_USER => 'magento',
+        ConfigOptionsListConstants::KEY_PASSWORD => '',
     ];
 
     /**
@@ -227,11 +227,11 @@ class InstallerTest extends \PHPUnit_Framework_TestCase
     public function testInstall()
     {
         $request = [
-            SetupConfigOptionsList::INPUT_KEY_DB_HOST => '127.0.0.1',
-            SetupConfigOptionsList::INPUT_KEY_DB_NAME => 'magento',
-            SetupConfigOptionsList::INPUT_KEY_DB_USER => 'magento',
-            SetupConfigOptionsList::INPUT_KEY_ENCRYPTION_KEY => 'encryption_key',
-            BackendConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'backend',
+            ConfigOptionsListConstants::INPUT_KEY_DB_HOST => '127.0.0.1',
+            ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'magento',
+            ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'magento',
+            ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY => 'encryption_key',
+            ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'backend',
         ];
         $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
         $allModules = ['Foo_One' => [], 'Bar_Two' => []];
@@ -436,7 +436,7 @@ class InstallerTest extends \PHPUnit_Framework_TestCase
         $this->config->expects($this->once())->method('isAvailable')->willReturn(true);
         $this->config->expects($this->once())
             ->method('get')
-            ->with(SetupConfigOptionsList::CONFIG_PATH_DB_CONNECTION_DEFAULT)
+            ->with(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT)
             ->willReturn(self::$dbConfig);
         $this->connection->expects($this->at(0))->method('quoteIdentifier')->with('magento')->willReturn('`magento`');
         $this->connection->expects($this->at(1))->method('query')->with('DROP DATABASE IF EXISTS `magento`');
@@ -489,3 +489,15 @@ class InstallerTest extends \PHPUnit_Framework_TestCase
         return $newObject;
     }
 }
+
+namespace Magento\Setup\Model;
+
+/**
+ * Mocking autoload function
+ * 
+ * @returns array
+ */
+function spl_autoload_functions()
+{
+    return ['mock_function_one', 'mock_function_two'];
+}
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php
index 26289d9ba52fe368db84c326610dce05891f0974..3080faf35d90ba555a310f1079c3209c90081cda 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php
@@ -179,19 +179,32 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
     {
         $this->phpInfo->expects($this->once())->method('getCurrent')->willReturn(['xdebug']);
         $this->phpInfo->expects($this->once())->method('getRequiredMinimumXDebugNestedLevel')->willReturn(50);
-        $message = sprintf(
+        $xdebugMessage = sprintf(
             'Your current setting of xdebug.max_nesting_level=%d.
                  Magento 2 requires it to be set to %d or more.
                  Edit your config, restart web server, and try again.',
             100,
             50
         );
+        $rawPostMessage = sprintf(
+            'Your PHP Version is %s, but always_populate_raw_post_data = -1.
+ 	        $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will stop the installer from running.
+	        Please open your php.ini file and set always_populate_raw_post_data to -1.
+ 	        If you need more help please call your hosting provider.
+ 	        ',
+            PHP_VERSION
+        );
         $expected = [
             'responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS,
             'data' => [
                 'xdebug_max_nesting_level' => [
-                    'message' => $message,
+                    'message' => $xdebugMessage,
                     'error' => false,
+                ],
+                'always_populate_raw_post_data' => [
+                    'message' => $rawPostMessage,
+                    'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
+                    'error' => false
                 ]
             ]
         ];
@@ -202,19 +215,32 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
     {
         $this->phpInfo->expects($this->once())->method('getCurrent')->willReturn(['xdebug']);
         $this->phpInfo->expects($this->once())->method('getRequiredMinimumXDebugNestedLevel')->willReturn(200);
-        $message = sprintf(
+        $xdebugMessage = sprintf(
             'Your current setting of xdebug.max_nesting_level=%d.
                  Magento 2 requires it to be set to %d or more.
                  Edit your config, restart web server, and try again.',
             100,
             200
         );
+        $rawPostMessage = sprintf(
+            'Your PHP Version is %s, but always_populate_raw_post_data = -1.
+ 	        $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will stop the installer from running.
+	        Please open your php.ini file and set always_populate_raw_post_data to -1.
+ 	        If you need more help please call your hosting provider.
+ 	        ',
+            PHP_VERSION
+        );
         $expected = [
             'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR,
             'data' => [
                 'xdebug_max_nesting_level' => [
-                    'message' => $message,
+                    'message' => $xdebugMessage,
                     'error' => true,
+                ],
+                'always_populate_raw_post_data' => [
+                    'message' => $rawPostMessage,
+                    'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
+                    'error' => false
                 ]
             ]
         ];
@@ -224,7 +250,24 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
     public function testCheckPhpSettingsNoXDebug()
     {
         $this->phpInfo->expects($this->once())->method('getCurrent')->willReturn([]);
-        $expected = ['responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, 'data' => []];
+        $rawPostMessage = sprintf(
+            'Your PHP Version is %s, but always_populate_raw_post_data = -1.
+ 	        $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will stop the installer from running.
+	        Please open your php.ini file and set always_populate_raw_post_data to -1.
+ 	        If you need more help please call your hosting provider.
+ 	        ',
+            PHP_VERSION
+        );
+        $expected = [
+            'responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS,
+            'data' => [
+                'always_populate_raw_post_data' => [
+                    'message' => $rawPostMessage,
+                    'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
+                    'error' => false
+                ]
+            ]
+        ];
         $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings());
     }
 
@@ -282,7 +325,11 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
 
 namespace Magento\Setup\Model;
 
-function ini_get()
+function ini_get($param)
 {
-    return 100;
+    if ($param === 'xdebug.max_nesting_level') {
+        return 100;
+    } elseif ($param === 'always_populate_raw_post_data') {
+        return -1;
+    }
 }
diff --git a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php
index 3f833f10a80e6aa2d6abc5c987659cdf919f437f..ad7f8285196d29543b94473189461b93aa6adb02 100644
--- a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php
@@ -46,9 +46,31 @@ class DbValidatorTest extends \PHPUnit_Framework_TestCase
         $this->connection
             ->expects($this->atLeastOnce())
             ->method('query')
-            ->with('SHOW GRANTS FOR current_user()')
             ->willReturn($pdo);
-        $pdo->expects($this->once())->method('fetchAll')->willReturn([['GRANT ALL PRIVILEGES ON `name.*` TO']]);
+        $pdo->expects($this->once())
+            ->method('fetchAll')
+            ->willReturn(
+                [
+                    ['SELECT'],
+                    ['INSERT'],
+                    ['UPDATE'],
+                    ['DELETE'],
+                    ['CREATE'],
+                    ['DROP'],
+                    ['REFERENCES'],
+                    ['INDEX'],
+                    ['ALTER'],
+                    ['CREATE TEMPORARY TABLES'],
+                    ['LOCK TABLES'],
+                    ['EXECUTE'],
+                    ['CREATE VIEW'],
+                    ['SHOW VIEW'],
+                    ['CREATE ROUTINE'],
+                    ['ALTER ROUTINE'],
+                    ['EVENT'],
+                    ['TRIGGER'],
+                ]
+            );
         $this->assertEquals(true, $this->dbValidator->checkDatabaseConnection('name', 'host', 'user', 'password'));
     }
 
@@ -65,11 +87,10 @@ class DbValidatorTest extends \PHPUnit_Framework_TestCase
             ->willReturn('5.6.0-0ubuntu0.12.04.1');
         $pdo = $this->getMockForAbstractClass('Zend_Db_Statement_Interface', [], '', false);
         $this->connection
-            ->expects($this->once())
+            ->expects($this->atLeastOnce())
             ->method('query')
-            ->with('SHOW GRANTS FOR current_user()')
             ->willReturn($pdo);
-        $pdo->expects($this->once())->method('fetchAll')->willReturn([['GRANT SELECT ON *.* TO']]);
+        $pdo->expects($this->atLeastOnce())->method('fetchAll')->willReturn([['SELECT']]);
         $this->dbValidator->checkDatabaseConnection('name', 'host', 'user', 'password');
     }
 
diff --git a/setup/src/Magento/Setup/Validator/DbValidator.php b/setup/src/Magento/Setup/Validator/DbValidator.php
index 1470ecf6c1814942d3656971f854fa7fc40161ef..e7b7aea7f0bf02bd6058d1811ddce51fe2ec24f6 100644
--- a/setup/src/Magento/Setup/Validator/DbValidator.php
+++ b/setup/src/Magento/Setup/Validator/DbValidator.php
@@ -62,8 +62,9 @@ class DbValidator
      */
     public function checkDatabaseConnection($dbName, $dbHost, $dbUser, $dbPass = '')
     {
+        // establish connection to information_schema view to retrieve information about user and table privileges
         $connection = $this->connectionFactory->create([
-            ConfigOptionsListConstants::KEY_NAME => $dbName,
+            ConfigOptionsListConstants::KEY_NAME => 'information_schema',
             ConfigOptionsListConstants::KEY_HOST => $dbHost,
             ConfigOptionsListConstants::KEY_USER => $dbUser,
             ConfigOptionsListConstants::KEY_PASSWORD => $dbPass,
@@ -86,6 +87,7 @@ class DbValidator
                 }
             }
         }
+
         return $this->checkDatabasePrivileges($connection, $dbName);
     }
 
@@ -99,12 +101,60 @@ class DbValidator
      */
     private function checkDatabasePrivileges(\Magento\Framework\DB\Adapter\AdapterInterface $connection, $dbName)
     {
-        $grantInfo = $connection->query('SHOW GRANTS FOR current_user()')->fetchAll(\PDO::FETCH_NUM);
+        $requiredPrivileges = [
+            'SELECT',
+            'INSERT',
+            'UPDATE',
+            'DELETE',
+            'CREATE',
+            'DROP',
+            'REFERENCES',
+            'INDEX',
+            'ALTER',
+            'CREATE TEMPORARY TABLES',
+            'LOCK TABLES',
+            'EXECUTE',
+            'CREATE VIEW',
+            'SHOW VIEW',
+            'CREATE ROUTINE',
+            'ALTER ROUTINE',
+            'EVENT',
+            'TRIGGER'
+        ];
+
+        // check global privileges
+        $userPrivilegesQuery = "SELECT PRIVILEGE_TYPE FROM USER_PRIVILEGES "
+            . "WHERE REPLACE(GRANTEE, '\'', '') = current_user()";
+        $grantInfo = $connection->query($userPrivilegesQuery)->fetchAll(\PDO::FETCH_NUM);
+        if (empty(array_diff($requiredPrivileges, $this->parseGrantInfo($grantInfo)))) {
+            return true;
+        }
+
+        // check table privileges
+        $schemaPrivilegesQuery = "SELECT PRIVILEGE_TYPE FROM SCHEMA_PRIVILEGES " .
+            "WHERE '$dbName' LIKE TABLE_SCHEMA AND REPLACE(GRANTEE, '\'', '') = current_user()";
+        $grantInfo = $connection->query($schemaPrivilegesQuery)->fetchAll(\PDO::FETCH_NUM);
+        if (empty(array_diff($requiredPrivileges, $this->parseGrantInfo($grantInfo)))) {
+            return true;
+        }
+
+        $errorMessage = 'Database user does not have enough privileges. Please make sure '
+            . implode(', ', $requiredPrivileges) . " privileges are granted to table '$dbName'.";
+        throw new \Magento\Setup\Exception($errorMessage);
+    }
+
+    /**
+     * Parses query result
+     *
+     * @param array $grantInfo
+     * @return array
+     */
+    private function parseGrantInfo(array $grantInfo)
+    {
+        $result = [];
         foreach ($grantInfo as $grantRow) {
-            if (preg_match('/(ALL|ALL\sPRIVILEGES)\sON\s[^a-zA-Z\d\s]?(\*|' . $dbName .  ')/', $grantRow[0]) === 1) {
-                return true;
-            }
+            $result[] = $grantRow[0];
         }
-        throw new \Magento\Setup\Exception('Database user does not have enough privileges.');
+        return $result;
     }
 }
diff --git a/setup/view/magento/setup/create-admin-account.phtml b/setup/view/magento/setup/create-admin-account.phtml
index 379974ec0c6698b8d8641ff73f4f0cc377ee9b80..fa58a132d6de365ea907f8abc44a3c39b8bac666 100644
--- a/setup/view/magento/setup/create-admin-account.phtml
+++ b/setup/view/magento/setup/create-admin-account.phtml
@@ -19,7 +19,7 @@ $passwordWizard = sprintf(
         </div>
     <p>%s</p>',
     'Password Strength:',
-    'Enter a mix of 6 or more numbers and letters. For a stronger password, include at least one small letter, big letter, and symbol (Ex: BuyIt$54).'
+    'Enter a mix of 7 or more numbers and letters. For a stronger password, include at least one small letter, big letter, and symbol (Ex: BuyIt$54).'
 );
 ?>
 
@@ -146,7 +146,7 @@ $passwordWizard = sprintf(
                 >
             <div class="error-container">
                 <span ng-show="account.adminPassword.$error.checkPassword">
-                    Please enter a mix of at least 6 alpha-numeric characters.
+                    Please enter a mix of at least 7 alpha-numeric characters.
                 </span>
                 <span ng-show="account.adminPassword.$error.required">
                     Please enter your new password.
diff --git a/setup/view/magento/setup/readiness-check/progress.phtml b/setup/view/magento/setup/readiness-check/progress.phtml
index 964f9c403e472b31c115fbd5d30da479b40382e3..53ca61521c556249a18ffa14ec85d6e5b90bfeb4 100755
--- a/setup/view/magento/setup/readiness-check/progress.phtml
+++ b/setup/view/magento/setup/readiness-check/progress.phtml
@@ -285,7 +285,7 @@
                 </div>
 
                 <p ng-show="componentDependency.expanded">For additional assistance, see
-                    <a href="http://devdocs.magento.com/guides/v2.0/install-gde/trouble/trouble/php/tshoot_php-set.html"
+                    <a href="http://devdocs.magento.com/guides/v2.0/install-gde/trouble/php/tshoot_php-set.html"
                        target="_blank">PHP settings check help
                     </a>.
                 </p>