From 7400261ffcb052625070cf79a2d75f60282590cd Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Wed, 3 Oct 2018 13:17:04 +0300 Subject: [PATCH 01/25] MAGETWO-93769: Catalog performance improvements --- .../Model/Product/Price/TierPriceStorage.php | 21 ++++++++++--------- .../Catalog/Model/ProductIdLocator.php | 15 +++++++++++-- .../ResourceModel/Product/Collection.php | 10 ++++++++- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php b/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php index 1bddd2d07cd81..7298e650bd448 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php +++ b/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php @@ -171,16 +171,17 @@ private function getExistingPrices(array $skus, $groupBySku = false) $ids = $this->retrieveAffectedIds($skus); $rawPrices = $this->tierPricePersistence->get($ids); $prices = []; - - $linkField = $this->tierPricePersistence->getEntityLinkField(); - $skuByIdLookup = $this->buildSkuByIdLookup($skus); - foreach ($rawPrices as $rawPrice) { - $sku = $skuByIdLookup[$rawPrice[$linkField]]; - $price = $this->tierPriceFactory->create($rawPrice, $sku); - if ($groupBySku) { - $prices[$sku][] = $price; - } else { - $prices[] = $price; + if ($rawPrices) { + $linkField = $this->tierPricePersistence->getEntityLinkField(); + $skuByIdLookup = $this->buildSkuByIdLookup($skus); + foreach ($rawPrices as $rawPrice) { + $sku = $skuByIdLookup[$rawPrice[$linkField]]; + $price = $this->tierPriceFactory->create($rawPrice, $sku); + if ($groupBySku) { + $prices[$sku][] = $price; + } else { + $prices[] = $price; + } } } diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index 2d9af6829ad6e..ba8fa01b40f58 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -37,6 +37,11 @@ class ProductIdLocator implements \Magento\Catalog\Model\ProductIdLocatorInterfa */ private $idsBySku = []; + /** + * Page size to iterate collection + */ + private $pageSize = 10000; + /** * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory @@ -72,8 +77,14 @@ public function retrieveProductIdsBySkus(array $skus) $linkField = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) ->getLinkField(); - foreach ($collection as $item) { - $this->idsBySku[strtolower(trim($item->getSku()))][$item->getData($linkField)] = $item->getTypeId(); + $collection->setPageSize($this->pageSize); + $pages = $collection->getLastPageNumber(); + for ($currentPage = 1; $currentPage <= $pages; $currentPage++) { + $collection->setCurPage($currentPage); + foreach ($collection->getItems() as $item) { + $this->idsBySku[strtolower(trim($item->getSku()))][$item->getData($linkField)] = $item->getTypeId(); + } + $collection->clear(); } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index fdd98442150ae..4aa427223dcbe 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -290,6 +290,11 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac */ private $dimensionFactory; + /** + * @var \Magento\Framework\DataObject + */ + private $emptyItem; + /** * Collection constructor * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory @@ -550,7 +555,10 @@ protected function _prepareStaticFields() */ public function getNewEmptyItem() { - $object = parent::getNewEmptyItem(); + if (null === $this->emptyItem) { + $this->emptyItem = parent::getNewEmptyItem(); + } + $object = clone $this->emptyItem; if ($this->isEnabledFlat()) { $object->setIdFieldName($this->getEntity()->getIdFieldName()); } From 6c7ce718ea5d2cc91269242963bda2293388f00e Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Thu, 4 Oct 2018 11:56:26 +0300 Subject: [PATCH 02/25] MAGETWO-93769: Catalog performance improvements --- .../Catalog/Model/ProductIdLocator.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index ba8fa01b40f58..21ddf06427982 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -38,23 +38,28 @@ class ProductIdLocator implements \Magento\Catalog\Model\ProductIdLocatorInterfa private $idsBySku = []; /** - * Page size to iterate collection + * Batch size to iterate collection + * + * @var int */ - private $pageSize = 10000; + private $batchSize; /** * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory - * @param string $limitIdsBySkuValues + * @param string $idsLimit + * @param int $batchSize [optional] */ public function __construct( \Magento\Framework\EntityManager\MetadataPool $metadataPool, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory, - $idsLimit + $idsLimit, + $batchSize = 5000 ) { $this->metadataPool = $metadataPool; $this->collectionFactory = $collectionFactory; $this->idsLimit = (int)$idsLimit; + $this->batchSize = $batchSize; } /** @@ -77,12 +82,14 @@ public function retrieveProductIdsBySkus(array $skus) $linkField = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) ->getLinkField(); - $collection->setPageSize($this->pageSize); + $collection->setPageSize($this->batchSize); $pages = $collection->getLastPageNumber(); for ($currentPage = 1; $currentPage <= $pages; $currentPage++) { $collection->setCurPage($currentPage); foreach ($collection->getItems() as $item) { - $this->idsBySku[strtolower(trim($item->getSku()))][$item->getData($linkField)] = $item->getTypeId(); + $sku = strtolower(trim($item->getSku())); + $itemIdentifier = $item->getData($linkField); + $this->idsBySku[$sku][$itemIdentifier] = $item->getTypeId(); } $collection->clear(); } From bdf8c0d5632bf05ce6be5a6f084dba46918a2297 Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Thu, 4 Oct 2018 14:22:38 +0300 Subject: [PATCH 03/25] MAGETWO-93769: Catalog performance improvements --- app/code/Magento/Catalog/Model/ProductIdLocator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index 21ddf06427982..e51deb7f6cbe7 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -48,13 +48,13 @@ class ProductIdLocator implements \Magento\Catalog\Model\ProductIdLocatorInterfa * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory * @param string $idsLimit - * @param int $batchSize [optional] + * @param int $batchSize defines how many items can be processed by one request */ public function __construct( \Magento\Framework\EntityManager\MetadataPool $metadataPool, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory, $idsLimit, - $batchSize = 5000 + int $batchSize = 5000 ) { $this->metadataPool = $metadataPool; $this->collectionFactory = $collectionFactory; From b0bc510b885067a725ecce2339f614327528797d Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Thu, 4 Oct 2018 17:21:05 +0300 Subject: [PATCH 04/25] MAGETWO-93769: Catalog performance improvements --- .../Catalog/Model/ProductIdLocator.php | 4 +-- .../Product/Price/TierPriceStorageTest.php | 24 ++++++++++++++++++ .../Test/Unit/Model/ProductIdLocatorTest.php | 17 +++++++++++-- .../ResourceModel/Product/CollectionTest.php | 25 +++++++++++++++++-- 4 files changed, 64 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index e51deb7f6cbe7..4c4e6b416527b 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -48,7 +48,7 @@ class ProductIdLocator implements \Magento\Catalog\Model\ProductIdLocatorInterfa * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory * @param string $idsLimit - * @param int $batchSize defines how many items can be processed by one request + * @param int $batchSize defines how many items can be processed by one iteration */ public function __construct( \Magento\Framework\EntityManager\MetadataPool $metadataPool, @@ -86,7 +86,7 @@ public function retrieveProductIdsBySkus(array $skus) $pages = $collection->getLastPageNumber(); for ($currentPage = 1; $currentPage <= $pages; $currentPage++) { $collection->setCurPage($currentPage); - foreach ($collection->getItems() as $item) { + foreach ($collection->getIterator() as $item) { $sku = strtolower(trim($item->getSku())); $itemIdentifier = $item->getData($linkField); $this->idsBySku[$sku][$itemIdentifier] = $item->getTypeId(); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/TierPriceStorageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/TierPriceStorageTest.php index c9288790ed6e1..a97f2281125a6 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/TierPriceStorageTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/TierPriceStorageTest.php @@ -152,6 +152,30 @@ public function testGet() $this->assertEquals(2, count($prices)); } + /** + * Test get method without tierprices. + * + * @return void + */ + public function testGetWithoutTierPrices() + { + $skus = ['simple', 'virtual']; + $this->tierPriceValidator + ->expects($this->once()) + ->method('validateSkus') + ->with($skus) + ->willReturn($skus); + $this->productIdLocator->expects($this->atLeastOnce()) + ->method('retrieveProductIdsBySkus') + ->with(['simple', 'virtual']) + ->willReturn(['simple' => ['2' => 'simple'], 'virtual' => ['3' => 'virtual']]); + $this->tierPricePersistence->expects($this->once())->method('get')->willReturn([]); + $this->tierPricePersistence->expects($this->never())->method('getEntityLinkField'); + $this->tierPriceFactory->expects($this->never())->method('create'); + $prices = $this->tierPriceStorage->get($skus); + $this->assertEmpty($prices); + } + /** * Test update method. * diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php index b730e12ca820b..6455aa58dd234 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php @@ -58,7 +58,16 @@ public function testRetrieveProductIdsBySkus() { $skus = ['sku_1', 'sku_2']; $collection = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) - ->setMethods(['getIterator', 'addFieldToFilter']) + ->setMethods( + [ + 'getIterator', + 'addFieldToFilter', + 'setPageSize', + 'getLastPageNumber', + 'setCurPage', + 'clear' + ] + ) ->disableOriginalConstructor()->getMock(); $product = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterface::class) ->setMethods(['getSku', 'getData', 'getTypeId']) @@ -69,7 +78,11 @@ public function testRetrieveProductIdsBySkus() $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); $collection->expects($this->once())->method('addFieldToFilter') ->with(\Magento\Catalog\Api\Data\ProductInterface::SKU, ['in' => $skus])->willReturnSelf(); - $collection->expects($this->once())->method('getIterator')->willReturn(new \ArrayIterator([$product])); + $collection->expects($this->atLeastOnce())->method('getIterator')->willReturn(new \ArrayIterator([$product])); + $collection->expects($this->atLeastOnce())->method('setPageSize')->willReturnSelf(); + $collection->expects($this->atLeastOnce())->method('getLastPageNumber')->willReturn(1); + $collection->expects($this->atLeastOnce())->method('setCurPage')->with(1)->willReturnSelf(); + $collection->expects($this->atLeastOnce())->method('clear')->willReturnSelf(); $this->metadataPool ->expects($this->once()) ->method('getMetadata') diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index dbbb3fb29513b..bb39aa7f9db77 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -58,13 +58,18 @@ class CollectionTest extends \PHPUnit\Framework\TestCase */ private $storeManager; + /** + * @var \Magento\Framework\Data\Collection\EntityFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $entityFactory; + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $entityFactory = $this->createMock(\Magento\Framework\Data\Collection\EntityFactory::class); + $this->entityFactory = $this->createMock(\Magento\Framework\Data\Collection\EntityFactory::class); $logger = $this->getMockBuilder(\Psr\Log\LoggerInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -168,7 +173,7 @@ protected function setUp() $this->collection = $this->objectManager->getObject( \Magento\Catalog\Model\ResourceModel\Product\Collection::class, [ - 'entityFactory' => $entityFactory, + 'entityFactory' => $this->entityFactory, 'logger' => $logger, 'fetchStrategy' => $fetchStrategy, 'eventManager' => $eventManager, @@ -379,4 +384,20 @@ public function testAddTierPriceData() $this->assertSame($this->collection, $this->collection->addTierPriceData()); } + + /** + * Test for getNewEmptyItem() method + * + * @return void + */ + public function testGetNewEmptyItem() + { + $item = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) + ->disableOriginalConstructor() + ->getMock(); + $this->entityFactory->expects($this->once())->method('create')->willReturn($item); + $firstItem = $this->collection->getNewEmptyItem(); + $secondItem = $this->collection->getNewEmptyItem(); + $this->assertEquals($firstItem, $secondItem); + } } From c58160625d6bca174b0751f1b671b5ec195b2637 Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Fri, 5 Oct 2018 12:27:10 +0300 Subject: [PATCH 05/25] MAGETWO-93769: Catalog performance improvements --- app/code/Magento/Catalog/Model/ProductIdLocator.php | 2 +- .../Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index 4c4e6b416527b..8c42821d31697 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -86,7 +86,7 @@ public function retrieveProductIdsBySkus(array $skus) $pages = $collection->getLastPageNumber(); for ($currentPage = 1; $currentPage <= $pages; $currentPage++) { $collection->setCurPage($currentPage); - foreach ($collection->getIterator() as $item) { + foreach ($collection->getItems() as $item) { $sku = strtolower(trim($item->getSku())); $itemIdentifier = $item->getData($linkField); $this->idsBySku[$sku][$itemIdentifier] = $item->getTypeId(); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php index 6455aa58dd234..b9cb82274c808 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php @@ -60,7 +60,7 @@ public function testRetrieveProductIdsBySkus() $collection = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) ->setMethods( [ - 'getIterator', + 'getItems', 'addFieldToFilter', 'setPageSize', 'getLastPageNumber', @@ -78,7 +78,7 @@ public function testRetrieveProductIdsBySkus() $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); $collection->expects($this->once())->method('addFieldToFilter') ->with(\Magento\Catalog\Api\Data\ProductInterface::SKU, ['in' => $skus])->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('getIterator')->willReturn(new \ArrayIterator([$product])); + $collection->expects($this->atLeastOnce())->method('getItems')->willReturn([$product]); $collection->expects($this->atLeastOnce())->method('setPageSize')->willReturnSelf(); $collection->expects($this->atLeastOnce())->method('getLastPageNumber')->willReturn(1); $collection->expects($this->atLeastOnce())->method('setCurPage')->with(1)->willReturnSelf(); From 5fb7cf4c4f97255622f413a4a33667ae093e032d Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Fri, 5 Oct 2018 15:24:45 +0300 Subject: [PATCH 06/25] MAGETWO-93769: Catalog performance improvements --- .../Catalog/Model/Product/Price/TierPriceStorage.php | 8 ++++---- app/code/Magento/Catalog/Model/ProductIdLocator.php | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php b/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php index 7298e650bd448..3ee064670a460 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php +++ b/app/code/Magento/Catalog/Model/Product/Price/TierPriceStorage.php @@ -97,7 +97,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function get(array $skus) { @@ -107,7 +107,7 @@ public function get(array $skus) } /** - * {@inheritdoc} + * @inheritdoc */ public function update(array $prices) { @@ -128,7 +128,7 @@ public function update(array $prices) } /** - * {@inheritdoc} + * @inheritdoc */ public function replace(array $prices) { @@ -144,7 +144,7 @@ public function replace(array $prices) } /** - * {@inheritdoc} + * @inheritdoc */ public function delete(array $prices) { diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index 8c42821d31697..2d382164f2649 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -63,7 +63,17 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc + * + * Load product items by provided products SKUs. + * Products collection will be iterated by pages with the $this->batchSize as a page size (for a cases when to many + * products SKUs were provided in parameters. + * Loaded products will be chached in the $this->idsBySku variable, but in the end of the method these storage will + * be truncated to $idsLimit quantity. + * As a result array with the products data will be returned with the following scheme: + * $data['product_sku']['link_field_value' => 'product_type'] + * + * @throws \Exception */ public function retrieveProductIdsBySkus(array $skus) { From 7b4e38654b79e1a6bab82fa78d965a64806ad8ab Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Tue, 4 Dec 2018 18:05:55 +0200 Subject: [PATCH 07/25] MAGETWO-96907: [MFTF Test] Admin - Customers - Addresses Grid - set address as default billing from the grid --- .../Test/Mftf/Page/AdminEditCustomerPage.xml | 3 ++ .../AdminCustomerAddressFiltersSection.xml | 20 ++++++++ ...minCustomerAddressesGridActionsSection.xml | 21 ++++++++ .../AdminCustomerAddressesGridSection.xml | 15 ++++++ ...inSetCustomerDefaultBillingAddressTest.xml | 49 +++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml index 31dad24ba8372..d662c5cef6032 100644 --- a/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml +++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml @@ -9,6 +9,9 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml new file mode 100644 index 0000000000000..b8bb318f0eba8 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml @@ -0,0 +1,20 @@ + + + + +
+ + + + + + + +
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml new file mode 100644 index 0000000000000..2c684df4286f5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml @@ -0,0 +1,21 @@ + + + + +
+ + + + + + + + +
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml new file mode 100644 index 0000000000000..68da815520da2 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml @@ -0,0 +1,15 @@ + + + + +
+ + +
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml new file mode 100644 index 0000000000000..356e5b9a09c19 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml @@ -0,0 +1,49 @@ + + + + + + + + + <description value="Admin should be able to set customer default billing address"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-94952"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="customer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + <!--Edit customer info--> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> + <argument name="customer" value="$$customer$$"/> + </actionGroup> + <click stepKey="goToAddresses" selector="{{AdminCustomerAccountInformationSection.addressesButton}}"/> + <waitForPageLoad stepKey="waitForAddresses"/> + + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersSectionOnCustomerAddressGrid"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/> + <fillField userInput="{{Simple_US_Customer.lastname}}" selector="//" stepKey="fillNameFieldOnFiltersSection"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCustomerGroupGridActionsSection.selectButton('customerGroupName')}}" stepKey="clickSelectButton"/> + + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDeleteCustomerGroup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> + <see userInput="The customer will receive an email with a link to reset password." stepKey="messageThatLinkToPasswordResetIsSent"/> + </test> +</tests> + + From e0729e4a20019869db4c55a4b8832a417aa5afe5 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Tue, 4 Dec 2018 20:08:06 +0200 Subject: [PATCH 08/25] MAGETWO-96910: [MFTF Test] Admin - Customers - Addresses Grid - delete customer address from the grid - Add selectors in AdminCustomerAddressesGridSection - Change "actions" selector to unique in AdminCustomerAddressesGridActionsSection --- .../Section/AdminCustomerAddressesGridActionsSection.xml | 2 +- .../Mftf/Section/AdminCustomerAddressesGridSection.xml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml index 2c684df4286f5..078f8bf23116b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml @@ -13,7 +13,7 @@ <element name="gridLoadingMask" type="button" selector=".admin__data-grid-loading-mask"/> <element name="search" type="input" selector="#fulltext"/> <element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/> - <element name="actions" type="text" selector=".action-select"/> + <element name="actions" type="text" selector="//div[@class='admin__data-grid-header']//button[@class='action-select']"/> <element name="filters" type="button" selector="button[data-action='grid-filter-expand']" timeout="30"/> <element name="firstRow" type="button" selector="tr:nth-of-type(1)[data-role='row']"/> <element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml index 68da815520da2..d2e18f5018bd6 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml @@ -10,6 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminCustomerAddressesGridSection"> <element name="customerAddressGrid" type="text" selector="table[data-role='grid']"/> - <element name="firstRowEditLink" type="text" selector="tr[data-repeat-index='0'] .action-menu-item" timeout="30"/> + <element name="firstRowSelectLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//button[@class='action-select']"/> + <element name="firstRowEditLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//a[contains(@data-action,'item-edit')]" timeout="30"/> + <element name="firstRowSetAsDefaultBillingLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//a[contains(@data-action,'item-setDefaultBilling')]" timeout="30"/> + <element name="firstRowSetAsDefaultShippingLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//a[contains(@data-action,'item-setDefaultShipping')]" timeout="30"/> + <element name="firstRowDeleteLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//a[contains(@data-action,'item-delete')]" timeout="30"/> + <element name="firstRowCheckbox" type="checkbox" selector="//tr[contains(@data-repeat-index, '0')]//input[contains(@data-action, 'select-row')]"/> + <element name="checkboxByName" type="checkbox" selector="//div[contains(text(),'{{customer}}')]/ancestor::tr[contains(@class, 'data-row')]//input[@class='admin__control-checkbox']" parameterized="true" /> + </section> </sections> From 82aab1b6fe87e1c45a197e833cca5ef6b85fbba9 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Wed, 5 Dec 2018 15:21:13 +0200 Subject: [PATCH 09/25] MAGETWO-96910: [MFTF Test] Admin - Customers - Addresses Grid - delete customer address from the grid via mass actions - Add not finalized test - Add selector Addresses in AdminEditCustomerInformationSection --- .../AdminEditCustomerInformationSection.xml | 2 + ...AddressesFromTheGridViaMassActionsTest.xml | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml index a28c6d5ff5e2d..8c3a011052ac1 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml @@ -10,5 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditCustomerInformationSection"> <element name="orders" type="button" selector="#tab_orders_content" timeout="30"/> + <element name="addresses" type="button" selector="//a[@id='tab_address']" timeout="30"/> + </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml new file mode 100644 index 0000000000000..316655a27453c --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest"> + <annotations> + <title value="Admin delete customer addresses from the grid via mass actions"/> + <description value="Admin delete customer addresses from the grid via mass actions"/> + <features value="Module/ Customer"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94951"/> + <stories value="MAGETWO-94346: Implement handling of large number of addresses on admin edit customer page"/> + <group value="customer"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customerts. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. On edit customer page open *Addresses* tab and find a grid with the additional addresses + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer"/> + </actionGroup> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <!-- - + Step4. Check checkboxes for several addresses open *Actions* dropdown at the top of addresses grid and select action *Delete* + Step5. Press *Ok* button on the pop-up + <!- --> + <click selector="{{AdminCustomerAddressesGridSection.firstRowCheckbox}}" stepKey="tickFirstRowCustomerAddressCheckbox"/> + <click selector="{{AdminCustomerAddressesGridActionsSection.actions}}" stepKey="openActionsDropdown"/> + <click selector="{{AdminCustomerAddressesGridActionsSection.delete}}" stepKey="chooseDeleteOption"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad1"/> + <click selector="{{AdminCustomerAddressesGridActionsSection.ok}}" stepKey="clickOkOnPopup"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad2"/> + <see userInput="We couldn't find any records." selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" stepKey="checkThatCustomerAddressesGridHasNoRecords"/> +</test> +</tests> From 4197ba54c09f00e8f2df4730eb4e3e1f1fb0bc5a Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Wed, 5 Dec 2018 18:50:51 +0200 Subject: [PATCH 10/25] MAGETWO-96910: [MFTF Test] Admin - Customers - Addresses Grid - delete customer address from the grid via mass actions - Add selector secondRowCheckbox in AdminCustomerAddressesGridSection - Finalize test --- .../Test/Mftf/Section/AdminCustomerAddressesGridSection.xml | 1 + ...nDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml index d2e18f5018bd6..948d6f1cd9777 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml @@ -16,6 +16,7 @@ <element name="firstRowSetAsDefaultShippingLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//a[contains(@data-action,'item-setDefaultShipping')]" timeout="30"/> <element name="firstRowDeleteLink" type="text" selector="//tr[contains(@data-repeat-index, '0')]//a[contains(@data-action,'item-delete')]" timeout="30"/> <element name="firstRowCheckbox" type="checkbox" selector="//tr[contains(@data-repeat-index, '0')]//input[contains(@data-action, 'select-row')]"/> + <element name="secondRowCheckbox" type="checkbox" selector="//tr[contains(@data-repeat-index, '1')]//input[contains(@data-action, 'select-row')]"/> <element name="checkboxByName" type="checkbox" selector="//div[contains(text(),'{{customer}}')]/ancestor::tr[contains(@class, 'data-row')]//input[@class='admin__control-checkbox']" parameterized="true" /> </section> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml index 316655a27453c..2cbe47c8e937f 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> @@ -33,7 +33,7 @@ <!- --> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> - <argument name="customer" value="Simple_US_Customer"/> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <!-- - @@ -41,6 +41,7 @@ Step5. Press *Ok* button on the pop-up <!- --> <click selector="{{AdminCustomerAddressesGridSection.firstRowCheckbox}}" stepKey="tickFirstRowCustomerAddressCheckbox"/> + <click selector="{{AdminCustomerAddressesGridSection.secondRowCheckbox}}" stepKey="tickSecondRowCustomerAddressCheckbox"/> <click selector="{{AdminCustomerAddressesGridActionsSection.actions}}" stepKey="openActionsDropdown"/> <click selector="{{AdminCustomerAddressesGridActionsSection.delete}}" stepKey="chooseDeleteOption"/> <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad1"/> From a475158c042b44d268faf9ed1a8af4a690694b92 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Wed, 5 Dec 2018 18:53:28 +0200 Subject: [PATCH 11/25] MAGETWO-96962: [MFTF Test] Admin - Customers - Addresses Grid - delete customer address from the grid via mass actions - Add test --- ...DeleteCustomerAddressesFromTheGridTest.xml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml new file mode 100644 index 0000000000000..d6b58c3098ff6 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminDeleteCustomerAddressesFromTheGridTest"> + <annotations> + <title value="Admin delete customer addresses from the grid"/> + <description value="Admin delete customer addresses from the grid"/> + <features value="Module/ Customer"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94850"/> + <stories value="MAGETWO-94346: Implement handling of large number of addresses on admin edit customer page"/> + <group value="customer"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customerts. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. On edit customer page open *Addresses* tab and find a grid with the additional addresses + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> + </actionGroup> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <!-- - + Step4. Click *Select* link in *Actions* column for target additional address + Step5. Click *Delete* + Step6. Press *Ok* button on the pop-up + <!- --> + <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickOnSelectLinkInFirstRow"/> + <click selector="{{AdminCustomerAddressesGridSection.firstRowDeleteLink}}" stepKey="chooseDeleteOptionInFirstRow"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad1"/> + <click selector="{{AdminCustomerAddressesGridActionsSection.ok}}" stepKey="clickOkOnPopup"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad2"/> + <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickOnSelectLinkInFirstRow2"/> + <click selector="{{AdminCustomerAddressesGridSection.firstRowDeleteLink}}" stepKey="chooseDeleteOptionInFirstRow2"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad3"/> + <click selector="{{AdminCustomerAddressesGridActionsSection.ok}}" stepKey="clickOkOnPopup2"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad4"/> + <see userInput="We couldn't find any records." selector="{{AdminCustomerAddressesGridSection.customerAddressGrid}}" stepKey="checkThatCustomerAddressesGridHasNoRecords"/> +</test> +</tests> From 58ae228051e30aef82474c206238e8355c910ecf Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Thu, 6 Dec 2018 11:27:28 +0200 Subject: [PATCH 12/25] MAGETWO-96962: [MFTF Test] Admin - Customers - Addresses Grid - delete customer address from the grid - Add selector rowsInGrid in AdminCustomerAddressesGridSection - Remove empty lines - Finalize test, add one more assert and comments --- .../Mftf/Section/AdminCustomerAddressesGridSection.xml | 2 +- .../Section/AdminEditCustomerInformationSection.xml | 1 - .../AdminDeleteCustomerAddressesFromTheGridTest.xml | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml index 948d6f1cd9777..85c086d01848b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridSection.xml @@ -18,6 +18,6 @@ <element name="firstRowCheckbox" type="checkbox" selector="//tr[contains(@data-repeat-index, '0')]//input[contains(@data-action, 'select-row')]"/> <element name="secondRowCheckbox" type="checkbox" selector="//tr[contains(@data-repeat-index, '1')]//input[contains(@data-action, 'select-row')]"/> <element name="checkboxByName" type="checkbox" selector="//div[contains(text(),'{{customer}}')]/ancestor::tr[contains(@class, 'data-row')]//input[@class='admin__control-checkbox']" parameterized="true" /> - + <element name="rowsInGrid" type="text" selector="//tr[contains(@class,'data-row')]"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml index 8c3a011052ac1..f5bbb84eaa593 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml @@ -11,6 +11,5 @@ <section name="AdminEditCustomerInformationSection"> <element name="orders" type="button" selector="#tab_orders_content" timeout="30"/> <element name="addresses" type="button" selector="//a[@id='tab_address']" timeout="30"/> - </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml index d6b58c3098ff6..c5a581011fd8d 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -36,16 +36,16 @@ <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> - <!-- - - Step4. Click *Select* link in *Actions* column for target additional address - Step5. Click *Delete* - Step6. Press *Ok* button on the pop-up - <!- --> + <!--Step4. Click *Select* link in *Actions* column for target additional address--> <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickOnSelectLinkInFirstRow"/> + <!--Step5. Click *Delete*--> <click selector="{{AdminCustomerAddressesGridSection.firstRowDeleteLink}}" stepKey="chooseDeleteOptionInFirstRow"/> <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad1"/> + <!--Step6. Press *Ok* button on the pop-up--> <click selector="{{AdminCustomerAddressesGridActionsSection.ok}}" stepKey="clickOkOnPopup"/> <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad2"/> + <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> + <!--Step7. Delete last customer address--> <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickOnSelectLinkInFirstRow2"/> <click selector="{{AdminCustomerAddressesGridSection.firstRowDeleteLink}}" stepKey="chooseDeleteOptionInFirstRow2"/> <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad3"/> From 4357340663054ea4e17e80cdea2d3b3f1303b511 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Thu, 6 Dec 2018 13:00:43 +0200 Subject: [PATCH 13/25] MAGETWO-96974: [MFTF Test] Admin - Customers - Addresses Grid - search customer address by keyword - Add test --- ...dminSearchCustomerAddressByKeywordTest.xml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml new file mode 100644 index 0000000000000..521101d3fa93a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminSearchCustomerAddressByKeywordTest"> + <annotations> + <title value="Admin search customer address by keyword"/> + <description value="Admin search customer address by keyword"/> + <features value="Module/ Customer"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94954"/> + <stories value="MAGETWO-94346: Implement handling of large number of addresses on admin edit customer page"/> + <group value="customer"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customerts. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. On edit customer page open *Addresses* tab and find a grid with the additional addresses + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> + </actionGroup> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <!--Step4. Fill *Search by keyword* filed with the query and press enter or clock on the magnifier icon--> + <fillField userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="FillCustomerAddressStreetInSearchByKeyword"/> + <pressKey parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="pressEnterKey"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad"/> + <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> + </test> +</tests> \ No newline at end of file From fe2df173dc7f07ca546d5db050dedb928dbda193 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Thu, 6 Dec 2018 19:58:05 +0200 Subject: [PATCH 14/25] MAGETWO-96907: [MFTF Test] Admin - Customers - Addresses Grid - set address as default billing from the grid - Customer default billing and shipping sections added; - New test added; - New customer without default addresses added; --- .../Customer/Test/Mftf/Data/AddressData.xml | 16 +++++++ .../Customer/Test/Mftf/Data/CustomerData.xml | 14 ++++++ ...CustomerAddressesDefaultBillingSection.xml | 16 +++++++ ...ustomerAddressesDefaultShippingSection.xml | 16 +++++++ .../Section/AdminCustomerAddressesSection.xml | 2 +- ...inSetCustomerDefaultBillingAddressTest.xml | 43 +++++++++++-------- 6 files changed, 89 insertions(+), 18 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultShippingSection.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml index 2bbe7930f6dbf..61e07a6faa971 100755 --- a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml @@ -68,6 +68,22 @@ <requiredEntity type="region">RegionNY</requiredEntity> <data key="country">United States</data> </entity> + <entity name="US_Address_NY_Not_Default_Address" type="address"> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="company">368</data> + <array key="street"> + <item>368 Broadway St.</item> + <item>Apt. 113</item> + </array> + <data key="city">New York</data> + <data key="state">New York</data> + <data key="country_id">US</data> + <data key="postcode">10001</data> + <data key="telephone">512-345-6789</data> + <requiredEntity type="region">RegionNY</requiredEntity> + <data key="country">United States</data> + </entity> <entity name="US_Address_CA" type="address"> <data key="firstname">John</data> <data key="lastname">Doe</data> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml index 6f5ade53e6790..f3ef631b65742 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml @@ -59,6 +59,20 @@ <requiredEntity type="address">US_Address_NY</requiredEntity> <requiredEntity type="address">UK_Not_Default_Address</requiredEntity> </entity> + <entity name="Simple_US_Customer_Multiple_Addresses_No_Default_Address" type="customer"> + <data key="group_id">0</data> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">John.Doe@example.com</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="fullname">John Doe</data> + <data key="password">pwdTest123!</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity> + <requiredEntity type="address">UK_Not_Default_Address</requiredEntity> + </entity> <entity name="Simple_US_Customer_NY" type="customer"> <data key="group_id">0</data> <data key="default_billing">true</data> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml new file mode 100644 index 0000000000000..a85c12fda1064 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCustomerAddressesDefaultBillingSection"> + <element name="addressDetails" type="text" selector="//div[@class='customer-default-billing-address-content']//div[@class='address_details']"/> + <element name="address" type="text" selector="//div[@class='customer-default-billing-address-content']//address//span"/> + <element name="editButton" type="text" selector="//button[@data-index='edit_billing_address']"/> + </section> +</sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultShippingSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultShippingSection.xml new file mode 100644 index 0000000000000..610bb16874b8a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultShippingSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCustomerAddressesDefaultShippingSection"> + <element name="addressDetails" type="text" selector="//div[@class='customer-default-shipping-address-content']//div[@class='address_details']"/> + <element name="address" type="text" selector="//div[@class='customer-default-shipping-address-content']//address//span"/> + <element name="editButton" type="text" selector="//button[@data-index='edit_shipping_address']"/> + </section> +</sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml index 6f70c2d087e62..69472069854a8 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminCustomerAddressesSection"> <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> - <element name="defaultBillingAddress" type="button" selector="div[data-index=default_billing] .admin__actions-switch-label"/> + <element name="defaultBillingAddress" type="input" selector="//input[@name='default_billing']"/> <element name="defaultShippingAddress" type="button" selector="div[data-index=default_shipping] .admin__actions-switch-label"/> <element name="firstNameForAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'firstname')]"/> <element name="lastNameForAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'lastname')]"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml index 356e5b9a09c19..4491418cb082d 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml @@ -18,31 +18,40 @@ <group value="customer"/> </annotations> <before> - <createData entity="Simple_US_Customer" stepKey="customer"/> + <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> - <!--Edit customer info--> - <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> - <argument name="customer" value="$$customer$$"/> + <!-- - + Step1. Login to admin and go to Customers > All Customers. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. On edit customer page open *Addresses* tab and find a grid with the additional addresses + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> </actionGroup> - <click stepKey="goToAddresses" selector="{{AdminCustomerAccountInformationSection.addressesButton}}"/> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <waitForPageLoad stepKey="waitForAddresses"/> - - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersSectionOnCustomerAddressGrid"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/> - <fillField userInput="{{Simple_US_Customer.lastname}}" selector="//" stepKey="fillNameFieldOnFiltersSection"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCustomerGroupGridActionsSection.selectButton('customerGroupName')}}" stepKey="clickSelectButton"/> - - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDeleteCustomerGroup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> - <see userInput="The customer will receive an email with a link to reset password." stepKey="messageThatLinkToPasswordResetIsSent"/> + <fillField userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="fillCustomerAddressStreetInSearchByKeyword"/> + <pressKey parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="pressEnterKey"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad"/> + <see userInput="The customer does not have default billing address" selector="{{AdminCustomerAddressesDefaultBillingSection.address}}" stepKey="assertThatThereIsNoDefaultBillingAddress"/> + <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> + <!--Step4. Click *Select* link in *Actions* column for target additional address--> + <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickSelectElementFromRow" /> + <!--Step4. Click *Set as default shipping*--> + <click selector="{{AdminCustomerAddressesGridSection.firstRowSetAsDefaultBillingLink}}" stepKey="clickOnSetAddressAsDefaultBilling"/> + <!--Step5. Press *Ok* button on the pop-up--> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSetAddressAsDefaultBilling"/> + <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="seeDefaultBillingAddressSection"/> + <see userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingIsSet"/> + <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/> + <waitForPageLoad stepKey="waitForCustomerAddressModalLoad"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" attribute="value" expectedValue="1" stepKey="assertDefaultBillingSwitcherIsEnabledOnCustomerAddressModal"/> </test> </tests> From ec20bad8df3df4879e89e0def467d042e72997eb Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Thu, 6 Dec 2018 20:55:40 +0200 Subject: [PATCH 15/25] MAGETWO-96992: [MFTF Test] Admin - Customers - delete default billing customer address - Add test - Add selectors in AdminCustomerAddressesDefaultBillingSection --- ...CustomerAddressesDefaultBillingSection.xml | 2 + ...eleteDefaultBillingCustomerAddressTest.xml | 50 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml index a85c12fda1064..d93a11c155111 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml @@ -12,5 +12,7 @@ <element name="addressDetails" type="text" selector="//div[@class='customer-default-billing-address-content']//div[@class='address_details']"/> <element name="address" type="text" selector="//div[@class='customer-default-billing-address-content']//address//span"/> <element name="editButton" type="text" selector="//button[@data-index='edit_billing_address']"/> + <element name="deleteButton" type="button" selector="//button[@id='delete']"/> + <element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml new file mode 100644 index 0000000000000..1f303d41e2d4c --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminDeleteDefaultBillingCustomerAddressTest"> + <annotations> + <title value="Admin delete default billing customer address"/> + <description value="Admin delete default billing customer address"/> + <features value="Module/ Customer"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94816"/> + <stories value="MAGETWO-94346: Implement handling of large number of addresses on admin edit customer page"/> + <group value="customer"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customerts. + Step2. On *Customers* page choose customer from preconditions and open it to edit + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> + </actionGroup> + <!--Step3. Open *Addresses* tab on edit customer page and click *edit* link near *Default Billing Address* block--> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <seeNumberOfElements userInput="2" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeTwoCustomerAddressesInGrid"/> + <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditNearDefaultBillingAddress"/> + <waitForPageLoad stepKey="waitForDefaultBillingAddressPopupLoad"/> + <!--Step4. Press *Delete* button--> + <click selector="{{AdminCustomerAddressesDefaultBillingSection.deleteButton}}" stepKey="clickDeleteButton"/> + <waitForPageLoad stepKey="waitForConfirmationPopupLoad"/> + <click selector="{{AdminCustomerAddressesDefaultBillingSection.ok}}" stepKey="clickOkOnPopup"/> + <waitForPageLoad stepKey="waitForDefaultBillingAddressPopupLoad2"/> + <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> + <dontSee userInput="{{US_Address_NY.street[0]}}" stepKey="assertDefaultBillingIsSet"/> + </test> +</tests> From ee1fed8724b1ee951c78d52797e701bad44e5903 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Fri, 7 Dec 2018 10:27:44 +0200 Subject: [PATCH 16/25] MAGETWO-96907: [MFTF Test] Admin - Customers - Addresses Grid - set address as default billing from the grid - Remove duplicate element in sections; --- .../Mftf/Section/AdminCustomerAddressesGridActionsSection.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml index 078f8bf23116b..d8d93814333ca 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesGridActionsSection.xml @@ -15,7 +15,6 @@ <element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/> <element name="actions" type="text" selector="//div[@class='admin__data-grid-header']//button[@class='action-select']"/> <element name="filters" type="button" selector="button[data-action='grid-filter-expand']" timeout="30"/> - <element name="firstRow" type="button" selector="tr:nth-of-type(1)[data-role='row']"/> <element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/> </section> </sections> From de5e9bca06c9cbd3f78b9de4cea6511cccd4a1a8 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Fri, 7 Dec 2018 11:01:43 +0200 Subject: [PATCH 17/25] MAGETWO-96992: [MFTF Test] Admin - Customers - delete default billing customer address - move selectors deleteButton, ok to AdminCustomerAddressesSection section - fix grammatical error --- .../Section/AdminCustomerAddressesDefaultBillingSection.xml | 2 -- .../Test/Mftf/Section/AdminCustomerAddressesSection.xml | 2 ++ .../Test/AdminDeleteDefaultBillingCustomerAddressTest.xml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml index d93a11c155111..a85c12fda1064 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesDefaultBillingSection.xml @@ -12,7 +12,5 @@ <element name="addressDetails" type="text" selector="//div[@class='customer-default-billing-address-content']//div[@class='address_details']"/> <element name="address" type="text" selector="//div[@class='customer-default-billing-address-content']//address//span"/> <element name="editButton" type="text" selector="//button[@data-index='edit_billing_address']"/> - <element name="deleteButton" type="button" selector="//button[@id='delete']"/> - <element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml index 69472069854a8..68784414e4f29 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml @@ -22,5 +22,7 @@ <element name="phoneNumber" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'telephone')]"/> <element name="saveAddress" type="button" selector="//button[@title='Save']"/> <element name="customerAddressRow" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true"/> + <element name="deleteButton" type="button" selector="//button[@id='delete']"/> + <element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml index 1f303d41e2d4c..822378c8707a8 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- - - Step1. Login to admin and go to Customers > All Customerts. + Step1. Login to admin and go to Customers > All Customers. Step2. On *Customers* page choose customer from preconditions and open it to edit <!- --> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> @@ -40,9 +40,9 @@ <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditNearDefaultBillingAddress"/> <waitForPageLoad stepKey="waitForDefaultBillingAddressPopupLoad"/> <!--Step4. Press *Delete* button--> - <click selector="{{AdminCustomerAddressesDefaultBillingSection.deleteButton}}" stepKey="clickDeleteButton"/> + <click selector="{{AdminCustomerAddressesSection.deleteButton}}" stepKey="clickDeleteButton"/> <waitForPageLoad stepKey="waitForConfirmationPopupLoad"/> - <click selector="{{AdminCustomerAddressesDefaultBillingSection.ok}}" stepKey="clickOkOnPopup"/> + <click selector="{{AdminCustomerAddressesSection.ok}}" stepKey="clickOkOnPopup"/> <waitForPageLoad stepKey="waitForDefaultBillingAddressPopupLoad2"/> <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> <dontSee userInput="{{US_Address_NY.street[0]}}" stepKey="assertDefaultBillingIsSet"/> From 95816aa070612590a17c02cf5861708aff30a367 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Fri, 7 Dec 2018 11:36:40 +0200 Subject: [PATCH 18/25] MAGETWO-96963: [MFTF Test] Admin - Customer - Addresses Grid - set address as default shipping from the grid --- .../Section/AdminCustomerAddressesSection.xml | 4 +- ...inSetCustomerDefaultBillingAddressTest.xml | 10 ++-- ...nSetCustomerDefaultShippingAddressTest.xml | 58 +++++++++++++++++++ 3 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml index 69472069854a8..b2d461e8cc672 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml @@ -10,8 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminCustomerAddressesSection"> <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> - <element name="defaultBillingAddress" type="input" selector="//input[@name='default_billing']"/> + <element name="defaultBillingAddress" type="button" selector="div[data-index=default_billing] .admin__actions-switch-label"/> + <element name="defaultBillingAddressCheckBox" type="input" selector="//input[@name='default_billing']"/> <element name="defaultShippingAddress" type="button" selector="div[data-index=default_shipping] .admin__actions-switch-label"/> + <element name="defaultShippingAddressCheckBox" type="input" selector="//input[@name='default_shipping']"/> <element name="firstNameForAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'firstname')]"/> <element name="lastNameForAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'lastname')]"/> <element name="streetAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'street')]"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml index 4491418cb082d..03bedb98fc7df 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml @@ -12,7 +12,7 @@ <annotations> <stories value="Set customer default billing address"/> <title value="Admin should be able to set customer default billing address"/> - <description value="Admin should be able to set customer default billing address"/> + <description value="Admin should be able to set customer default billing address from customer addresses grid row actions"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-94952"/> <group value="customer"/> @@ -43,15 +43,15 @@ <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> <!--Step4. Click *Select* link in *Actions* column for target additional address--> <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickSelectElementFromRow" /> - <!--Step4. Click *Set as default shipping*--> + <!--Step4. Click *Set as default billing*--> <click selector="{{AdminCustomerAddressesGridSection.firstRowSetAsDefaultBillingLink}}" stepKey="clickOnSetAddressAsDefaultBilling"/> <!--Step5. Press *Ok* button on the pop-up--> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSetAddressAsDefaultBilling"/> <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="seeDefaultBillingAddressSection"/> - <see userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingIsSet"/> + <see userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsSet"/> <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/> - <waitForPageLoad stepKey="waitForCustomerAddressModalLoad"/> - <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" attribute="value" expectedValue="1" stepKey="assertDefaultBillingSwitcherIsEnabledOnCustomerAddressModal"/> + <waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultBillingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultBillingCheckboxIsCheckedOnCustomerAddressAddUpdateForm"/> </test> </tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml new file mode 100644 index 0000000000000..cc9e71e047858 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminSetCustomerDefaultShippingAddressTest"> + <annotations> + <stories value="Set customer default shipping address"/> + <title value="Admin should be able to set customer default shipping address"/> + <description value="Admin should be able to set customer default shipping address from customer addresses grid row actions"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-94953"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customers. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. On edit customer page open *Addresses* tab and find a grid with the additional addresses + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> + </actionGroup> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <waitForPageLoad stepKey="waitForAddresses"/> + <fillField userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="fillCustomerAddressStreetInSearchByKeyword"/> + <pressKey parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="pressEnterKey"/> + <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad"/> + <see userInput="The customer does not have default shipping address" selector="{{AdminCustomerAddressesDefaultShippingSection.address}}" stepKey="assertThatThereIsNoDefaultShippingAddress"/> + <seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeOnlyOneCustomerAddressesInGrid"/> + <!--Step4. Click *Select* link in *Actions* column for target additional address--> + <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickSelectElementFromRow" /> + <!--Step4. Click *Set as default shipping*--> + <click selector="{{AdminCustomerAddressesGridSection.firstRowSetAsDefaultShippingLink}}" stepKey="clickOnSetAddressAsDefaultShipping"/> + <!--Step5. Press *Ok* button on the pop-up--> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSetAddressAsDefaultShipping"/> + <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="seeDefaultShippingAddressSection"/> + <see userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="assertDefaultShippingAddressIsSet"/> + <click selector="{{AdminCustomerAddressesDefaultShippingSection.editButton}}" stepKey="clickEditDefaultShippingAddress"/> + <waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultShippingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultShippingCheckboxIsCheckedOnCustomerAddressAddUpdateForm"/> + </test> +</tests> + + From 3c2f0e65b89ce217eccd0e860617d4a90eb5c524 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Fri, 7 Dec 2018 16:23:04 +0200 Subject: [PATCH 19/25] MAGETWO-96997: [MFTF Test] Admin - Customers - add new default billing/shipping customer address --- .../Section/AdminCustomerAddressesSection.xml | 8 ++- ...aultBillingShippingCustomerAddressTest.xml | 68 +++++++++++++++++++ ...inSetCustomerDefaultBillingAddressTest.xml | 2 - ...nSetCustomerDefaultShippingAddressTest.xml | 2 - 4 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml index ac56e4847f603..8068f94032730 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressesSection.xml @@ -11,14 +11,18 @@ <section name="AdminCustomerAddressesSection"> <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> <element name="defaultBillingAddress" type="button" selector="div[data-index=default_billing] .admin__actions-switch-label"/> - <element name="defaultBillingAddressCheckBox" type="input" selector="//input[@name='default_billing']"/> + <element name="defaultBillingAddressCheckBox" type="input" selector="//div[@class='admin__field-control']//input[@name='default_billing']"/> <element name="defaultShippingAddress" type="button" selector="div[data-index=default_shipping] .admin__actions-switch-label"/> - <element name="defaultShippingAddressCheckBox" type="input" selector="//input[@name='default_shipping']"/> + <element name="defaultShippingAddressCheckBox" type="input" selector="//div[@class='admin__field-control']//input[@name='default_shipping']"/> <element name="firstNameForAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'firstname')]"/> <element name="lastNameForAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'lastname')]"/> <element name="streetAddress" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'street')]"/> <element name="city" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'city')]"/> + <element name="company" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'company')]"/> + <element name="region" type="select" selector="//div[@class='admin__field-control']//select[@name='region_id']"/> + <element name="regionId" type="select" selector="//div[@class='admin__field-control']//select[@name='region_id']//option[@data-title='{{regionName}}']" parameterized="true"/> <element name="country" type="select" selector="//div[@class='admin__field-control']//select[contains(@name, 'country_id')]"/> + <element name="countryId" type="input" selector="//div[@class='admin__field-control']//select[contains(@name, 'country_id')]//option[@value='{{countryName}}']" parameterized="true"/> <element name="state" type="select" selector="//div[@class='admin__field-control']//select[contains(@name, 'region_id')]"/> <element name="zip" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'postcode')]"/> <element name="phoneNumber" type="input" selector="//div[@class='admin__field-control']//input[contains(@name, 'telephone')]"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml new file mode 100644 index 0000000000000..df5597dcc44ad --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAddNewDefaultBillingShippingCustomerAddressTest"> + <annotations> + <stories value="Add new default billing/shipping customer address"/> + <title value="Add new default billing/shipping customer address"/> + <description value="Add new default billing/shipping customer address on customer addresses tab"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-94814"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="customer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customers. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. Open *Addresses* tab on edit customer page and press *Add New Address* button + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> + </actionGroup> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <waitForPageLoad stepKey="waitForAddresses"/> + <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/> + <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsSetBeforeChangingDefaultAddress"/> + <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/> + <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="assertDefaultShippingAddressIsSetBeforeChangingDefaultAddress"/> + <click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickAddNewAddressButton"/> + <waitForPageLoad stepKey="waitForAddUpdateCustomerAddressForm"/> + <!--Step4. Fill all the fields with test data and press *Save* button--> + <click selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" stepKey="enableDefaultBillingAddress"/> + <click selector="{{AdminCustomerAddressesSection.defaultShippingAddress}}" stepKey="enableDefaultShippingAddress"/> + <fillField userInput="{{US_Address_TX.firstname}}" selector="{{AdminCustomerAddressesSection.firstNameForAddress}}" stepKey="fillFirstName"/> + <fillField userInput="{{US_Address_TX.lastname}}" selector="{{AdminCustomerAddressesSection.lastNameForAddress}}" stepKey="fillLastName"/> + <fillField userInput="{{US_Address_TX.company}}" selector="{{AdminCustomerAddressesSection.company}}" stepKey="fillCompany"/> + <fillField userInput="{{US_Address_TX.street[0]}}" selector="{{AdminCustomerAddressesSection.streetAddress}}" stepKey="fillStreet"/> + <fillField userInput="{{US_Address_TX.city}}" selector="{{AdminCustomerAddressesSection.city}}" stepKey="fillCity"/> + <click selector="{{AdminCustomerAddressesSection.country}}" stepKey="clickCountryToOpenListOfCountries"/> + <click selector="{{AdminCustomerAddressesSection.countryId(US_Address_TX.country_id)}}" stepKey="fillCountry"/> + <fillField userInput="{{US_Address_TX.postcode}}" selector="{{AdminCustomerAddressesSection.zip}}" stepKey="fillPostcode"/> + <fillField userInput="{{US_Address_TX.telephone}}" selector="{{AdminCustomerAddressesSection.phoneNumber}}" stepKey="fillTelephone"/> + <click selector="{{AdminCustomerAddressesSection.region}}" stepKey="clickRegionToOpenListOfRegions"/> + <click selector="{{AdminCustomerAddressesSection.regionId(US_Address_TX.state)}}" stepKey="fillRegion"/> + <click selector="{{AdminCustomerAddressesSection.saveAddress}}" stepKey="clickSaveCustomerAddressOnAddUpdateAddressForm"/> + <waitForPageLoad stepKey="waitForNewAddressIsCreated"/> + <see userInput="{{US_Address_TX.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsChanged"/> + <see userInput="{{US_Address_TX.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="assertDefaultShippingAddressIsChanged"/> + <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/> + <waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultBillingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultBillingIsEnabledCustomerAddressAddUpdateForm"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultShippingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultShippingIsEnabledOnCustomerAddressAddUpdateForm"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml index 03bedb98fc7df..ec80d7003144e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml @@ -54,5 +54,3 @@ <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultBillingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultBillingCheckboxIsCheckedOnCustomerAddressAddUpdateForm"/> </test> </tests> - - diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml index cc9e71e047858..3fc6c1a481abf 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml @@ -54,5 +54,3 @@ <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultShippingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultShippingCheckboxIsCheckedOnCustomerAddressAddUpdateForm"/> </test> </tests> - - From 937d720011760cb5ae2c888cf806c3f89d1cb260 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Fri, 7 Dec 2018 17:16:44 +0200 Subject: [PATCH 20/25] MAGETWO-96999: [MFTF Test] Admin - Customers - edit default billing/shipping customer address --- ...aultBillingShippingCustomerAddressTest.xml | 12 ++-- ...aultBillingShippingCustomerAddressTest.xml | 68 +++++++++++++++++++ 2 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml index df5597dcc44ad..d48439ef5fbf8 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml @@ -18,7 +18,7 @@ <group value="customer"/> </annotations> <before> - <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="customer"/> + <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> @@ -32,14 +32,14 @@ <!- --> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> - <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <waitForPageLoad stepKey="waitForAddresses"/> - <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/> - <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsSetBeforeChangingDefaultAddress"/> - <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/> - <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="assertDefaultShippingAddressIsSetBeforeChangingDefaultAddress"/> + <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.address}}" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/> + <see userInput="The customer does not have default billing address" selector="{{AdminCustomerAddressesDefaultBillingSection.address}}" stepKey="assertThereIsNoDefaultBillingAddressSet"/> + <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.address}}" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/> + <see userInput="The customer does not have default shipping address" selector="{{AdminCustomerAddressesDefaultShippingSection.address}}" stepKey="assertThereIsNoDefaultShippingAddressSet"/> <click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickAddNewAddressButton"/> <waitForPageLoad stepKey="waitForAddUpdateCustomerAddressForm"/> <!--Step4. Fill all the fields with test data and press *Save* button--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml new file mode 100644 index 0000000000000..680af0d39c9f0 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminEditDefaultBillingShippingCustomerAddressTest"> + <annotations> + <stories value="Edit default billing/shipping customer address"/> + <title value="Edit default billing/shipping customer address"/> + <description value="Edit default billing/shipping customer address on customer addresses tab"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-94815"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="customer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- - + Step1. Login to admin and go to Customers > All Customers. + Step2. On *Customers* page choose customer from preconditions and open it to edit + Step3. Open *Addresses* tab on edit customer page and press *Add New Address* button + <!- --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> + </actionGroup> + <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <waitForPageLoad stepKey="waitForAddresses"/> + <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/> + <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsSetBeforeChangingDefaultAddress"/> + <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/> + <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="assertDefaultShippingAddressIsSetBeforeChangingDefaultAddress"/> + <click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickAddNewAddressButton"/> + <waitForPageLoad stepKey="waitForAddUpdateCustomerAddressForm"/> + <!--Step4. Fill all the fields with test data and press *Save* button--> + <click selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" stepKey="enableDefaultBillingAddress"/> + <click selector="{{AdminCustomerAddressesSection.defaultShippingAddress}}" stepKey="enableDefaultShippingAddress"/> + <fillField userInput="{{US_Address_TX.firstname}}" selector="{{AdminCustomerAddressesSection.firstNameForAddress}}" stepKey="fillFirstName"/> + <fillField userInput="{{US_Address_TX.lastname}}" selector="{{AdminCustomerAddressesSection.lastNameForAddress}}" stepKey="fillLastName"/> + <fillField userInput="{{US_Address_TX.company}}" selector="{{AdminCustomerAddressesSection.company}}" stepKey="fillCompany"/> + <fillField userInput="{{US_Address_TX.street[0]}}" selector="{{AdminCustomerAddressesSection.streetAddress}}" stepKey="fillStreet"/> + <fillField userInput="{{US_Address_TX.city}}" selector="{{AdminCustomerAddressesSection.city}}" stepKey="fillCity"/> + <click selector="{{AdminCustomerAddressesSection.country}}" stepKey="clickCountryToOpenListOfCountries"/> + <click selector="{{AdminCustomerAddressesSection.countryId(US_Address_TX.country_id)}}" stepKey="fillCountry"/> + <fillField userInput="{{US_Address_TX.postcode}}" selector="{{AdminCustomerAddressesSection.zip}}" stepKey="fillPostcode"/> + <fillField userInput="{{US_Address_TX.telephone}}" selector="{{AdminCustomerAddressesSection.phoneNumber}}" stepKey="fillTelephone"/> + <click selector="{{AdminCustomerAddressesSection.region}}" stepKey="clickRegionToOpenListOfRegions"/> + <click selector="{{AdminCustomerAddressesSection.regionId(US_Address_TX.state)}}" stepKey="fillRegion"/> + <click selector="{{AdminCustomerAddressesSection.saveAddress}}" stepKey="clickSaveCustomerAddressOnAddUpdateAddressForm"/> + <waitForPageLoad stepKey="waitForNewAddressIsCreated"/> + <see userInput="{{US_Address_TX.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsChanged"/> + <see userInput="{{US_Address_TX.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="assertDefaultShippingAddressIsChanged"/> + <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/> + <waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultBillingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultBillingIsEnabledCustomerAddressAddUpdateForm"/> + <assertElementContainsAttribute selector="{{AdminCustomerAddressesSection.defaultShippingAddressCheckBox}}" attribute="value" expectedValue="1" stepKey="assertDefaultShippingIsEnabledOnCustomerAddressAddUpdateForm"/> + </test> +</tests> From fff16e3eaa6e12502af7662fe6050ede5c80c021 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Mon, 10 Dec 2018 12:35:08 +0200 Subject: [PATCH 21/25] MAGETWO-96974: [MFTF Test] Admin - Customers - Addresses Grid - search customer address by keyword - Stabilize test, add reindex command in before test --- .../Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml index 521101d3fa93a..7982fab6b14f5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml @@ -20,6 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> From 54fb30c981befe5b6c28d5888f2042b4e3d6eee9 Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Mon, 17 Dec 2018 15:44:30 +0200 Subject: [PATCH 22/25] MAGETWO-97188: Stabilize PR --- .../Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml | 2 +- .../Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml | 3 +++ ...minDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml | 1 + .../Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml index 149d39e2d9bfa..b9a3839ff9894 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAddressFiltersSection.xml @@ -19,6 +19,6 @@ <element name="countryInput" type="input" selector="select[name=country_id]"/> <element name="telephoneInput" type="input" selector="input[name=telephone]"/> <element name="applyFilter" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/> - <element name="clearAll" type="button" selector=".admin__data-grid-header .action-tertiary.action-clear"/> + <element name="clearAll" type="button" selector=".admin__data-grid-header .action-tertiary.action-clear" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml index c5a581011fd8d..061948ff7410b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -20,6 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> @@ -37,6 +38,8 @@ </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <!--Step4. Click *Select* link in *Actions* column for target additional address--> + <wait stepKey="aaa" time="20"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickOnSelectLinkInFirstRow"/> <!--Step5. Click *Delete*--> <click selector="{{AdminCustomerAddressesGridSection.firstRowDeleteLink}}" stepKey="chooseDeleteOptionInFirstRow"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml index 2cbe47c8e937f..c7ee52b746e60 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -20,6 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml index 822378c8707a8..248d589b480c9 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -20,6 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> From 4e9a84831027db88b6377bbfb45c25dbb868181b Mon Sep 17 00:00:00 2001 From: Dmytro Drozd <ddrozd@magento.com> Date: Mon, 17 Dec 2018 15:53:15 +0200 Subject: [PATCH 23/25] MAGETWO-97188: Stabilize PR --- .../AdminAddNewDefaultBillingShippingCustomerAddressTest.xml | 1 + .../Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml | 1 - ...AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml | 1 + .../Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml | 1 + .../Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml | 1 + .../Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml | 1 + .../Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml | 1 + .../Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml | 1 + 8 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml index d48439ef5fbf8..fba7ebd2d4d5e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml @@ -36,6 +36,7 @@ </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <waitForPageLoad stepKey="waitForAddresses"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.address}}" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/> <see userInput="The customer does not have default billing address" selector="{{AdminCustomerAddressesDefaultBillingSection.address}}" stepKey="assertThereIsNoDefaultBillingAddressSet"/> <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.address}}" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml index 061948ff7410b..4f501c27352bf 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -38,7 +38,6 @@ </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <!--Step4. Click *Select* link in *Actions* column for target additional address--> - <wait stepKey="aaa" time="20"/> <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <click selector="{{AdminCustomerAddressesGridSection.firstRowSelectLink}}" stepKey="clickOnSelectLinkInFirstRow"/> <!--Step5. Click *Delete*--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml index c7ee52b746e60..a703c5a7c5d92 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -37,6 +37,7 @@ <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <!-- - Step4. Check checkboxes for several addresses open *Actions* dropdown at the top of addresses grid and select action *Delete* Step5. Press *Ok* button on the pop-up diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml index 248d589b480c9..bb455677d5e94 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -37,6 +37,7 @@ </actionGroup> <!--Step3. Open *Addresses* tab on edit customer page and click *edit* link near *Default Billing Address* block--> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <seeNumberOfElements userInput="2" selector="{{AdminCustomerAddressesGridSection.rowsInGrid}}" stepKey="seeTwoCustomerAddressesInGrid"/> <click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditNearDefaultBillingAddress"/> <waitForPageLoad stepKey="waitForDefaultBillingAddressPopupLoad"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml index 680af0d39c9f0..df317c8bf7012 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml @@ -36,6 +36,7 @@ </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <waitForPageLoad stepKey="waitForAddresses"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <seeElement selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/> <see userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="assertDefaultBillingAddressIsSetBeforeChangingDefaultAddress"/> <seeElement selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml index 7982fab6b14f5..9f1c5e8cd923a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml @@ -37,6 +37,7 @@ <argument name="customer" value="Simple_US_Customer_Multiple_Addresses"/> </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <!--Step4. Fill *Search by keyword* filed with the query and press enter or clock on the magnifier icon--> <fillField userInput="{{US_Address_NY.street[0]}}" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="FillCustomerAddressStreetInSearchByKeyword"/> <pressKey parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="pressEnterKey"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml index ec80d7003144e..db8d4e1ee1eea 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml @@ -36,6 +36,7 @@ </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <waitForPageLoad stepKey="waitForAddresses"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <fillField userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="fillCustomerAddressStreetInSearchByKeyword"/> <pressKey parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="pressEnterKey"/> <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml index 3fc6c1a481abf..6e83218176904 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml @@ -36,6 +36,7 @@ </actionGroup> <click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTab"/> <waitForPageLoad stepKey="waitForAddresses"/> + <conditionalClick selector="{{AdminCustomerAddressFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerAddressFiltersSection.clearAll}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> <fillField userInput="{{US_Address_NY_Not_Default_Address.street[0]}}" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="fillCustomerAddressStreetInSearchByKeyword"/> <pressKey parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" selector="{{AdminCustomerAddressesGridActionsSection.search}}" stepKey="pressEnterKey"/> <waitForPageLoad stepKey="waitForCustomerAddressesGridPageLoad"/> From 42f6dc3bff3d32b439c0397c2a30a52297da67ae Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Tue, 18 Dec 2018 18:26:06 +0200 Subject: [PATCH 24/25] MAGETWO-97188: Stabilize PR - Add suffix to store group code; --- app/code/Magento/Store/Test/Mftf/Data/StoreGroupData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreGroupData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreGroupData.xml index 7b31623f237e9..e575ca3317ab6 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreGroupData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreGroupData.xml @@ -23,7 +23,7 @@ </entity> <entity name="staticStoreGroup" type="group"> <data key="name">NewStore</data> - <data key="code">Base12</data> + <data key="code" unique="suffix">Base12</data> <data key="root_category_id">2</data> <data key="website_id">1</data> </entity> From 7362c89c65ad822c12a7f82826fc51c320459400 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Thu, 20 Dec 2018 17:14:56 +0200 Subject: [PATCH 25/25] MAGETWO-97266: [Panda] PR Stabilization --- .../app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml index 9c19f80e91d39..cdb73c5d36f25 100644 --- a/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/Analytics/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" summary="Navigate to menu chapter"> <variation name="NavigateMenuTestBIEssentials" summary="Navigate through BI Essentials admin menu to Sign Up page" ticketId="MAGETWO-63700"> + <data name="issue" xsi:type="string">MAGETWO-97261: Magento\Backend\Test\TestCase\NavigateMenuTest fails on Jenkins</data> <data name="menuItem" xsi:type="string">Reports > BI Essentials</data> <data name="waitMenuItemNotVisible" xsi:type="boolean">false</data> <data name="businessIntelligenceLink" xsi:type="string">https://dashboard.rjmetrics.com/v2/magento/signup</data>