diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php index 656998113fdb92e50e5177db4876651cfcd2023a..b4293a39895850fb349a6232e0c5b95fc1dfa50f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php @@ -11,6 +11,8 @@ use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Eav\Model\Config; use Magento\Framework\DB\Select; use Magento\Framework\EntityManager\MetadataPool; +use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\Store; /** * Class StatusBaseSelectProcessor @@ -27,16 +29,24 @@ class StatusBaseSelectProcessor implements BaseSelectProcessorInterface */ private $metadataPool; + /** + * @var StoreResolverInterface + */ + private $storeResolver; + /** * @param Config $eavConfig * @param MetadataPool $metadataPool + * @param StoreResolverInterface $storeResolver */ public function __construct( Config $eavConfig, - MetadataPool $metadataPool + MetadataPool $metadataPool, + StoreResolverInterface $storeResolver ) { $this->eavConfig = $eavConfig; $this->metadataPool = $metadataPool; + $this->storeResolver = $storeResolver; } /** @@ -48,13 +58,23 @@ class StatusBaseSelectProcessor implements BaseSelectProcessorInterface $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); $statusAttribute = $this->eavConfig->getAttribute(Product::ENTITY, ProductInterface::STATUS); - $select->join( + $select->joinLeft( + ['status_global_attr' => $statusAttribute->getBackendTable()], + "status_global_attr.{$linkField} = " . self::PRODUCT_TABLE_ALIAS . ".{$linkField}" + . ' AND status_global_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId() + . ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID, + [] + ); + + $select->joinLeft( ['status_attr' => $statusAttribute->getBackendTable()], - sprintf('status_attr.%s = %s.%1$s', $linkField, self::PRODUCT_TABLE_ALIAS), + "status_attr.{$linkField} = " . self::PRODUCT_TABLE_ALIAS . ".{$linkField}" + . ' AND status_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId() + . ' AND status_attr.store_id = ' . $this->storeResolver->getCurrentStoreId(), [] - ) - ->where('status_attr.attribute_id = ?', $statusAttribute->getAttributeId()) - ->where('status_attr.value = ?', Status::STATUS_ENABLED); + ); + + $select->where('IFNULL(status_attr.value, status_global_attr.value) = ?', Status::STATUS_ENABLED); return $select; } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/StatusBaseSelectProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/StatusBaseSelectProcessorTest.php index 0909f754a01c2c937e8c3692c52b1a256a27b0c3..1fada997913b620de06ddedcbffb3fdcdea92620 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/StatusBaseSelectProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/StatusBaseSelectProcessorTest.php @@ -16,7 +16,12 @@ use Magento\Framework\DB\Select; use Magento\Framework\EntityManager\EntityMetadataInterface; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\Store; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class StatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase { /** @@ -29,6 +34,11 @@ class StatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase */ private $metadataPool; + /** + * @var StoreResolverInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $storeResolver; + /** * @var Select|\PHPUnit_Framework_MockObject_MockObject */ @@ -43,11 +53,13 @@ class StatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase { $this->eavConfig = $this->getMockBuilder(Config::class)->disableOriginalConstructor()->getMock(); $this->metadataPool = $this->getMockBuilder(MetadataPool::class)->disableOriginalConstructor()->getMock(); + $this->storeResolver = $this->getMockBuilder(StoreResolverInterface::class)->getMock(); $this->select = $this->getMockBuilder(Select::class)->disableOriginalConstructor()->getMock(); $this->statusBaseSelectProcessor = (new ObjectManager($this))->getObject(StatusBaseSelectProcessor::class, [ 'eavConfig' => $this->eavConfig, 'metadataPool' => $this->metadataPool, + 'storeResolver' => $this->storeResolver, ]); } @@ -55,7 +67,8 @@ class StatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase { $linkField = 'link_field'; $backendTable = 'backend_table'; - $attributeId = 'attribute_id'; + $attributeId = 2; + $currentStoreId = 1; $metadata = $this->getMock(EntityMetadataInterface::class); $metadata->expects($this->once()) @@ -66,13 +79,14 @@ class StatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase ->with(ProductInterface::class) ->willReturn($metadata); + /** @var AttributeInterface|\PHPUnit_Framework_MockObject_MockObject $statusAttribute */ $statusAttribute = $this->getMockBuilder(AttributeInterface::class) ->setMethods(['getBackendTable', 'getAttributeId']) ->getMock(); - $statusAttribute->expects($this->once()) + $statusAttribute->expects($this->atLeastOnce()) ->method('getBackendTable') ->willReturn($backendTable); - $statusAttribute->expects($this->once()) + $statusAttribute->expects($this->atLeastOnce()) ->method('getAttributeId') ->willReturn($attributeId); $this->eavConfig->expects($this->once()) @@ -80,21 +94,34 @@ class StatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase ->with(Product::ENTITY, ProductInterface::STATUS) ->willReturn($statusAttribute); - $this->select->expects($this->once()) - ->method('join') + $this->storeResolver->expects($this->once()) + ->method('getCurrentStoreId') + ->willReturn($currentStoreId); + + $this->select->expects($this->at(0)) + ->method('joinLeft') ->with( - ['status_attr' => $backendTable], - sprintf('status_attr.%s = %s.%1$s', $linkField, BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS), + ['status_global_attr' => $backendTable], + "status_global_attr.{$linkField} = " + . BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . ".{$linkField}" + . " AND status_global_attr.attribute_id = {$attributeId}" + . ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID, [] ) ->willReturnSelf(); $this->select->expects($this->at(1)) - ->method('where') - ->with('status_attr.attribute_id = ?', $attributeId) + ->method('joinLeft') + ->with( + ['status_attr' => $backendTable], + "status_attr.{$linkField} = " . BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . ".{$linkField}" + . " AND status_attr.attribute_id = {$attributeId}" + . " AND status_attr.store_id = {$currentStoreId}", + [] + ) ->willReturnSelf(); $this->select->expects($this->at(2)) ->method('where') - ->with('status_attr.value = ?', Status::STATUS_ENABLED) + ->with('IFNULL(status_attr.value, status_global_attr.value) = ?', Status::STATUS_ENABLED) ->willReturnSelf(); $this->assertEquals($this->select, $this->statusBaseSelectProcessor->process($this->select)); diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html index ed7ad193a12fde35dd2226afdf11f1233887afd8..498a9f852d06be2cc5787091aca7b641b7a45e8a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html @@ -4,8 +4,7 @@ * See COPYING.txt for license details. */ --> -<!-- ko ifnot: isItemsBlockExpanded() --> -<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active'}}"> +<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': isItemsBlockExpanded()}}"> <div class="title" data-role="title"> <strong role="heading"><span data-bind="text: getItemsQty()"></span> <!-- ko if: getItemsQty() == 1 --> @@ -32,33 +31,3 @@ </div> </div> </div> -<!-- /ko --> -<!-- ko if: isItemsBlockExpanded() --> -<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': true}}"> - <div class="title" data-role="title"> - <strong role="heading"><span data-bind="text: getItemsQty()"></span> - <!-- ko if: getItemsQty() == 1 --> - <!-- ko i18n: 'Item in Cart' --><!-- /ko --> - <!-- /ko --> - <!-- ko if: getItemsQty() > 1 --> - <!-- ko i18n: 'Items in Cart' --><!-- /ko --> - <!-- /ko --> - </strong> - </div> - <div class="content minicart-items" data-role="content"> - <div class="minicart-items-wrapper overflowed"> - <ol class="minicart-items"> - <!-- ko foreach: getItems() --> - <li class="product-item"> - <div class="product"> - <!-- ko foreach: $parent.elems() --> - <!-- ko template: getTemplate() --><!-- /ko --> - <!-- /ko --> - </div> - </li> - <!-- /ko --> - </ol> - </div> - </div> -</div> -<!-- /ko --> diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php index fbb69798ff94fbdf8caafc7486e564da662cf655..ed4863342a9670699fd544b7c7838697dd06eef7 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php @@ -9,9 +9,45 @@ namespace Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\Store; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Configurable extends \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice { + /** + * @var StoreResolverInterface + */ + private $storeResolver; + + /** + * Class constructor + * + * @param \Magento\Framework\Model\ResourceModel\Db\Context $context + * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\Framework\Module\Manager $moduleManager + * @param string $connectionName + * @param StoreResolverInterface $storeResolver + */ + public function __construct( + \Magento\Framework\Model\ResourceModel\Db\Context $context, + \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy, + \Magento\Eav\Model\Config $eavConfig, + \Magento\Framework\Event\ManagerInterface $eventManager, + \Magento\Framework\Module\Manager $moduleManager, + $connectionName = null, + StoreResolverInterface $storeResolver = null + ) { + parent::__construct($context, $tableStrategy, $eavConfig, $eventManager, $moduleManager, $connectionName); + $this->storeResolver = $storeResolver ?: + \Magento\Framework\App\ObjectManager::getInstance()->get(StoreResolverInterface::class); + } + /** * Reindex temporary (price result data) for all products * @@ -190,16 +226,21 @@ class Configurable extends \Magento\Catalog\Model\ResourceModel\Product\Indexer\ [] )->where( 'le.required_options=0' - )->join( - ['product_status' => $this->getTable($statusAttribute->getBackend()->getTable())], - sprintf( - 'le.%1$s = product_status.%1$s AND product_status.attribute_id = %2$s', - $linkField, - $statusAttribute->getAttributeId() - ), + )->joinLeft( + ['status_global_attr' => $statusAttribute->getBackendTable()], + "status_global_attr.{$linkField} = le.{$linkField}" + . ' AND status_global_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId() + . ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID, + [] + )->joinLeft( + ['status_attr' => $statusAttribute->getBackendTable()], + "status_attr.{$linkField} = le.{$linkField}" + . ' AND status_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId() + . ' AND status_attr.store_id = ' . $this->storeResolver->getCurrentStoreId(), [] )->where( - 'product_status.value=' . ProductStatus::STATUS_ENABLED + 'IFNULL(status_attr.value, status_global_attr.value) = ?', + Status::STATUS_ENABLED )->group( ['e.entity_id', 'i.customer_group_id', 'i.website_id', 'l.product_id'] ); diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index 7b32da94ddedb476eda579521c1a19c002618ec4..786c5f9770a2e56123983c7b82c63ea369bec0a4 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -554,6 +554,8 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt /** * Validate address attribute values * + * + * * @return bool|array * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -562,23 +564,24 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt { $errors = []; if (!\Zend_Validate::is($this->getFirstname(), 'NotEmpty')) { - $errors[] = __('Please enter the first name.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'firstname']); } if (!\Zend_Validate::is($this->getLastname(), 'NotEmpty')) { - $errors[] = __('Please enter the last name.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'lastname']); } if (!\Zend_Validate::is($this->getStreetLine(1), 'NotEmpty')) { - $errors[] = __('Please enter the street.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'street']); } if (!\Zend_Validate::is($this->getCity(), 'NotEmpty')) { - $errors[] = __('Please enter the city.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'city']); } if (!\Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { - $errors[] = __('Please enter the phone number.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'telephone']); + } $_havingOptionalZip = $this->_directoryData->getCountriesWithOptionalZip(); @@ -590,11 +593,11 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt 'NotEmpty' ) ) { - $errors[] = __('Please enter the zip/postal code.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'postcode']); } if (!\Zend_Validate::is($this->getCountryId(), 'NotEmpty')) { - $errors[] = __('Please enter the country.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'countryId']); } if ($this->getCountryModel()->getRegionCollection()->getSize() && !\Zend_Validate::is( @@ -604,7 +607,7 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt $this->getCountryId() ) ) { - $errors[] = __('Please enter the state/province.'); + $errors[] = __('%fieldName is a required field.', ['fieldName' => 'regionId']); } if (empty($errors) || $this->getShouldIgnoreValidation()) { diff --git a/app/code/Magento/Customer/Model/ResourceModel/AddressRepository.php b/app/code/Magento/Customer/Model/ResourceModel/AddressRepository.php index 67d4ea32369ba8a37fef329d2aec809037fcac75..24df57e07e84826dcd7a19cdd84e5e6ca70ac37c 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/AddressRepository.php +++ b/app/code/Magento/Customer/Model/ResourceModel/AddressRepository.php @@ -124,8 +124,12 @@ class AddressRepository implements \Magento\Customer\Api\AddressRepositoryInterf $addressModel->updateData($address); } - $inputException = $this->_validate($addressModel); - if ($inputException->wasErrorAdded()) { + $errors = $addressModel->validate(); + if ($errors !== true) { + $inputException = new InputException(); + foreach ($errors as $error) { + $inputException->addError($error); + } throw $inputException; } $addressModel->save(); @@ -255,70 +259,6 @@ class AddressRepository implements \Magento\Customer\Api\AddressRepositoryInterf return true; } - /** - * Validate Customer Addresses attribute values. - * - * @param CustomerAddressModel $customerAddressModel the model to validate - * @return InputException - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - private function _validate(CustomerAddressModel $customerAddressModel) - { - $exception = new InputException(); - if ($customerAddressModel->getShouldIgnoreValidation()) { - return $exception; - } - - if (!\Zend_Validate::is($customerAddressModel->getFirstname(), 'NotEmpty')) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'firstname'])); - } - - if (!\Zend_Validate::is($customerAddressModel->getLastname(), 'NotEmpty')) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'lastname'])); - } - - if (!\Zend_Validate::is($customerAddressModel->getStreetLine(1), 'NotEmpty')) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'street'])); - } - - if (!\Zend_Validate::is($customerAddressModel->getCity(), 'NotEmpty')) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'city'])); - } - - if (!\Zend_Validate::is($customerAddressModel->getTelephone(), 'NotEmpty')) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'telephone'])); - } - - $havingOptionalZip = $this->directoryData->getCountriesWithOptionalZip(); - if (!in_array($customerAddressModel->getCountryId(), $havingOptionalZip) - && !\Zend_Validate::is($customerAddressModel->getPostcode(), 'NotEmpty') - ) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'postcode'])); - } - - if (!\Zend_Validate::is($customerAddressModel->getCountryId(), 'NotEmpty')) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'countryId'])); - } - - if ($this->directoryData->isRegionRequired($customerAddressModel->getCountryId())) { - $regionCollection = $customerAddressModel->getCountryModel()->getRegionCollection(); - if (!$regionCollection->count() && empty($customerAddressModel->getRegion())) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'region'])); - } elseif ( - $regionCollection->count() - && !in_array( - $customerAddressModel->getRegionId(), - array_column($regionCollection->getData(), 'region_id') - ) - ) { - $exception->addError(__('%fieldName is a required field.', ['fieldName' => 'regionId'])); - } - } - return $exception; - } - /** * Retrieve collection processor * diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php index 32112ccdeb1aec053955226a49eb1838f8c4276b..ba833221aba18cb2b4f2b1e90a9c8b59d78327f5 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php @@ -336,31 +336,31 @@ class AbstractAddressTest extends \PHPUnit_Framework_TestCase return [ 'firstname' => [ array_merge(array_diff_key($data, ['firstname' => '']), ['country_id' => $countryId++]), - ['Please enter the first name.'], + ['firstname is a required field.'], ], 'lastname' => [ array_merge(array_diff_key($data, ['lastname' => '']), ['country_id' => $countryId++]), - ['Please enter the last name.'], + ['lastname is a required field.'], ], 'street' => [ array_merge(array_diff_key($data, ['street' => '']), ['country_id' => $countryId++]), - ['Please enter the street.'], + ['street is a required field.'], ], 'city' => [ array_merge(array_diff_key($data, ['city' => '']), ['country_id' => $countryId++]), - ['Please enter the city.'], + ['city is a required field.'], ], 'telephone' => [ array_merge(array_diff_key($data, ['telephone' => '']), ['country_id' => $countryId++]), - ['Please enter the phone number.'], + ['telephone is a required field.'], ], 'postcode' => [ array_merge(array_diff_key($data, ['postcode' => '']), ['country_id' => $countryId++]), - ['Please enter the zip/postal code.'], + ['postcode is a required field.'], ], 'country_id' => [ array_diff_key($data, ['country_id' => '']), - ['Please enter the country.'], + ['countryId is a required field.'], ], 'validated' => [array_merge($data, ['country_id' => $countryId++]), true], ]; diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php index b72a5f6a417d4ab77d2c025e1f43b6e58f72ccc2..5f6bc315acd16f6a79d82c5ee2566e240c6572a6 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php @@ -128,6 +128,7 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase 'setCustomer', 'getCountryModel', 'getShouldIgnoreValidation', + 'validate', 'save', 'getDataModel', 'getCustomerId', @@ -191,6 +192,9 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase $this->address->expects($this->once()) ->method('setCustomer') ->with($this->customer); + $this->address->expects($this->once()) + ->method('validate') + ->willReturn(true); $this->address->expects($this->once()) ->method('save'); $this->addressRegistry->expects($this->once()) @@ -208,9 +212,6 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase $this->address->expects($this->once()) ->method('getDataModel') ->willReturn($customerAddress); - $this->address->expects($this->once()) - ->method('getShouldIgnoreValidation') - ->willReturn(true); $this->repository->save($customerAddress); } @@ -222,6 +223,7 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase { $customerId = 34; $addressId = 53; + $errors[] = __('Please enter the state/province.'); $customerAddress = $this->getMockForAbstractClass( \Magento\Customer\Api\Data\AddressInterface::class, [], @@ -245,7 +247,9 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase $this->address->expects($this->once()) ->method('updateData') ->with($customerAddress); - $this->prepareMocksForInvalidAddressValidation(); + $this->address->expects($this->once()) + ->method('validate') + ->willReturn($errors); $this->repository->save($customerAddress); } @@ -258,6 +262,7 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase { $customerId = 34; $addressId = 53; + $errors[] = __('region is a required field.'); $customerAddress = $this->getMockForAbstractClass( \Magento\Customer\Api\Data\AddressInterface::class, [], @@ -281,60 +286,13 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase $this->address->expects($this->once()) ->method('updateData') ->with($customerAddress); - $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); - $regionCollection = $this->getMock( - \Magento\Directory\Model\ResourceModel\Region\Collection::class, - [], - [], - '', - false - ); - $this->address->expects($this->once()) - ->method('getShouldIgnoreValidation') - ->willReturn(false); - $this->address->expects($this->atLeastOnce()) - ->method('getCountryId') - ->willReturn(1); - $this->address->expects($this->once()) - ->method('getFirstname') - ->willReturn('firstname'); - $this->address->expects($this->once()) - ->method('getLastname') - ->willReturn('lastname'); - $this->address->expects($this->once()) - ->method('getStreetLine') - ->with(1) - ->willReturn('street line'); - $this->address->expects($this->once()) - ->method('getCity') - ->willReturn('city'); - $this->address->expects($this->once()) - ->method('getTelephone') - ->willReturn('23423423423'); $this->address->expects($this->never()) ->method('getRegionId') ->willReturn(null); - - $this->directoryData->expects($this->once()) - ->method('getCountriesWithOptionalZip') - ->willReturn([1]); - $this->address->expects($this->once()) - ->method('getCountryModel') - ->willReturn($countryModel); - $countryModel->expects($this->once()) - ->method('getRegionCollection') - ->willReturn($regionCollection); - $regionCollection->expects($this->once()) - ->method('count') - ->willReturn(0); - $this->directoryData->expects($this->once()) - ->method('isRegionRequired') - ->with(1) - ->willReturn(true); $this->address->expects($this->once()) - ->method('getRegion') - ->willReturn(''); + ->method('validate') + ->willReturn($errors); $this->repository->save($customerAddress); } @@ -347,6 +305,7 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase { $customerId = 34; $addressId = 53; + $errors[] = __('regionId is a required field.'); $customerAddress = $this->getMockForAbstractClass( \Magento\Customer\Api\Data\AddressInterface::class, [], @@ -370,114 +329,14 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase $this->address->expects($this->once()) ->method('updateData') ->with($customerAddress); - $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); - $regionCollection = $this->getMock( - \Magento\Directory\Model\ResourceModel\Region\Collection::class, - [], - [], - '', - false - ); - - $this->address->expects($this->once()) - ->method('getShouldIgnoreValidation') - ->willReturn(false); - $this->address->expects($this->atLeastOnce()) - ->method('getCountryId') - ->willReturn(1); - $this->address->expects($this->once()) - ->method('getFirstname') - ->willReturn('firstname'); - $this->address->expects($this->once()) - ->method('getLastname') - ->willReturn('lastname'); - $this->address->expects($this->once()) - ->method('getStreetLine') - ->with(1) - ->willReturn('street line'); - $this->address->expects($this->once()) - ->method('getCity') - ->willReturn('city'); - $this->address->expects($this->once()) - ->method('getTelephone') - ->willReturn('23423423423'); - $this->address->expects($this->once()) - ->method('getRegionId') - ->willReturn(2); - - $this->directoryData->expects($this->once()) - ->method('getCountriesWithOptionalZip') - ->willReturn([1]); - $this->address->expects($this->once()) - ->method('getCountryModel') - ->willReturn($countryModel); - $countryModel->expects($this->once()) - ->method('getRegionCollection') - ->willReturn($regionCollection); - $regionCollection->expects($this->atLeastOnce()) - ->method('count') - ->willReturn(2); - $regionCollection->expects($this->once()) - ->method('getData') - ->willReturn([5, 6, 7, 8, 9]); - $this->directoryData->expects($this->once()) - ->method('isRegionRequired') - ->with(1) - ->willReturn(true); $this->address->expects($this->never()) ->method('getRegion') ->willReturn(''); - - $this->repository->save($customerAddress); - } - - protected function prepareMocksForInvalidAddressValidation() - { - $countryModel = $this->getMock(\Magento\Directory\Model\Country::class, [], [], '', false); - $regionCollection = $this->getMock( - \Magento\Directory\Model\ResourceModel\Region\Collection::class, - [], - [], - '', - false - ); - - $this->address->expects($this->once()) - ->method('getShouldIgnoreValidation') - ->willReturn(false); - $this->address->expects($this->atLeastOnce()) - ->method('getCountryId'); - $this->address->expects($this->once()) - ->method('getFirstname'); - $this->address->expects($this->once()) - ->method('getLastname'); - $this->address->expects($this->once()) - ->method('getStreetLine') - ->with(1); $this->address->expects($this->once()) - ->method('getCity'); - $this->address->expects($this->once()) - ->method('getTelephone'); - $this->address->expects($this->never()) - ->method('getRegionId') - ->willReturn(null); + ->method('validate') + ->willReturn($errors); - $this->directoryData->expects($this->once()) - ->method('getCountriesWithOptionalZip') - ->willReturn([]); - $this->address->expects($this->once()) - ->method('getCountryModel') - ->willReturn($countryModel); - $countryModel->expects($this->once()) - ->method('getRegionCollection') - ->willReturn($regionCollection); - $regionCollection->expects($this->once()) - ->method('count') - ->willReturn(0); - $this->directoryData->expects($this->once()) - ->method('isRegionRequired') - ->with(null) - ->willReturn(true); + $this->repository->save($customerAddress); } public function testGetById() diff --git a/app/code/Magento/Review/etc/di.xml b/app/code/Magento/Review/etc/di.xml index d42d3e3330c670bce2c036cf8b100842f10a0a48..13f7d0b84bc505bb1fd66c9e16e36e75367219e2 100644 --- a/app/code/Magento/Review/etc/di.xml +++ b/app/code/Magento/Review/etc/di.xml @@ -26,4 +26,9 @@ <argument name="urlModel" xsi:type="object">Magento\Framework\Url</argument> </arguments> </type> + <type name="Magento\Review\Model\ResourceModel\Rating\Option"> + <arguments> + <argument name="customerSession" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index c1d2fd3f910518ddcf15ae50122db3e5f30cd098..cd9794dc1757d4cfa5f092209ad8515557e42a4a 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -259,6 +259,9 @@ define([ // whether swatches are rendered in product list or on product page inProductList: false, + // sly-old-price block selector + slyOldPriceSelector: '.sly-old-price', + // tier prise selectors start tierPriceTemplateSelector: '#tier-prices-template', tierPriceBlockSelector: '[data-role="tier-price-block"]', @@ -837,6 +840,12 @@ define([ } ); + if (result.oldPrice.amount !== result.finalPrice.amount) { + $(this.options.slyOldPriceSelector).show(); + } else { + $(this.options.slyOldPriceSelector).hide(); + } + if (result.tierPrices.length) { if (this.options.tierPriceTemplate) { tierPriceHtml = mageTemplate( diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php index 53fe49b759c64ec85b5eb8fedd8bae8aa7627757..3c324de0cabab5d35abf23d4d9ae354675bfdbe6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php @@ -102,7 +102,7 @@ class CustomAttribute extends SimpleElement { $element = null; foreach (array_keys($this->classReferences) as $key) { - if (strpos($class, $key) !== false) { + if ($class == $key) { return $this->classReferences[$class]; } } 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 82a7c263b1ca9671d8b125ac6a3f07e6324fa072..fee6efedff2e281742738d02cfdf36a644203b4e 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 @@ -167,7 +167,7 @@ <item name="selector" xsi:type="string">[name="product[%code%]"]</item> <item name="type" xsi:type="string">null</item> </item> - <item name="hasDatepicker" xsi:type="array"> + <item name="admin__control-text _has-datepicker" xsi:type="array"> <item name="selector" xsi:type="string">[name="product[%code%]"]</item> <item name="type" xsi:type="string">datepicker</item> </item> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php index ee3e534eb2384ae5b304cd3e05f8848311568c7d..0a11e63a8c2fb9825d25b2b9915404745a0b95b1 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php @@ -30,6 +30,7 @@ class AddProductsToShoppingCartEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S0'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml index 534214e3cb4256cf4f3f95754ed3c1f812cdd0c1..616f10aef0878e4d1b4d2425876901c7c2386665 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\AddProductsToShoppingCartEntityTest" summary="Add Products to Shopping Cart" ticketId="MAGETWO-25382"> <variation name="AddProductsToShoppingCartEntityTestVariation1"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S2</data> <data name="productsData/0" xsi:type="string">bundleProduct::bundle_dynamic_product</data> <data name="cart/data/grand_total" xsi:type="string">210</data> <data name="cart/data/subtotal" xsi:type="string">200</data> @@ -21,7 +21,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation2"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S2</data> <data name="productsData/0" xsi:type="string">bundleProduct::bundle_fixed_product</data> <data name="cart/data/grand_total" xsi:type="string">761</data> <data name="cart/data/subtotal" xsi:type="string">756</data> @@ -34,7 +34,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation3"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S0</data> <data name="productsData/0" xsi:type="string">catalogProductSimple::with_two_custom_option</data> <data name="cart/data/grand_total" xsi:type="string">345</data> <data name="cart/data/subtotal" xsi:type="string">340</data> @@ -47,7 +47,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation4"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S1</data> <data name="productsData/0" xsi:type="string">catalogProductVirtual::product_50_dollar</data> <data name="cart/data/grand_total" xsi:type="string">50</data> <data name="cart/data/subtotal" xsi:type="string">50</data> @@ -60,7 +60,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation5"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S0</data> <data name="productsData/0" xsi:type="string">configurableProduct::default</data> <data name="cart/data/grand_total" xsi:type="string">135</data> <data name="cart/data/subtotal" xsi:type="string">120</data> @@ -73,6 +73,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation6"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="productsData/0" xsi:type="string">downloadableProduct::with_two_separately_links</data> <data name="cart/data/grand_total" xsi:type="string">22.43</data> <data name="cart/data/subtotal" xsi:type="string">22.43</data> @@ -85,7 +86,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation7"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S2</data> <data name="productsData/0" xsi:type="string">groupedProduct::three_simple_products</data> <data name="cart/data/grand_total" xsi:type="string">1950</data> <data name="cart/data/subtotal" xsi:type="string">1920</data> @@ -98,7 +99,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart" /> </variation> <variation name="AddProductsToShoppingCartEntityTestVariation8"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S0</data> <data name="productsData/0" xsi:type="string">catalogProductSimple::with_two_custom_option</data> <data name="productsData/1" xsi:type="string">catalogProductVirtual::product_50_dollar</data> <data name="productsData/2" xsi:type="string">downloadableProduct::with_two_separately_links</data> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php index f2a809656ed65449fc63d5405b3449f8587005c5..d19ad5497b5dc6009d6e825571dd2f0ab8d67df4 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php @@ -32,6 +32,7 @@ class DeleteProductFromMiniShoppingCartTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S0'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml index 10f1245c2e4fbf20764519641b443e978bc04bf6..47387bb32ca9ebc857cf5df0d4c9129c8f459742 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\DeleteProductFromMiniShoppingCartTest" summary="Delete Product from Mini Shopping Cart" ticketId="MAGETWO-29104"> <variation name="DeleteProductFromMiniShoppingCartTestVariation1"> + <data name="tag" xsi:type="string">severity:S0</data> <data name="description" xsi:type="string">delete Simple</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="products/1" xsi:type="string">catalogProductVirtual::default</data> @@ -16,6 +17,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertProductPresentInMiniShoppingCart" /> </variation> <variation name="DeleteProductFromMiniShoppingCartTestVariation2"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="description" xsi:type="string">delete Simple</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="deletedProductIndex" xsi:type="string">0</data> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php index ae48e6e6b79487571539aa28567f7dd930b57237..877fd28593cfb060a0b1ac1e2d33bc3d42a425f7 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php @@ -30,6 +30,7 @@ class DeleteProductsFromShoppingCartTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml index 033ea76a2a5ff17c5233d7f1b543f6b72f013c61..2af59cbaac6a49bd64706d52477e9b481a28e976 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml @@ -8,36 +8,42 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\DeleteProductsFromShoppingCartTest" summary="Delete Products from Shopping Cart" ticketId="MAGETWO-25218"> <variation name="DeleteProductsFromShoppingCartTestVariation1"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="productsData/0" xsi:type="string">bundleProduct::bundle_dynamic_product</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation2"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="productsData/0" xsi:type="string">bundleProduct::bundle_fixed_product</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation3"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S1</data> <data name="productsData/0" xsi:type="string">catalogProductSimple::with_two_custom_option</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation4"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="productsData/0" xsi:type="string">catalogProductVirtual::product_50_dollar</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation5"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="productsData/0" xsi:type="string">configurableProduct::default</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation6"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="productsData/0" xsi:type="string">downloadableProduct::with_two_separately_links</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation7"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="productsData/0" xsi:type="string">groupedProduct::three_simple_products</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="DeleteProductsFromShoppingCartTestVariation8"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">to_maintain:yes, severity:S1</data> <data name="productsData/0" xsi:type="string">catalogProductSimple::with_two_custom_option</data> <data name="productsData/1" xsi:type="string">catalogProductVirtual::product_50_dollar</data> <data name="productsData/2" xsi:type="string">downloadableProduct::with_two_separately_links</data> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php index 5361ee6e3c127bafc03e53cd717ac067688f826a..a3ba73a1caf41c3d5ab2220feeab58ff3bc510df 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php @@ -21,6 +21,10 @@ use Magento\Mtf\TestCase\Scenario; */ class OnePageCheckoutJsValidationTest extends Scenario { + /* tags */ + const SEVERITY = 'S2'; + /* end tags */ + /** * Runs one page checkout js validation test. * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml index e930ff29882ceed4e8f99947a6a6ef4b4acc1c7a..f8f9b93661aa1b914e6fd4000cd0ece8f7dac302 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutJsValidationTest" summary="JS validation verification for Checkout flow" ticketId="MAGETWO-59697"> <variation name="OnePageCheckoutJsValidationTestVariation1" summary="JS validation is not applied for empty required checkout fields if customer did not fill them"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="checkoutMethod" xsi:type="string">guest</data> <constraint name="Magento\Checkout\Test\Constraint\AssertShippingAddressJsValidationMessagesIsAbsent" /> 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 25922102e1269c95280697db6c3175c36d6253fc..63454c8137975a4a64ee36e20ac596c5fcbc4f7d 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 @@ -41,6 +41,7 @@ class OnePageCheckoutTest extends Scenario /* tags */ const MVP = 'yes'; const TEST_TYPE = 'acceptance_test, extended_acceptance_test, 3rd_party_test'; + const SEVERITY = 'S0'; /* 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 b39ebe91efdf4aa72432c1190954a791d615c9bf..0e40b7d5b2c15c2f342f8390e05b61d9ef771cf8 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 @@ -8,6 +8,7 @@ <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" summary="OnePageCheckout within Offline Payment Methods" ticketId="MAGETWO-27485"> <variation name="OnePageCheckoutUsingLoginPopup" summary="Customer is redirected to checkout on login if guest is disabled, flow for existed Customer" ticketId="MAGETWO-49916"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">johndoe_with_addresses</data> <data name="checkoutMethod" xsi:type="string">login</data> @@ -21,6 +22,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" /> </variation> <variation name="OnePageCheckoutUsingRegisterLink" summary="Customer is redirected to checkout on login if guest is disabled, flow with registration new Customer" ticketId="MAGETWO-49917"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="issue" xsi:type="string">MAGETWO-59816: Redirect works improperly in a browser incognito mode</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">register_customer</data> @@ -36,6 +38,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" /> </variation> <variation name="OnePageCheckoutTestVariation1" summary="Checkout as UK guest with virtual product and downloadable product using coupon for not logged in customers"> + <data name="tag" xsi:type="string">severity:S0</data> <data name="products/0" xsi:type="string">catalogProductVirtual::default</data> <data name="products/1" xsi:type="string">downloadableProduct::with_two_separately_links</data> <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups</data> @@ -55,7 +58,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation2" summary="US customer during checkout using coupon for all customer groups"> - <data name="tag" xsi:type="string">stable:no</data> + <data name="tag" xsi:type="string">stable:no, severity:S0</data> <data name="products/0" 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> @@ -77,7 +80,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation3" summary="Checkout as UK guest with simple product" ticketId="MAGETWO-42603"> - <data name="tag" xsi:type="string">stable:no</data> + <data name="tag" xsi:type="string">stable:no, severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">default</data> <data name="checkoutMethod" xsi:type="string">guest</data> @@ -98,7 +101,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation4" summary="One Page Checkout Products with Special Prices" ticketId="MAGETWO-12429"> - <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0</data> <data name="products/0" xsi:type="string">catalogProductSimple::product_with_special_price</data> <data name="products/1" xsi:type="string">configurableProduct::product_with_special_price</data> <data name="customer/dataset" xsi:type="string">default</data> @@ -120,7 +123,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal"/> </variation> <variation name="OnePageCheckoutTestVariation5" summary="Guest Checkout using Check/Money Order and Free Shipping with Prices/Taxes Verifications" ticketId="MAGETWO-12412"> - <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, stable:no</data> + <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, stable:no, severity:S0</data> <data name="products/0" xsi:type="string">catalogProductSimple::product_10_dollar</data> <data name="products/1" xsi:type="string">configurableProduct::with_one_option</data> <data name="products/2" xsi:type="string">bundleProduct::bundle_fixed_100_dollar_product</data> @@ -144,6 +147,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation6" summary="Checkout as UK guest with virtual product using coupon for not logged in customers with Zero Subtotal Checkout payment method"> + <data name="tag" xsi:type="string">severity:S0</data> <data name="products/0" xsi:type="string">catalogProductVirtual::product_50_dollar</data> <data name="salesRule" xsi:type="string">active_sales_rule_with_fixed_price_discount_coupon</data> <data name="customer/dataset" xsi:type="string">default</data> @@ -163,6 +167,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation7" summary="Checkout as UK guest with condition available product qty = ordered product qty"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::product_with_qty_25</data> <data name="checkoutMethod" xsi:type="string">guest</data> <data name="shippingAddress/dataset" xsi:type="string">UK_address_without_email</data> @@ -182,6 +187,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductsOutOfStock" /> </variation> <variation name="OnePageCheckoutTestVariation8" summary="Checkout as UK customer with different shipping/billing address and register checkout method"> + <data name="tag" xsi:type="string">severity:S0</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">default</data> <data name="checkoutMethod" xsi:type="string">register</data> @@ -197,7 +203,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation9" summary="One Page Checkout Products with different shipping/billing address and Tier Prices" ticketId="MAGETWO-42604"> - <data name="tag" xsi:type="string">stable:no</data> + <data name="tag" xsi:type="string">stable:no, severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::simple_with_tier_price_and_order_qty_3</data> <data name="customer/dataset" xsi:type="string">default</data> <data name="checkoutMethod" xsi:type="string">login</data> @@ -216,6 +222,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> </variation> <variation name="OnePageCheckoutTestVariation10" summary="One Page Checkout with all product types"> + <data name="tag" xsi:type="string">stable:no, severity:S0</data> <data name="products/0" xsi:type="string">catalogProductVirtual::buy_all</data> <data name="products/1" xsi:type="string">downloadableProduct::with_two_separately_links_buy_all</data> <data name="products/2" xsi:type="string">configurableProduct::with_one_option_buy_all</data> @@ -237,6 +244,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductsOutOfStock" /> </variation> <variation name="OnePageCheckoutUsingSingInLink" summary="Login during checkout using 'Sign In' link" ticketId="MAGETWO-42547"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">customer_UK_US_addresses</data> <data name="checkoutMethod" xsi:type="string">sign_in</data> @@ -257,6 +265,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderAddresses" /> </variation> <variation name="OnePageCheckoutUsingNonDefaultAddress" summary="Checkout as Customer using non default address" ticketId="MAGETWO-42602"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">customer_US_DE_UK</data> <data name="checkoutMethod" xsi:type="string">login</data> @@ -278,6 +287,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderAddresses" /> </variation> <variation name="OnePageCheckoutUsingNewAddress" summary="Checkout as Customer using New address" ticketId="MAGETWO-42601"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">johndoe_with_addresses</data> <data name="checkoutMethod" xsi:type="string">sign_in</data> @@ -296,6 +306,7 @@ <constraint name="Magento\Sales\Test\Constraint\AssertOrderAddresses" /> </variation> <variation name="OnePageCheckoutTestVariation11" summary="Checkout as Customer using default address" ticketId="MAGETWO-42600, MAGETWO-42546"> + <data name="tag" xsi:type="string">severity:S1</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="customer/dataset" xsi:type="string">customer_UK_US_addresses</data> <data name="checkoutMethod" xsi:type="string">login</data> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php index 0bfe42f7fe78ced0ffb2282d69790ca42c4a1dec..3a9d381de3d810b59437fd3a73028bb058d3915c 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php @@ -34,6 +34,7 @@ class UpdateProductFromMiniShoppingCartEntityTest extends Injectable /* tags */ const MVP = 'yes'; const TEST_TYPE = 'extended_acceptance_test'; + const SEVERITY = 'S0'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml index cd500a935485cd0e08981d32a53b9280a7d2ad57..f7a675d36c5bd38c5ffc2153f0c7f47fe60f986f 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\UpdateProductFromMiniShoppingCartEntityTest" summary="Update Product from Mini Shopping Cart" ticketId="MAGETWO-29812"> <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation1" summary="Update Product Qty on Mini Shopping Cart" ticketId=" MAGETWO-35536"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S0</data> <data name="originalProduct/0" xsi:type="string">catalogProductSimple::default</data> <data name="checkoutData/dataset" xsi:type="string">simple_order_qty_2</data> <data name="use_minicart_to_edit_qty" xsi:type="boolean">true</data> @@ -25,7 +25,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertCustomerIsRedirectedToCheckoutFromCart" /> </variation> <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation2" summary="Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes, severity:S0</data> <data name="originalProduct/0" xsi:type="string">configurableProduct::default</data> <data name="checkoutData/dataset" xsi:type="string">configurable_update_mini_shopping_cart</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions" /> @@ -34,7 +34,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart" /> </variation> <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation3" summary="Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes, severity:S0</data> <data name="originalProduct/0" xsi:type="string">bundleProduct::bundle_fixed_product</data> <data name="checkoutData/dataset" xsi:type="string">bundle_update_mini_shopping_cart</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions" /> @@ -43,7 +43,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart" /> </variation> <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation4" summary="Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes, severity:S1</data> <data name="originalProduct/0" xsi:type="string">downloadableProduct::with_two_separately_links</data> <data name="checkoutData/dataset" xsi:type="string">downloadable_update_mini_shopping_cart</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions" /> @@ -52,7 +52,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart" /> </variation> <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation5" summary="Update Virtual product in mini shopping cart"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, to_maintain:yes, severity:S1</data> <data name="originalProduct/0" xsi:type="string">catalogProductVirtual::default</data> <data name="checkoutData/dataset" xsi:type="string">virtual_update_mini_shopping_cart</data> <constraint name="Magento\Checkout\Test\Constraint\AssertProductDataInMiniShoppingCart" /> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php index 3dba57e26e003726e856577f5e4b48a427428a24..57ef98528c877e96bd21d0773aa16d79466aed7a 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php @@ -34,6 +34,7 @@ class UpdateShoppingCartTest extends Injectable /* tags */ const MVP = 'yes'; const STABLE = 'no'; + const SEVERITY = 'S0'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml index 42428189f44b06b3c33550efb453d34900045133..912bb57e3f1eb2b00e4e481b8fa83c64975380dd 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\UpdateShoppingCartTest" summary="Update Shopping Cart" ticketId="MAGETWO-25081"> <variation name="UpdateShoppingCartTestVariation1"> + <data name="tag" xsi:type="string">severity:S0</data> <data name="product/dataset" xsi:type="string">default</data> <data name="product/data/price/value" xsi:type="string">100</data> <data name="product/data/checkout_data/qty" xsi:type="string">3</data> @@ -19,6 +20,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInShoppingCart" /> </variation> <variation name="UpdateShoppingCartTestVariation2"> + <data name="tag" xsi:type="string">severity:S0</data> <data name="product/dataset" xsi:type="string">with_two_custom_option</data> <data name="product/data/price/value" xsi:type="string">50</data> <data name="product/data/checkout_data/qty" xsi:type="string">11</data> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml index d7a61b0eaaa2fece41b7d1f464f0e56bdb80d159..9f13d8dddb9a768442f7051a6e11be16f7df9233 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml @@ -7,9 +7,9 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <type name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"> + <type name="Magento\Checkout\Test\Constraint\AssertAddedProductToCartSuccessMessage"> <arguments> - <argument name="severity" xsi:type="string">middle</argument> + <argument name="severity" xsi:type="string">S2</argument> </arguments> </type> <type name="Magento\Checkout\Test\Constraint\AssertBillingAddressAbsentInPayment"> @@ -17,9 +17,19 @@ <argument name="severity" xsi:type="string">S2</argument> </arguments> </type> - <type name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"> + <type name="Magento\Checkout\Test\Constraint\AssertBillingAddressSameAsShippingCheckbox"> <arguments> - <argument name="severity" xsi:type="string">S0</argument> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> </arguments> </type> <type name="Magento\Checkout\Test\Constraint\AssertCheckoutErrorMessage"> @@ -27,4 +37,124 @@ <argument name="severity" xsi:type="string">S1</argument> </arguments> </type> + <type name="Magento\Checkout\Test\Constraint\AssertCustomerIsRedirectedToCheckoutFromCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertDiscountInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertEstimateShippingAndTax"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertGrandTotalInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertGrandTotalOrderReview"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertMinicartEmpty"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"> + <arguments> + <argument name="severity" xsi:type="string">S0</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertPriceInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductAbsentInMiniShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductDataInMiniShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductIsNotEditable"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductPresentInMiniShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductPresentInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertProductsAbsentInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertShippingAddressJsValidationMessagesIsAbsent"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertShippingInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertShippingTotalOrderReview"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertSubtotalInMiniShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertSubtotalInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertSubTotalOrderReview"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertTaxInShoppingCart"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\Checkout\Test\Constraint\AssertTaxTotalOrderReview"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> </config> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php index 21f48abef963d288415d09b24d08a3fe8fd34ebe..b397b73f3a43d6c3d819d105e82efdb48568ec76 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php @@ -27,6 +27,7 @@ class CreateTermEntityTest extends Scenario /* tags */ const MVP = 'yes'; const TEST_TYPE = 'extended_acceptance_test'; + const SEVERITY = 'S3'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml index 8b1c1929d0f9d068d5a78382beb8237e3dced4fe..8f418b92e09a5ff53c44d3d4bacd538347e2ccfa 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CheckoutAgreements\Test\TestCase\CreateTermEntityTest" summary="Create Terms And Conditions" ticketId="MAGETWO-29586"> <variation name="CreateTermEntityTestVariation1" summary="Create enabled term entity with text value"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/data/name" xsi:type="string">name%isolation%</data> @@ -26,6 +26,7 @@ <constraint name="Magento\CheckoutAgreements\Test\Constraint\AssertTermOnCheckout" /> </variation> <variation name="CreateTermEntityTestVariation2" summary="Create enabled term entity with HTML value"> + <data name="tag" xsi:type="string">severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/data/name" xsi:type="string">name%isolation%</data> @@ -43,6 +44,7 @@ <constraint name="Magento\CheckoutAgreements\Test\Constraint\AssertTermOnCheckout" /> </variation> <variation name="CreateTermEntityTestVariation3" summary="Create disabled term entity"> + <data name="tag" xsi:type="string">severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/data/name" xsi:type="string">name%isolation%</data> @@ -60,7 +62,7 @@ <constraint name="Magento\CheckoutAgreements\Test\Constraint\AssertTermAbsentOnCheckout" /> </variation> <variation name="CreateTermEntityTestVariation4" summary="Terms and conditions on multishipping" ticketId="MAGETWO-32499"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="products/1" xsi:type="string">catalogProductSimple::default</data> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php index 2c65150aa697371c1fe050e5e4f5f9dfbdcb25b1..0f7dd2c1bf1631557de590ee37fb804c020c5ad9 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php @@ -26,6 +26,7 @@ class DeleteTermEntityTest extends Scenario { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S3'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml index 50e4af5a2dc36ce151de313ad22fc906921a59ac..3bfd5a63cc4e387c3ec52cba76def7601eff5cb1 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CheckoutAgreements\Test\TestCase\DeleteTermEntityTest" summary="Delete Terms And Conditions" ticketId="MAGETWO-29687"> <variation name="DeleteTermEntityTestVariation1"> + <data name="tag" xsi:type="string">severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/dataset" xsi:type="string">term_enabled_text</data> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml index 1387c7e1e1268085d100112302054fa9c374cde5..57580e2f10e1dc07a8034b414a28b556b6337897 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Backend\Test\TestCase\NavigateMenuTest"> <variation name="NavigateMenuTest17"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="menuItem" xsi:type="string">Stores > Terms and Conditions</data> <data name="pageTitle" xsi:type="string">Terms and Conditions</data> <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php index 277f38e0c7e1f1bdda9f122183415b35aa772f40..4266338ac6ef7818a5a670646be2090c64bf20a9 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php @@ -27,6 +27,7 @@ class UpdateTermEntityTest extends Scenario { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml index 69ea6309843d1ad7452c463a7d951675c745714d..537c61d83d7b5d079a6e80a174544f5aa7cbbead 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CheckoutAgreements\Test\TestCase\UpdateTermEntityTest" summary="Update Terms And Conditions" ticketId="MAGETWO-29635"> <variation name="UpdateTermEntityTestVariation1"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/dataset" xsi:type="string">term_disabled_text</data> @@ -26,6 +27,7 @@ <constraint name="Magento\CheckoutAgreements\Test\Constraint\AssertTermOnCheckout" /> </variation> <variation name="UpdateTermEntityTestVariation2"> + <data name="tag" xsi:type="string">severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/dataset" xsi:type="string">term_disabled_html</data> @@ -44,6 +46,7 @@ <constraint name="Magento\CheckoutAgreements\Test\Constraint\AssertTermOnCheckout" /> </variation> <variation name="UpdateTermEntityTestVariation3"> + <data name="tag" xsi:type="string">severity:S3</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/dataset" xsi:type="string">term_enabled_text</data> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml index 7dc8356351f2f7228a2c4ac5ceec524380dcd5e6..66381d8985802ed12fd9a83633e2ef8c1eebc75c 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml @@ -6,9 +6,39 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermRequireMessageOnMultishippingCheckout"> - <arguments> - <argument name="severity" xsi:type="string">high</argument> - </arguments> - </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermRequireMessageOnMultishippingCheckout"> + <arguments> + <argument name="severity" xsi:type="string">S3</argument> + </arguments> + </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermSuccessSaveMessage"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermInGrid"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermOnCheckout"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermAbsentOnCheckout"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermSuccessDeleteMessage"> + <arguments> + <argument name="severity" xsi:type="string">S2</argument> + </arguments> + </type> + <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermAbsentInGrid"> + <arguments> + <argument name="severity" xsi:type="string">S3</argument> + </arguments> + </type> </config> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php index e33adb68be4eb6eeb05753b072d394804acefb4a..40b622882d357a8c4770ace4b555230a134554f9 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php @@ -29,6 +29,7 @@ class CheckoutWithGiftMessagesTest extends Scenario { /* tags */ const MVP = 'no'; + const SEVERITY = 'S2'; const TO_MAINTAIN = 'yes'; // Consider variation #2 to work correctly with Virtual products /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml index 6226713f316c5f0a90f06291a3a8160a65ac912f..c4f03f0f3d317f3f8b4caa5eae6ad22ed0d475a9 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\GiftMessage\Test\TestCase\CheckoutWithGiftMessagesTest" summary="One Page Checkout with Gift Messages" ticketId="MAGETWO-28978"> <variation name="CheckoutWithGiftMessagesTestVariation1"> + <data name="tag" xsi:type="string">severity:S2</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="products/1" xsi:type="string">catalogProductVirtual::default</data> <data name="customer/dataset" xsi:type="string">default</data> @@ -27,7 +28,7 @@ <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrder" /> </variation> <variation name="CheckoutWithGiftMessagesTestVariation2"> - <data name="tag" xsi:type="string">to_maintain:yes</data> + <data name="tag" xsi:type="string">severity:S2,to_maintain:yes</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="products/1" xsi:type="string">catalogProductVirtual::default</data> <data name="customer/dataset" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php new file mode 100644 index 0000000000000000000000000000000000000000..962d94ab6d59acf09f89c4b9b21a07dcf5e2cb92 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright © 2016 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\GiftMessage\Test\TestCase; + +use Magento\Mtf\TestCase\Scenario; + +/** + * Preconditions: + * 1. Create Product according dataset. + * 2. Enable Gift Messages (Order/Items level). + * + * Steps: + * 1. Login to backend + * 2. Go to Sales >Orders + * 3. Create new order + * 4. Fill data form dataset + * 5. Perform all asserts + * + * @group Gift_Messages + * @ZephyrId MAGETWO-29642 + */ +class CreateGiftMessageOnBackendTest extends Scenario +{ + /* tags */ + const MVP = 'no'; + const SEVERITY = 'S2'; + const TO_MAINTAIN = 'yes'; + /* end tags */ + + /** + * Run CreateGiftMessageOnBackend test. + * + * @return void + */ + public function test() + { + $this->executeScenario(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..bc29b300b220e190e3ac6d00149520c44b493a7a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright © 2016 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\GiftMessage\Test\TestCase\CreateGiftMessageOnBackendTest" summary="Create Gift Message On Backend" ticketId="MAGETWO-29642"> + <variation name="CreateGiftMessageOnBackendTestVariation1"> + <data name="tag" xsi:type="string">severity:S2</data> + <data name="configData" xsi:type="string">cashondelivery, enable_gift_messages</data> + <data name="products/0" xsi:type="string">catalogProductSimple::default</data> + <data name="products/1" xsi:type="string">catalogProductVirtual::default</data> + <data name="customer/dataset" xsi:type="string">johndoe_with_addresses</data> + <data name="billingAddress/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="giftMessage/data/allow_gift_options" xsi:type="string">Yes</data> + <data name="giftMessage/data/allow_gift_options_for_items" xsi:type="string">Yes</data> + <data name="giftMessage/data/sender" xsi:type="string">John Doe</data> + <data name="giftMessage/data/recipient" xsi:type="string">Jane Doe</data> + <data name="giftMessage/data/message" xsi:type="string">text_gift_message</data> + <data name="giftMessage/data/items/datasets" xsi:type="string">default</data> + <data name="payment/method" xsi:type="string">cashondelivery</data> + <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInBackendOrder" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrderItems" /> + </variation> + <variation name="CreateGiftMessageOnBackendTestVariation2"> + <data name="tag" xsi:type="string">severity:S2</data> + <data name="configData" xsi:type="string">cashondelivery, enable_gift_messages</data> + <data name="products/0" xsi:type="string">catalogProductSimple::default</data> + <data name="products/1" xsi:type="string">catalogProductVirtual::default</data> + <data name="customer/dataset" xsi:type="string">johndoe_with_addresses</data> + <data name="billingAddress/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="giftMessage/data/allow_gift_options" xsi:type="string">Yes</data> + <data name="giftMessage/data/allow_gift_messages_for_order" xsi:type="string">Yes</data> + <data name="giftMessage/data/allow_gift_options_for_items" xsi:type="string">-</data> + <data name="giftMessage/data/sender" xsi:type="string">John Doe</data> + <data name="giftMessage/data/recipient" xsi:type="string">Jane Doe</data> + <data name="giftMessage/data/message" xsi:type="string">text_gift_message</data> + <data name="payment/method" xsi:type="string">cashondelivery</data> + <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInBackendOrder" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrder" /> + </variation> + <variation name="CreateGiftMessageOnBackendTestVariation3"> + <data name="tag" xsi:type="string">severity:S2</data> + <data name="configData" xsi:type="string">cashondelivery, enable_gift_messages</data> + <data name="products/0" xsi:type="string">catalogProductSimple::default</data> + <data name="products/1" xsi:type="string">catalogProductVirtual::default</data> + <data name="customer/dataset" xsi:type="string">johndoe_with_addresses</data> + <data name="billingAddress/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="giftMessage/data/allow_gift_options" xsi:type="string">Yes</data> + <data name="giftMessage/data/allow_gift_messages_for_order" xsi:type="string">Yes</data> + <data name="giftMessage/data/allow_gift_options_for_items" xsi:type="string">Yes</data> + <data name="giftMessage/data/sender" xsi:type="string">John Doe</data> + <data name="giftMessage/data/recipient" xsi:type="string">Jane Doe</data> + <data name="giftMessage/data/message" xsi:type="string">text_gift_message</data> + <data name="giftMessage/data/items/datasets" xsi:type="string">default</data> + <data name="payment/method" xsi:type="string">cashondelivery</data> + <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInBackendOrder" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrder" /> + <constraint name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrderItems" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml index bda2dc3ea97b95dead3597444f2a1438b88e2da7..a7ff131c0674637fd0c5c6c333d520649834b1cd 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml @@ -8,17 +8,17 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrderItems"> <arguments> - <argument name="severity" xsi:type="string">high</argument> + <argument name="severity" xsi:type="string">S2</argument> </arguments> </type> <type name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrder"> <arguments> - <argument name="severity" xsi:type="string">high</argument> + <argument name="severity" xsi:type="string">S2</argument> </arguments> </type> <type name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInBackendOrder"> <arguments> - <argument name="severity" xsi:type="string">high</argument> + <argument name="severity" xsi:type="string">S2</argument> </arguments> </type> </config> diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml index 2eac5848ace436ca634913d40d9b88cbeac67f7c..c792d650be0c1a4f8d2b094c78a8e59ee71346b4 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/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"> <type name="Magento\Multishipping\Test\Constraint\AssertMultishippingOrderSuccessPlacedMessage"> <arguments> - <argument name="severity" xsi:type="string">high</argument> + <argument name="severity" xsi:type="string">S3</argument> </arguments> </type> </config> diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php index 5db97cc36614924ae915b7b924b2c7a1f575e344..2e339e4347cf65ad13474de26ba61c3237cfafe9 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php @@ -67,4 +67,40 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase ->getFirstItem(); $this->assertEquals(20, $configurableProduct->getMinimalPrice()); } + + /** + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + */ + public function testGetProductFinalPriceIfOneOfChildIsDisabledPerStore() + { + /** @var Collection $collection */ + $collection = Bootstrap::getObjectManager()->get(CollectionFactory::class) + ->create(); + $configurableProduct = $collection + ->addIdFilter([1]) + ->addMinimalPrice() + ->load() + ->getFirstItem(); + $this->assertEquals(10, $configurableProduct->getMinimalPrice()); + + $childProduct = $this->productRepository->getById(10, false, null, true); + $childProduct->setStatus(Status::STATUS_DISABLED); + + // update in default store scope + $currentStoreId = $this->storeManager->getStore()->getId(); + $defaultStore = $this->storeManager->getDefaultStoreView(); + $this->storeManager->setCurrentStore($defaultStore->getId()); + $this->productRepository->save($childProduct); + $this->storeManager->setCurrentStore($currentStoreId); + + /** @var Collection $collection */ + $collection = Bootstrap::getObjectManager()->get(CollectionFactory::class) + ->create(); + $configurableProduct = $collection + ->addIdFilter([1]) + ->addMinimalPrice() + ->load() + ->getFirstItem(); + $this->assertEquals(20, $configurableProduct->getMinimalPrice()); + } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php index 50787c7962412b0611edf093825563061da67119..58df9f50f7f0c10a8750c1fdf31c68561b6fdb87 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php @@ -68,6 +68,38 @@ class LowestPriceOptionProviderTest extends \PHPUnit_Framework_TestCase $this->assertEquals(20, $lowestPriceChildrenProduct->getPrice()); } + /** + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + */ + public function testGetProductsIfOneOfChildIsDisabledPerStore() + { + $configurableProduct = $this->productRepository->getById(1, false, null, true); + $lowestPriceChildrenProducts = $this->lowestPriceOptionsProvider->getProducts($configurableProduct); + $this->assertCount(1, $lowestPriceChildrenProducts); + $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); + $this->assertEquals(10, $lowestPriceChildrenProduct->getPrice()); + + // load full aggregation root + $lowestPriceChildProduct = $this->productRepository->get( + $lowestPriceChildrenProduct->getSku(), + false, + null, + true + ); + $lowestPriceChildProduct->setStatus(Status::STATUS_DISABLED); + // update in default store scope + $currentStoreId = $this->storeManager->getStore()->getId(); + $defaultStore = $this->storeManager->getDefaultStoreView(); + $this->storeManager->setCurrentStore($defaultStore->getId()); + $this->productRepository->save($lowestPriceChildProduct); + $this->storeManager->setCurrentStore($currentStoreId); + + $lowestPriceChildrenProducts = $this->lowestPriceOptionsProvider->getProducts($configurableProduct); + $this->assertCount(1, $lowestPriceChildrenProducts); + $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); + $this->assertEquals(20, $lowestPriceChildrenProduct->getPrice()); + } + /** * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php index 037069e8fd2ca551a216a1e3fe349e1793aa8768..6c4bc5f52c0c06b08f44f2a70554fd3d11c9bca7 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php @@ -22,29 +22,6 @@ class ObserverImplementationTest extends \PHPUnit_Framework_TestCase */ protected static $observerClasses = []; - /** - * @var array - */ - protected static $blackList = [ - // not support of virtual types - 'SalesOrderIndexGridAsyncInsertObserver', - 'SalesInvoiceIndexGridAsyncInsertObserver', - 'SalesShipmentIndexGridAsyncInsertObserver', - 'SalesCreditmemoIndexGridAsyncInsertObserver', - 'SalesOrderIndexGridSyncInsert', - 'SalesInvoiceIndexGridSyncInsert', - 'SalesShipmentIndexGridSyncInsert', - 'SalesCreditmemoIndexGridSyncInsert', - 'SalesOrderIndexGridSyncRemove', - 'SalesInvoiceIndexGridSyncRemove', - 'SalesShipmentIndexGridSyncRemove', - 'SalesCreditmemoIndexGridSyncRemove', - 'SalesOrderSendEmailsObserver', - 'SalesOrderInvoiceSendEmailsObserver', - 'SalesOrderShipmentSendEmailsObserver', - 'SalesOrderCreditmemoSendEmailsObserver', - ]; - public static function setUpBeforeClass() { self::$observerClasses = array_merge( @@ -116,9 +93,18 @@ class ObserverImplementationTest extends \PHPUnit_Framework_TestCase } } } + + $blacklistFiles = str_replace('\\', '/', realpath(__DIR__)) . '/_files/blacklist/observers*.txt'; + $blacklistExceptions = []; + foreach (glob($blacklistFiles) as $fileName) { + $blacklistExceptions = array_merge( + $blacklistExceptions, + file($fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) + ); + } return array_diff( array_unique($observerClasses), - self::$blackList + $blacklistExceptions ); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/observers.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/observers.txt new file mode 100644 index 0000000000000000000000000000000000000000..3e9b19322cb09773f161b0e502ed7d84e7826a7e --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/observers.txt @@ -0,0 +1,16 @@ +SalesOrderIndexGridAsyncInsertObserver +SalesInvoiceIndexGridAsyncInsertObserver +SalesShipmentIndexGridAsyncInsertObserver +SalesCreditmemoIndexGridAsyncInsertObserver +SalesOrderIndexGridSyncInsert +SalesInvoiceIndexGridSyncInsert +SalesShipmentIndexGridSyncInsert +SalesCreditmemoIndexGridSyncInsert +SalesOrderIndexGridSyncRemove +SalesInvoiceIndexGridSyncRemove +SalesShipmentIndexGridSyncRemove +SalesCreditmemoIndexGridSyncRemove +SalesOrderSendEmailsObserver +SalesOrderInvoiceSendEmailsObserver +SalesOrderShipmentSendEmailsObserver +SalesOrderCreditmemoSendEmailsObserver