From 8fdc1fd6589f3880644dc2c17d32be5bce38002b Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Tue, 27 Jan 2015 16:51:19 +0200 Subject: [PATCH 01/50] MTA-549: Re-factor Tests for Update Products --- .../BundleProduct/BundleSelections.php | 76 ++++++++++ .../Test/Fixture/BundleProduct/Price.php | 8 ++ .../Bundle/Test/Repository/BundleProduct.xml | 46 ++++++ .../Bundle/Test/TestCase/EditBundleTest.php | 131 ------------------ .../UpdateBundleProductEntityTest.php | 12 ++ .../UpdateBundleProductEntityTest/test.csv | 8 +- .../CatalogProductSimple/AttributeSetId.php | 6 +- .../Test/Repository/CatalogProductSimple.xml | 44 ++++++ .../Product/EditSimpleProductTest.php | 115 --------------- .../Product/UpdateSimpleProductEntityTest.php | 68 ++++----- .../UpdateSimpleProductEntityTest/test.csv | 17 +-- .../ConfigurableAttributesData.php | 68 ++++++++- .../ConfigurableProductInjectable.xml | 25 ++++ .../Test/TestCase/EditConfigurableTest.php | 60 -------- .../test.csv | 11 +- .../ConfigurableProduct/Test/etc/scenario.xml | 3 - .../InjectableTests/end_to_end_ce.xml | 6 +- 17 files changed, 331 insertions(+), 373 deletions(-) delete mode 100755 dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/EditBundleTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/EditSimpleProductTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/EditConfigurableTest.php diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index 0529e48c6c948..9a14e7e4d93dd 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -152,6 +152,7 @@ protected function getPreset($name) ], ], ], + 'default_fixed' => [ 'bundle_options' => [ [ @@ -189,6 +190,7 @@ protected function getPreset($name) ], ], ], + 'second' => [ 'bundle_options' => [ [ @@ -226,6 +228,7 @@ protected function getPreset($name) ], ], ], + 'all_types_fixed' => [ 'bundle_options' => [ [ @@ -356,6 +359,7 @@ protected function getPreset($name) ], ], ], + 'all_types_dynamic' => [ 'bundle_options' => [ [ @@ -470,6 +474,7 @@ protected function getPreset($name) ], ], ], + 'with_not_required_options' => [ 'bundle_options' => [ [ @@ -538,6 +543,77 @@ protected function getPreset($name) ], ], ], + + 'MAGETWO-12841' => [ + 'bundle_options' => [ + [ + 'title' => 'BundleOption1', + 'type' => 'Drop-down', + 'required' => 'Yes', + 'assigned_products' => [ + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_price_value' => 10.00, + 'selection_price_type' => 'Fixed', + 'selection_qty' => 1, + ], + ], + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_price_value' => 20.00, + 'selection_price_type' => 'Percent', + 'selection_qty' => 1, + ] + ], + ], + ], + ], + 'products' => [ + [ + 'catalogProductSimple::product_without_category', + 'catalogProductSimple::product_without_category', + ], + ], + ], + + 'MAGETWO-12842' => [ + 'bundle_options' => [ + [ + 'title' => 'Drop-down Option', + 'type' => 'Drop-down', + 'assigned_products' => [ + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_qty' => 1, + ], + ], + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_qty' => 1, + ] + ], + ], + ], + ], + 'products' => [ + [ + 'catalogProductSimple::product_without_category', + 'catalogProductSimple::product_without_category', + ], + ], + ], ]; if (!isset($presets[$name])) { throw new \InvalidArgumentException( diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php index 33965ee8bdfed..cc1f90fca13fe 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php @@ -186,6 +186,14 @@ public function getPreset() 'price_to' => '756.00', 'cart_price' => '756.00', ], + 'MAGETWO-12841' => [ + 'price_from' => '130.00', + 'price_to' => '144.00', + ], + 'MAGETWO-12842' => [ + 'price_from' => '100.00', + 'price_to' => '100.00', + ] ]; if (!isset($presets[$this->currentPreset])) { return null; diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index f8d27a60783b6..2d570553dc73a 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -131,5 +131,51 @@ default_fixed + + + Bundle fixed product %isolation% + bundle-fixed-product-%isolation% + sku_bundle_fixed_product_%isolation% + Fixed + Fixed + + 100 + + + taxable_goods + + 1 + Fixed + + Main Website + + + default_subcategory + + + MAGETWO-12841 + + + + + Bundle dynamic product %isolation% + bundle-dynamic-product-%isolation% + sku_bundle_dynamic_product_%isolation% + Dynamic + Dynamic + + - + MAGETWO-12842 + + + Main Website + + + default_subcategory + + + MAGETWO-12842 + + diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/EditBundleTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/EditBundleTest.php deleted file mode 100755 index f4592e21ddab9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/EditBundleTest.php +++ /dev/null @@ -1,131 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Edit bundle - * - * @dataProvider createDataProvider - * @ZephyrId MAGETWO-12842 - * @ZephyrId MAGETWO-12841 - * - * @param $fixture - * @return void - */ - public function testEditBundle($fixture) - { - //Data - /** @var $product \Magento\Bundle\Test\Fixture\Bundle */ - /** @var $editProduct \Magento\Bundle\Test\Fixture\Bundle */ - $product = Factory::getFixtureFactory()->$fixture(); - $product->switchData('bundle'); - $product->persist(); - $editProduct = Factory::getFixtureFactory()->$fixture(); - $editProduct->switchData('bundle_edit_required_fields'); - - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $gridBlock = $productGridPage->getProductGrid(); - $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - $productForm = $editProductPage->getProductForm(); - $cachePage = Factory::getPageFactory()->getAdminCache(); - - $productGridPage->open(); - $gridBlock->searchAndOpen([ - 'sku' => $product->getSku(), - 'type' => 'Bundle Product', - ]); - $productForm->fill($editProduct); - $editProductPage->getFormPageActions()->save(); - //Verifying - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - // Flush cache - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - //Verifying - $this->assertOnGrid($editProduct); - $this->assertOnCategory($editProduct, $product->getCategoryName()); - } - - /** - * Create data provider - * - * @return array - */ - public function createDataProvider() - { - return [ - ['getMagentoBundleBundleFixed'], - ['getMagentoBundleBundleDynamic'] - ]; - } - - /** - * Assert existing product on admin product grid - * - * @param Bundle $product - * @return void - */ - protected function assertOnGrid($product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Check the product on the category page - * - * @param Bundle $product - * @param string $categoryName - * @return void - */ - protected function assertOnCategory($product, $categoryName) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($categoryName); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $this->assertSame($product->getName(), $productViewBlock->getProductName()); - $this->assertEquals( - $product->getProductPrice(), - [ - 'price_from' => $productViewBlock->getPriceBlock()->getPriceFrom(), - 'price_to' => $productViewBlock->getPriceBlock()->getPriceTo() - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php index e2ab1af866a86..0762db749375f 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php @@ -83,5 +83,17 @@ public function test(BundleProduct $product, BundleProduct $originalProduct) $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter); $this->catalogProductEdit->getProductForm()->fill($product); $this->catalogProductEdit->getFormPageActions()->save(); + + $productWithCategory = null; + if ($product->hasData('category_ids')) { + $productWithCategory = $product; + } elseif ($originalProduct->hasData('category_ids')) { + $productWithCategory = $originalProduct; + } + if ($productWithCategory) { + $categories = $productWithCategory->getDataFieldConfig('category_ids')['source']->getCategories(); + return ['category' => reset($categories)]; + } + return []; } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv index 235936c0f1038..d6a18ca9bd419 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv @@ -1,3 +1,5 @@ -"originalProduct/dataSet";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/price/preset";"product/data/weight_type";"product/data/weight";"product/data/category_ids/presets";"product/data/description";"product/data/bundle_shipment_type";"product/data/bundle_selections/preset";"product/data/checkout_data/preset";"product/data/visibility";"product/data/url_key";"constraint" -"bundle_dynamic_product";"bundle_fixed_%isolation%";"Fixed";"bundle_fixed_%isolation%";"dynamic-100";"Fixed";"1";"-";"Bundle Product Fixed Required";"Together";"default_dynamic";"default";"-";"bundle-fixed-url-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertBundlePriceView, assertBundlePriceType" -"bundle_fixed_product";"bundle_dynamic_%isolation%";"Dynamic";"bundle_sku_%isolation%";"fixed-756";"Dynamic";"-";"default_subcategory";"-";"Separately";"default_fixed";"default";"Catalog, Search";"bundle-dynamic-url-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType" +"description";"originalProduct/dataSet";"product/data/url_key";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/price/value";"product/data/price/preset";"product/data/weight_type";"product/data/weight";"product/data/category_ids/presets";"product/data/description";"product/data/bundle_shipment_type";"product/data/bundle_selections/preset";"product/data/checkout_data/preset";"product/data/visibility";"constraint";"tag" +"Update dynamic bundle product";"bundle_dynamic_product";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"Fixed";"bundle_dynamic_%isolation%";"-";"dynamic-100";"Fixed";"1";"-";"Bundle Product Fixed Required";"Together";"default_dynamic";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertBundlePriceView, assertBundlePriceType";"" +"Update fixed bundle product";"bundle_fixed_product";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"fixed-756";"Dynamic";"-";"default_subcategory";"-";"Separately";"default_fixed";"default";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"MAGETWO-12841: Edit Bundle Product (Fixed Price)";"MAGETWO-12841";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"-";"bundle_sku_%isolation%";"120.00";"MAGETWO-12841";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage";"bamboo_plan:end_to_end" +"MAGETWO-12842: Edit Bundle (dynamic) Product";"MAGETWO-12842";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"-";"bundle_sku_%isolation%";"-";"MAGETWO-12842";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage";"bamboo_plan:end_to_end" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php index 28b6e17750ad2..798cb76ead304 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php @@ -42,15 +42,19 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data { $this->params = $params; if (isset($data['dataSet']) && $data['dataSet'] !== '-') { + /** @var CatalogAttributeSet $attributeSet */ $attributeSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataSet' => $data['dataSet']]); + if (!$attributeSet->hasData('attribute_set_id')) { + $attributeSet->persist(); + } } if (isset($data['attribute_set']) && $data['attribute_set'] instanceof CatalogAttributeSet) { $attributeSet = $data['attribute_set']; } - /** @var CatalogAttributeSet $attributeSet */ if (!isset($data['dataSet']) && !isset($data['attribute_set'])) { $this->data = $data; } else { + /** @var CatalogAttributeSet $attributeSet */ $this->data = $attributeSet->getAttributeSetName(); $this->attributeSet = $attributeSet; } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index 03d8f449d9343..1fdf058b40569 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -214,6 +214,23 @@ simple-product-%isolation% + + Simple product without category %isolation% + simple-product-%isolation% + simple_product_without_category_%isolation% + 1 + + default + + + 100 + + + + Main Website + + + default @@ -944,5 +961,32 @@ one_fpt_for_all_states + + + Simple product MAGETWO-12428 %isolation% + simple-product-%isolation% + simple_product_without_category_%isolation% + + 10 + + + + taxable_goods + + + 1000 + In Stock + + 1 + + default + + + Main Website + + + default_subcategory + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/EditSimpleProductTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/EditSimpleProductTest.php deleted file mode 100644 index 75898fccf9a97..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/EditSimpleProductTest.php +++ /dev/null @@ -1,115 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Edit simple product - * - * @ZephyrId MAGETWO-12428 - * @return void - */ - public function testEditProduct() - { - $product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $product->switchData('simple'); - $product->persist(); - $editProduct = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $editProduct->switchData('simple_edit_required_fields'); - - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $gridBlock = $productGridPage->getProductGrid(); - $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - $productForm = $editProductPage->getProductForm(); - $cachePage = Factory::getPageFactory()->getAdminCache(); - - $productGridPage->open(); - $gridBlock->searchAndOpen(['sku' => $product->getSku(), 'type' => 'Simple Product']); - $productForm->fill($editProduct); - $editProductPage->getFormPageActions()->save(); - //Verifying - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - // Flush cache - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - //Verifying - $this->assertOnGrid($editProduct); - $this->assertOnCategoryPage($editProduct, $product->getCategoryName()); - $this->assertOnProductPage($product, $editProduct); - } - - /** - * Assert existing product on admin product grid - * - * @param SimpleProduct $product - * @return void - */ - protected function assertOnGrid(SimpleProduct $product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Assert product data on category page - * - * @param SimpleProduct $product - * @param string $categoryName - * @return void - */ - protected function assertOnCategoryPage(SimpleProduct $product, $categoryName) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($categoryName); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - } - - /** - * Assert product data on product page - * - * @param SimpleProduct $productOld - * @param SimpleProduct $productEdited - * @return void - */ - protected function assertOnProductPage(SimpleProduct $productOld, SimpleProduct $productEdited) - { - Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $productOld->getUrlKey() . '.html'); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - - $productViewBlock = $productPage->getViewBlock(); - $this->assertEquals($productEdited->getName(), $productViewBlock->getProductName()); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals(number_format($productEdited->getProductPrice(), 2), $price); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php index 33125f9bdffa3..733bc890d6afe 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php @@ -10,7 +10,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** @@ -40,13 +40,6 @@ class UpdateSimpleProductEntityTest extends Injectable const DOMAIN = 'MX'; /* end tags */ - /** - * Simple product fixture - * - * @var CatalogProductSimple - */ - protected $initialProduct; - /** * Product page with a grid * @@ -61,48 +54,17 @@ class UpdateSimpleProductEntityTest extends Injectable */ protected $editProductPage; - /** - * Prepare data - * - * @param Category $category - * @return array - */ - public function __prepare(Category $category) - { - $category->persist(); - return [ - 'category' => $category - ]; - } - /** * Injection data * * @param CatalogProductIndex $productGrid * @param CatalogProductEdit $editProductPage - * @param Category $category - * @param FixtureFactory $fixtureFactory * @return void */ public function __inject( CatalogProductIndex $productGrid, - CatalogProductEdit $editProductPage, - Category $category, - FixtureFactory $fixtureFactory + CatalogProductEdit $editProductPage ) { - $this->initialProduct = $fixtureFactory->createByCode( - 'catalogProductSimple', - [ - 'dataSet' => 'default', - 'data' => [ - 'category_ids' => [ - 'category' => $category, - ], - ] - ] - ); - $this->initialProduct->persist(); - $this->productGrid = $productGrid; $this->editProductPage = $editProductPage; } @@ -110,16 +72,36 @@ public function __inject( /** * Run update product simple entity test * + * @param string $initialProduct * @param CatalogProductSimple $product + * @throws \Exception * @return array */ - public function test(CatalogProductSimple $product) + public function test($initialProduct, CatalogProductSimple $product) { - $filter = ['sku' => $this->initialProduct->getSku()]; + $createProductsStep = ObjectManager::getInstance()->create( + 'Magento\Catalog\Test\TestStep\CreateProductStep', + ['product' => $initialProduct] + ); + /** @var CatalogProductSimple $initialProduct */ + $initialProduct = $createProductsStep->run()['product']; + $filter = ['sku' => $initialProduct->getSku()]; + $this->productGrid->open()->getProductGrid()->searchAndOpen($filter); $this->editProductPage->getProductForm()->fill($product); $this->editProductPage->getFormPageActions()->save(); - return ['initialProduct' => $this->initialProduct]; + $sharedArguments = ['initialProduct' => $initialProduct]; + $productWithCategory = null; + if ($product->hasData('category_ids')) { + $productWithCategory = $product; + } elseif ($initialProduct->hasData('category_ids')) { + $productWithCategory = $initialProduct; + } + if ($productWithCategory) { + $categories = $productWithCategory->getDataFieldConfig('category_ids')['source']->getCategories(); + $sharedArguments['category'] = reset($categories); + } + return $sharedArguments; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv index 78e544b303da2..4ba37e8767426 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv @@ -1,8 +1,9 @@ -"product/data/category_ids/presets";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"product/data/weight";"product/data/visibility";"product/data/status";"product/data/url_key";"constraint" -"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"245.00";"200.0000";"-";"test-simple-product-%isolation%";"120.0000";"Catalog, Search";"-";"simple-product-%isolation%";"assertProductSaveMessage, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage" -"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.00";"123.0000";"-";"test-simple-product-%isolation%";"129.0000";"Not Visible Individually";"-";"simple-product-%isolation%";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" -"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.01";"125.0000";"-";"test-simple-product-%isolation%";"25.0000";"Catalog";"-";"simple-product-%isolation%";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductSearchableBySku, assertProductVisibleInCategory, assertProductPage" -"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.02";"89.0000";"-";"test-simple-product-%isolation%";"89.0000";"Search";"-";"simple-product-%isolation%";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductVisibleInCategory, assertProductPage, assertProductSearchableBySku, assertProductPage" -"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.03";"25.0000";"Out of Stock";"test-simple-product-%isolation%";"125.0000";"-";"-";"simple-product-%isolation%";"assertProductSaveMessage, assertProductForm, assertProductOutOfStock, assertProductPage, assertProductVisibleInCategory, assertProductSearchableBySku" -"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"simple-product-%isolation%";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" -"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"simple-product-%isolation%";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory" +"description";"initialProduct";"product/data/category_ids/presets";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"product/data/weight";"product/data/visibility";"product/data/status";"constraint";"tag" +"Update visibility to Catalog, Search";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"245.00";"200.0000";"-";"test-simple-product-%isolation%";"120.0000";"Catalog, Search";"-";"assertProductSaveMessage, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Update visibility to Not Visible Individually";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.00";"123.0000";"-";"test-simple-product-%isolation%";"129.0000";"Not Visible Individually";"-";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend";"" +"Update visibility to Catalog";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.01";"125.0000";"-";"test-simple-product-%isolation%";"25.0000";"Catalog";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductSearchableBySku, assertProductVisibleInCategory, assertProductPage";"" +"Update visibility to Search";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.02";"89.0000";"-";"test-simple-product-%isolation%";"89.0000";"Search";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductVisibleInCategory, assertProductPage, assertProductSearchableBySku, assertProductPage";"" +"Update stock to Out of Stock";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.03";"25.0000";"Out of Stock";"test-simple-product-%isolation%";"125.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertProductOutOfStock, assertProductPage, assertProductVisibleInCategory, assertProductSearchableBySku";"" +"Update product status to offline";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend";"" +"Update category";"catalogProductSimple::product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory";"" +"MAGETWO-12428: Edite Simple Product";"catalogProductSimple::MAGETWO-12428";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"133.00";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductPage";"bamboo_plan:end_to_end" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php index 17e00b49ce77a..8959b44178ca2 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php @@ -176,6 +176,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'one_variation' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -202,6 +203,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'two_options' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -242,6 +244,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'two_new_options' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -284,6 +287,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'one_new_options' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -301,6 +305,7 @@ class ConfigurableAttributesData implements FixtureInterface 'products' => [], 'matrix' => [], ], + 'two_new_options_with_zero_products' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -322,6 +327,7 @@ class ConfigurableAttributesData implements FixtureInterface ], 'matrix' => [], ], + 'two_options_with_assigned_product' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -365,6 +371,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'color_and_size' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -430,6 +437,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'size' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -468,6 +476,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'with_one_option' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -515,6 +524,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + 'with_out_of_stock_item' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -535,6 +545,50 @@ class ConfigurableAttributesData implements FixtureInterface ], 'matrix' => [], ], + + 'MAGETWO-12840' => [ + 'attributes_data' => [ + 'attribute_key_0' => [ + 'options' => [ + 'option_key_0' => [ + 'label' => 'option_key_1_%isolation%', + 'pricing_value' => 11, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + 'option_key_1' => [ + 'label' => 'option_2_%isolation%', + 'pricing_value' => 12, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + ], + ], + ], + 'attributes' => [ + 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', + ], + 'products' => [ + 'attribute_key_0:option_key_0' => 'catalogProductSimple::product_without_category', + 'attribute_key_0:option_key_1' => 'catalogProductSimple::product_without_category', + ], + 'matrix' => [ + 'attribute_key_0:option_key_0' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 100, + ], + 'weight' => 1, + ], + 'attribute_key_0:option_key_1' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 200, + ], + 'weight' => 1, + ], + ], + ], ]; /** @@ -645,9 +699,21 @@ protected function prepareProducts(array $data) if (is_string($product)) { list($fixture, $dataSet) = explode('::', $product); $attributeData = ['attributes' => $this->getProductAttributeData($key)]; + $stock = []; + + if (isset($data['matrix'][$key]['quantity_and_stock_status']['qty'])) { + $stock['quantity_and_stock_status'] = [ + 'qty' => $data['matrix'][$key]['quantity_and_stock_status']['qty'], + 'is_in_stock' => 'In Stock', + ]; + } + $product = $this->fixtureFactory->createByCode( $fixture, - ['dataSet' => $dataSet, 'data' => array_merge($attributeSetData, $attributeData)] + [ + 'dataSet' => $dataSet, + 'data' => array_merge($attributeSetData, $attributeData, $stock) + ] ); } if (!$product->hasData('id')) { diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml index 5290b878250fa..ec6cd09110839 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml @@ -211,5 +211,30 @@ default + + + Configurable product %isolation% + test-configurable-product-%isolation% + sku_configurable_product_%isolation% + + 10 + + + taxable_goods + + 1 + + default_subcategory + + + Main Website + + + MAGETWO-12840 + + + custom_attribute_set + + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/EditConfigurableTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/EditConfigurableTest.php deleted file mode 100644 index 568fce2a32a3a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/EditConfigurableTest.php +++ /dev/null @@ -1,60 +0,0 @@ -getMagentoConfigurableProductConfigurableProduct(); - $configurable->switchData('configurable'); - $configurable->persist(); - $productSku = $configurable->getSku(); - //Preparing Data for editing product - $editProduct = $configurable->getEditData(); - - //Steps - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - //Login - Factory::getApp()->magentoBackendLoginUser(); - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - //Search and open original configurable product - $productGridPage->getProductGrid()->searchAndOpen(['sku' => $productSku]); - //Editing product options - $productForm->fill($editProduct); - $createProductPage->getFormPageActions()->save(); - //Verifying - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - //Verifying - $this->assertOnGrid($editProduct); - $this->assertOnFrontend($editProduct); - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv index 2d4653b21fefe..29e11af29c387 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv @@ -1,5 +1,6 @@ -"description";"attributeTypeAction";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"updatedProduct/data/affected_attribute_set";"constraint" -"Add new option to existed Attribute";"addOptions";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"configurable-product-%isolation%";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" -"Add new variations";"";"two_new_options";"three_attributes";"159";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"configurable-product-%isolation%";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" -"Delete one attribute and add another";"deleteLast";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"configurable-product-%isolation%";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage" -"Delete attribute and add another with products qty = 0";"deleteAll";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"configurable-product-%isolation%";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock" +"description";"attributeTypeAction";"product";"updatedProduct/data/url_key";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"updatedProduct/data/affected_attribute_set";"constraint";"tag" +"Add new option to existed Attribute";"addOptions";"configurableProductInjectable::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" +"Add new variations";"";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" +"Delete one attribute and add another";"deleteLast";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage";"" +"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock";"" +"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProductInjectable::MAGETWO-12840";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage";"bamboo_plan:end_to_end" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/scenario.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/scenario.xml index b53a78e864b81..48f33a357c9e7 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/scenario.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/scenario.xml @@ -12,9 +12,6 @@ createProduct - - configurableProductInjectable::default - openProductOnBackend diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml index 9c14458282a1d..b48f7eff4bae7 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml @@ -14,7 +14,7 @@ - + @@ -22,12 +22,12 @@ - + - + From a851bc3c7e3558efd66e93dd5066215382210b45 Mon Sep 17 00:00:00 2001 From: Oleksii Kolesnyk Date: Wed, 28 Jan 2015 09:49:21 +0200 Subject: [PATCH 02/50] MTA-1357: 3-rd party creadentials --- dev/tests/functional/.gitignore | 1 + dev/tests/functional/credentials.xml.dist | 13 +++++++++++++ dev/tests/functional/phpunit.xml.dist | 1 + 3 files changed, 15 insertions(+) create mode 100644 dev/tests/functional/credentials.xml.dist diff --git a/dev/tests/functional/.gitignore b/dev/tests/functional/.gitignore index a415b0cffbf04..06440a2b35e9a 100755 --- a/dev/tests/functional/.gitignore +++ b/dev/tests/functional/.gitignore @@ -8,4 +8,5 @@ !/config/isolation.yml.dist !/config/server.yml.dist phpunit.xml +credentials.xml /lib/Magento/Mtf/Util/Generate/testcase.xml diff --git a/dev/tests/functional/credentials.xml.dist b/dev/tests/functional/credentials.xml.dist new file mode 100644 index 0000000000000..b8d07c2829d77 --- /dev/null +++ b/dev/tests/functional/credentials.xml.dist @@ -0,0 +1,13 @@ + + + + + + + diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index e35a918f69d4d..bec21af3d4226 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -44,6 +44,7 @@ + From 186fc56d89d2e3ca6b706d3e29611536c3e4b461 Mon Sep 17 00:00:00 2001 From: Oleksii Kolesnyk Date: Wed, 28 Jan 2015 11:07:32 +0200 Subject: [PATCH 03/50] MTA-1357: 3-rd party creadentials --- dev/tests/functional/credentials.xml.dist | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dev/tests/functional/credentials.xml.dist b/dev/tests/functional/credentials.xml.dist index b8d07c2829d77..1cf5152577e62 100644 --- a/dev/tests/functional/credentials.xml.dist +++ b/dev/tests/functional/credentials.xml.dist @@ -8,6 +8,20 @@ - - + + + + + + + + + + + + + + + + From c76cecc27b46eb92d6595576a8f8518df362369e Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Wed, 28 Jan 2015 18:35:29 +0200 Subject: [PATCH 04/50] MTA-549: Re-factor Tests for Update Products - Fixed logical and code style errors - Removed BAT, END_TO_END plans --- .../BundleProduct/BundleSelections.php | 4 +- .../Test/Fixture/BundleProduct/Price.php | 4 +- .../Bundle/Test/Repository/BundleProduct.xml | 10 ++-- .../UpdateBundleProductEntityTest.php | 24 ++++---- .../UpdateBundleProductEntityTest/test.csv | 10 ++-- .../Test/Repository/CatalogProductSimple.xml | 27 --------- .../CreateCategoryEntityTest/test.csv | 4 +- .../Test/TestCase/Product/CreateTest.php | 2 +- .../Product/UpdateSimpleProductEntityTest.php | 50 ++++++++--------- .../UpdateSimpleProductEntityTest/test.csv | 18 +++--- .../AdvancedSearchEntityTest/test.csv | 2 +- .../TestCase/SearchEntityResultsTest/test.csv | 2 +- .../ConfigurableAttributesData.php | 2 +- .../ConfigurableProductInjectable.xml | 4 +- .../test.csv | 12 ++-- .../test.csv | 2 +- .../UpdateCustomerFrontendEntityTest/test.csv | 2 +- .../test.csv | 2 +- .../CreateCategoryRewriteEntityTest/test.csv | 2 +- .../test.csv | 2 +- .../Mtf/TestSuite/InjectableTests/bat_ce.xml | 31 ----------- .../InjectableTests/end_to_end_ce.xml | 55 ------------------- 22 files changed, 78 insertions(+), 193 deletions(-) delete mode 100644 dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/bat_ce.xml delete mode 100644 dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index 9a14e7e4d93dd..6f5a58cba9766 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -544,7 +544,7 @@ protected function getPreset($name) ], ], - 'MAGETWO-12841' => [ + 'two_options_with_fixed_and_percent_prices' => [ 'bundle_options' => [ [ 'title' => 'BundleOption1', @@ -582,7 +582,7 @@ protected function getPreset($name) ], ], - 'MAGETWO-12842' => [ + 'two_options_assigned_products_without_category' => [ 'bundle_options' => [ [ 'title' => 'Drop-down Option', diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php index cc1f90fca13fe..1de9d3fdbaa56 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php @@ -186,11 +186,11 @@ public function getPreset() 'price_to' => '756.00', 'cart_price' => '756.00', ], - 'MAGETWO-12841' => [ + 'bundle_fixed_with_category' => [ 'price_from' => '130.00', 'price_to' => '144.00', ], - 'MAGETWO-12842' => [ + 'bundle_dynamic_with_category' => [ 'price_from' => '100.00', 'price_to' => '100.00', ] diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index 2d570553dc73a..6208d62898007 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -132,7 +132,7 @@ - + Bundle fixed product %isolation% bundle-fixed-product-%isolation% sku_bundle_fixed_product_%isolation% @@ -153,11 +153,11 @@ default_subcategory - MAGETWO-12841 + two_options_with_fixed_and_percent_prices - + Bundle dynamic product %isolation% bundle-dynamic-product-%isolation% sku_bundle_dynamic_product_%isolation% @@ -165,7 +165,7 @@ Dynamic - - MAGETWO-12842 + bundle_dynamic_with_category Main Website @@ -174,7 +174,7 @@ default_subcategory - MAGETWO-12842 + two_options_assigned_products_without_category diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php index 0762db749375f..a4d27b3a4fb1f 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php @@ -77,23 +77,23 @@ public function __inject( */ public function test(BundleProduct $product, BundleProduct $originalProduct) { + // Preconditions $originalProduct->persist(); - $this->catalogProductIndex->open(); + $originalCategory = $originalProduct->hasData('category_ids') + ? $originalProduct->getDataFieldConfig('category_ids')['source']->getCategories() + : null; + $category = $product->hasData('category_ids') + ? $product->getDataFieldConfig('category_ids')['source']->getCategories() + : $originalCategory; + + // Steps $filter = ['sku' => $originalProduct->getSku()]; + + $this->catalogProductIndex->open(); $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter); $this->catalogProductEdit->getProductForm()->fill($product); $this->catalogProductEdit->getFormPageActions()->save(); - $productWithCategory = null; - if ($product->hasData('category_ids')) { - $productWithCategory = $product; - } elseif ($originalProduct->hasData('category_ids')) { - $productWithCategory = $originalProduct; - } - if ($productWithCategory) { - $categories = $productWithCategory->getDataFieldConfig('category_ids')['source']->getCategories(); - return ['category' => reset($categories)]; - } - return []; + return ['category' => $category]; } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv index d6a18ca9bd419..8b50fc1f7bfc1 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest/test.csv @@ -1,5 +1,5 @@ -"description";"originalProduct/dataSet";"product/data/url_key";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/price/value";"product/data/price/preset";"product/data/weight_type";"product/data/weight";"product/data/category_ids/presets";"product/data/description";"product/data/bundle_shipment_type";"product/data/bundle_selections/preset";"product/data/checkout_data/preset";"product/data/visibility";"constraint";"tag" -"Update dynamic bundle product";"bundle_dynamic_product";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"Fixed";"bundle_dynamic_%isolation%";"-";"dynamic-100";"Fixed";"1";"-";"Bundle Product Fixed Required";"Together";"default_dynamic";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertBundlePriceView, assertBundlePriceType";"" -"Update fixed bundle product";"bundle_fixed_product";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"fixed-756";"Dynamic";"-";"default_subcategory";"-";"Separately";"default_fixed";"default";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"MAGETWO-12841: Edit Bundle Product (Fixed Price)";"MAGETWO-12841";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"-";"bundle_sku_%isolation%";"120.00";"MAGETWO-12841";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage";"bamboo_plan:end_to_end" -"MAGETWO-12842: Edit Bundle (dynamic) Product";"MAGETWO-12842";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"-";"bundle_sku_%isolation%";"-";"MAGETWO-12842";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage";"bamboo_plan:end_to_end" +"description";"originalProduct/dataSet";"product/data/url_key";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/price/value";"product/data/price/preset";"product/data/weight_type";"product/data/weight";"product/data/category_ids/presets";"product/data/description";"product/data/bundle_shipment_type";"product/data/bundle_selections/preset";"product/data/checkout_data/preset";"product/data/visibility";"constraint" +"Update dynamic bundle product";"bundle_dynamic_product";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"Fixed";"bundle_dynamic_%isolation%";"-";"dynamic-100";"Fixed";"1";"-";"Bundle Product Fixed Required";"Together";"default_dynamic";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertBundlePriceView, assertBundlePriceType" +"Update fixed bundle product";"bundle_fixed_product";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"fixed-756";"Dynamic";"-";"default_subcategory";"-";"Separately";"default_fixed";"default";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType" +"MAGETWO-12841: Edit Bundle Product (Fixed Price)";"bundle_fixed_with_category";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"-";"bundle_sku_%isolation%";"120.00";"bundle_fixed_with_category";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage" +"MAGETWO-12842: Edit Bundle (dynamic) Product";"bundle_dynamic_with_category";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"-";"bundle_sku_%isolation%";"-";"bundle_dynamic_with_category";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index 1fdf058b40569..e55b1f0e5ce5c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -961,32 +961,5 @@ one_fpt_for_all_states - - - Simple product MAGETWO-12428 %isolation% - simple-product-%isolation% - simple_product_without_category_%isolation% - - 10 - - - - taxable_goods - - - 1000 - In Stock - - 1 - - default - - - Main Website - - - default_subcategory - - diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv index c878fef54a694..a7a0fb8c4babb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv @@ -6,5 +6,5 @@ "Create anchor subcategory with all fields";"addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Anchor Subcategory All Fields";"Subcategory Page Title";"Yes";"Static block and products";"default";"Yes";"No";"Position";"Name";"Price";"No";"Price";"No";"50";"default";"catalogProductSimple::default,catalogProductSimple::default";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage, assertCategoryForAssignedProducts";"" "Create not active subcategory";"addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Not active category";"-";"Yes";"-";"-";"-";"Yes";"-";"-";"-";"Yes";"-";"Yes";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm";"" "Create not included in menu subcategory";"addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Not included in menu";"-";"No";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm";"" -"MAGETWO-12513: Create Category from Category page with Required Fields Only";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage";"bamboo_plan:BAT,test_type:acceptance_test" -"MAGETWO-16351: Assign Products at the Category Level";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default, bundleProduct::bundle_fixed_product";"assertCategorySaveMessage, assertCategoryForAssignedProducts";"bamboo_plan:end_to_end,test_type:acceptance_test" +"MAGETWO-12513: Create Category from Category page with Required Fields Only";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage";"test_type:acceptance_test" +"MAGETWO-16351: Assign Products at the Category Level";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default, bundleProduct::bundle_fixed_product";"assertCategorySaveMessage, assertCategoryForAssignedProducts";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php index b168b568d2420..a2b847339be75 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php @@ -12,7 +12,7 @@ /** * Class CreateTest - * Create simple product for BAT + * Create simple product */ class CreateTest extends Functional { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php index 733bc890d6afe..da593c1143566 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\TestCase\Product; -use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; @@ -14,13 +13,11 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for UpdateProductSimpleEntity - * * Test Flow: * * Precondition: - * Category is created. - * Product is created and assigned to created category. + * 1. Category is created. + * 2. Product is created and assigned to created category. * * Steps: * 1. Login to backend. @@ -72,36 +69,37 @@ public function __inject( /** * Run update product simple entity test * - * @param string $initialProduct + * @param CatalogProductSimple $initialProduct * @param CatalogProductSimple $product * @throws \Exception * @return array */ - public function test($initialProduct, CatalogProductSimple $product) + + + /** + * @param CatalogProductSimple $initialProduct + * @param CatalogProductSimple $product + * @return array + */ + public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product) { - $createProductsStep = ObjectManager::getInstance()->create( - 'Magento\Catalog\Test\TestStep\CreateProductStep', - ['product' => $initialProduct] - ); - /** @var CatalogProductSimple $initialProduct */ - $initialProduct = $createProductsStep->run()['product']; + // Preconditions + $initialProduct->persist(); + $initialCategory = $initialProduct->hasData('category_ids') + ? $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0] + : null; + $category = $product->hasData('category_ids') + ? $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] + : $initialCategory; + + // Steps $filter = ['sku' => $initialProduct->getSku()]; - $this->productGrid->open()->getProductGrid()->searchAndOpen($filter); + $this->productGrid->open(); + $this->productGrid->getProductGrid()->searchAndOpen($filter); $this->editProductPage->getProductForm()->fill($product); $this->editProductPage->getFormPageActions()->save(); - $sharedArguments = ['initialProduct' => $initialProduct]; - $productWithCategory = null; - if ($product->hasData('category_ids')) { - $productWithCategory = $product; - } elseif ($initialProduct->hasData('category_ids')) { - $productWithCategory = $initialProduct; - } - if ($productWithCategory) { - $categories = $productWithCategory->getDataFieldConfig('category_ids')['source']->getCategories(); - $sharedArguments['category'] = reset($categories); - } - return $sharedArguments; + return ['category' => $category]; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv index 4ba37e8767426..1e68045339dbb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv @@ -1,9 +1,9 @@ -"description";"initialProduct";"product/data/category_ids/presets";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"product/data/weight";"product/data/visibility";"product/data/status";"constraint";"tag" -"Update visibility to Catalog, Search";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"245.00";"200.0000";"-";"test-simple-product-%isolation%";"120.0000";"Catalog, Search";"-";"assertProductSaveMessage, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" -"Update visibility to Not Visible Individually";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.00";"123.0000";"-";"test-simple-product-%isolation%";"129.0000";"Not Visible Individually";"-";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend";"" -"Update visibility to Catalog";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.01";"125.0000";"-";"test-simple-product-%isolation%";"25.0000";"Catalog";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductSearchableBySku, assertProductVisibleInCategory, assertProductPage";"" -"Update visibility to Search";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.02";"89.0000";"-";"test-simple-product-%isolation%";"89.0000";"Search";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductVisibleInCategory, assertProductPage, assertProductSearchableBySku, assertProductPage";"" -"Update stock to Out of Stock";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.03";"25.0000";"Out of Stock";"test-simple-product-%isolation%";"125.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertProductOutOfStock, assertProductPage, assertProductVisibleInCategory, assertProductSearchableBySku";"" -"Update product status to offline";"catalogProductSimple::product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend";"" -"Update category";"catalogProductSimple::product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory";"" -"MAGETWO-12428: Edite Simple Product";"catalogProductSimple::MAGETWO-12428";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"133.00";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductPage";"bamboo_plan:end_to_end" +"description";"initialProduct/dataSet";"product/data/category_ids/presets";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"product/data/weight";"product/data/visibility";"product/data/status";"constraint" +"Update visibility to Catalog, Search";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"245.00";"200.0000";"-";"test-simple-product-%isolation%";"120.0000";"Catalog, Search";"-";"assertProductSaveMessage, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage" +"Update visibility to Not Visible Individually";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.00";"123.0000";"-";"test-simple-product-%isolation%";"129.0000";"Not Visible Individually";"-";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" +"Update visibility to Catalog";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.01";"125.0000";"-";"test-simple-product-%isolation%";"25.0000";"Catalog";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductSearchableBySku, assertProductVisibleInCategory, assertProductPage" +"Update visibility to Search";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.02";"89.0000";"-";"test-simple-product-%isolation%";"89.0000";"Search";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductVisibleInCategory, assertProductPage, assertProductSearchableBySku, assertProductPage" +"Update stock to Out of Stock";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.03";"25.0000";"Out of Stock";"test-simple-product-%isolation%";"125.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertProductOutOfStock, assertProductPage, assertProductVisibleInCategory, assertProductSearchableBySku" +"Update product status to offline";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" +"Update category";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory" +"MAGETWO-12428: Edit Simple Product";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"133.00";"-";"-";"test-simple-product-%isolation%";"-";"-";"-";"assertProductSaveMessage, assertProductPage" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv index 8a814121950bd..e17b78111094b 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv @@ -1,5 +1,5 @@ "description";"products/simple_1";"products/simple_2";"productSearch/data/name";"productSearch/data/sku";"productSearch/data/description";"productSearch/data/short_description";"productSearch/data/price/value/price_from";"productSearch/data/price/value/price_to";"constraint";"tag" -"MAGETWO-12421: Use Advanced Search to Find the Product";"Yes";"-";"abc_dfj";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"bamboo_plan:end_to_end,test_type:acceptance_test" +"MAGETWO-12421: Use Advanced Search to Find the Product";"Yes";"-";"abc_dfj";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"test_type:acceptance_test" "Search product in advanced search by name";"-";"Yes";"adc_123";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" "Search product in advanced search by partial name";"Yes";"-";"abc";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" "Search product in advanced search by sku";"Yes";"-";"-";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv index 90b795c9df0fb..27c6e337beb15 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv @@ -1,5 +1,5 @@ "description";"catalogSearch/data/query_text/value";"constraint";"tag" -"MAGETWO-12420: Use Quick Search to Find the Product";"catalogProductSimple::default::sku";"assertProductCanBeOpenedFromSearchResult";"bamboo_plan:BAT,test_type:acceptance_test" +"MAGETWO-12420: Use Quick Search to Find the Product";"catalogProductSimple::default::sku";"assertProductCanBeOpenedFromSearchResult";"test_type:acceptance_test" "Search simple product";"catalogProductSimple::default::simple";"assertCatalogSearchResult";"" "Search virtual product";"catalogProductVirtual::default::virtual";"assertCatalogSearchResult";"" "Search configurable product";"configurableProductInjectable::default::configurable";"assertCatalogSearchResult";"" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php index 8959b44178ca2..fe5d1888b21e5 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php @@ -546,7 +546,7 @@ class ConfigurableAttributesData implements FixtureInterface 'matrix' => [], ], - 'MAGETWO-12840' => [ + 'two_options_with_fixed_price' => [ 'attributes_data' => [ 'attribute_key_0' => [ 'options' => [ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml index ec6cd09110839..2813bd4418a14 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml @@ -212,7 +212,7 @@ - + Configurable product %isolation% test-configurable-product-%isolation% sku_configurable_product_%isolation% @@ -230,7 +230,7 @@ Main Website - MAGETWO-12840 + two_options_with_fixed_price custom_attribute_set diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv index 29e11af29c387..03d41b617cb51 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv @@ -1,6 +1,6 @@ -"description";"attributeTypeAction";"product";"updatedProduct/data/url_key";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"updatedProduct/data/affected_attribute_set";"constraint";"tag" -"Add new option to existed Attribute";"addOptions";"configurableProductInjectable::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" -"Add new variations";"";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" -"Delete one attribute and add another";"deleteLast";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage";"" -"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock";"" -"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProductInjectable::MAGETWO-12840";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage";"bamboo_plan:end_to_end" +"description";"attributeTypeAction";"product";"updatedProduct/data/url_key";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"updatedProduct/data/affected_attribute_set";"constraint" +"Add new option to existed Attribute";"addOptions";"configurableProductInjectable::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" +"Add new variations";"";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" +"Delete one attribute and add another";"deleteLast";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage" +"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock" +"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProductInjectable::two_options_with_fixed_price";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest/test.csv index 8fbfecdc45c01..83793d238d3b9 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest/test.csv @@ -1,4 +1,4 @@ "description";"customer/data/firstname";"customer/data/lastname";"customer/data/email";"customer/data/is_subscribed";"customer/data/password";"customer/data/password_confirmation";"constraint";"tag" "Register new customer";"john";"doe";"johndoe%isolation%@example.com";"No";"123123q";"123123q";"assertCustomerSuccessRegisterMessage, assertCustomerInGrid";"" "Register new customer with subscribing";"john";"doe";"johndoe%isolation%@example.com";"Yes";"123123q";"123123q";"assertCustomerSuccessRegisterMessage, assertCustomerInGrid, assertCustomerForm, assertCustomerIsSubscribedToNewsletter";"" -"MAGETWO-12394: Register Customer";"john";"doe";"johndoe%isolation%@example.com";"No";"123123q";"123123q";"assertCustomerSuccessRegisterMessage, assertCustomerRedirectToDashboard";"bamboo_plan:end_to_end,test_type:acceptance_test" +"MAGETWO-12394: Register Customer";"john";"doe";"johndoe%isolation%@example.com";"No";"123123q";"123123q";"assertCustomerSuccessRegisterMessage, assertCustomerRedirectToDashboard";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest/test.csv index cfc3bea41fc9d..336248ae1d134 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest/test.csv @@ -2,4 +2,4 @@ "Update customer information and add US address";"Jany %isolation%";"Doe %isolation%";"janydoe%isolation%@example.com";"Jany %isolation%";"Doe %isolation%";"Company %isolation%";"Some street %isolation%";"City %isolation%";"United States";"Colorado";"-";"555-888-111-999";"161-999-8888";"12345";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses";"" "Update customer information and add UK address";"Jonny %isolation%";"Doe %isolation%";"jonny%isolation%@example.com";"John %isolation%";"Doe %isolation%";"Company %isolation%";"Some street %isolation%";"City %isolation%";"United Kingdom";"-";"Region %isolation%";"0123456789-02134567";"5555-874-99634";"12345";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses";"" "Update customer information and add France address";"Jean %isolation%";"Reno %isolation%";"jean%isolation%@example.com";"Jean %isolation%";"Reno %isolation%";"Magento %isolation%";"18-20 Rue Maréchal Leclerc";"Quintin";"France";"Côtes-d'Armor";"-";"555-888-111-999";"161-999-8888";"12345";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses";"" -"MAGETWO-12394: Register Customer. Update address";"-";"-";"-";"John";"Doe";"Magento %isolation%";"6161 West Centinela Avenue";"Culver City";"United States";"California";"-";"555-55-555-55";"-";"90230";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses";"bamboo_plan:end_to_end,test_type:acceptance_test" \ No newline at end of file +"MAGETWO-12394: Register Customer. Update address";"-";"-";"-";"John";"Doe";"Magento %isolation%";"6161 West Centinela Avenue";"Culver City";"United States";"California";"-";"555-55-555-55";"-";"90230";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses";"test_type:acceptance_test" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest/test.csv index 53247eb174626..cde2e51dc0f56 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest/test.csv @@ -1,3 +1,3 @@ "description";"review/data/customer";"review/data/nickname";"review/data/title";"review/data/detail";"review/data/ratings/1/dataSet";"review/data/ratings/1/rating";"review/data/entity_id/dataSet";"constraint";"tag" "Create product review with rating";"-";"name_%isolation%";"title_%isolation%";"review_%isolation%";"visibleOnDefaultWebsite";"4";"catalogProductSimple::default";"assertReviewCreationSuccessMessage, assertProductReviewInGrid, assertProductRatingOnReviewPage, assertProductRatingInProductPage";"" -"MAGETWO-12403 - Add Product Review from Customer's Prospective";"Guest";"name_%isolation%";"title_%isolation%";"review_%isolation%";"-";"-";"catalogProductSimple::default";"assertReviewCreationSuccessMessage, assertProductReviewIsAbsentOnProductPage, assertProductReviewForm, assertSetApprovedProductReview, assertReviewLinksIsPresentOnProductPage, assertProductReviewOnProductPage";"bamboo_plan:end_to_end,test_type:acceptance_test" +"MAGETWO-12403 - Add Product Review from Customer's Prospective";"Guest";"name_%isolation%";"title_%isolation%";"review_%isolation%";"-";"-";"catalogProductSimple::default";"assertReviewCreationSuccessMessage, assertProductReviewIsAbsentOnProductPage, assertProductReviewForm, assertSetApprovedProductReview, assertReviewLinksIsPresentOnProductPage, assertProductReviewOnProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest/test.csv index e10157b78f1eb..ca6e413bc6b8a 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest/test.csv @@ -1,5 +1,5 @@ "description";"urlRewrite/data/entity_type";"urlRewrite/data/store_id";"urlRewrite/data/request_path";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint";"tag" -"MAGETWO-12407: Add Permanent Redirect for Category";"For category";"Main Website/Main Website Store/Default Store View";"cat%isolation%-redirect.html";"Permanent (301)";"End-to-end test";"assertUrlRewriteSaveMessage, assertUrlRewriteCategoryRedirect";"bamboo_plan:end_to_end,test_type:acceptance_test" +"MAGETWO-12407: Add Permanent Redirect for Category";"For category";"Main Website/Main Website Store/Default Store View";"cat%isolation%-redirect.html";"Permanent (301)";"End-to-end test";"assertUrlRewriteSaveMessage, assertUrlRewriteCategoryRedirect";"test_type:acceptance_test" "Create Category URL Rewrites with no redirect";"For category";"Main Website/Main Website Store/Default Store View";"test_request%isolation%";"No";"test description";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid";"" "Create Category URL Rewrites with Temporary redirect";"For category";"Main Website/Main Website Store/Default Store View";"request_path%isolation%";"Temporary (302)";"test description";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCategoryRedirect";"" "Create Category URL Rewrites with Permanent redirect";"For category";"Main Website/Main Website Store/Default Store View";"request_path%isolation%";"Permanent (301)";"test description";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCategoryRedirect";"" diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest/test.csv index a48b064c2d1ff..cf134120d0987 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest/test.csv @@ -1,5 +1,5 @@ "description";"urlRewrite/data/entity_type";"product/dataSet";"urlRewrite/data/store_id";"urlRewrite/data/request_path";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint";"tag" -"MAGETWO-12409: Add Temporary Redirect for Product";"For product";"product_with_category";"Main Website/Main Website Store/Default Store View";"cat%isolation%/simp_redirect%isolation%.html";"Temporary (302)";"description_%isolation%";"assertUrlRewriteSaveMessage, assertUrlRewriteProductRedirect";"bamboo_plan:end_to_end,test_type:acceptance_test" +"MAGETWO-12409: Add Temporary Redirect for Product";"For product";"product_with_category";"Main Website/Main Website Store/Default Store View";"cat%isolation%/simp_redirect%isolation%.html";"Temporary (302)";"description_%isolation%";"assertUrlRewriteSaveMessage, assertUrlRewriteProductRedirect";"test_type:acceptance_test" "Create Product URL Rewrites with no redirect";"For product";"default";"Main Website/Main Website Store/Default Store View";"test_%isolation%.html";"No";"description_%isolation%";"assertUrlRewriteSaveMessage";"" "Create Product URL Rewrites with Temporary redirect";"For product";"default";"Main Website/Main Website Store/Default Store View";"test_%isolation%.html";"Temporary (302)";"description_%isolation%";"assertUrlRewriteSaveMessage, assertUrlRewriteProductRedirect";"" "Create Product URL Rewrites with Permanent redirect";"For product";"default";"Main Website/Main Website Store/Default Store View";"test_%isolation%.html";"Permanent (301)";"description_%isolation%";"assertUrlRewriteSaveMessage, assertUrlRewriteProductRedirect";"" diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/bat_ce.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/bat_ce.xml deleted file mode 100644 index e875401e6e82d..0000000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/bat_ce.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml deleted file mode 100644 index b48f7eff4bae7..0000000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From e036b46220fbaceb6a65a8d6e9d221795cbccdb9 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Thu, 29 Jan 2015 09:28:05 +0200 Subject: [PATCH 05/50] MTA-549: Re-factor Tests for Update Products - Fixed PHPDoc --- .../Test/TestCase/UpdateBundleProductEntityTest.php | 5 +---- .../TestCase/Product/UpdateSimpleProductEntityTest.php | 8 -------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php index a4d27b3a4fb1f..7f9f43b7718fd 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php @@ -12,8 +12,6 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for Update BundleProductEntity - * * Test Flow: * * Precondition: @@ -28,7 +26,6 @@ * 5. Click "Save". * 6. Perform asserts * - * * @group Bundle_Product_(MX) * @ZephyrId MAGETWO-26195 */ @@ -73,7 +70,7 @@ public function __inject( * * @param BundleProduct $product * @param BundleProduct $originalProduct - * @return void + * @return array */ public function test(BundleProduct $product, BundleProduct $originalProduct) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php index da593c1143566..50f0a80f2c518 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php @@ -69,14 +69,6 @@ public function __inject( /** * Run update product simple entity test * - * @param CatalogProductSimple $initialProduct - * @param CatalogProductSimple $product - * @throws \Exception - * @return array - */ - - - /** * @param CatalogProductSimple $initialProduct * @param CatalogProductSimple $product * @return array From d790fc14db69e457defa3de27ed34a7d08e9834a Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Thu, 29 Jan 2015 10:26:09 +0200 Subject: [PATCH 06/50] MTA-551: Re-factor Test for Out of Stock Item --- .../Test/Block/Product/ListProduct.php | 56 +++++++------ .../Block/Product/ProductList/ProductItem.php | 33 ++++++++ .../Catalog/Test/Block/Product/View.php | 2 +- .../AssertAddToCartButtonAbsent.php | 78 +++--------------- .../AssertAddToCartButtonPresent.php | 79 ++++--------------- .../Product/CreateSimpleProductEntityTest.php | 60 +++++++++++--- .../testCreate.csv | 39 ++++----- 7 files changed, 163 insertions(+), 184 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php index 4415fec2ac069..47b7c83011fc1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php @@ -6,16 +6,25 @@ namespace Magento\Catalog\Test\Block\Product; +use Magento\Catalog\Test\Block\Product\ProductList\ProductItem; use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Factory\Factory; +use Magento\Mtf\Fixture\InjectableFixture; /** - * Product list. + * Product list block. */ class ListProduct extends Block { + /** + * Locator for product item block. + * + * @var string + */ + protected $productItem = './/*[contains(@class,"product-item-link") and @title="%s"]/ancestor::li'; + /** * This member holds the class name of the regular price block. * @@ -58,13 +67,6 @@ class ListProduct extends Block */ protected $oldPrice = ".old-price .price-container"; - /** - * 'Add to Card' button. - * - * @var string - */ - protected $addToCard = "button.action.tocart"; - /** * Price box CSS selector. * @@ -86,16 +88,35 @@ class ListProduct extends Block */ protected $sorter = '#sorter'; + /** + * Return product item block. + * + * @param InjectableFixture $product + * @return ProductItem + */ + public function getProductItem(InjectableFixture $product) + { + $locator = sprintf($this->productItem, $product->getName()); + + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', + ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] + ); + } + /** * This method returns the price box block for the named product. * - * @param string $productName String containing the name of the product to find. + * @param string $productName * @return Price */ public function getProductPriceBlock($productName) { - return Factory::getBlockFactory()->getMagentoCatalogProductPrice( - $this->getProductDetailsElement($productName)->find($this->priceBlockClass, Locator::SELECTOR_CLASS_NAME) + $productDetails = $this->getProductDetailsElement($productName); + + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\Price', + ['element' => $productDetails->find($this->priceBlockClass, Locator::SELECTOR_CLASS_NAME)] ); } @@ -186,18 +207,7 @@ public function getOldPriceCategoryPage() */ public function getPrice($productId) { - return $this->_rootElement->find(sprintf($this->priceBox, $productId), Locator::SELECTOR_CSS) - ->getText(); - } - - /** - * Check 'Add To Card' button availability. - * - * @return bool - */ - public function checkAddToCardButton() - { - return $this->_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->isVisible(); + return $this->_rootElement->find(sprintf($this->priceBox, $productId), Locator::SELECTOR_CSS)->getText(); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php new file mode 100644 index 0000000000000..bab42f700c198 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php @@ -0,0 +1,33 @@ +_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->isVisible(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php index d2c48765f52aa..e29a8a6716a36 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php @@ -351,7 +351,7 @@ public function openMapBlockOnProductPage() * * @return bool */ - public function checkAddToCardButton() + public function isVisibleAddToCardButton() { return $this->_rootElement->find($this->addToCart, Locator::SELECTOR_CSS)->isVisible(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php index 4aad21571bd7d..f4f6b09b735c2 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php @@ -13,8 +13,7 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertAddToCartButtonAbsent - * Checks the button on the category/product pages + * Checks the button on the category/product pages. */ class AssertAddToCartButtonAbsent extends AbstractConstraint { @@ -23,35 +22,7 @@ class AssertAddToCartButtonAbsent extends AbstractConstraint /* end tags */ /** - * Category Page - * - * @var CatalogCategoryView - */ - protected $catalogCategoryView; - - /** - * Index Page - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Product simple fixture - * - * @var CatalogProductSimple - */ - protected $product; - - /** - * Product Page on Frontend - * - * @var CatalogProductView - */ - protected $catalogProductView; - - /** - * Assert that "Add to cart" button is not display on page + * Assert that "Add to cart" button is not display on page. * * @param CmsIndex $cmsIndex * @param CatalogCategoryView $catalogCategoryView @@ -66,52 +37,29 @@ public function processAssert( CatalogProductSimple $product, CatalogProductView $catalogProductView ) { - $this->catalogCategoryView = $catalogCategoryView; - $this->cmsIndex = $cmsIndex; - $this->product = $product; - $this->catalogProductView = $catalogProductView; + $cmsIndex->open(); + $cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); - $this->addToCardAbsentOnCategory(); - $this->addToCardAbsentOnProduct(); - } + $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); + while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { + $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); + } + \PHPUnit_Framework_Assert::assertTrue($isProductVisible, 'Product is absent on category page.'); - /** - * "Add to cart" button is not displayed on Category page - * - * @return void - */ - protected function addToCardAbsentOnCategory() - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategoryByName( - $this->product->getCategoryIds()[0] - ); \PHPUnit_Framework_Assert::assertFalse( - $this->catalogCategoryView->getListProductBlock()->checkAddToCardButton(), + $catalogCategoryView->getListProductBlock()->getProductItem($product)->isVisibleAddToCardButton(), "Button 'Add to Card' is present on Category page" ); - } - /** - * "Add to cart" button is not display on Product page - * - * @return void - */ - protected function addToCardAbsentOnProduct() - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategoryByName( - $this->product->getCategoryIds()[0] - ); - $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName()); + $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); \PHPUnit_Framework_Assert::assertFalse( - $this->catalogProductView->getViewBlock()->checkAddToCardButton(), + $catalogProductView->getViewBlock()->isVisibleAddToCardButton(), "Button 'Add to Card' is present on Product page." ); } /** - * Text absent button "Add to Cart" on the category/product pages + * Text absent button "Add to Cart" on the category/product pages. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php index b779f7a8eaaee..80954db0a0a6b 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php @@ -11,10 +11,10 @@ use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertAddToCartButtonPresent - * Checks the button on the category/product pages + * Checks the button on the category/product pages. */ class AssertAddToCartButtonPresent extends AbstractConstraint { @@ -23,35 +23,7 @@ class AssertAddToCartButtonPresent extends AbstractConstraint /* end tags */ /** - * Category Page on Frontend - * - * @var CatalogCategoryView - */ - protected $catalogCategoryView; - - /** - * Index Page - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Product simple fixture - * - * @var CatalogProductSimple - */ - protected $product; - - /** - * Product Page on Frontend - * - * @var CatalogProductView - */ - protected $catalogProductView; - - /** - * Assert that "Add to cart" button is present on page + * Assert that "Add to cart" button is present on page. * * @param CmsIndex $cmsIndex * @param CatalogCategoryView $catalogCategoryView @@ -66,52 +38,29 @@ public function processAssert( CatalogProductSimple $product, CatalogProductView $catalogProductView ) { - $this->catalogCategoryView = $catalogCategoryView; - $this->cmsIndex = $cmsIndex; - $this->product = $product; - $this->catalogProductView = $catalogProductView; + $cmsIndex->open(); + $cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); - $this->addToCardPresentOnCategory(); - $this->addToCardPresentOnProduct(); - } + $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); + while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { + $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); + } + \PHPUnit_Framework_Assert::assertTrue($isProductVisible, 'Product is absent on category page.'); - /** - * "Add to cart" button is display on Category page - * - * @return void - */ - protected function addToCardPresentOnCategory() - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategoryByName( - $this->product->getCategoryIds()[0] - ); \PHPUnit_Framework_Assert::assertTrue( - $this->catalogCategoryView->getListProductBlock()->checkAddToCardButton(), + $catalogCategoryView->getListProductBlock()->getProductItem($product)->isVisibleAddToCardButton(), "Button 'Add to Card' is absent on Category page." ); - } - /** - * "Add to cart" button is display on Product page - * - * @return void - */ - protected function addToCardPresentOnProduct() - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategoryByName( - $this->product->getCategoryIds()[0] - ); - $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName()); + $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); \PHPUnit_Framework_Assert::assertTrue( - $this->catalogProductView->getViewBlock()->checkAddToCardButton(), + $catalogProductView->getViewBlock()->isVisibleAddToCardButton(), "Button 'Add to Card' is absent on Product page." ); } /** - * Text present button "Add to Cart" on the category/product pages + * Text present button "Add to Cart" on the category/product pages. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php index 02044246737b1..4a2f8adc1a303 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php @@ -10,11 +10,11 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for CreateSimpleProductEntity - * * Test Flow: * 1. Login to the backend. * 2. Navigate to Products > Catalog. @@ -29,33 +29,41 @@ class CreateSimpleProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; /* end tags */ /** - * Category fixture + * Configuration setting. + * + * @var string + */ + protected $configData; + + /** + * Category fixture. * * @var Category */ protected $category; /** - * Product page with a grid + * Product page with a grid. * * @var CatalogProductIndex */ protected $productGrid; /** - * Page to create a product + * Page to create a product. * * @var CatalogProductNew */ protected $newProductPage; /** - * Prepare data + * Prepare data. * * @param Category $category * @return array @@ -70,7 +78,7 @@ public function __prepare(Category $category) } /** - * Injection data + * Injection data. * * @param Category $category * @param CatalogProductIndex $productGrid @@ -88,18 +96,48 @@ public function __inject( } /** - * Run create product simple entity test + * Run create product simple entity test. * - * @param CatalogProductSimple $product + * @param string $configData + * @param array $productData * @param Category $category - * @return void + * @param FixtureFactory $fixtureFactory + * @return array */ - public function testCreate(CatalogProductSimple $product, Category $category) + public function testCreate($configData, array $productData, Category $category, FixtureFactory $fixtureFactory) { + $this->configData = $configData; + + // Preconditions + ObjectManager::getInstance()->create( + 'Magento\Core\Test\TestStep\SetupConfigurationStep', + ['configData' => $this->configData] + )->run(); + $product = $fixtureFactory->createByCode('catalogProductSimple', + [ + 'data' => array_merge($productData, ['category_ids' => ['category' => $category]]) + ] + ); + // Steps $this->productGrid->open(); $this->productGrid->getGridPageActionBlock()->addProduct('simple'); $this->newProductPage->getProductForm()->fill($product, null, $category); $this->newProductPage->getFormPageActions()->save(); + + return ['product' => $product]; + } + + /** + * Clean data after running test. + * + * @return void + */ + public function tearDown() + { + ObjectManager::getInstance()->create( + 'Magento\Core\Test\TestStep\SetupConfigurationStep', + ['configData' => $this->configData, 'rollback' => true] + )->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index 9ddc8f5a79c00..d43b35c8cac21 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,19 +1,20 @@ -"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"constraint" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage" -"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage" +"description";"configData";"productData/url_key";"productData/name";"productData/sku";"productData/tax_class_id/dataSet";"productData/price/value";"productData/special_price";"productData/short_description";"productData/description";"productData/weight";"productData/quantity_and_stock_status/qty";"productData/quantity_and_stock_status/is_in_stock";"productData/visibility";"productData/custom_options/preset";"productData/checkout_data/preset";"productData/custom_options/import_products";"productData/price/preset";"productData/group_price/preset";"productData/tier_price/preset";"constraint";"tag" +"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" +"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" +"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" +"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" +"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" +"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" +"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" +"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" From dd74133b8faf8c0d2ce3058726c3d34c1faef4e6 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Thu, 29 Jan 2015 13:16:23 +0200 Subject: [PATCH 07/50] MTA-551: Re-factor Test for Out of Stock Item - Fixed logical and code style errors --- .../Test/Block/Product/ListProduct.php | 1 - .../AssertAddToCartButtonAbsent.php | 13 ++-- .../AssertAddToCartButtonPresent.php | 10 ++- .../Product/CreateSimpleProductEntityTest.php | 76 ++++++------------- .../testCreate.csv | 2 +- 5 files changed, 38 insertions(+), 64 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php index 47b7c83011fc1..9cf82bb82d2eb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php @@ -10,7 +10,6 @@ use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Mtf\Factory\Factory; use Magento\Mtf\Fixture\InjectableFixture; /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php index f4f6b09b735c2..41d280ebf40ed 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php @@ -6,11 +6,12 @@ namespace Magento\Catalog\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Page\Category\CatalogCategoryView; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Mtf\Fixture\InjectableFixture; /** * Checks the button on the category/product pages. @@ -24,21 +25,23 @@ class AssertAddToCartButtonAbsent extends AbstractConstraint /** * Assert that "Add to cart" button is not display on page. * + * @param InjectableFixture $product + * @param Category $category * @param CmsIndex $cmsIndex * @param CatalogCategoryView $catalogCategoryView - * @param CatalogProductSimple $product * @param CatalogProductView $catalogProductView * * @return void */ public function processAssert( + InjectableFixture $product, + Category $category, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, - CatalogProductSimple $product, CatalogProductView $catalogProductView ) { $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); + $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { @@ -48,7 +51,7 @@ public function processAssert( \PHPUnit_Framework_Assert::assertFalse( $catalogCategoryView->getListProductBlock()->getProductItem($product)->isVisibleAddToCardButton(), - "Button 'Add to Card' is present on Category page" + "Button 'Add to Card' is present on Category page." ); $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php index 80954db0a0a6b..3626d4c98de44 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php @@ -6,7 +6,7 @@ namespace Magento\Catalog\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Page\Category\CatalogCategoryView; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; @@ -25,21 +25,23 @@ class AssertAddToCartButtonPresent extends AbstractConstraint /** * Assert that "Add to cart" button is present on page. * + * @param InjectableFixture $product + * @param Category $category * @param CmsIndex $cmsIndex * @param CatalogCategoryView $catalogCategoryView - * @param CatalogProductSimple $product * @param CatalogProductView $catalogProductView * * @return void */ public function processAssert( + InjectableFixture $product, + Category $category, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, - CatalogProductSimple $product, CatalogProductView $catalogProductView ) { $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); + $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php index 4a2f8adc1a303..c7af9682fa24f 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php @@ -10,7 +10,6 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; @@ -35,95 +34,66 @@ class CreateSimpleProductEntityTest extends Injectable /* end tags */ /** - * Configuration setting. - * - * @var string - */ - protected $configData; - - /** - * Category fixture. + * Object Manager. * - * @var Category + * @var ObjectManager */ - protected $category; + protected $objectManager; /** - * Product page with a grid. - * - * @var CatalogProductIndex - */ - protected $productGrid; - - /** - * Page to create a product. + * Configuration setting. * - * @var CatalogProductNew + * @var string */ - protected $newProductPage; + protected $configData; /** * Prepare data. * + * @param ObjectManager $objectManager * @param Category $category * @return array */ - public function __prepare(Category $category) + public function __prepare(ObjectManager $objectManager, Category $category) { - $category->persist(); + $this->objectManager = $objectManager; + $category->persist(); return [ 'category' => $category ]; } /** - * Injection data. + * Run create product simple entity test. * + * @param string $configData + * @param CatalogProductSimple $product * @param Category $category * @param CatalogProductIndex $productGrid * @param CatalogProductNew $newProductPage - * @return void + * @return array */ - public function __inject( + public function testCreate( + $configData, + CatalogProductSimple $product, Category $category, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage ) { - $this->category = $category; - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Run create product simple entity test. - * - * @param string $configData - * @param array $productData - * @param Category $category - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function testCreate($configData, array $productData, Category $category, FixtureFactory $fixtureFactory) - { $this->configData = $configData; // Preconditions - ObjectManager::getInstance()->create( + $this->objectManager->create( 'Magento\Core\Test\TestStep\SetupConfigurationStep', ['configData' => $this->configData] )->run(); - $product = $fixtureFactory->createByCode('catalogProductSimple', - [ - 'data' => array_merge($productData, ['category_ids' => ['category' => $category]]) - ] - ); // Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addProduct('simple'); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); + $productGrid->open(); + $productGrid->getGridPageActionBlock()->addProduct('simple'); + $newProductPage->getProductForm()->fill($product, null, $category); + $newProductPage->getFormPageActions()->save(); return ['product' => $product]; } @@ -135,7 +105,7 @@ public function testCreate($configData, array $productData, Category $category, */ public function tearDown() { - ObjectManager::getInstance()->create( + $this->objectManager->create( 'Magento\Core\Test\TestStep\SetupConfigurationStep', ['configData' => $this->configData, 'rollback' => true] )->run(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index d43b35c8cac21..b427c47b6a74c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,4 +1,4 @@ -"description";"configData";"productData/url_key";"productData/name";"productData/sku";"productData/tax_class_id/dataSet";"productData/price/value";"productData/special_price";"productData/short_description";"productData/description";"productData/weight";"productData/quantity_and_stock_status/qty";"productData/quantity_and_stock_status/is_in_stock";"productData/visibility";"productData/custom_options/preset";"productData/checkout_data/preset";"productData/custom_options/import_products";"productData/price/preset";"productData/group_price/preset";"productData/tier_price/preset";"constraint";"tag" +"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"constraint";"tag" "Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" "Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" "Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" From d6d0bac021c2eb16ed66cca75f0eac9018a6f07a Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Thu, 29 Jan 2015 18:25:58 +0200 Subject: [PATCH 08/50] MTA-576: Re-factor Test for Create Customer on Backend --- .../Product/AbstractCompareProductsTest.php | 8 +- .../Checkout/Test/Block/Cart/Shipping.php | 6 +- .../Checkout/Test/Block/Onepage/Billing.php | 12 +- .../TestStep/FillBillingInformationStep.php | 16 +- .../TestStep/SelectCheckoutMethodStep.php | 8 +- .../Constraint/AssertTermAbsentOnCheckout.php | 2 +- .../Test/Constraint/AssertTermOnCheckout.php | 2 +- .../Block/Account/AddressesAdditional.php | 6 +- .../Customer/Test/Block/Address/Renderer.php | 12 +- .../Customer/Test/Block/Form/CustomerForm.php | 8 +- .../AssertAddressDeletedBackend.php | 12 +- .../AssertCustomerDefaultAddresses.php | 10 +- .../Test/Constraint/AssertCustomerForm.php | 16 +- .../AssertCustomerGroupOnCustomerForm.php | 6 +- .../Test/Constraint/AssertCustomerInGrid.php | 10 +- .../Constraint/AssertCustomerInvalidEmail.php | 6 +- .../AssertCustomerMassDeleteInGrid.php | 4 +- .../AssertCustomerMassDeleteNotInGrid.php | 4 +- .../Constraint/AssertCustomerNotInGrid.php | 6 +- .../AssertCustomerPasswordChanged.php | 12 +- .../Test/Constraint/AssertCustomerTitle.php | 47 ++++ .../AssertMassActionSuccessUpdateMessage.php | 4 +- .../AssertWrongPassConfirmationMessage.php | 6 +- .../Magento/Customer/Test/Fixture/Address.php | 156 ------------ .../{AddressInjectable.xml => Address.xml} | 6 +- .../Customer/Test/Fixture/Customer.php | 171 ------------- .../{CustomerInjectable.xml => Customer.xml} | 10 +- .../Address.php | 8 +- .../GroupId.php | 2 +- .../Handler/Curl/SaveCustomerWithAddress.php | 2 +- .../{CustomerInjectable => Customer}/Curl.php | 8 +- .../Handler/Customer/CustomerInterface.php | 17 ++ .../CustomerInjectableInterface.php | 19 -- .../{AddressInjectable.xml => Address.xml} | 2 +- .../Customer/Test/Repository/Customer.php | 233 ------------------ .../{CustomerInjectable.xml => Customer.xml} | 16 +- .../TestCase/BackendCustomerCreateTest.php | 58 ----- .../TestCase/ChangeCustomerPasswordTest.php | 10 +- .../CreateCustomerBackendEntityTest.php | 41 +-- .../CreateCustomerBackendEntityTest/test.csv | 7 + .../testCreateCustomerBackendEntity.csv | 6 - .../CreateExistingCustomerFrontendEntity.php | 10 +- .../TestCase/DeleteCustomerAddressTest.php | 6 +- .../DeleteCustomerBackendEntityTest.php | 6 +- .../TestCase/MassAssignCustomerGroupTest.php | 10 +- .../MassDeleteCustomerBackendEntityTest.php | 6 +- .../RegisterCustomerFrontendEntityTest.php | 6 +- .../UpdateCustomerBackendEntityTest.php | 16 +- .../UpdateCustomerFrontendEntityTest.php | 16 +- .../Test/TestStep/CreateCustomerStep.php | 8 +- .../TestStep/LoginCustomerOnFrontendStep.php | 8 +- .../TestStep/OpenCustomerOnBackendStep.php | 10 +- .../Magento/Customer/Test/etc/constraint.xml | 15 +- .../app/Magento/Customer/Test/etc/curl/di.xml | 2 +- .../app/Magento/Customer/Test/etc/fixture.xml | 8 +- ...axCalculationAfterCheckoutDownloadable.php | 2 +- ...nAfterCheckoutDownloadableExcludingTax.php | 2 +- .../AssertGiftMessageInFrontendOrder.php | 6 +- .../AssertGiftMessageInFrontendOrderItems.php | 6 +- .../TestStep/FillCustomerAddressesStep.php | 6 +- .../TestStep/FillShippingInformationStep.php | 8 +- ...AssertCustomerIsSubscribedToNewsletter.php | 6 +- .../Block/Adminhtml/Review/Customer/Grid.php | 8 +- ...bstractAssertCustomerOrderReportResult.php | 6 +- .../AssertAbandonedCartCustomerInfoResult.php | 6 +- .../AssertCustomerOrderCountReportResult.php | 6 +- .../AssertCustomerOrderTotalReportResult.php | 6 +- .../AssertProductReportByCustomerInGrid.php | 6 +- ...AssertProductReportByCustomerNotInGrid.php | 6 +- .../AssertProductReviewsQtyByCustomer.php | 8 +- .../AbandonedCartsReportEntityTest.php | 6 +- .../CustomerReviewReportEntityTest.php | 8 +- .../TestCase/NewAccountsReportEntityTest.php | 6 +- .../TestCase/ProductsInCartReportEntity.php | 10 +- ...ssertProductReviewInGridOnCustomerPage.php | 6 +- ...anageProductReviewFromCustomerPageTest.php | 14 +- .../AbstractAssertOrderOnFrontend.php | 6 +- .../AssertOrderInOrdersGridOnFrontend.php | 6 +- .../AssertOrderNotVisibleOnMyAccount.php | 6 +- .../AssertSalesPrintOrderBillingAddress.php | 6 +- .../Test/TestStep/FillBillingAddressStep.php | 10 +- .../Test/TestStep/SelectCustomerOrderStep.php | 8 +- .../Sales/Test/TestStep/SubmitOrderStep.php | 12 +- ...tractAssertTaxCalculationAfterCheckout.php | 2 +- ...tractAssertTaxRuleIsAppliedToAllPrices.php | 8 +- .../Test/Constraint/AssertTaxRuleApplying.php | 12 +- .../Test/TestCase/DeleteTaxRuleEntityTest.php | 8 +- .../Test/TestCase/UpdateTaxRuleEntityTest.php | 2 +- .../Test/TestCase/CreateTaxWithFptTest.php | 12 +- ...ductIsPresentInCustomerBackendWishlist.php | 6 +- .../AssertProductsIsAbsentInWishlist.php | 6 +- .../Test/TestCase/AbstractWishlistTest.php | 6 +- .../AddProductToWishlistEntityTest.php | 10 +- ...CartFromCustomerWishlistOnFrontendTest.php | 6 +- ...ProductInCustomerWishlistOnBackendTest.php | 10 +- ...roductInCustomerWishlistOnFrontendTest.php | 10 +- ...oductFromCustomerWishlistOnBackendTest.php | 10 +- ...leteProductsFromWishlistOnFrontendTest.php | 6 +- ...eProductFromShoppingCartToWishlistTest.php | 10 +- .../Test/TestCase/ShareWishlistEntityTest.php | 14 +- ...ProductInCustomerWishlistOnBackendTest.php | 10 +- 101 files changed, 460 insertions(+), 1002 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.php rename dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/{AddressInjectable.xml => Address.xml} (96%) delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.php rename dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/{CustomerInjectable.xml => Customer.xml} (95%) rename dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/{CustomerInjectable => Customer}/Address.php (91%) rename dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/{CustomerInjectable => Customer}/GroupId.php (97%) rename dev/tests/functional/tests/app/Magento/Customer/Test/Handler/{CustomerInjectable => Customer}/Curl.php (96%) create mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/CustomerInterface.php delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/CustomerInjectableInterface.php rename dev/tests/functional/tests/app/Magento/Customer/Test/Repository/{AddressInjectable.xml => Address.xml} (99%) delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.php rename dev/tests/functional/tests/app/Magento/Customer/Test/Repository/{CustomerInjectable.xml => Customer.xml} (89%) delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/BackendCustomerCreateTest.php create mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php index b8bcce9c6c744..94ab4152c7bc5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Page\Product\CatalogProductCompare; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; @@ -76,7 +76,7 @@ abstract class AbstractCompareProductsTest extends Injectable /** * Fixture customer. * - * @var CustomerInjectable + * @var Customer */ protected $customer; @@ -84,10 +84,10 @@ abstract class AbstractCompareProductsTest extends Injectable * Prepare data. * * @param FixtureFactory $fixtureFactory - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - public function __prepare(FixtureFactory $fixtureFactory, CustomerInjectable $customer) + public function __prepare(FixtureFactory $fixtureFactory, Customer $customer) { $this->fixtureFactory = $fixtureFactory; $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php index b6fde4920b1d0..52b7fadcd585e 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php @@ -6,7 +6,7 @@ namespace Magento\Checkout\Test\Block\Cart; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; @@ -99,10 +99,10 @@ public function selectShippingMethod(array $shipping) /** * Fill shipping and tax form * - * @param AddressInjectable $address + * @param Address $address * @return void */ - public function fillEstimateShippingAndTax(AddressInjectable $address) + public function fillEstimateShippingAndTax(Address $address) { $this->openEstimateShippingAndTax(); $this->fill($address); diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php index db9b6109a05b7..6f5ecebf39996 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php @@ -6,8 +6,8 @@ namespace Magento\Checkout\Test\Block\Onepage; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Block\Form; /** @@ -40,14 +40,14 @@ class Billing extends Form /** * Fill billing address * - * @param AddressInjectable $billingAddress - * @param CustomerInjectable $customer + * @param Address $billingAddress + * @param Customer $customer * @param bool $isShippingAddress * @return void */ public function fillBilling( - AddressInjectable $billingAddress = null, - CustomerInjectable $customer = null, + Address $billingAddress = null, + Customer $customer = null, $isShippingAddress = false ) { if ($billingAddress) { diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php index 1c0ce87c6880e..7d406644d97a7 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php @@ -7,8 +7,8 @@ namespace Magento\Checkout\Test\TestStep; use Magento\Checkout\Test\Page\CheckoutOnepage; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\TestStep\TestStepInterface; /** @@ -27,14 +27,14 @@ class FillBillingInformationStep implements TestStepInterface /** * Address fixture * - * @var AddressInjectable + * @var Address */ protected $billingAddress; /** * Customer fixture * - * @var CustomerInjectable + * @var Customer */ protected $customer; @@ -48,14 +48,14 @@ class FillBillingInformationStep implements TestStepInterface /** * @constructor * @param CheckoutOnepage $checkoutOnepage - * @param AddressInjectable $billingAddress - * @param CustomerInjectable $customer + * @param Address $billingAddress + * @param Customer $customer * @param string $checkoutMethod */ public function __construct( CheckoutOnepage $checkoutOnepage, - AddressInjectable $billingAddress, - CustomerInjectable $customer, + Address $billingAddress, + Customer $customer, $checkoutMethod ) { $this->checkoutOnepage = $checkoutOnepage; diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php index 3d37267a82e62..b7a24b61d368d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php @@ -7,7 +7,7 @@ namespace Magento\Checkout\Test\TestStep; use Magento\Checkout\Test\Page\CheckoutOnepage; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\TestStep\TestStepInterface; /** @@ -33,17 +33,17 @@ class SelectCheckoutMethodStep implements TestStepInterface /** * Customer fixture * - * @var CustomerInjectable + * @var Customer */ protected $customer; /** * @constructor * @param CheckoutOnepage $checkoutOnepage - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $checkoutMethod */ - public function __construct(CheckoutOnepage $checkoutOnepage, CustomerInjectable $customer, $checkoutMethod) + public function __construct(CheckoutOnepage $checkoutOnepage, Customer $customer, $checkoutMethod) { $this->checkoutOnepage = $checkoutOnepage; $this->checkoutMethod = $checkoutMethod; diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php index 19842adc066a9..0a836d753131c 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php @@ -60,7 +60,7 @@ public function processAssert( ); $product = $createProductsStep->run(); - $billingAddress = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'default']); + $billingAddress = $fixtureFactory->createByCode('address', ['dataSet' => 'default']); $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCartButton(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php index 386c4038028ea..68bb0c2b6e7ff 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php @@ -71,7 +71,7 @@ public function processAssert( ); $product = $createProductsStep->run(); - $billingAddress = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'default']); + $billingAddress = $fixtureFactory->createByCode('address', ['dataSet' => 'default']); $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCartButton(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesAdditional.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesAdditional.php index 80b259639594c..8929219497886 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesAdditional.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesAdditional.php @@ -5,7 +5,7 @@ */ namespace Magento\Customer\Test\Block\Account; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; @@ -39,10 +39,10 @@ class AddressesAdditional extends Block /** * Delete Additional Address * - * @param AddressInjectable $address + * @param Address $address * @return void */ - public function deleteAdditionalAddress(AddressInjectable $address) + public function deleteAdditionalAddress(Address $address) { $this->_rootElement->find(sprintf($this->addressSelector, $address->getStreet()), Locator::SELECTOR_XPATH) ->find($this->deleteAddressLink)->click(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php index 5acbb5377c8b7..8e7123d56343d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Address/Renderer.php @@ -6,10 +6,10 @@ namespace Magento\Customer\Test\Block\Address; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; /** - * Render output from AddressInjectable fixture according to data format type. + * Render output from Address fixture according to data format type. */ class Renderer { @@ -21,18 +21,18 @@ class Renderer protected $type; /** - * AddressInjectable fixture. + * Address fixture. * - * @var AddressInjectable + * @var Address */ protected $address; /** * @constructor - * @param AddressInjectable $address + * @param Address $address * @param string $type */ - public function __construct(AddressInjectable $address, $type = null) + public function __construct(Address $address, $type = null) { $this->address = $address; $this->type = $type; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php index 21b2410a61593..6d7588a6e3914 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php @@ -9,7 +9,7 @@ use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; /** * Customer account edit form. @@ -56,7 +56,7 @@ public function submit() */ public function fill(FixtureInterface $customer, SimpleElement $element = null) { - /** @var CustomerInjectable $customer */ + /** @var Customer $customer */ if ($customer->hasData()) { return parent::fill($customer, $element); } @@ -65,10 +65,10 @@ public function fill(FixtureInterface $customer, SimpleElement $element = null) /** * Get all error validation messages for fields. * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function getValidationMessages(CustomerInjectable $customer) + public function getValidationMessages(Customer $customer) { $messages = []; foreach (array_keys($customer->getData()) as $field) { diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php index 6259e116b41a2..ca98ef766c5c0 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php @@ -6,8 +6,8 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex; use Magento\Sales\Test\Page\Adminhtml\OrderIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -27,15 +27,15 @@ class AssertAddressDeletedBackend extends AbstractConstraint * * @param OrderIndex $orderIndex * @param OrderCreateIndex $orderCreateIndex - * @param AddressInjectable $deletedAddress - * @param CustomerInjectable $customer + * @param Address $deletedAddress + * @param Customer $customer * @return void */ public function processAssert( OrderIndex $orderIndex, OrderCreateIndex $orderCreateIndex, - AddressInjectable $deletedAddress, - CustomerInjectable $customer + Address $deletedAddress, + Customer $customer ) { $filter = ['email' => $customer->getEmail()]; $orderIndex->open()->getGridPageActions()->addNew(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php index 3fb0c59976d8e..540636897c2cc 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -23,10 +23,10 @@ class AssertCustomerDefaultAddresses extends AbstractConstraint * Asserts that Default Billing Address and Default Shipping Address equal to data from fixture * * @param CustomerAccountIndex $customerAccountIndex - * @param AddressInjectable $address + * @param Address $address * @return void */ - public function processAssert(CustomerAccountIndex $customerAccountIndex, AddressInjectable $address) + public function processAssert(CustomerAccountIndex $customerAccountIndex, Address $address) { $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Account Dashboard'); $defaultBillingAddress = explode( @@ -80,10 +80,10 @@ protected function verifyForm(array $pattern, array $address) /** * Make pattern for form verifying * - * @param AddressInjectable $address + * @param Address $address * @return array */ - protected function makeAddressPattern(AddressInjectable $address) + protected function makeAddressPattern(Address $address) { $pattern = []; $regionId = $address->getRegionId(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php index 0c55f3cd04a06..8cdf44ff1e0dc 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php @@ -6,8 +6,8 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Mtf\Constraint\AbstractConstraint; @@ -37,19 +37,19 @@ class AssertCustomerForm extends AbstractConstraint /** * Assert that displayed customer data on edit page(backend) equals passed from fixture * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerIndex $pageCustomerIndex * @param CustomerIndexEdit $pageCustomerIndexEdit - * @param AddressInjectable $address [optional] - * @param CustomerInjectable $initialCustomer [optional] + * @param Address $address[optional] + * @param Customer $initialCustomer [optional] * @return void */ public function processAssert( - CustomerInjectable $customer, + Customer $customer, CustomerIndex $pageCustomerIndex, CustomerIndexEdit $pageCustomerIndexEdit, - AddressInjectable $address = null, - CustomerInjectable $initialCustomer = null + Address $address = null, + Customer $initialCustomer = null ) { $data = []; $filter = []; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php index 10d3c750d07e3..cb2fe5f120d62 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php @@ -7,7 +7,7 @@ namespace Magento\Customer\Test\Constraint; use Magento\Customer\Test\Fixture\CustomerGroupInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew; use Magento\Mtf\Constraint\AbstractConstraint; @@ -37,9 +37,9 @@ public function processAssert( CustomerIndexNew $customerIndexNew, CustomerIndex $customerIndex ) { - /** @var CustomerInjectable $customer */ + /** @var Customer $customer */ $customer = $fixtureFactory->createByCode( - 'customerInjectable', + 'customer', [ 'dataSet' => 'defaultBackend', 'data' => ['group_id' => ['customerGroup' => $customerGroup]] diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php index 569e949e9170a..e04c8fc3f2c5d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -23,17 +23,17 @@ class AssertCustomerInGrid extends AbstractConstraint /** * Assert customer availability in Customer Grid * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerIndex $pageCustomerIndex - * @param CustomerInjectable $initialCustomer [optional] + * @param Customer $initialCustomer [optional] * @return void * * @SuppressWarnings(PHPMD.NPathComplexity) */ public function processAssert( - CustomerInjectable $customer, + Customer $customer, CustomerIndex $pageCustomerIndex, - CustomerInjectable $initialCustomer = null + Customer $initialCustomer = null ) { if ($initialCustomer) { $customer = $customer->hasData() diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php index 63c178507c63c..98ef9feb499e1 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew; use Magento\Mtf\Constraint\AbstractConstraint; @@ -26,11 +26,11 @@ class AssertCustomerInvalidEmail extends AbstractConstraint * Assert that error message "Please correct this email address: "%email%"." is displayed * after customer with invalid email save * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerIndexNew $pageCustomerIndexNew * @return void */ - public function processAssert(CustomerInjectable $customer, CustomerIndexNew $pageCustomerIndexNew) + public function processAssert(Customer $customer, CustomerIndexNew $pageCustomerIndexNew) { $expectMessage = str_replace('%email%', $customer->getEmail(), self::ERROR_EMAIL_MESSAGE); $actualMessage = $pageCustomerIndexNew->getMessagesBlock()->getErrorMessages(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php index f309e6ac9db5c..f3e519421ef49 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -26,7 +26,7 @@ class AssertCustomerMassDeleteInGrid extends AbstractConstraint * @param CustomerIndex $pageCustomerIndex * @param AssertCustomerInGrid $assertCustomerInGrid * @param int $customersQtyToDelete - * @param CustomerInjectable[] $customers + * @param Customer[] $customers * @return void */ public function processAssert( diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php index c2bbd18879b42..2282775dca1dd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -26,7 +26,7 @@ class AssertCustomerMassDeleteNotInGrid extends AbstractConstraint * @param CustomerIndex $customerIndexPage * @param AssertCustomerNotInGrid $assertCustomerNotInGrid * @param int $customersQtyToDelete - * @param CustomerInjectable[] $customers + * @param Customer[] $customers * @return void */ public function processAssert( diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php index 69104a54536b3..34faf0ab6c37d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -23,12 +23,12 @@ class AssertCustomerNotInGrid extends AbstractConstraint /** * Asserts that customer is not in customer's grid * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerIndex $customerIndexPage * @return void */ public function processAssert( - CustomerInjectable $customer, + Customer $customer, CustomerIndex $customerIndexPage ) { $customerIndexPage->open(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php index 67e2021c36e6a..690b437961fdd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureFactory; @@ -25,18 +25,18 @@ class AssertCustomerPasswordChanged extends AbstractConstraint * * @param FixtureFactory $fixtureFactory * @param CustomerAccountIndex $customerAccountIndex - * @param CustomerInjectable $initialCustomer - * @param CustomerInjectable $customer + * @param Customer $initialCustomer + * @param Customer $customer * @return void */ public function processAssert( FixtureFactory $fixtureFactory, CustomerAccountIndex $customerAccountIndex, - CustomerInjectable $initialCustomer, - CustomerInjectable $customer + Customer $initialCustomer, + Customer $customer ) { $customer = $fixtureFactory->createByCode( - 'customerInjectable', + 'customer', [ 'dataSet' => 'default', 'data' => [ diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php new file mode 100644 index 0000000000000..c714e7b6c4fc5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php @@ -0,0 +1,47 @@ +getFirstname() . ' ' . $customer->getLastname(), + $pageCustomerIndex->getTitleBlock()->getTitle(), + 'Wrong page title is displayed.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Assert that title is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php index cdd9c6c2cd206..1d14f0995f6dd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -28,7 +28,7 @@ class AssertMassActionSuccessUpdateMessage extends AbstractConstraint /** * Assert update message is appears on customer grid (Customers > All Customers) * - * @param CustomerInjectable|CustomerInjectable[] $customer + * @param Customer|Customer[] $customer * @param CustomerIndex $pageCustomerIndex * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php index 341c4befe32eb..f323dab1383bb 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountEdit; use Magento\Mtf\Constraint\AbstractConstraint; @@ -27,11 +27,11 @@ class AssertWrongPassConfirmationMessage extends AbstractConstraint /** * Assert that conformation message is present. * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerAccountEdit $customerAccountEdit * @return void */ - public function processAssert(CustomerInjectable $customer, CustomerAccountEdit $customerAccountEdit) + public function processAssert(Customer $customer, CustomerAccountEdit $customerAccountEdit) { $validationMessages = $customerAccountEdit->getAccountInfoForm()->getValidationMessages($customer); if (isset($validationMessages['password_confirmation'])) { diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.php deleted file mode 100644 index 3419fc5b42e85..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.php +++ /dev/null @@ -1,156 +0,0 @@ -getData(); - $address = isset($data['fields']['prefix']['value']) ? $data['fields']['prefix']['value'] . ' ' : '' - . $data['fields']['firstname']['value'] . ' ' - . (isset($data['fields']['middlename']['value']) ? $data['fields']['middlename']['value'] . ' ' : '') - . $data['fields']['lastname']['value'] . ', ' - . (isset($data['fields']['suffix']['value']) ? $data['fields']['suffix']['value'] . ' ' : '') - . $data['fields']['street']['value'] . ', ' - . $data['fields']['city']['value'] . ', ' - . $data['fields']['region_id']['value'] . ' ' - . $data['fields']['postcode']['value'] . ', ' - . $data['fields']['country_id']['value']; - - return $address; - } - - /** - * Get city - * - * @return string - */ - public function getCity() - { - return $this->getData('fields/city/value'); - } - - /** - * Get country - * - * @return string - */ - public function getCountry() - { - return $this->getData('fields/country/value'); - } - - /** - * Get first name - * - * @return string - */ - public function getFirstName() - { - return $this->getData('fields/firstname'); - } - - /** - * Get last name - * - * @return string - */ - public function getLastName() - { - return $this->getData('fields/lastname'); - } - - /** - * Get postal code - * - * @return string - */ - public function getPostCode() - { - return $this->getData('fields/postcode/value'); - } - - /** - * Get region - * - * @return string - */ - public function getRegion() - { - return $this->getData('fields/region/value'); - } - - /** - * Get telephone number - * - * @return string - */ - public function getTelephone() - { - return $this->getData('fields/telephone'); - } - - /** - * {inheritdoc} - */ - protected function _initData() - { - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCustomerAddress($this->_dataConfig, $this->_data); - - //Default data set - $this->switchData('address_US_1'); - } - - /** - * Set customer - * - * @param FixtureInterface $customer - */ - public function setCustomer(FixtureInterface $customer) - { - $this->_customer = $customer; - } - - /** - * Persists prepared data into application - */ - public function persist() - { - Factory::getApp()->magentoCustomerCreateAddress($this); - } - - /** - * Get customer - * - * @return FixtureInterface - */ - public function getCustomer() - { - return $this->_customer; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressInjectable.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml similarity index 96% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressInjectable.xml rename to dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml index cdc7f3ee9d49d..dd7b21e540ac3 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml @@ -7,13 +7,13 @@ --> + class="Magento\Customer\Test\Fixture\Address"> Magento_Customer eav customer_address Magento\Customer\Model\Resource\Address\Collection - Magento\Customer\Test\Repository\AddressInjectable - Magento\Customer\Test\Handler\AddressInjectable\AddressInjectableInterface + Magento\Customer\Test\Repository\Address + Magento\Customer\Test\Handler\Address\AddressInterface John Doe diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.php deleted file mode 100644 index 52bd27ee085e3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.php +++ /dev/null @@ -1,171 +0,0 @@ -getMagentoCustomerAddress(); - $customerAddress->switchData('address_US_2'); - $customerAddress->setCustomer($this); - return $customerAddress; - } - - /** - * Create customer via frontend - * - * @return string - */ - public function persist() - { - return Factory::getApp()->magentoCustomerCreateCustomer($this); - } - - /** - * Get customer email - * - * @return string - */ - public function getEmail() - { - return $this->getData('fields/email/value'); - } - - /** - * Get customer password - * - * @return string - */ - public function getPassword() - { - return $this->getData('fields/password/value'); - } - - /** - * Get first name - * - * @return string - */ - public function getFirstName() - { - return $this->getData('fields/firstname/value'); - } - - /** - * Get last name - * - * @return string - */ - public function getLastName() - { - return $this->getData('fields/lastname/value'); - } - - /** - * Get billing address for customer - * - * @return Address - */ - public function getDefaultBillingAddress() - { - $defaultBilling = Factory::getFixtureFactory()->getMagentoCustomerAddress(); - $defaultBilling->switchData($this->getAddressDatasetName()); - $defaultBilling->setCustomer($this); - return $defaultBilling; - } - - /** - * Get default shipping address for customer - * - * @return Address - */ - public function getDefaultShippingAddress() - { - $defaultShipping = Factory::getFixtureFactory()->getMagentoCustomerAddress(); - $defaultShipping->switchData($this->getAddressDatasetName()); - $defaultShipping->setCustomer($this); - return $defaultShipping; - } - - /** - * Get customer group - * - * @return string - */ - public function getGroup() - { - return $this->getData('fields/group_id/value'); - } - - /** - * {inheritdoc} - */ - protected function _initData() - { - $this->_defaultConfig = [ - 'grid_filter' => ['email'], - 'constraint' => 'Success', - ]; - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCustomerCustomer($this->_dataConfig, $this->_data); - - //Default data set - $this->switchData('customer_US_1'); - } - - /** - * @return \Magento\Customer\Test\Fixture\Address - */ - public function getAddressData() - { - $customerAddress = Factory::getFixtureFactory()->getMagentoCustomerAddress(); - $customerAddress->switchData('address_data_US_1'); - $customerAddress->setCustomer($this); - return $customerAddress; - } - - /** - * Get address dataset name - * - * @return string - */ - protected function getAddressDatasetName() - { - return $this->getData('address/dataset/value'); - } - - /** - * Update the customer fixture with a new customer group - * - * @param $value - * @param $inputValue - */ - public function updateCustomerGroup($value, $inputValue) - { - $data = [ - 'fields' => [ - 'group_id' => [ - 'value' => $value, - 'input_value' => $inputValue, - ], - ], - ]; - $this->_data = array_replace_recursive($this->_data, $data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml similarity index 95% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable.xml rename to dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml index ca8a9add498b0..54a0df25cc167 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml @@ -7,14 +7,14 @@ --> + class="Magento\Customer\Test\Fixture\Customer"> Magento_Customer eav customer Magento\Customer\Model\Resource\Customer\Collection email - Magento\Customer\Test\Repository\CustomerInjectable - Magento\Customer\Test\Handler\CustomerInjectable\CustomerInjectableInterface + Magento\Customer\Test\Repository\Customer + Magento\Customer\Test\Handler\Customer\CustomerInterface John Doe @@ -26,7 +26,7 @@ address virtual - Magento\Customer\Test\Fixture\CustomerInjectable\Address + Magento\Customer\Test\Fixture\Customer\Address confirmation @@ -116,7 +116,7 @@ select account_information - Magento\Customer\Test\Fixture\CustomerInjectable\GroupId + Magento\Customer\Test\Fixture\Customer\GroupId lastname diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable/Address.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php similarity index 91% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable/Address.php rename to dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php index 7a5d580c6b4b9..a950e2323c9d2 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable/Address.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\Customer\Test\Fixture\CustomerInjectable; +namespace Magento\Customer\Test\Fixture\Customer; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address as AddressInjectable; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; @@ -51,8 +51,8 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array if (isset($data['presets'])) { $data['presets'] = explode(',', $data['presets']); foreach ($data['presets'] as $value) { - /** @var AddressInjectable $fixture */ - $addresses = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => $value]); + /** @var AddressInjectable $addresses*/ + $addresses = $fixtureFactory->createByCode('address', ['dataSet' => $value]); $this->data[] = $addresses->getData(); $this->addressesFixture[] = $addresses; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable/GroupId.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php similarity index 97% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable/GroupId.php rename to dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php index 1c728b16ec424..972073d270220 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerInjectable/GroupId.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Customer\Test\Fixture\CustomerInjectable; +namespace Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Fixture\CustomerGroupInjectable; use Magento\Mtf\Fixture\FixtureFactory; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php index 945abc7193462..43456cb34eec5 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php @@ -92,7 +92,7 @@ protected function getValue($values) public function persist(FixtureInterface $fixture = null) { /** @var \Magento\Customer\Test\Fixture\Customer $fixture */ - $address = $fixture->getDefaultBillingAddress(); + $address = $fixture->getDefaultBilling(); $fields = $this->prepareData($address->getData('fields')); $url = $_ENV['app_frontend_url'] . $this->saveUrl; $curl = $this->saveCustomer($fixture); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php similarity index 96% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php rename to dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php index 52b1c48dfbf9e..216a6dd111803 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\Customer\Test\Handler\CustomerInjectable; +namespace Magento\Customer\Test\Handler\Customer; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Handler\Curl as AbstractCurl; use Magento\Mtf\System\Config; @@ -18,7 +18,7 @@ * Class Curl * Curl handler for creating customer through registration page. */ -class Curl extends AbstractCurl implements CustomerInjectableInterface +class Curl extends AbstractCurl implements CustomerInterface { /** * Default customer group @@ -69,7 +69,7 @@ public function persist(FixtureInterface $customer = null) { $address = []; $result = []; - /** @var CustomerInjectable $customer */ + /** @var Customer $customer */ $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; $data = $customer->getData(); $data['group_id'] = $this->getCustomerGroup($customer); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/CustomerInterface.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/CustomerInterface.php new file mode 100644 index 0000000000000..ad0c6d929ddf5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/CustomerInterface.php @@ -0,0 +1,17 @@ + - + John Doe diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.php deleted file mode 100644 index c0d1a73894069..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.php +++ /dev/null @@ -1,233 +0,0 @@ - 'General', self::INDEX_INPUT_VALUE => '1']; - - /** - * @var array attributes that represent a group type of 'Retailer' - */ - protected $groupRetailer = [self::INDEX_VALUE => 'Retailer', self::INDEX_INPUT_VALUE => '3']; - - /** - * {inheritdoc} - */ - public function __construct(array $defaultConfig = [], array $defaultData = []) - { - $this->_data['default'] = [ - 'config' => $defaultConfig, - 'data' => $defaultData, - ]; - - $this->_data['customer_US_1'] = $this->_getUS1(); - $this->_data['backend_customer'] = $this->_getBackendCustomer($this->groupGeneral); - $this->_data['backend_retailer_customer'] = $this->_getBackendCustomer($this->groupRetailer); - $this->_data['customer_UK_1'] = $this->getUK1(); - $this->_data['customer_UK_with_VAT'] = $this->getUKWithVAT($this->_data['customer_UK_1']); - $this->_data['customer_DE_1'] = $this->getDE1(); - } - - protected function _getUS1() - { - return [ - 'data' => [ - 'fields' => [ - 'firstname' => [ - 'value' => 'John', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'lastname' => [ - 'value' => 'Doe', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'email' => [ - 'value' => 'John.Doe%isolation%@example.com', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'password' => [ - 'value' => '123123q', - ], - 'password_confirmation' => [ - 'value' => '123123q', - ], - ], - 'address' => [ - 'dataset' => [ - 'value' => 'address_US_1', - ], - ], - ] - ]; - } - - /** - * Get customer from Germany - * - * @return array - */ - protected function getDE1() - { - return [ - 'data' => [ - 'fields' => [ - 'firstname' => [ - 'value' => 'Jan', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'lastname' => [ - 'value' => 'Jansen', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'email' => [ - 'value' => 'Jan.Jansen%isolation%@example.com', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'password' => [ - 'value' => '123123q', - ], - 'password_confirmation' => [ - 'value' => '123123q', - ], - ], - ] - ]; - } - - protected function _getBackendCustomer($groupType) - { - return [ - 'data' => [ - 'fields' => [ - 'firstname' => [ - 'value' => 'John', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'lastname' => [ - 'value' => 'Doe', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'email' => [ - 'value' => 'John.Doe%isolation%@example.com', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'website_id' => [ - 'value' => 'Main Website', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - 'input' => 'select', - 'input_value' => '1', - ], - 'group_id' => [ - 'value' => $groupType[self::INDEX_VALUE], - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - 'input' => 'select', - 'input_value' => $groupType[self::INDEX_INPUT_VALUE], - ], - 'password' => [ - 'value' => '123123q', - 'group' => null, - ], - 'password_confirmation' => [ - 'value' => '123123q', - 'group' => null, - ], - ], - 'address' => [ - 'dataset' => [ - 'value' => 'address_US_1', - ], - ], - 'addresses' => [], - ] - ]; - } - - /** - * Get customer data for UK - * - * @return array - */ - protected function getUK1() - { - return [ - 'data' => [ - 'fields' => [ - 'firstname' => [ - 'value' => 'Jane', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'lastname' => [ - 'value' => 'Doe', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'email' => [ - 'value' => 'Jane.Doe%isolation%@example.com', - 'group' => self::GROUP_CUSTOMER_INFO_TABS_ACCOUNT, - ], - 'password' => [ - 'value' => '123123q', - ], - 'password_confirmation' => [ - 'value' => '123123q', - ], - ], - 'address' => [ - 'dataset' => [ - 'value' => 'address_UK', - ], - ], - ], - ]; - } - - /** - * Get customer data for UK with VAT number - * - * @param array $defaultData - * @return array - */ - protected function getUKWithVAT($defaultData) - { - return array_replace_recursive( - $defaultData, - [ - 'data' => [ - 'address' => [ - 'dataset' => [ - 'value' => 'address_UK_with_VAT', - ], - ], - ], - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml similarity index 89% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.xml rename to dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml index 5df2e83a4d1bb..20c6ee3ff7cb7 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml @@ -6,7 +6,7 @@ */ --> - + John Doe @@ -133,5 +133,19 @@ US_address_NY, US_address + + + John + Doe%isolation% + + General + + John.Doe%isolation%@example.com + 123123q + 123123q + + address_US_1 + + diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/BackendCustomerCreateTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/BackendCustomerCreateTest.php deleted file mode 100644 index c979cd41c25bb..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/BackendCustomerCreateTest.php +++ /dev/null @@ -1,58 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * New customer creation in backend - * - * @ZephyrId MAGETWO-12516 - */ - public function testCreateCustomer() - { - //Data - $customerFixture = Factory::getFixtureFactory()->getMagentoCustomerCustomer(); - $customerFixture->switchData('backend_customer'); - $searchData = [ - 'email' => $customerFixture->getEmail(), - ]; - //Pages - $customerPage = Factory::getPageFactory()->getCustomerIndex(); - $customerCreatePage = Factory::getPageFactory()->getCustomerIndexNew(); - - //Steps - $customerPage->open(); - $customerPage->getPageActionsBlock()->addNew(); - $customerCreatePage->getCustomerForm()->fillCustomer($customerFixture); - $customerCreatePage->getPageActionsBlock()->saveAndContinue(); - $customerCreatePage->getMessagesBlock()->waitSuccessMessage(); - - //Verifying - $customerPage->open(); - $this->assertTrue( - $customerPage->getCustomerGridBlock()->isRowVisible($searchData), - 'Customer email "' . $searchData['email'] . '" not found in the grid' - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php index b29e28cb54b08..0040ce3c12d65 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.php @@ -6,12 +6,12 @@ namespace Magento\Customer\Test\TestCase; +use Magento\Mtf\TestCase\Injectable; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountEdit; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Customer\Test\Page\CustomerAccountLogin; -use Magento\Mtf\TestCase\Injectable; /** * Test Flow: @@ -88,11 +88,11 @@ public function __inject( /** * Run Change customer password test. * - * @param CustomerInjectable $initialCustomer - * @param CustomerInjectable $customer + * @param Customer $initialCustomer + * @param Customer $customer * @return void */ - public function test(CustomerInjectable $initialCustomer, CustomerInjectable $customer) + public function test(Customer $initialCustomer, Customer $customer) { // Preconditions $initialCustomer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php index ec75d23b1047e..13fc7277df346 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php @@ -6,22 +6,22 @@ namespace Magento\Customer\Test\TestCase; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Mtf\TestCase\Injectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew; -use Magento\Mtf\TestCase\Injectable; /** - * Test Coverage for CreateCustomerBackendEntityTest + * Test Coverage for CreateCustomerBackendEntityTest. * * General Flow: * 1. Log in as default admin user. - * 2. Go to Customers > All Customers - * 3. Press "Add New Customer" button - * 4. Fill form - * 5. Click "Save Customer" button - * 6. Perform all assertions + * 2. Go to Customers > All Customers. + * 3. Press "Add New Customer" button. + * 4. Fill form. + * 5. Click "Save Customer" button. + * 6. Perform all assertions. * * @ticketId MAGETWO-23424 */ @@ -33,23 +33,32 @@ class CreateCustomerBackendEntityTest extends Injectable /* end tags */ /** - * @var CustomerInjectable + * Customer fixture. + * + * @var Customer */ protected $customer; /** + * Customer index page. + * * @var CustomerIndex */ protected $pageCustomerIndex; /** + * New customer page. + * * @var CustomerIndexNew */ protected $pageCustomerIndexNew; /** + * Inject customer pages. + * * @param CustomerIndex $pageCustomerIndex * @param CustomerIndexNew $pageCustomerIndexNew + * @return void */ public function __inject( CustomerIndex $pageCustomerIndex, @@ -60,10 +69,14 @@ public function __inject( } /** - * @param CustomerInjectable $customer - * @param AddressInjectable $address + * Create customer on backend. + * + * @param Customer $customer + * @param Address $address + * @param string $customerAction + * @return void */ - public function testCreateCustomerBackendEntity(CustomerInjectable $customer, AddressInjectable $address) + public function test(Customer $customer, Address $address, $customerAction) { // Prepare data $address = $address->hasData() ? $address : null; @@ -72,6 +85,6 @@ public function testCreateCustomerBackendEntity(CustomerInjectable $customer, Ad $this->pageCustomerIndex->open(); $this->pageCustomerIndex->getPageActionsBlock()->addNew(); $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address); - $this->pageCustomerIndexNew->getPageActionsBlock()->save(); + $this->pageCustomerIndexNew->getPageActionsBlock()->$customerAction(); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv new file mode 100644 index 0000000000000..1a673246c5176 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv @@ -0,0 +1,7 @@ +"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue";"tag" +"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" +"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689";"" +"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" +"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"";"" +"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" +"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerTitle";"";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv deleted file mode 100644 index 7db78a347381a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv +++ /dev/null @@ -1,6 +0,0 @@ -"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue" -"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" -"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689" -"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" -"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"" -"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php index 6ab2dd30c72d3..80e7a2eef28ff 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php @@ -7,7 +7,7 @@ namespace Magento\Customer\Test\TestCase; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountCreate; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\TestCase\Injectable; @@ -62,14 +62,14 @@ class CreateExistingCustomerFrontendEntity extends Injectable * @param CustomerAccountCreate $customerAccountCreate * @param CustomerAccountLogout $customerAccountLogout * @param CmsIndex $cmsIndex - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ public function __inject( CustomerAccountCreate $customerAccountCreate, CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex, - CustomerInjectable $customer + Customer $customer ) { $this->customerAccountLogout = $customerAccountLogout; $this->customerAccountCreate = $customerAccountCreate; @@ -84,10 +84,10 @@ public function __inject( /** * Create Existing Customer account on frontend * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - public function testCreateExistingCustomer(CustomerInjectable $customer) + public function testCreateExistingCustomer(Customer $customer) { //Steps $this->cmsIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php index 22d2be27760f6..36cb46a29b4ee 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php @@ -7,7 +7,7 @@ namespace Magento\Customer\Test\TestCase; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Mtf\TestCase\Injectable; @@ -81,10 +81,10 @@ public function __inject( /** * Runs Delete Customer Address test * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function test(CustomerInjectable $customer) + public function test(Customer $customer) { // Precondition: $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.php index d6fe3981534da..adb0c3fc6db5b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Mtf\TestCase\Injectable; @@ -61,10 +61,10 @@ public function __inject(CustomerIndex $customerIndexPage, CustomerIndexEdit $cu /** * Runs Delete Customer Backend Entity test * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - public function testDeleteCustomerBackendEntity(CustomerInjectable $customer) + public function testDeleteCustomerBackendEntity(Customer $customer) { // Preconditions: $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php index fa1782e8a4dd8..1ad32642a33cd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php @@ -7,7 +7,7 @@ namespace Magento\Customer\Test\TestCase; use Magento\Customer\Test\Fixture\CustomerGroupInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\TestCase\Injectable; @@ -56,10 +56,10 @@ class MassAssignCustomerGroupTest extends Injectable /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -80,11 +80,11 @@ public function __inject(CustomerIndex $customerIndex) /** * Mass assign customer group * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerGroupInjectable $customerGroup * @return void */ - public function test(CustomerInjectable $customer, CustomerGroupInjectable $customerGroup) + public function test(Customer $customer, CustomerGroupInjectable $customerGroup) { // Steps $customerGroup->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php index 99efcb8300d9f..ef596fbdfa071 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Mtf\Fixture\FixtureFactory; @@ -102,13 +102,13 @@ public function test($customersQty, $customersQtyToDelete) * Create Customers * * @param int $customersQty - * @return CustomerInjectable[] + * @return Customer[] */ protected function createCustomers($customersQty) { $customers = []; for ($i = 0; $i < $customersQty; $i++) { - $customer = $this->fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'default']); + $customer = $this->fixtureFactory->createByCode('customer', ['dataSet' => 'default']); $customer->persist(); $customers[] = $customer; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php index 586084a5fa731..06bd850b3766e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountCreate; use Magento\Cms\Test\Page\CmsIndex; use Magento\Customer\Test\Page\CustomerAccountLogout; @@ -64,9 +64,9 @@ public function __inject( /** * Create Customer account on frontend * - * @param CustomerInjectable $customer + * @param Customer $customer */ - public function test(CustomerInjectable $customer) + public function test(Customer $customer) { //Steps $this->cmsIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php index ed3e94fc950aa..f1fdd71ae8e92 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php @@ -6,8 +6,8 @@ namespace Magento\Customer\Test\TestCase; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Mtf\TestCase\Injectable; @@ -55,14 +55,14 @@ public function __inject( } /** - * @param CustomerInjectable $initialCustomer - * @param CustomerInjectable $customer - * @param AddressInjectable $address + * @param Customer $initialCustomer + * @param Customer $customer + * @param Address $address */ public function testUpdateCustomerBackendEntity( - CustomerInjectable $initialCustomer, - CustomerInjectable $customer, - AddressInjectable $address + Customer $initialCustomer, + Customer $customer, + Address $address ) { // Prepare data $address = $address->hasData() ? $address : null; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php index 9c1822ed88b7c..5fdcc4b7c3993 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php @@ -8,8 +8,8 @@ use Magento\Cms\Test\Page\CmsIndex; use Magento\Customer\Test\Constraint\AssertCustomerInfoSuccessSavedMessage; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountEdit; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Customer\Test\Page\CustomerAccountLogin; @@ -116,16 +116,16 @@ public function __inject( /** * Run Update Customer Entity test * - * @param CustomerInjectable $initialCustomer - * @param CustomerInjectable $customer - * @param AddressInjectable $address + * @param Customer $initialCustomer + * @param Customer $customer + * @param Address $address * @param AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage * @return void */ public function test( - CustomerInjectable $initialCustomer, - CustomerInjectable $customer, - AddressInjectable $address, + Customer $initialCustomer, + Customer $customer, + Address $address, AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage ) { // Preconditions diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/CreateCustomerStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/CreateCustomerStep.php index e3c28182eef96..a98e2da6adab1 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/CreateCustomerStep.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/CreateCustomerStep.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\TestStep; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\TestStep\TestStepInterface; /** @@ -18,7 +18,7 @@ class CreateCustomerStep implements TestStepInterface /** * Customer fixture * - * @var CustomerInjectable + * @var Customer */ protected $customer; @@ -31,10 +31,10 @@ class CreateCustomerStep implements TestStepInterface /** * @constructor - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $checkoutMethod */ - public function __construct(CustomerInjectable $customer, $checkoutMethod = '') + public function __construct(Customer $customer, $checkoutMethod = '') { $this->customer = $customer; if ($checkoutMethod === 'register' || $checkoutMethod === 'guest') { diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php index 4cc77cfa414dd..745b576a528ab 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php @@ -7,7 +7,7 @@ namespace Magento\Customer\Test\TestStep; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Mtf\TestStep\TestStepInterface; @@ -19,7 +19,7 @@ class LoginCustomerOnFrontendStep implements TestStepInterface /** * Customer fixture. * - * @var CustomerInjectable + * @var Customer */ protected $customer; @@ -41,12 +41,12 @@ class LoginCustomerOnFrontendStep implements TestStepInterface * @constructor * @param CmsIndex $cmsIndex * @param CustomerAccountLogin $customerAccountLogin - * @param CustomerInjectable $customer + * @param Customer $customer */ public function __construct( CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, - CustomerInjectable $customer + Customer $customer ) { $this->cmsIndex = $cmsIndex; $this->customerAccountLogin = $customerAccountLogin; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/OpenCustomerOnBackendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/OpenCustomerOnBackendStep.php index 5182c34ee7cb1..ae24b8a0b386d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/OpenCustomerOnBackendStep.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/OpenCustomerOnBackendStep.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\TestStep; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Mtf\TestStep\TestStepInterface; @@ -19,23 +19,23 @@ class OpenCustomerOnBackendStep implements TestStepInterface /** * Customer fixture * - * @var CustomerInjectable + * @var Customer */ protected $customer; /** * Customer index page * - * @var CustomerInjectable + * @var Customer */ protected $customerIndex; /** * @constructor - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerIndex $customerIndex */ - public function __construct(CustomerInjectable $customer, CustomerIndex $customerIndex) + public function __construct(Customer $customer, CustomerIndex $customerIndex) { $this->customer = $customer; $this->customerIndex = $customerIndex; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml index 8359c1d24c0c0..c14b930e86321 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml @@ -27,30 +27,33 @@ middle - + middle - + middle - + + + middle + middle - - + + @@ -100,7 +103,7 @@ low -
+
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml index 1a27c3c2250a0..303133bdea2b4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml @@ -6,6 +6,6 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/fixture.xml index d099ea9e58501..33518c85f82b7 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/fixture.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/fixture.xml @@ -6,7 +6,7 @@ */ --> - + eav customer Magento\Customer\Model\Resource\Customer\Collection @@ -25,12 +25,12 @@ virtual - - + +
eav customer_address Magento\Customer\Model\Resource\Address\Collection - +
flat customer_group diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php index 009f5e1cacd07..bb4eedec5fd96 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php @@ -9,7 +9,7 @@ use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Checkout\Test\Page\CheckoutOnepage; use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Sales\Test\Page\OrderView; use Magento\Mtf\Fixture\InjectableFixture; use Magento\Tax\Test\Constraint\AbstractAssertTaxCalculationAfterCheckout; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php index 60a4e36293d08..c0e21c6d332e4 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php @@ -6,7 +6,7 @@ namespace Magento\Downloadable\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; /** * Checks that prices excl tax on order review and customer order pages are equal to specified in dataset. diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php index 9a2946618d87a..49d37759fbac9 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php @@ -6,7 +6,7 @@ namespace Magento\GiftMessage\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Sales\Test\Page\OrderHistory; @@ -27,7 +27,7 @@ class AssertGiftMessageInFrontendOrder extends AbstractConstraint * Assert that message from dataSet is displayed on order(s) view page on frontend * * @param GiftMessage $giftMessage - * @param CustomerInjectable $customer + * @param Customer $customer * @param OrderHistory $orderHistory * @param OrderView $orderView * @param CustomerAccountLogout $customerAccountLogout @@ -36,7 +36,7 @@ class AssertGiftMessageInFrontendOrder extends AbstractConstraint */ public function processAssert( GiftMessage $giftMessage, - CustomerInjectable $customer, + Customer $customer, OrderHistory $orderHistory, OrderView $orderView, CustomerAccountLogout $customerAccountLogout, diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index 09c931ac7a31d..bdfb649759a89 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -6,7 +6,7 @@ namespace Magento\GiftMessage\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Sales\Test\Page\OrderHistory; @@ -27,7 +27,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint * Assert that message from dataSet is displayed for each items on order(s) view page on frontend * * @param GiftMessage $giftMessage - * @param CustomerInjectable $customer + * @param Customer $customer * @param OrderHistory $orderHistory * @param OrderView $orderView * @param CustomerAccountLogout $customerAccountLogout @@ -37,7 +37,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint */ public function processAssert( GiftMessage $giftMessage, - CustomerInjectable $customer, + Customer $customer, OrderHistory $orderHistory, OrderView $orderView, CustomerAccountLogout $customerAccountLogout, diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillCustomerAddressesStep.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillCustomerAddressesStep.php index b88b563b4c098..1ff01795ef352 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillCustomerAddressesStep.php +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillCustomerAddressesStep.php @@ -5,7 +5,7 @@ */ namespace Magento\Multishipping\Test\TestStep; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\ObjectManager; use Magento\Multishipping\Test\Page\MultishippingCheckoutAddresses; use Magento\Mtf\TestStep\TestStepInterface; @@ -45,13 +45,13 @@ class FillCustomerAddressesStep implements TestStepInterface /** * @param MultishippingCheckoutAddresses $addresses - * @param CustomerInjectable $customer + * @param Customer $customer * @param ObjectManager $objectManager * @param array $products */ public function __construct( MultishippingCheckoutAddresses $addresses, - CustomerInjectable $customer, + Customer $customer, ObjectManager $objectManager, $products ) { diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillShippingInformationStep.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillShippingInformationStep.php index 311dbaaa8e422..66741bb38ffe0 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillShippingInformationStep.php +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/FillShippingInformationStep.php @@ -5,7 +5,7 @@ */ namespace Magento\Multishipping\Test\TestStep; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Multishipping\Test\Page\MultishippingCheckoutShipping; use Magento\Mtf\TestStep\TestStepInterface; @@ -24,7 +24,7 @@ class FillShippingInformationStep implements TestStepInterface /** * Customer fixture containing addresses. * - * @var CustomerInjectable + * @var Customer */ protected $customer; @@ -37,12 +37,12 @@ class FillShippingInformationStep implements TestStepInterface /** * @param MultishippingCheckoutShipping $shippingInformation - * @param CustomerInjectable $customer + * @param Customer $customer * @param array $shippingMethod */ public function __construct( MultishippingCheckoutShipping $shippingInformation, - CustomerInjectable $customer, + Customer $customer, array $shippingMethod ) { $this->shippingInformation = $shippingInformation; diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php index 7e41b346d1d2a..5997c32892703 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php @@ -6,7 +6,7 @@ namespace Magento\Newsletter\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Newsletter\Test\Page\Adminhtml\SubscriberIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -23,12 +23,12 @@ class AssertCustomerIsSubscribedToNewsletter extends AbstractConstraint /** * Assert customer is subscribed to newsletter * - * @param CustomerInjectable $customer + * @param Customer $customer * @param SubscriberIndex $subscriberIndex * @return void */ public function processAssert( - CustomerInjectable $customer, + Customer $customer, SubscriberIndex $subscriberIndex ) { $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Customer/Grid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Customer/Grid.php index 3eaae41b7e2bd..09b0022ba004d 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Customer/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Review/Customer/Grid.php @@ -7,7 +7,7 @@ namespace Magento\Reports\Test\Block\Adminhtml\Review\Customer; use Magento\Backend\Test\Block\Widget\Grid as AbstractGrid; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Client\Locator; /** @@ -33,12 +33,12 @@ class Grid extends AbstractGrid /** * Open customer review report * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - public function openReview(CustomerInjectable $customer) + public function openReview(Customer $customer) { - $customerName = $customer->getFirstName() . ' ' . $customer->getLastName(); + $customerName = $customer->getFirstname() . ' ' . $customer->getLastname(); $this->_rootElement->find(sprintf($this->searchRow, $customerName), Locator::SELECTOR_XPATH)->click(); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php index 82e4fe1f4b0a9..f7ff86b916f10 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php @@ -6,7 +6,7 @@ namespace Magento\Reports\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -22,12 +22,12 @@ abstract class AbstractAssertCustomerOrderReportResult extends AbstractConstrain /** * Prepare filter * - * @param CustomerInjectable $customer + * @param Customer $customer * @param array $columns * @param array $report * @return array */ - public function prepareFilter(CustomerInjectable $customer, array $columns, array $report) + public function prepareFilter(Customer $customer, array $columns, array $report) { $format = ''; switch ($report['report_period']) { diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php index 346f78a1c747a..8ebb47d842a33 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php @@ -6,7 +6,7 @@ namespace Magento\Reports\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Reports\Test\Page\Adminhtml\AbandonedCarts; use Magento\Mtf\Constraint\AbstractConstraint; @@ -28,10 +28,10 @@ class AssertAbandonedCartCustomerInfoResult extends AbstractConstraint * * @param AbandonedCarts $abandonedCarts * @param array $products - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - public function processAssert(AbandonedCarts $abandonedCarts, $products, CustomerInjectable $customer) + public function processAssert(AbandonedCarts $abandonedCarts, $products, Customer $customer) { $abandonedCarts->open(); $qty = 0; diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php index c1052cbb9e820..889294fca0074 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php @@ -6,7 +6,7 @@ namespace Magento\Reports\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Reports\Test\Page\Adminhtml\CustomerOrdersReport; /** @@ -23,14 +23,14 @@ class AssertCustomerOrderCountReportResult extends AbstractAssertCustomerOrderRe * Assert OrderCountReport grid for all params * * @param CustomerOrdersReport $customerOrdersReport - * @param CustomerInjectable $customer + * @param Customer $customer * @param array $columns * @param array $report * @return void */ public function processAssert( CustomerOrdersReport $customerOrdersReport, - CustomerInjectable $customer, + Customer $customer, array $columns, array $report ) { diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php index 4bf17a62e87ca..4631562a0e180 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php @@ -6,7 +6,7 @@ namespace Magento\Reports\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Reports\Test\Page\Adminhtml\CustomerTotalsReport; /** @@ -23,14 +23,14 @@ class AssertCustomerOrderTotalReportResult extends AbstractAssertCustomerOrderRe * Assert OrderTotalReport grid for all params * * @param CustomerTotalsReport $customerTotalsReport - * @param CustomerInjectable $customer + * @param Customer $customer * @param array $columns * @param array $report * @return void */ public function processAssert( CustomerTotalsReport $customerTotalsReport, - CustomerInjectable $customer, + Customer $customer, array $columns, array $report ) { diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php index d537838adef6c..fd03bd9fb74df 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php @@ -7,7 +7,7 @@ namespace Magento\Reports\Test\Constraint; use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Reports\Test\Page\Adminhtml\CustomerReportReview; use Magento\Review\Test\Constraint\AssertProductReviewInGrid; use Magento\Review\Test\Fixture\Review; @@ -31,7 +31,7 @@ class AssertProductReportByCustomerInGrid extends AbstractConstraint * @param Review $review * @param AssertProductReviewInGrid $assertProductReviewInGrid * @param CustomerReportReview $customerReportReview - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogProductSimple $product * @param string $gridStatus * @return void @@ -41,7 +41,7 @@ public function processAssert( Review $review, AssertProductReviewInGrid $assertProductReviewInGrid, CustomerReportReview $customerReportReview, - CustomerInjectable $customer, + Customer $customer, CatalogProductSimple $product = null, $gridStatus = '' ) { diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php index 76116fee9c8e8..f834f667c8076 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php @@ -7,7 +7,7 @@ namespace Magento\Reports\Test\Constraint; use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Reports\Test\Page\Adminhtml\CustomerReportReview; use Magento\Review\Test\Constraint\AssertProductReviewNotInGrid; use Magento\Review\Test\Fixture\Review; @@ -31,7 +31,7 @@ class AssertProductReportByCustomerNotInGrid extends AbstractConstraint * @param Review $review * @param AssertProductReviewNotInGrid $assertProductReviewNotInGrid * @param CustomerReportReview $customerReportReview - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogProductSimple $product * @param string $gridStatus * @return void @@ -41,7 +41,7 @@ public function processAssert( Review $review, AssertProductReviewNotInGrid $assertProductReviewNotInGrid, CustomerReportReview $customerReportReview, - CustomerInjectable $customer, + Customer $customer, CatalogProductSimple $product, $gridStatus = '' ) { diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php index 1ae6670b974dd..9528233a5b82f 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php @@ -6,7 +6,7 @@ namespace Magento\Reports\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Reports\Test\Page\Adminhtml\CustomerReportReview; use Magento\Mtf\Constraint\AbstractConstraint; @@ -24,16 +24,16 @@ class AssertProductReviewsQtyByCustomer extends AbstractConstraint * Assert product reviews qty column in Review Report by Customer grid * * @param CustomerReportReview $customerReportReview - * @param CustomerInjectable $customer + * @param Customer $customer * @param int $reviewsCount * @return void */ public function processAssert( CustomerReportReview $customerReportReview, - CustomerInjectable $customer, + Customer $customer, $reviewsCount ) { - $customerName = $customer->getFirstName() . ' ' . $customer->getLastName(); + $customerName = $customer->getFirstname() . ' ' . $customer->getLastname(); $customerReportReview->open(); \PHPUnit_Framework_Assert::assertEquals( $reviewsCount, diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php index bc27cf23ec8c3..2770831f3b627 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php @@ -9,7 +9,7 @@ use Magento\Mtf\TestCase\Injectable; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Client\BrowserInterface; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Catalog\Test\Page\Product\CatalogProductView; /** @@ -81,10 +81,10 @@ public function __inject( * Create product and add it to cart. * * @param string $products - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function test($products, CustomerInjectable $customer) + public function test($products, Customer $customer) { $this->markTestIncomplete('Bug: MAGETWO-31737'); // Precondition diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php index 28a4f7204b41d..705127c1d81d6 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php @@ -10,7 +10,7 @@ use Magento\Catalog\Test\Page\Category\CatalogCategoryView; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Reports\Test\Page\Adminhtml\ProductReportReview; @@ -96,7 +96,7 @@ class CustomerReviewReportEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $customer = $fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'johndoe_unique']); + $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_unique']); $customer->persist(); return ['customer' => $customer]; @@ -133,7 +133,7 @@ public function __inject( * Test Creation for CustomerReviewReportEntity * * @param Review $review - * @param CustomerInjectable $customer + * @param Customer $customer * @param $customerLogin * @param CatalogProductSimple $product * @param BrowserInterface $browser @@ -143,7 +143,7 @@ public function __inject( */ public function test( Review $review, - CustomerInjectable $customer, + Customer $customer, CatalogProductSimple $product, BrowserInterface $browser, $customerLogin diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php index 62a4231bca01c..f00195c836913 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\Reports\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Reports\Test\Page\Adminhtml\CustomerAccounts; use Magento\Mtf\TestCase\Injectable; @@ -64,11 +64,11 @@ public function __inject(CustomerIndex $customerIndexPage, CustomerAccounts $cus /** * New Accounts Report. * - * @param CustomerInjectable $customer + * @param Customer $customer * @param array $customersReport * @return void */ - public function test(CustomerInjectable $customer, array $customersReport) + public function test(Customer $customer, array $customersReport) { $this->markTestIncomplete('MAGETWO-26663'); // Preconditions diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php index 59fcbb7b335fe..a5af836086932 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\Client\BrowserInterface; @@ -72,10 +72,10 @@ class ProductsInCartReportEntity extends Injectable /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -106,14 +106,14 @@ public function __inject( /** * Create products in cart report entity * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogProductSimple $product * @param string $isGuest * @param BrowserInterface $browser * @return void */ public function test( - CustomerInjectable $customer, + Customer $customer, CatalogProductSimple $product, $isGuest, BrowserInterface $browser diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php index 1208bd72e4d80..b10b5322a0985 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php @@ -6,7 +6,7 @@ namespace Magento\Review\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Review\Test\Block\Adminhtml\Product\Grid as ReviewsGrid; @@ -26,7 +26,7 @@ class AssertProductReviewInGridOnCustomerPage extends AbstractConstraint /** * Asserts all Product Review variables in the reviews grid on customer page * - * @param CustomerInjectable $customer + * @param Customer $customer * @param Review $reviewInitial * @param Review $review * @param CustomerIndexEdit $customerIndexEdit @@ -35,7 +35,7 @@ class AssertProductReviewInGridOnCustomerPage extends AbstractConstraint * @return void */ public function processAssert( - CustomerInjectable $customer, + Customer $customer, Review $reviewInitial, Review $review, CustomerIndexEdit $customerIndexEdit, diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php index 52f5bbe692b4e..014dd2a3c79d9 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Customer\Test\Page\CustomerAccountLogin; @@ -125,10 +125,10 @@ class ManageProductReviewFromCustomerPageTest extends Injectable /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); return ['customer' => $customer]; @@ -175,13 +175,13 @@ public function __inject( * * @param Review $reviewInitial * @param Review $review - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ public function test( Review $reviewInitial, Review $review, - CustomerInjectable $customer + Customer $customer ) { // Preconditions $this->login($customer); @@ -211,10 +211,10 @@ public function test( /** * Login customer on frontend * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - protected function login(CustomerInjectable $customer) + protected function login(Customer $customer) { $this->cmsIndex->open(); if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php index 3ebe97e8f48a8..9ba84f6a064de 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AbstractAssertOrderOnFrontend.php @@ -8,7 +8,7 @@ use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\ObjectManager; @@ -51,10 +51,10 @@ public function __construct( /** * Login customer and open Order page * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - protected function loginCustomerAndOpenOrderPage(CustomerInjectable $customer) + protected function loginCustomerAndOpenOrderPage(Customer $customer) { $this->cmsIndex->open(); $loginCustomerOnFrontendStep = $this->objectManager->create( diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php index 8b4dd2454da91..22cee3c20e2a7 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\OrderHistory; @@ -27,7 +27,7 @@ class AssertOrderInOrdersGridOnFrontend extends AbstractConstraint * Assert that order is present in Orders grid on frontend * * @param OrderInjectable $order - * @param CustomerInjectable $customer + * @param Customer $customer * @param ObjectManager $objectManager * @param CustomerAccountIndex $customerAccountIndex * @param OrderHistory $orderHistory @@ -38,7 +38,7 @@ class AssertOrderInOrdersGridOnFrontend extends AbstractConstraint */ public function processAssert( OrderInjectable $order, - CustomerInjectable $customer, + Customer $customer, ObjectManager $objectManager, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php index 595a9428edaf9..7967bf5798740 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\OrderHistory; @@ -27,7 +27,7 @@ class AssertOrderNotVisibleOnMyAccount extends AbstractConstraint * Assert order is not visible in customer account on frontend * * @param OrderInjectable $order - * @param CustomerInjectable $customer + * @param Customer $customer * @param ObjectManager $objectManager * @param CustomerAccountIndex $customerAccountIndex * @param OrderHistory $orderHistory @@ -36,7 +36,7 @@ class AssertOrderNotVisibleOnMyAccount extends AbstractConstraint */ public function processAssert( OrderInjectable $order, - CustomerInjectable $customer, + Customer $customer, ObjectManager $objectManager, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php index 8c6c78230ea17..43881bd436eb1 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\Constraint; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Sales\Test\Page\SalesGuestPrint; use Magento\Mtf\Constraint\AbstractConstraint; @@ -23,10 +23,10 @@ class AssertSalesPrintOrderBillingAddress extends AbstractConstraint * Assert that BillingAddress printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint - * @param AddressInjectable $billingAddress + * @param Address $billingAddress * @return void */ - public function processAssert(SalesGuestPrint $salesGuestPrint, AddressInjectable $billingAddress) + public function processAssert(SalesGuestPrint $salesGuestPrint, Address $billingAddress) { $addressRenderer = $this->objectManager->create( 'Magento\Customer\Test\Block\Address\Renderer', diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php index a5931b05e83d8..8cc96b27e30aa 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\TestStep; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex; use Magento\Mtf\TestStep\TestStepInterface; @@ -25,16 +25,16 @@ class FillBillingAddressStep implements TestStepInterface /** * Address. * - * @var AddressInjectable + * @var Address */ protected $billingAddress; /** * @constructor * @param OrderCreateIndex $orderCreateIndex - * @param AddressInjectable $billingAddress + * @param Address $billingAddress */ - public function __construct(OrderCreateIndex $orderCreateIndex, AddressInjectable $billingAddress) + public function __construct(OrderCreateIndex $orderCreateIndex, Address $billingAddress) { $this->orderCreateIndex = $orderCreateIndex; $this->billingAddress = $billingAddress; @@ -43,7 +43,7 @@ public function __construct(OrderCreateIndex $orderCreateIndex, AddressInjectabl /** * Fill Sales Data. * - * @return AddressInjectable + * @return Address */ public function run() { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php index 8c1d84dd8ea81..cf5f5e64475f8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SelectCustomerOrderStep.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\TestStep; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex; use Magento\Mtf\TestStep\TestStepInterface; @@ -26,16 +26,16 @@ class SelectCustomerOrderStep implements TestStepInterface /** * Customer * - * @var CustomerInjectable + * @var Customer */ protected $customer; /** * @constructor * @param OrderCreateIndex $orderCreateIndex - * @param CustomerInjectable $customer + * @param Customer $customer */ - public function __construct(OrderCreateIndex $orderCreateIndex, CustomerInjectable $customer) + public function __construct(OrderCreateIndex $orderCreateIndex, Customer $customer) { $this->orderCreateIndex = $orderCreateIndex; $this->customer = $customer; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index f9195c3787581..14c3b7576a910 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -6,8 +6,8 @@ namespace Magento\Sales\Test\TestStep; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex; use Magento\Sales\Test\Page\Adminhtml\OrderView; use Magento\Mtf\Fixture\FixtureFactory; @@ -44,16 +44,16 @@ class SubmitOrderStep implements TestStepInterface * @param OrderCreateIndex $orderCreateIndex * @param OrderView $orderView * @param FixtureFactory $fixtureFactory - * @param CustomerInjectable $customer - * @param AddressInjectable $billingAddress + * @param Customer $customer + * @param Address $billingAddress * @param \Magento\Mtf\Fixture\FixtureInterface[] $products */ public function __construct( OrderCreateIndex $orderCreateIndex, OrderView $orderView, FixtureFactory $fixtureFactory, - CustomerInjectable $customer, - AddressInjectable $billingAddress, + Customer $customer, + Address $billingAddress, array $products ) { $this->orderCreateIndex = $orderCreateIndex; diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php index fd580fd0c21bb..f6c2557645ca0 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php @@ -10,7 +10,7 @@ use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Checkout\Test\Page\CheckoutOnepage; use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Sales\Test\Page\OrderView; use Magento\Mtf\Fixture\InjectableFixture; diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php index 558a37ed5ba7e..94c43d9081e71 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php @@ -11,7 +11,7 @@ use Magento\Catalog\Test\Page\Category\CatalogCategoryView; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Checkout\Test\Page\CheckoutCart; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\InjectableFixture; @@ -108,7 +108,7 @@ public function processAssert( $this->catalogProductView = $catalogProductView; $this->checkoutCart = $checkoutCart; //Preconditions - $address = $fixtureFactory->createByCode('addressInjectable', ['dataSet' => 'US_address_NY']); + $address = $fixtureFactory->createByCode('address', ['dataSet' => 'US_address_NY']); $shipping = ['carrier' => 'Flat Rate', 'method' => 'Fixed']; $actualPrices = []; //Assertion steps @@ -165,11 +165,11 @@ public function getCartPrices(InjectableFixture $product, $actualPrices) /** * Fill estimate block. * - * @param AddressInjectable $address + * @param Address $address * @param array $shipping * @return void */ - public function fillEstimateBlock(AddressInjectable $address, $shipping) + public function fillEstimateBlock(Address $address, $shipping) { $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address); $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php index f4ec80bd813e9..4c5e2cabf1c61 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php @@ -9,8 +9,8 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Checkout\Test\Page\CheckoutCart; -use Magento\Customer\Test\Fixture\AddressInjectable; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Address; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Tax\Test\Fixture\TaxRule; @@ -84,10 +84,10 @@ abstract protected function assert(); * @param TaxRule $taxRule * @param CustomerAccountLogin $customerAccountLogin * @param CustomerAccountLogout $customerAccountLogout - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogProductView $catalogProductView * @param CheckoutCart $checkoutCart - * @param AddressInjectable $address + * @param Address $address * @param array $shipping * @param BrowserInterface $browser * @param TaxRule $initialTaxRule @@ -100,10 +100,10 @@ public function processAssert( TaxRule $taxRule, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout, - CustomerInjectable $customer, + Customer $customer, CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, - AddressInjectable $address, + Address $address, array $shipping, BrowserInterface $browser, TaxRule $initialTaxRule = null diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php index aa0fac22b2b43..3c8e925589b39 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\Tax\Test\TestCase; -use Magento\Customer\Test\Fixture\AddressInjectable; +use Magento\Customer\Test\Fixture\Address; use Magento\Tax\Test\Fixture\TaxRule; use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex; use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew; @@ -59,7 +59,7 @@ class DeleteTaxRuleEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $customer = $fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'default']); + $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'default']); $customer->persist(); return ['customer' => $customer]; @@ -83,14 +83,14 @@ public function __inject( * Delete Tax Rule Entity test * * @param TaxRule $taxRule - * @param AddressInjectable $address + * @param Address $address * @param array $shipping * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function testDeleteTaxRule( TaxRule $taxRule, - AddressInjectable $address, + Address $address, array $shipping ) { // Precondition diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php index 8cd7b7abe08bf..b99a60f66df7f 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php @@ -60,7 +60,7 @@ class UpdateTaxRuleEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $customer = $fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'johndoe_retailer']); + $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_retailer']); $customer->persist(); return ['customer' => $customer]; diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php index 7a23a2d49ca3d..5269a408dd3e7 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Fixture\CatalogAttributeSet; use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; @@ -72,7 +72,7 @@ public function __prepare( FixtureFactory $fixtureFactory ) { $this->fixtureFactory = $fixtureFactory; - $customer = $fixtureFactory->createByCode('customerInjectable', ['dataSet' => 'johndoe_with_addresses']); + $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_with_addresses']); $customer->persist(); $taxRule = $fixtureFactory->createByCode('taxRule', ['dataSet' => 'tax_rule_default']); $taxRule->persist(); @@ -88,10 +88,10 @@ public function __prepare( /** * Login customer. * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - protected function loginCustomer(CustomerInjectable $customer) + protected function loginCustomer(Customer $customer) { $this->objectManager->create( 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', @@ -103,7 +103,7 @@ protected function loginCustomer(CustomerInjectable $customer) * Test product prices with tax. * * @param string $configData - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogAttributeSet $productTemplate * @param array $productData * @return array @@ -111,7 +111,7 @@ protected function loginCustomer(CustomerInjectable $customer) public function test( $productData, $configData, - CustomerInjectable $customer, + Customer $customer, CatalogAttributeSet $productTemplate ) { $product = $this->fixtureFactory->createByCode( diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php index 8370fbd4a307c..bdcb0eb6b3789 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\Constraint; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Mtf\Constraint\AbstractConstraint; @@ -27,14 +27,14 @@ class AssertProductIsPresentInCustomerBackendWishlist extends AbstractConstraint * Assert that products added to wishlist are present on Customers account on backend. * * @param CustomerIndex $customerIndex - * @param CustomerInjectable $customer + * @param Customer $customer * @param CustomerIndexEdit $customerIndexEdit * @param InjectableFixture $product * @return void */ public function processAssert( CustomerIndex $customerIndex, - CustomerInjectable $customer, + Customer $customer, CustomerIndexEdit $customerIndexEdit, InjectableFixture $product ) { diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php index 661cfac7c9b8d..04b74347792fd 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php @@ -7,7 +7,7 @@ namespace Magento\Wishlist\Test\Constraint; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Customer\Test\Page\CustomerAccountLogout; @@ -31,7 +31,7 @@ class AssertProductsIsAbsentInWishlist extends AbstractConstraint * @param CustomerAccountIndex $customerAccountIndex * @param WishlistIndex $wishlistIndex * @param InjectableFixture[] $products - * @param CustomerInjectable $customer + * @param Customer $customer * @param CmsIndex $cmsIndex * @param CustomerAccountLogin $customerAccountLogin * @param CustomerAccountLogout $customerAccountLogout @@ -41,7 +41,7 @@ public function processAssert( CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, $products, - CustomerInjectable $customer, + Customer $customer, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php index b69fa2218ad10..736d2e0e81366 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Wishlist\Test\Page\WishlistIndex; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\ObjectManager; @@ -82,10 +82,10 @@ public function __inject( /** * Login customer. * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - protected function loginCustomer(CustomerInjectable $customer) + protected function loginCustomer(Customer $customer) { $loginCustomerOnFrontendStep = $this->objectManager->create( 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php index b5a860011a096..cfa7f5ec7517d 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; /** * Test Flow: @@ -34,10 +34,10 @@ class AddProductToWishlistEntityTest extends AbstractWishlistTest /** * Prepare data for test * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -47,11 +47,11 @@ public function __prepare(CustomerInjectable $customer) /** * Run Add Product To Wishlist test * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $product * @return array */ - public function test(CustomerInjectable $customer, $product) + public function test(Customer $customer, $product) { $this->markTestIncomplete('Bug: MAGETWO-32813'); $product = $this->createProducts($product)[0]; diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php index dc3dbf9f69ad2..e4ba86d4db956 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php @@ -7,7 +7,7 @@ namespace Magento\Wishlist\Test\TestCase; use Magento\Checkout\Test\Fixture\Cart; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; /** * Test Flow: @@ -36,12 +36,12 @@ class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishli /** * Run suggest searching result test * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $products * @param int $qty * @return array */ - public function test(CustomerInjectable $customer, $products, $qty) + public function test(Customer $customer, $products, $qty) { // Preconditions $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php index 27407c6718fd7..745db63f3394c 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; @@ -41,10 +41,10 @@ class ConfigureProductInCustomerWishlistOnBackendTest extends AbstractWishlistTe /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -54,14 +54,14 @@ public function __prepare(CustomerInjectable $customer) /** * Configure customer wish list on backend * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $product * @param CustomerIndex $customerIndex * @param CustomerIndexEdit $customerIndexEdit * @return array */ public function test( - CustomerInjectable $customer, + Customer $customer, $product, CustomerIndex $customerIndex, CustomerIndexEdit $customerIndexEdit diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php index 61cd85e971fe5..522c26c35f17e 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; /** * Test Flow: @@ -37,10 +37,10 @@ class ConfigureProductInCustomerWishlistOnFrontendTest extends AbstractWishlistT /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -50,11 +50,11 @@ public function __prepare(CustomerInjectable $customer) /** * Configure customer wish list on frontend * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $product * @return array */ - public function test(CustomerInjectable $customer, $product) + public function test(Customer $customer, $product) { $this->markTestIncomplete('Bug: MAGETWO-32815'); // Preconditions diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php index c2791aa183991..d139eec4e67c0 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; @@ -40,10 +40,10 @@ class DeleteProductFromCustomerWishlistOnBackendTest extends AbstractWishlistTes /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -53,14 +53,14 @@ public function __prepare(CustomerInjectable $customer) /** * Delete product from customer wishlist on backend * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $product * @param CustomerIndex $customerIndex * @param CustomerIndexEdit $customerIndexEdit * @return array */ public function test( - CustomerInjectable $customer, + Customer $customer, $product, CustomerIndex $customerIndex, CustomerIndexEdit $customerIndexEdit diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php index 86d61f27b5c51..db05a08990533 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; /** * Test Flow: @@ -35,12 +35,12 @@ class DeleteProductsFromWishlistOnFrontendTest extends AbstractWishlistTest /** * Delete products form default wish list * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $products * @param string $removedProductsIndex [optional] * @return array */ - public function test(CustomerInjectable $customer, $products, $removedProductsIndex = null) + public function test(Customer $customer, $products, $removedProductsIndex = null) { // Preconditions $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php index 4446df6cc863d..7083e3e70ace5 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php @@ -8,7 +8,7 @@ use Magento\Checkout\Test\Constraint\AssertAddedProductToCartSuccessMessage; use Magento\Checkout\Test\Page\CheckoutCart; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Fixture\FixtureInterface; /** @@ -36,10 +36,10 @@ class MoveProductFromShoppingCartToWishlistTest extends AbstractWishlistTest /** * Prepare data for test * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -49,14 +49,14 @@ public function __prepare(CustomerInjectable $customer) /** * Run Move from ShoppingCard to Wishlist test * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $product * @param AssertAddedProductToCartSuccessMessage $assertAddedProductToCartSuccessMessage * @param CheckoutCart $checkoutCart * @return array */ public function test( - CustomerInjectable $customer, + Customer $customer, $product, AssertAddedProductToCartSuccessMessage $assertAddedProductToCartSuccessMessage, CheckoutCart $checkoutCart diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php index 342066c81cdc0..881161d8d5166 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Customer\Test\Page\CustomerAccountLogout; @@ -99,12 +99,12 @@ class ShareWishlistEntityTest extends Injectable /** * Prepare data * - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogProductSimple $product * @return array */ public function __prepare( - CustomerInjectable $customer, + Customer $customer, CatalogProductSimple $product ) { $customer->persist(); @@ -150,14 +150,14 @@ public function __inject( * Share wish list * * @param BrowserInterface $browser - * @param CustomerInjectable $customer + * @param Customer $customer * @param CatalogProductSimple $product * @param array $sharingInfo * @return void */ public function test( BrowserInterface $browser, - CustomerInjectable $customer, + Customer $customer, CatalogProductSimple $product, array $sharingInfo ) { @@ -173,10 +173,10 @@ public function test( /** * Login customer * - * @param CustomerInjectable $customer + * @param Customer $customer * @return void */ - protected function loginCustomer(CustomerInjectable $customer) + protected function loginCustomer(Customer $customer) { $this->cmsIndex->open(); if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) { diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php index 4e81a9f6e53d2..0c2913116d0e2 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php @@ -6,7 +6,7 @@ namespace Magento\Wishlist\Test\TestCase; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; @@ -38,10 +38,10 @@ class ViewProductInCustomerWishlistOnBackendTest extends AbstractWishlistTest /** * Prepare customer for test. * - * @param CustomerInjectable $customer + * @param Customer $customer * @return array */ - public function __prepare(CustomerInjectable $customer) + public function __prepare(Customer $customer) { $customer->persist(); @@ -51,14 +51,14 @@ public function __prepare(CustomerInjectable $customer) /** * Configure customer wish list on backend. * - * @param CustomerInjectable $customer + * @param Customer $customer * @param string $product * @param CustomerIndex $customerIndex * @param CustomerIndexEdit $customerIndexEdit * @return array */ public function test( - CustomerInjectable $customer, + Customer $customer, $product, CustomerIndex $customerIndex, CustomerIndexEdit $customerIndexEdit From c83fd902f1000c23007e1b831a24f28cf669ae3d Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Thu, 29 Jan 2015 18:34:37 +0200 Subject: [PATCH 09/50] MTA-551: Re-factor Test for Out of Stock Item - Removed ObjectManager from test --- .../Product/CreateSimpleProductEntityTest.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php index c7af9682fa24f..7715da24d6e3f 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php @@ -10,11 +10,10 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: + * Steps: * 1. Login to the backend. * 2. Navigate to Products > Catalog. * 3. Start to create simple product. @@ -33,13 +32,6 @@ class CreateSimpleProductEntityTest extends Injectable const DOMAIN = 'MX'; /* end tags */ - /** - * Object Manager. - * - * @var ObjectManager - */ - protected $objectManager; - /** * Configuration setting. * @@ -50,15 +42,13 @@ class CreateSimpleProductEntityTest extends Injectable /** * Prepare data. * - * @param ObjectManager $objectManager * @param Category $category * @return array */ - public function __prepare(ObjectManager $objectManager, Category $category) + public function __prepare(Category $category) { - $this->objectManager = $objectManager; - $category->persist(); + return [ 'category' => $category ]; From 52560b3152f9bdfacaa30f3e76cbf882685b7ccb Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 30 Jan 2015 13:38:19 +0200 Subject: [PATCH 10/50] MTA-576: Re-factor Test for Create Customer on Backend - Fixed old tests --- .../Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php index b07f1dd1a0388..c64786fa5551c 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php @@ -20,8 +20,7 @@ class ForgotPasswordOnFrontendTest extends Functional public function testForgotPassword() { // Create Customer - $customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer(); - $customer->switchData('customer_US_1'); + $customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer(['dataSet' => 'customer_US_1']); $customer->persist(); $customerAccountLoginPage = Factory::getPageFactory()->getCustomerAccountLogin(); From cfc2658172e9d1997d87997c77d1973db6f69af8 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 30 Jan 2015 16:32:24 +0200 Subject: [PATCH 11/50] MTA-576: Re-factor Test for Create Customer on Backend - Added old data set --- .../Customer/Test/Fixture/Customer.xml | 1 + .../Customer/Test/Repository/Customer.xml | 36 +++++++++++++++++++ .../TestCase/ForgotPasswordOnFrontendTest.php | 5 ++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml index 54a0df25cc167..1e2177b17300b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml @@ -27,6 +27,7 @@ address virtual Magento\Customer\Test\Fixture\Customer\Address + addresses confirmation diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml index 20c6ee3ff7cb7..9d908206af100 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml @@ -147,5 +147,41 @@ address_US_1 + + + John + Doe%isolation% + + Retailer + + John.Doe%isolation%@example.com + 123123q + 123123q + + address_US_1 + + + + + John + Doe%isolation% + John.Doe%isolation%@example.com + 123123q + 123123q + + address_US_1 + + + + + John + Doe%isolation% + John.Doe%isolation%@example.com + 123123q + 123123q + + address_UK + + diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php index c64786fa5551c..eaace14b84a7f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php @@ -20,7 +20,10 @@ class ForgotPasswordOnFrontendTest extends Functional public function testForgotPassword() { // Create Customer - $customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer(['dataSet' => 'customer_US_1']); + $customer = ObjectManager::getInstance()->create( + 'Magento\Customer\Test\Fixture\Customer', + ['dataSet' => 'customer_US_1'] + ); $customer->persist(); $customerAccountLoginPage = Factory::getPageFactory()->getCustomerAccountLogin(); From e96aff0b80f609fc9f8741bc8f5ecb26cbc273e9 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Fri, 30 Jan 2015 17:25:10 +0200 Subject: [PATCH 12/50] MTA-550: Re-factor Tests for Assign Promoted Products - Re-factor cross-sell products --- .../Bundle/Test/Fixture/BundleProduct.xml | 18 + .../Block/Product/ProductList/Crosssell.php | 65 +++- .../Block/Product/ProductList/ProductItem.php | 47 +++ .../AssertCrossSellsProductsSection.php | 18 +- .../AssertNoCrossSellsProductsSection.php | 9 +- .../AbstractRelatedProducts.php | 47 +-- .../Test/Fixture/CatalogProductVirtual.xml | 18 + .../Product/AddCrossSellEntityTest.php | 56 --- .../Product/AddCrossSellEntityTest/test.csv | 2 - .../Product/AddToCartCrossSellTest.php | 331 ++++++++++++++++++ .../Product/AddToCartCrossSellTest/test.csv | 3 + .../testCreate.csv | 41 +-- .../Test/TestCase/Product/CrosssellTest.php | 135 ------- .../Fixture/ConfigurableProductInjectable.xml | 12 + .../CheckoutData.php | 13 +- .../ConfigurableProductInjectable.xml | 3 + .../Fixture/DownloadableProductInjectable.xml | 18 + .../Mtf/TestSuite/GithubPublicationTests.php | 71 ---- 18 files changed, 566 insertions(+), 341 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest/test.csv create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php delete mode 100644 dev/tests/functional/testsuites/Magento/Mtf/TestSuite/GithubPublicationTests.php diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml index 5e88525da9742..50d20322a0801 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml @@ -510,5 +510,23 @@ virtual websites + + cross_sell_products + virtual + crosssells + Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts + + + up_sell_products + virtual + upsells + Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts + + + related_products + virtual + related-products + Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts +
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php index 9b5d42d49b913..d7c9291210993 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php @@ -9,45 +9,72 @@ use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Catalog\Test\Fixture\Product; /** - * Class Crosssell - * Crosssell product block on the page + * Cross-sell product block on the checkout page. */ class Crosssell extends Block { /** - * Link selector + * Product item block. * * @var string */ - protected $linkSelector = '.product.name [title="%s"]'; + protected $productItem = 'li.product-item'; /** - * Verify cross-sell item + * Product item block by product name. + * + * @var string + */ + protected $productItemByName = './/*[contains(@class,"product-item-link") and @title="%s"]/ancestor::li'; + + /** + * Check whether block is visible. * - * @param FixtureInterface $crosssell * @return bool */ - public function verifyProductCrosssell(FixtureInterface $crosssell) + public function isVisible() { - $match = $this->_rootElement->find(sprintf($this->linkSelector, $crosssell->getName()), Locator::SELECTOR_CSS); - return $match->isVisible(); + return $this->_rootElement->isVisible(); } /** - * Click on cross-sell product link + * Return product item block. * - * @param Product $product - * @return SimpleElement + * @param FixtureInterface $product + * @return ProductItem */ - public function clickLink($product) + public function getProductItem(FixtureInterface $product) { - $this->_rootElement->find( - sprintf($this->linkSelector, $product->getName()), - Locator::SELECTOR_CSS - )->click(); + $locator = sprintf($this->productItemByName, $product->getName()); + + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', + ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Get list of product names. + * + * @return array + */ + public function getProductNames() + { + $productItems = $this->_rootElement->getElements($this->productItem, Locator::SELECTOR_CSS); + $names = []; + + foreach ($productItems as $productItem) { + /** @var ProductItem $productItemBlock */ + $productItemBlock = $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', + ['element' => $productItem] + ); + + $names[] = $productItemBlock->getProductName(); + } + + return $names; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php index bab42f700c198..a3408fca5a689 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/ProductItem.php @@ -14,6 +14,13 @@ */ class ProductItem extends Block { + /** + * Link to product view page. + * + * @var string + */ + protected $link = 'a.product-item-link'; + /** * 'Add to Card' button. * @@ -21,6 +28,36 @@ class ProductItem extends Block */ protected $addToCard = "button.action.tocart"; + /** + * Check whether block is visible. + * + * @return bool + */ + public function isVisible() + { + return $this->_rootElement->isVisible(); + } + + /** + * Open product view page by link. + * + * @return void + */ + public function open() + { + $this->_rootElement->find($this->link, Locator::SELECTOR_CSS)->click(); + } + + /** + * Return product name. + * + * @return string + */ + public function getProductName() + { + return trim($this->_rootElement->find($this->link)->getText()); + } + /** * Checking that "Add to Card" button is visible * @@ -30,4 +67,14 @@ public function isVisibleAddToCardButton() { return $this->_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->isVisible(); } + + /** + * Click by "Add to Cart" button. + * + * @return void + */ + public function clickAddToCart() + { + $this->_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->click(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php index b6a8c8c559ffa..71ef4bf14e2e2 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php @@ -11,11 +11,9 @@ use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertCrossSellsProductsSection - * Assert that product is displayed in cross-sell section + * Assert that product is displayed in cross-sell section. */ class AssertCrossSellsProductsSection extends AbstractConstraint { @@ -24,30 +22,30 @@ class AssertCrossSellsProductsSection extends AbstractConstraint /* end tags */ /** - * Assert that product is displayed in cross-sell section + * Assert that product is displayed in cross-sell section. * * @param BrowserInterface $browser * @param CheckoutCart $checkoutCart * @param CatalogProductSimple $product * @param CatalogProductView $catalogProductView - * @param InjectableFixture[] $relatedProducts * @return void */ public function processAssert( BrowserInterface $browser, CheckoutCart $checkoutCart, CatalogProductSimple $product, - CatalogProductView $catalogProductView, - array $relatedProducts + CatalogProductView $catalogProductView ) { + $relatedProducts = $product->getDataFieldConfig('cross_sell_products')['source']->getProducts(); + $errors = []; + $checkoutCart->open(); $checkoutCart->getCartBlock()->clearShoppingCart(); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->addToCart($product); - $errors = []; foreach ($relatedProducts as $relatedProduct) { - if (!$checkoutCart->getCrosssellBlock()->verifyProductCrosssell($relatedProduct)) { + if (!$checkoutCart->getCrosssellBlock()->getProductItem($relatedProduct)->isVisible()) { $errors[] = 'Product \'' . $relatedProduct->getName() . '\' is absent in cross-sell section.'; } } @@ -56,7 +54,7 @@ public function processAssert( } /** - * Text success product is displayed in cross-sell section + * Text success product is displayed in cross-sell section. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php index 9ba318c3a3f9f..030b8b8012b12 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php @@ -14,8 +14,7 @@ use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertNoCrossSellsProductsSection - * Assert that product is not displayed in cross-sell section + * Assert that product is not displayed in cross-sell section. */ class AssertNoCrossSellsProductsSection extends AbstractConstraint { @@ -24,7 +23,7 @@ class AssertNoCrossSellsProductsSection extends AbstractConstraint /* end tags */ /** - * Assert that product is not displayed in cross-sell section + * Assert that product is not displayed in cross-sell section. * * @param BrowserInterface $browser * @param CatalogProductSimple $product @@ -47,14 +46,14 @@ public function processAssert( $catalogProductView->getViewBlock()->addToCart($product); foreach ($relatedProducts as $relatedProduct) { \PHPUnit_Framework_Assert::assertFalse( - $checkoutCart->getCrosssellBlock()->verifyProductCrosssell($relatedProduct), + $checkoutCart->getCrosssellBlock()->getProductItem($relatedProduct)->isVisible(), 'Product \'' . $relatedProduct->getName() . '\' is exist in cross-sell section.' ); } } /** - * Text success product is not displayed in cross-sell section + * Text success product is not displayed in cross-sell section. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php index b1ffd0322195e..fbe47d82bdf68 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php @@ -11,27 +11,26 @@ use Magento\Mtf\Fixture\FixtureInterface; /** - * Class AbstractRelatedProducts - * Base class for create related products + * Base class for create related products. */ class AbstractRelatedProducts implements FixtureInterface { /** - * Data set configuration settings + * Data set configuration settings. * * @var array */ protected $params; /** - * Data of the created products + * Data of the created products. * * @var array */ protected $data = []; /** - * Products fixture + * Products fixture. * * @var array */ @@ -41,7 +40,7 @@ class AbstractRelatedProducts implements FixtureInterface * @constructor * @param FixtureFactory $fixtureFactory * @param array $params - * @param array $data + * @param array $data [optional] */ public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { @@ -51,29 +50,33 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array $presets = array_map('trim', explode(',', $data['presets'])); foreach ($presets as $preset) { list($fixtureCode, $dataSet) = explode('::', $preset); - - /** @var CatalogProductSimple $product */ - $product = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); - if (!$product->hasData('id')) { - $product->persist(); - } - + $this->products[] = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + } + } + if (isset($data['products'])) { + foreach ($data['products'] as $product) { $this->products[] = $product; - $this->data[] = [ - 'entity_id' => $product->getId(), - 'name' => $product->getName(), - 'sku' => $product->getSku(), - ]; } } + foreach ($this->products as $product) { + if (!$product->hasData('id')) { + $product->persist(); + } + + $this->data[] = [ + 'entity_id' => $product->getId(), + 'name' => $product->getName(), + 'sku' => $product->getSku(), + ]; + } if (isset($data['data'])) { $this->data = array_replace_recursive($this->data, $data['data']); } } /** - * Persist related products + * Persist related products. * * @return void */ @@ -83,7 +86,7 @@ public function persist() } /** - * Return prepared data set + * Return prepared data set. * * @param string|null $key * @return array @@ -96,7 +99,7 @@ public function getData($key = null) } /** - * Return data set configuration settings + * Return data set configuration settings. * * @return array */ @@ -106,7 +109,7 @@ public function getDataConfig() } /** - * Return related products + * Return related products. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml index 30a872c70b94a..d1df3efa67260 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml @@ -449,5 +449,23 @@ null Magento\Catalog\Test\Fixture\CatalogProductVirtual\CheckoutData + + cross_sell_products + virtual + crosssells + Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts + + + up_sell_products + virtual + upsells + Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts + + + related_products + virtual + related-products + Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest.php deleted file mode 100644 index e7e2680a05dcd..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest.php +++ /dev/null @@ -1,56 +0,0 @@ - Catalog - * 3. Click Add new product - * 4. Fill data from dataSet - * 5. Save product - * 6. Perform all assertions - * - * @group Cross-sells_(MX) - * @ZephyrId MAGETWO-29081 - */ -class AddCrossSellEntityTest extends AbstractAddRelatedProductsEntityTest -{ - /* tags */ - const MVP = 'yes'; - const DOMAIN = 'MX'; - /* end tags */ - - /** - * Run test add cross sell products entity - * - * @param string $productData - * @param string $crossSellProductsData - * @return array - */ - public function test($productData, $crossSellProductsData) - { - $product = $this->getProductByData($productData, ['cross_sell_products' => $crossSellProductsData]); - $this->createAndSaveProduct($product); - - /** @var CrossSellProducts $crossSellProducts */ - $crossSellProducts = $product->getDataFieldConfig('cross_sell_products')['source']; - return [ - 'product' => $product, - 'relatedProducts' => $crossSellProducts->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest/test.csv deleted file mode 100644 index 7049626255666..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCrossSellEntityTest/test.csv +++ /dev/null @@ -1,2 +0,0 @@ -"productData";"crossSellProductsData";"constraint" -"catalogProductSimple::default";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertCrossSellsProductsSection" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php new file mode 100644 index 0000000000000..a9403a471d57f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php @@ -0,0 +1,331 @@ +browser = $browser; + $this->fixtureFactory = $fixtureFactory; + $this->assertProductSaveMessage = $assertProductSaveMessage; + $this->assertAddedProductToCartSuccessMessage = $assertAddedProductToCartSuccessMessage; + } + + /** + * Inject data. + * + * @param CatalogProductIndex $catalogProductIndex + * @param CatalogProductEdit $catalogProductEdit + * @param CatalogProductView $catalogProductView + * @param CheckoutCart $checkoutCart + * @return void + */ + public function __inject( + CatalogProductIndex $catalogProductIndex, + CatalogProductEdit $catalogProductEdit, + CatalogProductView $catalogProductView, + CheckoutCart $checkoutCart + ) { + $this->catalogProductIndex = $catalogProductIndex; + $this->catalogProductEdit = $catalogProductEdit; + $this->catalogProductView = $catalogProductView; + $this->checkoutCart = $checkoutCart; + } + + /** + * Run test add to cart cross-sell products. + * + * @param string $products + * @param string $promotedProducts + * @param string $order + * @param string $crossSell + * @return void + */ + public function test($products, $promotedProducts, $order, $crossSell) + { + // Preconditions + $this->createProducts($products); + $this->assignPromotedProducts($promotedProducts); + + // Steps + $this->createOrder($order); + $this->verify($crossSell); + } + + /** + * Create products. + * + * @param string $products + * @return void + */ + protected function createProducts($products) + { + $list = array_map('trim', explode(',', $products)); + + foreach ($list as $item) { + list($productName, $fixtureCode, $dataSet) = array_map('trim', explode('::', $item)); + $product = $this->fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + + $product->persist(); + $this->products[$productName] = $product; + } + } + + /** + * Assigning promoted products. + * + * @param string $promotedProducts + * @return void + */ + protected function assignPromotedProducts($promotedProducts) + { + $promotedProducts = $this->parsePromotedProducts($promotedProducts); + + foreach ($promotedProducts as $productName => $assignedNames) { + $initialProduct = $this->products[$productName]; + $filter = ['sku' => $initialProduct->getSku()]; + $assignedProducts = []; + + foreach ($assignedNames as $assignedName) { + $assignedProducts[] = $this->products[$assignedName]; + } + + $product = $this->fixtureFactory->create( + get_class($initialProduct), + [ + 'data' => [ + 'cross_sell_products' => [ + 'products' => $assignedProducts + ] + ] + ] + ); + $this->catalogProductIndex->open(); + $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter); + $this->catalogProductEdit->getProductForm()->fill($product); + $this->catalogProductEdit->getFormPageActions()->save(); + $this->assertProductSaveMessage->processAssert($this->catalogProductEdit); + } + } + + /** + * Parse promoted products. + * + * @param string $promotedProducts + * @return array + */ + protected function parsePromotedProducts($promotedProducts) + { + $list = array_map('trim', explode(';', $promotedProducts)); + $result = []; + + foreach ($list as $item) { + list($productName, $promotedNames) = array_map('trim', explode(':', $item)); + $result[$productName] = array_map('trim', explode(',', $promotedNames)); + } + + return $result; + } + + /** + * Create order. + * + * @param string $order + * @return void + */ + protected function createOrder($order) + { + $products = $this->prepareOrder($order); + $initialProduct = array_shift($products); + + $this->checkoutCart->open(); + $this->checkoutCart->getCartBlock()->clearShoppingCart(); + + $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); + $this->catalogProductView->getViewBlock()->addToCart($initialProduct); + $this->assertAddedProductToCartSuccessMessage->processAssert($this->checkoutCart, $initialProduct); + foreach ($products as $product) { + $this->addToCartFromCrossSell($product); + } + } + + /** + * Convert short names products to products entities. + * + * @param string $order + * @return array + */ + protected function prepareOrder($order) + { + $productNames = array_map('trim', explode(',', $order)); + $products = []; + + foreach ($productNames as $productName) { + $products[] = $this->products[$productName]; + } + + return $products; + } + + /** + * Add product from cross-sell block to cart. + * + * @param FixtureInterface $product + * @return void + */ + protected function addToCartFromCrossSell(FixtureInterface $product) + { + $productItem = $this->checkoutCart->getCrosssellBlock()->getProductItem($product); + + \PHPUnit_Framework_Assert::assertTrue( + $productItem->isVisible(), + "Product {$product->getName()} is absent in cross-sell block." + ); + + $productItem->clickAddToCart(); + if (false !== strpos($this->browser->getUrl(), $product->getUrlKey())) { + $this->catalogProductView->getViewBlock()->addToCart($product); + } + $this->assertAddedProductToCartSuccessMessage->processAssert($this->checkoutCart, $product); + } + + /** + * Verify cross-sell block. + * + * @param string $crossSell + * @return void + */ + protected function verify($crossSell) + { + if (empty($crossSell)) { + \PHPUnit_Framework_Assert::assertFalse( + $this->checkoutCart->getCrosssellBlock()->isVisible(), + "Cross-sell block is present." + ); + return; + } + + $products = array_map('trim', explode(',', $crossSell)); + $productNames = []; + + foreach ($products as $shortName) { + $productNames[] = $this->products[$shortName]->getName(); + } + \PHPUnit_Framework_Assert::assertEquals( + $productNames, + $this->checkoutCart->getCrosssellBlock()->getProductNames() + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv new file mode 100644 index 0000000000000..80f8035884fa7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv @@ -0,0 +1,3 @@ +"products";"promotedProducts";"order";"crossSell";"tag" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,simple3::catalogProductSimple::product_with_category";"simple1:simple2,simple3;simple3:simple1,simple2";"simple1,simple3";"simple2";"" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple1,simple2";"simple1,config1,simple2";"";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index b427c47b6a74c..87d2bcbb05efd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,20 +1,21 @@ -"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"constraint";"tag" -"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" -"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" -"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" -"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" -"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" -"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" -"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" -"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" -"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" -"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" -"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" +"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"constraint";"tag" +"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" +"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" +"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" +"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" +"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" +"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" +"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" +"Create product with cros-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertCrossSellsProductsSection";"" +"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php deleted file mode 100644 index 2f71f814a2ac3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CrosssellTest.php +++ /dev/null @@ -1,135 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Product Cross-selling. Assign cross-selling to products and see them related on the front-end. - * - * @ZephyrId MAGETWO-12390 - * @return void - */ - public function testCreateCrosssell() - { - $simple1 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $simple1->switchData('simple'); - $simple1->persist(); - - $simple2 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $simple2->switchData('simple'); - $simple2->persist(); - - $configurable = Factory::getFixtureFactory()->getMagentoConfigurableProductConfigurableProduct(); - $configurable->switchData('configurable'); - $configurable->persist(); - - $this->addCrosssellProducts($simple1, [$simple2, $configurable]); - $this->addCrosssellProducts($configurable, [$simple1, $simple2]); - - //Ensure shopping cart is empty - $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); - $checkoutCartPage->open(); - $checkoutCartPage->getCartBlock()->clearShoppingCart(); - - $productPage = Factory::getPageFactory()->getCatalogProductView(); - Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $simple1->getUrlKey() . '.html'); - $productPage->getViewBlock()->addToCart($simple1); - - $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); - $checkoutCartPage->getMessagesBlock()->waitSuccessMessage(); - - $cartBlock = $checkoutCartPage->getCartBlock(); - $this->assertTrue($cartBlock->isProductInShoppingCart($simple1)); - - $crosssellBlock = $checkoutCartPage->getCrosssellBlock(); - - $this->assertTrue($crosssellBlock->isVisible(), "cross-sell view not found"); - - $this->assertTrue( - $crosssellBlock->verifyProductcrosssell($configurable), - 'Cross-sell product ' . $configurable->getName() . ' was not found in the first product page.' - ); - - $this->assertTrue( - $crosssellBlock->verifyProductcrosssell($simple2), - 'Upsell product ' . $simple2->getName() . ' was not found in the first product page.' - ); - - $crosssellBlock = $checkoutCartPage->getCrosssellBlock(); - $crosssellBlock->clickLink($configurable); - - $productPage = Factory::getPageFactory()->getCatalogProductView(); - Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $configurable->getUrlKey() . '.html'); - $productPage->getViewBlock()->addToCart($configurable); - - $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); - $cartBlock = $checkoutCartPage->getCartBlock(); - $this->assertTrue($cartBlock->isProductInShoppingCart($configurable)); - $this->assertTrue($cartBlock->isProductInShoppingCart($simple1)); - - $crosssellBlock = $checkoutCartPage->getCrosssellBlock(); - $crosssellBlock->clickLink($simple2); - - $productPage = Factory::getPageFactory()->getCatalogProductView(); - Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $simple2->getUrlKey() . '.html'); - $productPage->getViewBlock()->addToCart($simple2); - - $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); - $cartBlock = $checkoutCartPage->getCartBlock(); - $this->assertTrue($cartBlock->isProductInShoppingCart($configurable)); - $this->assertTrue($cartBlock->isProductInShoppingCart($simple1)); - $this->assertTrue($cartBlock->isProductInShoppingCart($simple2)); - - $this->assertFalse($checkoutCartPage->getCrosssellBlock()->isVisible()); - } - - /** - * Assign an array of products as cross-sells to the passed in $product - * - * @param Product $product - * @param array $crosssellProducts - * @return void - */ - private function addCrosssellProducts(Product $product, array $crosssellProducts) - { - $crosssellFixture = Factory::getFixtureFactory()->getMagentoCatalogCrosssellProducts(); - $crosssellFixture->setProducts($crosssellProducts); - $crosssellFixture->switchData('add_crosssell_products'); - //Data - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - //Steps - $productGridPage->open(); - $productGridPage->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $editProductPage->getProductForm()->fill($crosssellFixture); - $editProductPage->getFormPageActions()->save(); - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml index ebf560c60d456..ede1655eb7c97 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml @@ -487,11 +487,23 @@ null Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable\CheckoutData + + cross_sell_products + virtual + crosssells + Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts + up_sell_products virtual upsells Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts + + related_products + virtual + related-products + Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php index be7f577cbaf5f..4734c9f5ea751 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php @@ -15,7 +15,7 @@ class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData { /** - * Get preset array + * Get preset array. * * @param $name * @return array|null @@ -166,6 +166,17 @@ protected function getPreset($name) ], 'qty' => 1, ], + 'two_options_with_fixed_price' => [ + 'options' => [ + 'configurable_options' => [ + [ + 'title' => 'attribute_key_0', + 'value' => 'option_key_1', + ], + ], + ], + 'qty' => 1, + ] ]; return isset($presets[$name]) ? $presets[$name] : null; } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml index 2813bd4418a14..745beff544789 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml @@ -235,6 +235,9 @@ custom_attribute_set + + two_options_with_fixed_price + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml index 20652c29b0227..9b6be090039a3 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml @@ -527,5 +527,23 @@ null Magento\Downloadable\Test\Fixture\DownloadableProductInjectable\CheckoutData + + cross_sell_products + virtual + crosssells + Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts + + + up_sell_products + virtual + upsells + Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts + + + related_products + virtual + related-products + Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts + diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/GithubPublicationTests.php b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/GithubPublicationTests.php deleted file mode 100644 index 69eea437e7eaa..0000000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/GithubPublicationTests.php +++ /dev/null @@ -1,71 +0,0 @@ -addTestSuite('Magento\Customer\Test\TestCase\BackendCustomerCreateTest'); - - // Using USPS/UPS/FedEx/DHL(EU)/DHL(US) online shipping carrier on checkout as a registered customer - // (MAGETWO-12444, MAGETWO-12848, MAGETWO-12849, MAGETWO-12850, MAGETWO-12851) - $suite->addTestSuite('Magento\Checkout\Test\TestCase\ShippingCarrierTest'); - - // Adding temporary redirect for product (MAGETWO-12409) - $suite->addTestSuite('Magento\UrlRewrite\Test\TestCase\CreateProductUrlRewriteEntityTest'); - - // Creating offline order for registered/new customer in admin (MAGETWO-12395, MAGETWO-12520) - $suite->addTestSuite('Magento\Sales\Test\TestCase\CreateOrderTest'); - - // Creating customer account (MAGETWO-12394) - $suite->addTestSuite('Magento\Customer\Test\TestCase\RegisterCustomerFrontendEntityTest'); - - // Creating Grouped product and assign it to the category (MAGETWO-13610) - $suite->addTestSuite('Magento\GroupedProduct\Test\TestCase\CreateGroupedTest'); - - // Creating Virtual product with required fields only and assign it to the category (MAGETWO-13593) - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateVirtualTest'); - - // Creating Downloadable product with required fields only and assign it to the category (MAGETWO-13595) - $suite->addTestSuite('Magento\Downloadable\Test\TestCase\Create\LinksPurchasedSeparatelyTest'); - - // Using ACL Role with full GWS Scope (without using Secret Key to URLs) (MAGETWO-12375, MAGETWO-12385) - $suite->addTestSuite('Magento\User\Test\TestCase\UserWithRestrictedRoleTest'); - - // Creating simple product with creating new category (required fields only) (MAGETWO-13345) - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCategoryTest'); - - // Checkout products with special prices (MAGETWO-12429) - $suite->addTestSuite('Magento\Checkout\Test\TestCase\ProductAdvancedPricingTest'); - - // Using layered navigation to filter product list (MAGETWO-12419) - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Layer\FilterProductListTest'); - - // Using quick search to find the product (MAGETWO-12420) - $suite->addTestSuite('Magento\CatalogSearch\Test\TestCase\SearchEntityResultsTest'); - - // Product Up-selling (MAGETWO-12391) - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\UpsellTest'); - - // Product Cross-selling (MAGETWO-12390) - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CrosssellTest'); - - return $suite; - } -} From 53c714546d243a8dfccbdf324e80517d73b807a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Mon, 2 Feb 2015 09:43:40 +0200 Subject: [PATCH 13/50] MTA-576: Re-factor Test for Create Customer on Backend - Deleted old fixture --- .../Customer/Test/Fixture/CustomerBackend.php | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerBackend.php diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerBackend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerBackend.php deleted file mode 100644 index 274b3d8c81f96..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerBackend.php +++ /dev/null @@ -1,24 +0,0 @@ -magentoCustomerCreateCustomerBackend($this); - } -} From 09a2ea45f4f7177370646ac1836f8a9ee77e8500 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Mon, 2 Feb 2015 15:44:38 +0200 Subject: [PATCH 14/50] MTA-576: Re-factor Test for Create Customer on Backend - Fixed bug with customer --- ...php => AssertCustomerBackendFormTitle.php} | 4 +- .../Customer/Test/Fixture/AddressBook.php | 62 ------------------- .../Test/Fixture/Customer/Address.php | 6 +- .../CreateCustomerBackendEntityTest.php | 4 +- .../CreateCustomerBackendEntityTest/test.csv | 14 ++--- .../TestCase/ForgotPasswordOnFrontendTest.php | 2 +- .../Magento/Customer/Test/etc/constraint.xml | 4 +- 7 files changed, 16 insertions(+), 80 deletions(-) rename dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/{AssertCustomerTitle.php => AssertCustomerBackendFormTitle.php} (89%) delete mode 100644 dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressBook.php diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendFormTitle.php similarity index 89% rename from dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php rename to dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendFormTitle.php index c714e7b6c4fc5..eee1cc7636f30 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendFormTitle.php @@ -13,7 +13,7 @@ /** * Assert that edit page of customer account contains correct title. */ -class AssertCustomerTitle extends AbstractConstraint +class AssertCustomerBackendFormTitle extends AbstractConstraint { /* tags */ const SEVERITY = 'middle'; @@ -42,6 +42,6 @@ public function processAssert(CustomerAccountIndex $pageCustomerIndex, Customer */ public function toString() { - return 'Assert that title is correct.'; + return 'Customer backend edit form title is correct.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressBook.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressBook.php deleted file mode 100644 index 9ef1a4ea240bb..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressBook.php +++ /dev/null @@ -1,62 +0,0 @@ -_addressFixture = $address; - } - - /** - * Switch current data set - * - * @param $name - * @return bool - */ - public function switchData($name) - { - $result = $this->_addressFixture->switchData($name); - if (!$result) { - return false; - } - $data = $this->_addressFixture->getData(); - $this->_data = ['fields' => ['address_id' => [ - 'value' => $data['fields']['firstname']['value'] . ' ' - . $data['fields']['lastname']['value'] . ', ' - . $data['fields']['street']['value'] . ', ' - . $data['fields']['city']['value'] . ', ' - . $data['fields']['region_id']['value'] . ' ' - . $data['fields']['postcode']['value'] . ', ' - . $data['fields']['country_id']['value'], - 'input' => 'select', - ]]]; - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php index a950e2323c9d2..ce4b8c6562b63 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php @@ -6,7 +6,7 @@ namespace Magento\Customer\Test\Fixture\Customer; -use Magento\Customer\Test\Fixture\Address as AddressInjectable; +use Magento\Customer\Test\Fixture\Address as AddressFixture; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; @@ -51,14 +51,14 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array if (isset($data['presets'])) { $data['presets'] = explode(',', $data['presets']); foreach ($data['presets'] as $value) { - /** @var AddressInjectable $addresses*/ + /** @var AddressFixture $addresses*/ $addresses = $fixtureFactory->createByCode('address', ['dataSet' => $value]); $this->data[] = $addresses->getData(); $this->addressesFixture[] = $addresses; } } elseif (empty($data['presets']) && !empty($data['addresses'])) { foreach ($data['addresses'] as $addresses) { - /** @var AddressInjectable $addresses */ + /** @var AddressFixture $addresses */ $this->data[] = $addresses->getData(); $this->addressesFixture[] = $addresses; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php index 13fc7277df346..e178cb7bcb48a 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php @@ -13,9 +13,7 @@ use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew; /** - * Test Coverage for CreateCustomerBackendEntityTest. - * - * General Flow: + * Steps: * 1. Log in as default admin user. * 2. Go to Customers > All Customers. * 3. Press "Add New Customer" button. diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv index 1a673246c5176..93a78eb7a70d9 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv @@ -1,7 +1,7 @@ -"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue";"tag" -"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" -"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689";"" -"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" -"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"";"" -"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" -"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerTitle";"";"test_type:acceptance_test" +"description";"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue";"tag" +"General customer without address";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" +"Customer with prefix";"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689";"" +"General customer from USA";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" +"Retailer customer without address";"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"";"" +"General customer from Poland";"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" +"MAGETWO-12516: Create New Customer on Backend";"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerBackendFormTitle";"";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php index eaace14b84a7f..6d77b740a4d74 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php @@ -20,7 +20,7 @@ class ForgotPasswordOnFrontendTest extends Functional public function testForgotPassword() { // Create Customer - $customer = ObjectManager::getInstance()->create( + $customer = $this->objectManager->getInstance()->create( 'Magento\Customer\Test\Fixture\Customer', ['dataSet' => 'customer_US_1'] ); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml index c14b930e86321..89439aa11492a 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml @@ -46,9 +46,9 @@ - + middle - + middle From 71cafe4579380c868f0ae795494f13b0d031ccf1 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Mon, 2 Feb 2015 18:57:52 +0200 Subject: [PATCH 15/50] MTA-1499: Analyse functional test failures --- .../Client/Element/OptgroupselectElement.php | 7 + .../Mtf/Client/Element/SelectstoreElement.php | 7 + .../Fixture/BundleProduct/CheckoutData.php | 4 +- .../app/Magento/Catalog/Test/Block/Search.php | 2 +- .../Test/Fixture/CatalogProductAttribute.php | 566 ------------------ .../Test/Fixture/CatalogProductSimple.xml | 1 + .../Test/Repository/CatalogProductSimple.xml | 3 + .../test.csv | 18 +- .../TestCase/CreateTermEntityTest/test.csv | 2 +- .../ResetCurrencySymbolEntityTest.php | 1 + .../CreateCustomerBackendEntityTest/test.csv | 14 +- .../testUpdateCustomerBackendEntity.csv | 8 +- .../CheckoutWithGiftMessagesTest/test.csv | 6 +- .../CreateGiftMessageOnBackendTest.php | 58 -- .../CreateGiftMessageOnBackendTest/test.csv | 4 - .../Catalog/Product/View/Type/Grouped.php | 2 +- .../Adminhtml/Integration/IntegrationGrid.php | 2 +- .../IntegrationGrid/ResourcesPopup.php | 44 ++ .../test.csv | 2 +- ...ultishippingOrderSuccessPlacedMessage.php} | 2 +- .../Multishipping/Test/etc/constraint.xml | 4 +- .../ViewedProductsReportEntityTest.php | 3 +- .../Magento/Review/Test/Fixture/Review.xml | 6 +- .../Magento/Review/Test/Repository/Review.xml | 2 +- .../Magento/Tax/Test/Repository/TaxClass.xml | 4 +- .../Magento/Weee/Test/Block/Product/View.php | 2 +- .../AddProductToWishlistEntityTest.php | 1 - ...ProductInCustomerWishlistOnBackendTest.php | 6 +- .../Mtf/TestSuite/InjectableTests/basic.xml | 1 - .../functional/utils/generate/factory.php | 4 +- 30 files changed, 110 insertions(+), 676 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.php delete mode 100644 dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv rename dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/{AssertOrderSuccessPlacedMessage.php => AssertMultishippingOrderSuccessPlacedMessage.php} (94%) diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php index a8398f4931685..5145f7575cac7 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php @@ -14,6 +14,13 @@ */ class OptgroupselectElement extends SelectElement { + /** + * Option locator + * + * @var string + */ + protected $optionByIndex = './/optgroup/option[%d]'; + /** * Option group selector * diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php index 32d1b11119a75..2147e8eeabd9d 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php @@ -13,6 +13,13 @@ */ class SelectstoreElement extends SelectElement { + /** + * Option locator + * + * @var string + */ + protected $optionByIndex = './/optgroup/option[%d]'; + /** * Store option group selector. * diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php index 055c7f80488c3..a0b12098757c6 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php @@ -70,10 +70,10 @@ protected function getPreset($name) ], ], ], - 'qty' => 2, + 'qty' => 1, 'cartItem' => [ 'price' => 756, - 'qty' => 2, + 'qty' => 1, 'subtotal' => 756, ], ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php index 2257512b72f9e..34b3fc49ec2a0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php @@ -20,7 +20,7 @@ class Search extends Block * * @var string */ - protected $searchAutocomplete = './/div[@id="search_autocomplete"]//li[text()="%s"]'; + protected $searchAutocomplete = './/div[@id="search_autocomplete"]//li[span[text()="%s"]]'; /** * Selector number of matches for a given row diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.php deleted file mode 100644 index 63f69ad90d2aa..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.php +++ /dev/null @@ -1,566 +0,0 @@ - 'attribute_label%isolation%', - 'frontend_input' => 'Text Field', - 'is_required' => 'No', - ]; - - protected $attribute_id = [ - 'attribute_code' => 'attribute_id', - 'backend_type' => 'smallint', - 'is_required' => '1', - 'default_value' => '', - 'input' => '', - ]; - - protected $entity_type_id = [ - 'attribute_code' => 'entity_type_id', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $attribute_code = [ - 'attribute_code' => 'attribute_code', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - 'group' => 'advanced-properties', - ]; - - protected $attribute_model = [ - 'attribute_code' => 'attribute_model', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $backend_model = [ - 'attribute_code' => 'backend_model', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $backend_type = [ - 'attribute_code' => 'backend_type', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => 'static', - 'input' => '', - ]; - - protected $backend_table = [ - 'attribute_code' => 'backend_table', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $frontend_model = [ - 'attribute_code' => 'frontend_model', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $frontend_input = [ - 'attribute_code' => 'frontend_input', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => 'select', - 'group' => 'properties', - ]; - - protected $frontend_label = [ - 'attribute_code' => 'frontend_label', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - 'group' => 'properties', - ]; - - protected $manage_frontend_label = [ - 'attribute_code' => 'manage_frontend_label', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - 'group' => 'manage-labels', - ]; - - protected $frontend_class = [ - 'attribute_code' => 'frontend_class', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $source_model = [ - 'attribute_code' => 'source_model', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $is_required = [ - 'attribute_code' => 'is_required', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => 'select', - 'group' => 'properties', - ]; - - protected $is_user_defined = [ - 'attribute_code' => 'is_user_defined', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $is_unique = [ - 'attribute_code' => 'is_unique', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'advanced-properties', - ]; - - protected $note = [ - 'attribute_code' => 'note', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $frontend_input_renderer = [ - 'attribute_code' => 'frontend_input_renderer', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $is_global = [ - 'attribute_code' => 'is_global', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '1', - 'input' => '', - 'group' => 'advanced-properties', - ]; - - protected $is_visible = [ - 'attribute_code' => 'is_visible', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '1', - 'input' => '', - ]; - - protected $is_searchable = [ - 'attribute_code' => 'is_searchable', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $is_filterable = [ - 'attribute_code' => 'is_filterable', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $is_comparable = [ - 'attribute_code' => 'is_comparable', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $is_visible_on_front = [ - 'attribute_code' => 'is_visible_on_front', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $is_html_allowed_on_front = [ - 'attribute_code' => 'is_html_allowed_on_front', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $is_used_for_price_rules = [ - 'attribute_code' => 'is_used_for_price_rules', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $is_filterable_in_search = [ - 'attribute_code' => 'is_filterable_in_search', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $used_in_product_listing = [ - 'attribute_code' => 'used_in_product_listing', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $used_for_sort_by = [ - 'attribute_code' => 'used_for_sort_by', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $apply_to = [ - 'attribute_code' => 'apply_to', - 'backend_type' => 'varchar', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - ]; - - protected $is_visible_in_advanced_search = [ - 'attribute_code' => 'is_visible_in_advanced_search', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - 'group' => 'frontend-properties', - ]; - - protected $position = [ - 'attribute_code' => 'position', - 'backend_type' => 'int', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $is_wysiwyg_enabled = [ - 'attribute_code' => 'is_wysiwyg_enabled', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $is_used_for_promo_rules = [ - 'attribute_code' => 'is_used_for_promo_rules', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '0', - 'input' => '', - ]; - - protected $search_weight = [ - 'attribute_code' => 'search_weight', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '1', - 'input' => '', - ]; - - protected $options = [ - 'attribute_code' => 'options', - 'backend_type' => 'smallint', - 'is_required' => '', - 'default_value' => '', - 'input' => '', - 'source' => 'Magento\Catalog\Test\Fixture\CatalogProductAttribute\Options', - ]; - - protected $default_value_text = [ - 'attribute_code' => 'default_value_text', - 'backend_type' => 'text', - 'group' => 'advanced-properties', - ]; - - protected $default_value_textarea = [ - 'attribute_code' => 'default_value_textarea', - 'backend_type' => 'text', - 'group' => 'advanced-properties', - ]; - - protected $default_value_date = [ - 'attribute_code' => 'default_value_date', - 'backend_type' => 'text', - 'group' => 'advanced-properties', - 'source' => 'Magento\Backend\Test\Fixture\Date', - ]; - - protected $default_value_yesno = [ - 'attribute_code' => 'default_value_yesno', - 'backend_type' => 'text', - 'group' => 'advanced-properties', - ]; - - public function getDefaultValueText() - { - return $this->getData('default_value_text'); - } - - public function getDefaultValueTextarea() - { - return $this->getData('default_value_textarea'); - } - - public function getDefaultValueDate() - { - return $this->getData('default_value_date'); - } - - public function getDefaultValueYesno() - { - return $this->getData('default_value_yesno'); - } - - public function getAttributeId() - { - return $this->getData('attribute_id'); - } - - public function getEntityTypeId() - { - return $this->getData('entity_type_id'); - } - - public function getAttributeCode() - { - return $this->getData('attribute_code'); - } - - public function getAttributeModel() - { - return $this->getData('attribute_model'); - } - - public function getBackendModel() - { - return $this->getData('backend_model'); - } - - public function getBackendType() - { - return $this->getData('backend_type'); - } - - public function getBackendTable() - { - return $this->getData('backend_table'); - } - - public function getFrontendModel() - { - return $this->getData('frontend_model'); - } - - public function getFrontendInput() - { - return $this->getData('frontend_input'); - } - - public function getFrontendLabel() - { - return $this->getData('frontend_label'); - } - - public function getManageFrontendLabel() - { - return $this->getData('manage_frontend_label'); - } - - public function getFrontendClass() - { - return $this->getData('frontend_class'); - } - - public function getSourceModel() - { - return $this->getData('source_model'); - } - - public function getIsRequired() - { - return $this->getData('is_required'); - } - - public function getIsUserDefined() - { - return $this->getData('is_user_defined'); - } - - public function getIsUnique() - { - return $this->getData('is_unique'); - } - - public function getNote() - { - return $this->getData('note'); - } - - public function getFrontendInputRenderer() - { - return $this->getData('frontend_input_renderer'); - } - - public function getIsGlobal() - { - return $this->getData('is_global'); - } - - public function getIsVisible() - { - return $this->getData('is_visible'); - } - - public function getIsSearchable() - { - return $this->getData('is_searchable'); - } - - public function getIsFilterable() - { - return $this->getData('is_filterable'); - } - - public function getIsComparable() - { - return $this->getData('is_comparable'); - } - - public function getIsVisibleOnFront() - { - return $this->getData('is_visible_on_front'); - } - - public function getIsHtmlAllowedOnFront() - { - return $this->getData('is_html_allowed_on_front'); - } - - public function getIsUsedForPriceRules() - { - return $this->getData('is_used_for_price_rules'); - } - - public function getIsFilterableInSearch() - { - return $this->getData('is_filterable_in_search'); - } - - public function getUsedInProductListing() - { - return $this->getData('used_in_product_listing'); - } - - public function getUsedForSortBy() - { - return $this->getData('used_for_sort_by'); - } - - public function getApplyTo() - { - return $this->getData('apply_to'); - } - - public function getIsVisibleInAdvancedSearch() - { - return $this->getData('is_visible_in_advanced_search'); - } - - public function getPosition() - { - return $this->getData('position'); - } - - public function getIsWysiwygEnabled() - { - return $this->getData('is_wysiwyg_enabled'); - } - - public function getIsUsedForPromoRules() - { - return $this->getData('is_used_for_promo_rules'); - } - - public function getSearchWeight() - { - return $this->getData('search_weight'); - } - - public function getOptions() - { - return $this->getData('options'); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index f24e386252451..382132e100afa 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -33,6 +33,7 @@ Main Website + simple-product-%isolation% simple diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index e55b1f0e5ce5c..c76490ca365de 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -575,6 +575,9 @@ - 1 + + Main Website + two_options diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv index e754cc39c2c32..65e0f5e88ed2e 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv @@ -1,9 +1,9 @@ -"productsData";"cart/data/grand_total";"constraint" -"bundleProduct::bundle_dynamic_product";"200";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"bundleProduct::bundle_fixed_product";"756";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"catalogProductSimple::with_two_custom_option";"340";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"catalogProductVirtual::product_50_dollar";"50";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"configurableProductInjectable::default";"516";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"downloadableProductInjectable::with_two_separately_links";"46";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"groupedProductInjectable::three_simple_products";"1920";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" -"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProductInjectable::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3272";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart" +"productsData";"cart/data/grand_total";"constraint";"issue" +"bundleProduct::bundle_dynamic_product";"200";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"bundleProduct::bundle_fixed_product";"756";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"catalogProductSimple::with_two_custom_option";"340";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"catalogProductVirtual::product_50_dollar";"50";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"configurableProductInjectable::default";"516";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"downloadableProductInjectable::with_two_separately_links";"46";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" +"groupedProductInjectable::three_simple_products";"1920";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProductInjectable::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3249";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv index 5bbef09db6773..a7b040b531960 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv @@ -3,4 +3,4 @@ "Create enabled term entity with HTML value";"catalogProductSimple::default";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" "Create enabled term entity with text value";"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" "Create disabled term entity";"catalogProductSimple::default";"name%isolation%";"Disabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout" -"Create enabled term, check with multishipping";"catalogProductSimple::default, catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermRequireMessageOnMultishippingCheckout, assertOrderSuccessPlacedMessage" \ No newline at end of file +"Create enabled term, check with multishipping";"catalogProductSimple::default, catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermRequireMessageOnMultishippingCheckout, assertMultishippingOrderSuccessPlacedMessage" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.php index 6c4dbffee168c..1265bf2e1f5b3 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.php @@ -121,6 +121,7 @@ public function test( $this->importCurrencyRate($configData); // Steps + $this->currencySymbolIndex->open(); $this->currencySymbolIndex->getCurrencySymbolForm()->fill($currencySymbol); $this->currencySymbolIndex->getPageActions()->save(); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv index 93a78eb7a70d9..ee1bf02936b35 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/test.csv @@ -1,7 +1,7 @@ -"description";"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue";"tag" -"General customer without address";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" -"Customer with prefix";"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689";"" -"General customer from USA";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" -"Retailer customer without address";"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"";"" -"General customer from Poland";"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";"" -"MAGETWO-12516: Create New Customer on Backend";"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerBackendFormTitle";"";"test_type:acceptance_test" +"description";"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"tag" +"General customer without address";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" +"Customer with prefix";"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" +"General customer from USA";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" +"Retailer customer without address";"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"" +"General customer from Poland";"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" +"MAGETWO-12516: Create New Customer on Backend";"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerBackendFormTitle";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv index f1e0e24884439..457306867243d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv @@ -1,4 +1,4 @@ -"initialCustomer/dataSet";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/prefix";"address/data/firstname";"address/data/middlename";"address/data/lastname";"address/data/suffix";"address/data/company";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/region";"address/data/postcode";"address/data/telephone";"address/data/fax";"address/data/vat_id";"constraint";"issue" -"default";"Wholesale";"%isolation%Prefix_";"John_%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"JohnDoe%isolation%@example.com";01/08/1986;123456789001;"Male";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-31689" -"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"3962 Horner Street";"Dothan";"United States";"Alabama";"-";36303;"334-200-4060";"555-666-777-8910";"U1234567890";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" -"default";"Retailer";"%isolation%Prefix_";"Jane_%isolation%";"Jane Middle Name %isolation%";"Doe%isolation%";"_JaneSuffix%isolation%";"Jane%isolation%@example.com";01/12/2000;987654321;"Female";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"39 Northgate Street";"BICKTON";"United Kingdom";"-";"PINMINNOCH";"KA26 1PF ";"999-777-111-2345";"-";987654321;"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-31689" +"initialCustomer/dataSet";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/prefix";"address/data/firstname";"address/data/middlename";"address/data/lastname";"address/data/suffix";"address/data/company";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/region";"address/data/postcode";"address/data/telephone";"address/data/fax";"address/data/vat_id";"constraint" +"default";"Wholesale";"%isolation%Prefix_";"John_%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"JohnDoe%isolation%@example.com";01/08/1986;123456789001;"Male";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid" +"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"3962 Horner Street";"Dothan";"United States";"Alabama";"-";36303;"334-200-4060";"555-666-777-8910";"U1234567890";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid" +"default";"Retailer";"%isolation%Prefix_";"Jane_%isolation%";"Jane Middle Name %isolation%";"Doe%isolation%";"_JaneSuffix%isolation%";"Jane%isolation%@example.com";01/12/2000;987654321;"Female";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"39 Northgate Street";"BICKTON";"United Kingdom";"-";"PINMINNOCH";"KA26 1PF ";"999-777-111-2345";"-";987654321;"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid" diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv index a11cab46509db..e6f4eaca3f301 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest/test.csv @@ -1,3 +1,3 @@ -"products";"customer/dataSet";"billingAddress/dataSet";"checkoutMethod";"shipping/shipping_service";"shipping/shipping_method";"giftMessage/data/allow_gift_options";"giftMessage/data/allow_gift_messages_for_order";"giftMessage/data/allow_gift_options_for_items";"giftMessage/data/sender";"giftMessage/data/recipient";"giftMessage/data/message";"payment/method";"constraint" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"login";"Flat Rate";"Fixed";"Yes";"Yes";"-";"John Doe";"Jane Doe";"text_gift_message";"cashondelivery";"assertOrderSuccessPlacedMessage, assertGiftMessageInFrontendOrder" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"login";"Flat Rate";"Fixed";"Yes";"-";"Yes";"John Doe";"Jane Doe";"text_gift_message";"cashondelivery";"assertOrderSuccessPlacedMessage, assertGiftMessageInFrontendOrderItems" +"products";"customer/dataSet";"billingAddress/dataSet";"checkoutMethod";"shipping/shipping_service";"shipping/shipping_method";"giftMessage/data/allow_gift_options";"giftMessage/data/allow_gift_messages_for_order";"giftMessage/data/allow_gift_options_for_items";"giftMessage/data/sender";"giftMessage/data/recipient";"giftMessage/data/message";"payment/method";"constraint";"issue" +"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"login";"Flat Rate";"Fixed";"Yes";"Yes";"-";"John Doe";"Jane Doe";"text_gift_message";"cashondelivery";"assertOrderSuccessPlacedMessage, assertGiftMessageInFrontendOrder";"Bug: MAGETWO-33079" +"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"login";"Flat Rate";"Fixed";"Yes";"-";"Yes";"John Doe";"Jane Doe";"text_gift_message";"cashondelivery";"assertOrderSuccessPlacedMessage, assertGiftMessageInFrontendOrderItems";"" diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php deleted file mode 100644 index ada89404bb3ec..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest.php +++ /dev/null @@ -1,58 +0,0 @@ -Orders - * 3. Create new order - * 4. Fill data form dataSet - * 5. Perform all asserts - * - * @group Gift_Messages_(CS) - * @ZephyrId MAGETWO-29642 - */ -class CreateGiftMessageOnBackendTest extends Scenario -{ - /* tags */ - const MVP = 'no'; - const DOMAIN = 'CS'; - /* end tags */ - - /** - * Run CreateGiftMessageOnBackend test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $setConfigStep = $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'cashondelivery', 'rollback' => true] - ); - $setConfigStep->run(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv deleted file mode 100644 index eceb66e4d4caf..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CreateGiftMessageOnBackendTest/test.csv +++ /dev/null @@ -1,4 +0,0 @@ -"products";"customer/dataSet";"billingAddress/dataSet";"shipping/shipping_service";"shipping/shipping_method";"giftMessage/data/allow_gift_options";"giftMessage/data/allow_gift_messages_for_order";"giftMessage/data/allow_gift_options_for_items";"giftMessage/data/sender";"giftMessage/data/recipient";"giftMessage/data/message";"giftMessage/data/items/dataSets";"payment/method";"constraint" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"Flat Rate";"Fixed";"Yes";"-";"Yes";"John Doe";"Jane Doe";"text_gift_message";"default, default";"cashondelivery";"assertOrderSuccessCreateMessage, assertGiftMessageInBackendOrder, assertGiftMessageInFrontendOrderItems" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"Flat Rate";"Fixed";"Yes";"Yes";"-";"John Doe";"Jane Doe";"text_gift_message";"-";"cashondelivery";"assertOrderSuccessCreateMessage, assertGiftMessageInBackendOrder, assertGiftMessageInFrontendOrder" -"catalogProductSimple::default, catalogProductVirtual::default";"customer_US";"customer_US";"Flat Rate";"Fixed";"Yes";"Yes";"Yes";"John Doe";"Jane Doe";"text_gift_message";"default, default";"cashondelivery";"assertOrderSuccessCreateMessage, assertGiftMessageInBackendOrder, assertGiftMessageInFrontendOrder, assertGiftMessageInFrontendOrderItems" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php index 0cacb9adcf166..ac6a4b1afe081 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php @@ -91,7 +91,7 @@ public function fill(FixtureInterface $product) sprintf($this->subProductByName, $productData['name']), Locator::SELECTOR_XPATH ); - $subProduct->find($this->qty)->keys([$productData['qty']]); + $subProduct->find($this->qty)->setValue($productData['qty']); $this->_rootElement->click(); } } diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php index 734d91c42648b..fa5f9a0e4a2f8 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid.php @@ -124,11 +124,11 @@ public function searchAndReauthorize(array $filter) */ public function getResourcesPopup() { + /** @var ResourcesPopup $resourcesPopup */ $resourcesPopup = $this->blockFactory->create( 'Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid\ResourcesPopup', ['element' => $this->_rootElement->find($this->resourcesPopupSelector, Locator::SELECTOR_XPATH)] ); - $this->waitForElementVisible($this->resourcesPopupSelector, Locator::SELECTOR_XPATH); return $resourcesPopup; } diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php index 6720168dc4f81..53baa08c1e281 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php @@ -6,7 +6,11 @@ namespace Magento\Integration\Test\Block\Adminhtml\Integration\IntegrationGrid; +use Magento\Mtf\Block\BlockFactory; use Magento\Mtf\Block\Form; +use Magento\Mtf\Block\Mapper; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Class ResourcesPopup @@ -28,6 +32,46 @@ class ResourcesPopup extends Form */ protected $reauthorizeButtonSelector = '[data-row-dialog="tokens"][data-row-is-reauthorize="1"]'; + /** + * API content selector. + * + * @var string + */ + protected $content = '#integrations-activate-permissions-content'; + + /** + * @constructor + * @param SimpleElement $element + * @param BlockFactory $blockFactory + * @param Mapper $mapper + * @param BrowserInterface $browser + */ + public function __construct( + SimpleElement $element, + BlockFactory $blockFactory, + Mapper $mapper, + BrowserInterface $browser + ) { + parent::__construct($element, $blockFactory, $mapper, $browser); + $this->waitPopupToLoad(); + } + + /** + * Wait until API content is loaded. + * + * @return void + */ + protected function waitPopupToLoad() + { + $context = $this->_rootElement; + $selector = $this->content; + $context->waitUntil( + function () use ($context, $selector) { + return $context->find($selector)->isVisible() ? true : null; + } + ); + } + /** * Click allow button in integration resources popup window. * diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv index 13f1a2efee0f3..e3bd6e83e3792 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest/test.csv @@ -1,2 +1,2 @@ "description";"constraint" -"Re-authorize integration";"assertIntegrationSuccessReauthorizeMessage, assertIntegrationForm, assertIntegrationTokensAfterReauthorize" +"Re-authorize integration";"assertIntegrationSuccessReauthorizeMessage, assertIntegrationTokensAfterReauthorize" diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/AssertOrderSuccessPlacedMessage.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/AssertMultishippingOrderSuccessPlacedMessage.php similarity index 94% rename from dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/AssertOrderSuccessPlacedMessage.php rename to dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/AssertMultishippingOrderSuccessPlacedMessage.php index 712b95a577553..dc01fef380ba8 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/AssertOrderSuccessPlacedMessage.php +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/Constraint/AssertMultishippingOrderSuccessPlacedMessage.php @@ -11,7 +11,7 @@ /** * Assert that success message for multiple address checkout is correct. */ -class AssertOrderSuccessPlacedMessage extends AbstractConstraint +class AssertMultishippingOrderSuccessPlacedMessage extends AbstractConstraint { /* tags */ const SEVERITY = 'high'; diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml index 8b6fe6fadc257..7e379b849a1f8 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml @@ -6,7 +6,7 @@ */ --> - + high - + diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php index 7ed40fc54cd16..a850585fabc19 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php @@ -13,8 +13,6 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; /** - * Test Creation for ViewedProductsReportEntity - * * Test Flow: * Preconditions: * 1. Create products @@ -67,6 +65,7 @@ class ViewedProductsReportEntityTest extends Injectable */ public function __prepare(CatalogProductIndex $catalogProductIndexPage) { + $this->markTestIncomplete('Bug: MAGETWO-33029'); $catalogProductIndexPage->open(); $catalogProductIndexPage->getProductGrid()->massaction([], 'Delete', true, 'Select All'); } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml index 67798c3a7ff2c..1d8176768a23f 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml @@ -26,8 +26,10 @@ Summary review %isolation% Text review %isolation% - visibleOnDefaultWebsite - 4 + + visibleOnDefaultWebsite + 4 + catalogProductSimple::default diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml index f00233db0fd8b..82370886e85e3 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml @@ -6,7 +6,7 @@ */ --> - + Approved diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml index a48e7e788ae52..7899e4a6a417b 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml @@ -24,7 +24,7 @@ - Customer Tax Class %isolation% + Customer Tax Class %isolation% CUSTOMER @@ -34,7 +34,7 @@ - None + None PRODUCT 0 diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php index 1fd1a7814e335..e2c66423d8e52 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php @@ -6,7 +6,7 @@ namespace Magento\Weee\Test\Block\Product; -use Magento\Mtf\Client\Element\Locator; +use Magento\Mtf\Client\Locator; /** * Product view block on the product page diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php index cfa7f5ec7517d..f64c8da3fa6d4 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php @@ -53,7 +53,6 @@ public function __prepare(Customer $customer) */ public function test(Customer $customer, $product) { - $this->markTestIncomplete('Bug: MAGETWO-32813'); $product = $this->createProducts($product)[0]; // Steps: diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php index 745db63f3394c..b358e5c134402 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php @@ -11,8 +11,6 @@ use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; /** - * Test Flow: - * * Preconditions: * 1. Create customer * 2. Create products @@ -39,7 +37,7 @@ class ConfigureProductInCustomerWishlistOnBackendTest extends AbstractWishlistTe /* end tags */ /** - * Prepare data + * Create customer. * * @param Customer $customer * @return array @@ -52,7 +50,7 @@ public function __prepare(Customer $customer) } /** - * Configure customer wish list on backend + * Configure customer wish list on backend. * * @param Customer $customer * @param string $product diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml index a63d9da454d4d..312f29100daba 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml @@ -10,7 +10,6 @@ - diff --git a/dev/tests/functional/utils/generate/factory.php b/dev/tests/functional/utils/generate/factory.php index 5cbb2fdb36f86..615550efbfea5 100644 --- a/dev/tests/functional/utils/generate/factory.php +++ b/dev/tests/functional/utils/generate/factory.php @@ -5,5 +5,7 @@ */ require_once dirname(__DIR__) . '/' . 'bootstrap.php'; -$objectManager->create('Magento\Mtf\Util\Generate\Factory')->launch(); +$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); +$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); +$magentoObjectManager->create('Magento\Mtf\Util\Generate\Factory')->launch(); \Magento\Mtf\Util\Generate\GenerateResult::displayResults(); From 01a1d358e9062ef747f6dd5f99b050b1c2e0a279 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Mon, 2 Feb 2015 17:51:52 +0200 Subject: [PATCH 16/50] MTA-550: Re-factor Tests for Assign Promoted Products - Re-factor up-sell products - Re-factor related products --- .../Block/Product/ProductList/Crosssell.php | 69 +--- .../Product/ProductList/PromotedSection.php | 77 +++++ .../Block/Product/ProductList/Related.php | 79 ++--- .../ProductList/Related/ProductItem.php | 42 +++ .../Test/Block/Product/ProductList/Upsell.php | 48 +-- .../AssertProductAbsentCrossSellSection.php | 47 +++ ....php => AssertProductAbsentCrossSells.php} | 20 +- ...=> AssertProductAbsentRelatedProducts.php} | 27 +- ...ion.php => AssertProductAbsentUpSells.php} | 27 +- .../AssertProductCrossSellSection.php | 58 ++++ ...ection.php => AssertProductCrossSells.php} | 19 +- ...n.php => AssertProductRelatedProducts.php} | 27 +- .../Test/Constraint/AssertProductUpSells.php | 63 ++++ .../AssertUpSellsProductsSection.php | 58 ---- .../Catalog/Test/Fixture/AssignProducts.php | 69 ---- .../Test/Fixture/CrosssellProducts.php | 64 ---- .../Catalog/Test/Fixture/RelatedProducts.php | 14 - .../Catalog/Test/Fixture/UpsellProducts.php | 14 - .../Test/Repository/AssignProducts.php | 42 --- .../AbstractProductPromotedProductsTest.php | 202 ++++++++++++ .../Product/AddRelatedProductsEntityTest.php | 57 ---- .../AddRelatedProductsEntityTest/test.csv | 2 - .../Product/AddToCartCrossSellTest.php | 296 ++++-------------- .../Product/AddToCartCrossSellTest/test.csv | 5 +- .../TestCase/Product/AddUpSellEntityTest.php | 55 ---- .../Product/AddUpSellEntityTest/test.csv | 3 - .../testCreate.csv | 44 +-- .../Product/NavigateRelatedProductsTest.php | 191 +++++++++++ .../NavigateRelatedProductsTest/test.csv | 2 + .../Product/NavigateUpSellProductsTest.php | 109 +++++++ .../NavigateUpSellProductsTest/test.csv | 2 + .../TestCase/Product/RelatedProductTest.php | 120 ------- .../Test/TestCase/Product/UpsellTest.php | 102 ------ .../Magento/Catalog/Test/etc/constraint.xml | 24 +- .../Mtf/TestSuite/InjectableTests/basic.xml | 1 - 35 files changed, 988 insertions(+), 1091 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/PromotedSection.php create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related/ProductItem.php create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php rename dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/{AssertNoCrossSellsProductsSection.php => AssertProductAbsentCrossSells.php} (72%) mode change 100755 => 100644 rename dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/{AssertNoRelatedProductsSection.php => AssertProductAbsentRelatedProducts.php} (63%) mode change 100755 => 100644 rename dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/{AssertNoUpSellsProductsSection.php => AssertProductAbsentUpSells.php} (55%) mode change 100755 => 100644 create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php rename dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/{AssertCrossSellsProductsSection.php => AssertProductCrossSells.php} (70%) mode change 100755 => 100644 rename dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/{AssertRelatedProductsSection.php => AssertProductRelatedProducts.php} (61%) mode change 100755 => 100644 create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php delete mode 100755 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/AssignProducts.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CrosssellProducts.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/RelatedProducts.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/UpsellProducts.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/AssignProducts.php create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest/test.csv delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest/test.csv create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php index d7c9291210993..30a0375cb4af2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php @@ -6,75 +6,10 @@ namespace Magento\Catalog\Test\Block\Product\ProductList; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; - /** * Cross-sell product block on the checkout page. */ -class Crosssell extends Block +class Crosssell extends PromotedSection { - /** - * Product item block. - * - * @var string - */ - protected $productItem = 'li.product-item'; - - /** - * Product item block by product name. - * - * @var string - */ - protected $productItemByName = './/*[contains(@class,"product-item-link") and @title="%s"]/ancestor::li'; - - /** - * Check whether block is visible. - * - * @return bool - */ - public function isVisible() - { - return $this->_rootElement->isVisible(); - } - - /** - * Return product item block. - * - * @param FixtureInterface $product - * @return ProductItem - */ - public function getProductItem(FixtureInterface $product) - { - $locator = sprintf($this->productItemByName, $product->getName()); - - return $this->blockFactory->create( - 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', - ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get list of product names. - * - * @return array - */ - public function getProductNames() - { - $productItems = $this->_rootElement->getElements($this->productItem, Locator::SELECTOR_CSS); - $names = []; - - foreach ($productItems as $productItem) { - /** @var ProductItem $productItemBlock */ - $productItemBlock = $this->blockFactory->create( - 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', - ['element' => $productItem] - ); - - $names[] = $productItemBlock->getProductName(); - } - - return $names; - } + // } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/PromotedSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/PromotedSection.php new file mode 100644 index 0000000000000..801f85d30efa2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/PromotedSection.php @@ -0,0 +1,77 @@ +_rootElement->isVisible(); + } + + /** + * Return product item block. + * + * @param FixtureInterface $product + * @return ProductItem + */ + public function getProductItem(FixtureInterface $product) + { + $locator = sprintf($this->productItemByName, $product->getName()); + + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', + ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Return list of products. + * + * @return ProductItem[] + */ + public function getProducts() + { + $elements = $this->_rootElement->getElements($this->productItem, Locator::SELECTOR_CSS); + $result = []; + + foreach ($elements as $element) { + $result[] = $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\ProductItem', + ['element' => $element] + ); + } + + return $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php index dd65782e9f253..cbd00b28c0551 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php @@ -6,77 +6,48 @@ namespace Magento\Catalog\Test\Block\Product\ProductList; -use Magento\Mtf\Block\Block; +use Magento\Catalog\Test\Block\Product\ProductList\Related\ProductItem; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Client\Element\SimpleElement; +use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Related - * Related product block on the page + * Related products section on the page. */ -class Related extends Block +class Related extends PromotedSection { /** - * Related product locator on the page + * Return product item block. * - * @var string + * @param FixtureInterface $product + * @return ProductItem */ - protected $relatedProduct = "//div[normalize-space(div//a)='%s']"; - - /** - * Checking related product visibility - * - * @param string $productName - * @return bool - */ - public function isRelatedProductVisible($productName) + public function getProductItem(FixtureInterface $product) { - return $this->getProductElement($productName)->isVisible(); - } + $locator = sprintf($this->productItemByName, $product->getName()); - /** - * Verify that you can choose the related products - * - * @param string $productName - * @return bool - */ - public function isRelatedProductSelectable($productName) - { - return $this->getProductElement($productName)->find("[name='related_products[]']")->isVisible(); + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\Related\ProductItem', + ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] + ); } /** - * Open related product + * Return list of products. * - * @param string $productName - * @return void + * @return ProductItem[] */ - public function openRelatedProduct($productName) + public function getProducts() { - $this->getProductElement($productName)->find('.product.name>a')->click(); - } + $elements = $this->_rootElement->getElements($this->productItem, Locator::SELECTOR_CSS); + $result = []; - /** - * Select related product - * - * @param string $productName - * @return void - */ - public function selectProductForAddToCart($productName) - { - $this->getProductElement($productName) - ->find("[name='related_products[]']", Locator::SELECTOR_CSS, 'checkbox') - ->setValue('Yes'); - } + foreach ($elements as $element) { + $result[] = $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Product\ProductList\Related\ProductItem', + ['element' => $element] + ); + } - /** - * Get related product element - * - * @param string $productName - * @return SimpleElement - */ - private function getProductElement($productName) - { - return $this->_rootElement->find(sprintf($this->relatedProduct, $productName), Locator::SELECTOR_XPATH); + return $result; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related/ProductItem.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related/ProductItem.php new file mode 100644 index 0000000000000..2418629b65400 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related/ProductItem.php @@ -0,0 +1,42 @@ +_rootElement->find($this->triggerChoose)->isVisible(); + } + + /** + * Choose the related products. + * + * @return void + */ + public function select() + { + $this->_rootElement->find($this->triggerChoose, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Upsell.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Upsell.php index ce1ee095156a9..2edaa683117ee 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Upsell.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Upsell.php @@ -6,52 +6,10 @@ namespace Magento\Catalog\Test\Block\Product\ProductList; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Client\Element\SimpleElement; - /** - * Class Upsell - * Upsell product block on the page + * Up-sell product section on the page. */ -class Upsell extends Block +class Upsell extends PromotedSection { - /** - * Upsell product locator on the page - * - * @var string - */ - protected $upsellProduct = "//div[normalize-space(div//a)='%s']"; - - /** - * Checking upsell product visibility - * - * @param string $productName - * @return bool - */ - public function isUpsellProductVisible($productName) - { - return $this->getProductElement($productName)->isVisible(); - } - - /** - * Open upsell product - * - * @param string $productName - */ - public function openUpsellProduct($productName) - { - $this->getProductElement($productName)->find('.product.name>a')->click(); - } - - /** - * Get a the product - * - * @param string $productName - * @return SimpleElement - */ - private function getProductElement($productName) - { - return $this->_rootElement->find(sprintf($this->upsellProduct, $productName), Locator::SELECTOR_XPATH); - } + // } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php new file mode 100644 index 0000000000000..4903045bb95fe --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php @@ -0,0 +1,47 @@ +open(); + \PHPUnit_Framework_Assert::assertFalse( + $checkoutCart->getCrosssellBlock()->isVisible(), + "Cross-sell block is present." + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Cross-sell section is absent.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php old mode 100755 new mode 100644 similarity index 72% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php index 030b8b8012b12..15ec04a749030 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php @@ -16,7 +16,7 @@ /** * Assert that product is not displayed in cross-sell section. */ -class AssertNoCrossSellsProductsSection extends AbstractConstraint +class AssertProductAbsentCrossSells extends AbstractConstraint { /* tags */ const SEVERITY = 'middle'; @@ -27,27 +27,33 @@ class AssertNoCrossSellsProductsSection extends AbstractConstraint * * @param BrowserInterface $browser * @param CatalogProductSimple $product - * @param InjectableFixture[] $relatedProducts * @param CatalogProductView $catalogProductView * @param CheckoutCart $checkoutCart + * @param InjectableFixture[]|null $promotedProducts * @return void */ public function processAssert( BrowserInterface $browser, CatalogProductSimple $product, - array $relatedProducts, CatalogProductView $catalogProductView, - CheckoutCart $checkoutCart + CheckoutCart $checkoutCart, + array $promotedProducts = null ) { + if (!$promotedProducts) { + $promotedProducts = $product->hasData('cross_sell_products') + ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() + : []; + } + $checkoutCart->open(); $checkoutCart->getCartBlock()->clearShoppingCart(); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->addToCart($product); - foreach ($relatedProducts as $relatedProduct) { + foreach ($promotedProducts as $promotedProduct) { \PHPUnit_Framework_Assert::assertFalse( - $checkoutCart->getCrosssellBlock()->getProductItem($relatedProduct)->isVisible(), - 'Product \'' . $relatedProduct->getName() . '\' is exist in cross-sell section.' + $checkoutCart->getCrosssellBlock()->getProductItem($promotedProduct)->isVisible(), + 'Product \'' . $promotedProduct->getName() . '\' is exist in cross-sell section.' ); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php old mode 100755 new mode 100644 similarity index 63% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php index 77dafc88946df..b281bc5a87ac1 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php @@ -13,41 +13,46 @@ use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertNoRelatedProductsSection - * Assert that product is not displayed in related products section + * Assert that product is not displayed in related products section. */ -class AssertNoRelatedProductsSection extends AbstractConstraint +class AssertProductAbsentRelatedProducts extends AbstractConstraint { /* tags */ const SEVERITY = 'middle'; /* end tags */ /** - * Assert that product is not displayed in related products section + * Assert that product is not displayed in related products section. * * @param BrowserInterface $browser * @param CatalogProductSimple $product - * @param InjectableFixture[] $relatedProducts * @param CatalogProductView $catalogProductView + * @param InjectableFixture[]|null $promotedProducts * @return void */ public function processAssert( BrowserInterface $browser, CatalogProductSimple $product, - array $relatedProducts, - CatalogProductView $catalogProductView + CatalogProductView $catalogProductView, + array $promotedProducts = null ) { + if (!$promotedProducts) { + $promotedProducts = $product->hasData('related_products') + ? $product->getDataFieldConfig('related_products')['source']->getProducts() + : []; + } + $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($relatedProducts as $relatedProduct) { + foreach ($promotedProducts as $promotedProduct) { \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getRelatedProductBlock()->isRelatedProductVisible($relatedProduct->getName()), - 'Product \'' . $relatedProduct->getName() . '\' is exist in related products.' + $catalogProductView->getRelatedProductBlock()->getProductItem($promotedProduct)->isVisible(), + 'Product \'' . $promotedProduct->getName() . '\' is exist in related products.' ); } } /** - * Text success product is not displayed in related products section + * Text success product is not displayed in related products section. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentUpSells.php old mode 100755 new mode 100644 similarity index 55% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentUpSells.php index e2ec0224da538..c965a42a37ac8 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentUpSells.php @@ -13,41 +13,46 @@ use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertNoUpSellsProductsSection - * Assert that product is not displayed in up-sell section + * Assert that product is not displayed in up-sell section. */ -class AssertNoUpSellsProductsSection extends AbstractConstraint +class AssertProductAbsentUpSells extends AbstractConstraint { /* tags */ const SEVERITY = 'middle'; /* end tags */ /** - * Assert that product is not displayed in up-sell section + * Assert that product is not displayed in up-sell section. * * @param BrowserInterface $browser * @param CatalogProductSimple $product - * @param InjectableFixture[] $relatedProducts * @param CatalogProductView $catalogProductView + * @param InjectableFixture[]|null $promotedProducts * @return void */ public function processAssert( BrowserInterface $browser, CatalogProductSimple $product, - array $relatedProducts, - CatalogProductView $catalogProductView + CatalogProductView $catalogProductView, + array $promotedProducts = null ) { + if (!$promotedProducts) { + $promotedProducts = $product->hasData('up_sell_products') + ? $product->getDataFieldConfig('up_sell_products')['source']->getProducts() + : []; + } + $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($relatedProducts as $relatedProduct) { + foreach ($promotedProducts as $promotedProduct) { \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getUpsellBlock()->isUpsellProductVisible($relatedProduct->getName()), - 'Product \'' . $relatedProduct->getName() . '\' is exist in up-sells products.' + $catalogProductView->getUpsellBlock()->getProductItem($promotedProduct)->isVisible(), + 'Product \'' . $promotedProduct->getName() . '\' is exist in up-sells products.' ); } } /** - * Text success product is not displayed in up-sell section + * Text success product is not displayed in up-sell section. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php new file mode 100644 index 0000000000000..512b3fb08269c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php @@ -0,0 +1,58 @@ +getName(); + } + foreach ($checkoutCart->getCrosssellBlock()->getProducts() as $productItem) { + $pageProductNames[] = $productItem->getProductName(); + } + + \PHPUnit_Framework_Assert::assertEquals( + $productNames, + $pageProductNames, + 'Wrong display cross-sell section.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Cross-sell section is correctly display.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php old mode 100755 new mode 100644 similarity index 70% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php index 71ef4bf14e2e2..036d9dabd5f0c --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php @@ -11,11 +11,12 @@ use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Mtf\Fixture\FixtureInterface; /** * Assert that product is displayed in cross-sell section. */ -class AssertCrossSellsProductsSection extends AbstractConstraint +class AssertProductCrossSells extends AbstractConstraint { /* tags */ const SEVERITY = 'middle'; @@ -28,25 +29,31 @@ class AssertCrossSellsProductsSection extends AbstractConstraint * @param CheckoutCart $checkoutCart * @param CatalogProductSimple $product * @param CatalogProductView $catalogProductView + * @param FixtureInterface[]|null $promotedProducts * @return void */ public function processAssert( BrowserInterface $browser, CheckoutCart $checkoutCart, CatalogProductSimple $product, - CatalogProductView $catalogProductView + CatalogProductView $catalogProductView, + array $promotedProducts = null ) { - $relatedProducts = $product->getDataFieldConfig('cross_sell_products')['source']->getProducts(); $errors = []; + if (!$promotedProducts) { + $promotedProducts = $product->hasData('cross_sell_products') + ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() + : []; + } $checkoutCart->open(); $checkoutCart->getCartBlock()->clearShoppingCart(); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->addToCart($product); - foreach ($relatedProducts as $relatedProduct) { - if (!$checkoutCart->getCrosssellBlock()->getProductItem($relatedProduct)->isVisible()) { - $errors[] = 'Product \'' . $relatedProduct->getName() . '\' is absent in cross-sell section.'; + foreach ($promotedProducts as $promotedProduct) { + if (!$checkoutCart->getCrosssellBlock()->getProductItem($promotedProduct)->isVisible()) { + $errors[] = 'Product \'' . $promotedProduct->getName() . '\' is absent in cross-sell section.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php old mode 100755 new mode 100644 similarity index 61% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php index c2279cf6a7325..dcb54175af889 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php @@ -13,41 +13,46 @@ use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertRelatedProductsSection - * Assert that product is displayed in related products section + * Assert that product is displayed in related products section. */ -class AssertRelatedProductsSection extends AbstractConstraint +class AssertProductRelatedProducts extends AbstractConstraint { /* tags */ const SEVERITY = 'middle'; /* end tags */ /** - * Assert that product is displayed in related products section + * Assert that product is displayed in related products section. * * @param BrowserInterface $browser * @param CatalogProductSimple $product - * @param InjectableFixture[] $relatedProducts * @param CatalogProductView $catalogProductView + * @param InjectableFixture[]|null $promotedProducts * @return void */ public function processAssert( BrowserInterface $browser, CatalogProductSimple $product, - array $relatedProducts, - CatalogProductView $catalogProductView + CatalogProductView $catalogProductView, + array $promotedProducts = null ) { + if (!$promotedProducts) { + $promotedProducts = $product->hasData('related_products') + ? $product->getDataFieldConfig('related_products')['source']->getProducts() + : []; + } + $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($relatedProducts as $relatedProduct) { + foreach ($promotedProducts as $promotedProduct) { \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getRelatedProductBlock()->isRelatedProductVisible($relatedProduct->getName()), - 'Product \'' . $relatedProduct->getName() . '\' is absent in related products.' + $catalogProductView->getRelatedProductBlock()->getProductItem($promotedProduct)->isVisible(), + 'Product \'' . $promotedProduct->getName() . '\' is absent in related products.' ); } } /** - * Text success product is displayed in related products section + * Text success product is displayed in related products section. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php new file mode 100644 index 0000000000000..bf7d0a5d785d5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php @@ -0,0 +1,63 @@ +hasData('up_sell_products') + ? $product->getDataFieldConfig('up_sell_products')['source']->getProducts() + : []; + } + + $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); + foreach ($promotedProducts as $promotedProduct) { + \PHPUnit_Framework_Assert::assertTrue( + $catalogProductView->getUpsellBlock()->getProductItem($promotedProduct)->isVisible(), + 'Product \'' . $promotedProduct->getName() . '\' is absent in up-sells products.' + ); + } + } + + /** + * Text success product is displayed in up-sell section. + * + * @return string + */ + public function toString() + { + return 'Product is displayed in up-sell section.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php deleted file mode 100755 index 0dae93dd6d207..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php +++ /dev/null @@ -1,58 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($relatedProducts as $relatedProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getUpsellBlock()->isUpsellProductVisible($relatedProduct->getName()), - 'Product \'' . $relatedProduct->getName() . '\' is absent in up-sells products.' - ); - } - } - - /** - * Text success product is displayed in up-sell section - * - * @return string - */ - public function toString() - { - return 'Product is displayed in up-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/AssignProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/AssignProducts.php deleted file mode 100644 index 47ba4a555e512..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/AssignProducts.php +++ /dev/null @@ -1,69 +0,0 @@ -_placeholders[$this->assignType . '_simple::getSku'] = [$this, 'productProvider']; - $this->_placeholders[$this->assignType . '_simple::getName'] = [$this, 'productProvider']; - $this->_placeholders[$this->assignType . '_configurable::getSku'] = [$this, 'productProvider']; - $this->_placeholders[$this->assignType . '_configurable::getName'] = [$this, 'productProvider']; - } - - /** - * Init Data - */ - protected function _initData() - { - $this->_dataConfig = [ - 'assignType ' => $this->assignType, - ]; - $this->_data = [ - 'fields' => [ - $this->assignType . '_products' => [ - 'value' => [ - 'product_1' => [ - 'sku' => '%' . $this->assignType . '_simple::getSku%', - 'name' => '%' . $this->assignType . '_simple::getName%', - ], - 'product_2' => [ - 'sku' => '%' . $this->assignType . '_configurable::getSku%', - 'name' => '%' . $this->assignType . '_configurable::getName%', - ], - ], - 'group' => $this->group, - ], - ], - ]; - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data); - } - - /** - * @param string $productData - * @return string - */ - protected function formatProductType($productData) - { - return str_replace($this->assignType . '_', '', $productData); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CrosssellProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CrosssellProducts.php deleted file mode 100644 index 6314c21b52cf8..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CrosssellProducts.php +++ /dev/null @@ -1,64 +0,0 @@ -_dataConfig = [ - 'assignType ' => $this->assignType, - ]; - $productsArray = []; - foreach ($this->_products as $key => $product) { - /** @var $product \Magento\Catalog\Test\Fixture\Product */ - $productsArray['product_' . $key] = [ - 'sku' => $product->getSku(), - 'name' => $product->getName(), - ]; - } - $this->_data['fields']['cross_sell_products']['value'] = $productsArray; - $this->_data['fields']['cross_sell_products']['group'] = $this->group; - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data); - } - - /** - * Set specified product to local data - * - * @param array $products - * @return $this - */ - public function setProducts(array $products) - { - $this->_products = $products; - $this->_initData(); - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/RelatedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/RelatedProducts.php deleted file mode 100644 index 22e6dd0f67b91..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/RelatedProducts.php +++ /dev/null @@ -1,14 +0,0 @@ -_data['default'] = [ - 'config' => $defaultConfig, - 'data' => $defaultData, - ]; - $this->_data['add_' . $defaultConfig['assignType '] . '_products'] = $this->_data['default']; - $this->_data['add_' . $defaultConfig['assignType '] . '_product'] = $this->withOneProduct( - $defaultConfig['assignType '] - ); - } - - /** - * @param string $type - * @return array - */ - protected function withOneProduct($type) - { - $data = $this->_data['default']; - unset($data['data']['fields'][$type . '_products']['value']['product_2']); - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php new file mode 100644 index 0000000000000..33ecce16a4dde --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php @@ -0,0 +1,202 @@ +browser = $browser; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Inject data. + * + * @param CatalogProductIndex $catalogProductIndex + * @param CatalogProductEdit $catalogProductEdit + * @param CatalogProductView $catalogProductView + * @return void + */ + public function __inject( + CatalogProductIndex $catalogProductIndex, + CatalogProductEdit $catalogProductEdit, + CatalogProductView $catalogProductView + ) { + $this->catalogProductIndex = $catalogProductIndex; + $this->catalogProductEdit = $catalogProductEdit; + $this->catalogProductView = $catalogProductView; + } + + /** + * Create products. + * + * @param string $products + * @return void + */ + protected function createProducts($products) + { + $list = array_map('trim', explode(',', $products)); + + foreach ($list as $item) { + list($productName, $fixtureCode, $dataSet) = array_map('trim', explode('::', $item)); + $product = $this->fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + + $product->persist(); + $this->products[$productName] = $product; + } + } + + /** + * Assign promoted products. + * + * @param string $promotedProducts + * @param string $type + * @return void + */ + protected function assignPromotedProducts($promotedProducts, $type) + { + $promotedProducts = $this->parsePromotedProducts($promotedProducts); + + foreach ($promotedProducts as $productName => $assignedNames) { + $initialProduct = $this->products[$productName]; + $filter = ['sku' => $initialProduct->getSku()]; + $assignedProducts = []; + + foreach ($assignedNames as $assignedName) { + $assignedProducts[] = $this->products[$assignedName]; + } + + $product = $this->fixtureFactory->create( + get_class($initialProduct), + [ + 'data' => [ + $type => [ + 'products' => $assignedProducts + ] + ] + ] + ); + $this->catalogProductIndex->open(); + $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter); + $this->catalogProductEdit->getProductForm()->fill($product); + $this->catalogProductEdit->getFormPageActions()->save(); + $this->catalogProductEdit->getMessagesBlock()->waitSuccessMessage(); + } + } + + /** + * Parse promoted products. + * + * @param string $promotedProducts + * @return array + */ + protected function parsePromotedProducts($promotedProducts) + { + $list = array_map('trim', explode(';', $promotedProducts)); + $result = []; + + foreach ($list as $item) { + list($productName, $promotedNames) = array_map('trim', explode(':', $item)); + $result[$productName] = array_map('trim', explode(',', $promotedNames)); + } + + return $result; + } + + /** + * Convert list steps to array. + * + * @param string $steps + * @return array + */ + protected function parseSteps($steps) + { + return array_map('trim', explode(',', $steps)); + } + + /** + * Convert assert data to array. + * + * @param string $assert + * @return array + */ + protected function parseAssert($assert) + { + $result = []; + $list = array_map('trim', explode(';', $assert)); + + foreach ($list as $item) { + list($step, $products) = array_map('trim', explode(':', $item)); + $result[$step] = empty($products) + ? [] + : array_map('trim', explode(',', $products)); + } + + return $result; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php deleted file mode 100644 index a04b26309f3f7..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php +++ /dev/null @@ -1,57 +0,0 @@ - Catalog - * 3. Add Product - * 4. Fill data according to dataSet - * 5. Save product - * 6. Perform all assertions - * - * @group Related_Products_(MX) - * @ZephyrId MAGETWO-29352 - */ -class AddRelatedProductsEntityTest extends AbstractAddRelatedProductsEntityTest -{ - /* tags */ - const MVP = 'yes'; - const DOMAIN = 'MX'; - /* end tags */ - - /** - * Run test add related products entity - * - * @param string $productData - * @param string $relatedProductsData - * @return array - */ - public function test($productData, $relatedProductsData) - { - $product = $this->getProductByData($productData, ['related_products' => $relatedProductsData]); - $this->createAndSaveProduct($product); - - /** @var RelatedProducts $relatedProducts */ - $relatedProducts = $product->getDataFieldConfig('related_products')['source']; - return [ - 'product' => $product, - 'relatedProducts' => $relatedProducts->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest/test.csv deleted file mode 100644 index c79fcf06524ca..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest/test.csv +++ /dev/null @@ -1,2 +0,0 @@ -"productData";"relatedProductsData";"constraint" -"catalogProductSimple::default";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertRelatedProductsSection" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php index a9403a471d57f..58db34994efe4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php @@ -6,17 +6,10 @@ namespace Magento\Catalog\Test\TestCase\Product; -use Magento\Catalog\Test\Constraint\AssertProductSaveMessage; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; -use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Checkout\Test\Constraint\AssertAddedProductToCartSuccessMessage; +use Magento\Catalog\Test\Constraint\AssertProductCrossSellSection; use Magento\Checkout\Test\Page\CheckoutCart; -use Magento\Mtf\Client\BrowserInterface; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\TestCase\Injectable; +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Mtf\Fixture\InjectableFixture; /** * Test Flow: @@ -26,12 +19,13 @@ * 2. Assign promoted products. * * Steps: - * 1. Add some products to cart. + * 1. Add initial products to cart. * 2. Verify Cross-sell block on checkout page. * + * @ZephyrId MAGETWO-12390 * @group Cross-sells_(MX) */ -class AddToCartCrossSellTest extends Injectable +class AddToCartCrossSellTest extends AbstractProductPromotedProductsTest { /* tags */ const TEST_TYPE = 'acceptance_test'; @@ -40,46 +34,11 @@ class AddToCartCrossSellTest extends Injectable /* end tags */ /** - * Interface Browser. + * Frontend page. * - * @var BrowserInterface + * @var CmsIndex */ - protected $browser; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Suite products. - * - * @var FixtureInterface[] - */ - protected $products = []; - - /** - * Catalog product index page in backend. - * - * @var CatalogProductIndex - */ - protected $catalogProductIndex; - - /** - * Catalog product edit page in backend. - * - * @var CatalogProductEdit - */ - protected $catalogProductEdit; - - /** - * Catalog product view page in frontend. - * - * @var CatalogProductView - */ - protected $catalogProductView; + protected $cmsIndex; /** * Checkout page. @@ -89,243 +48,96 @@ class AddToCartCrossSellTest extends Injectable protected $checkoutCart; /** - * Assert success message is displayed after product save. - * - * @var AssertProductSaveMessage - */ - protected $assertProductSaveMessage; - - /** - * Assert success message is appeared after add product to cart. - * - * @var AssertAddedProductToCartSuccessMessage - */ - protected $assertAddedProductToCartSuccessMessage; - - /** - * Prepare data. + * Assert that correctly display cross-sell section. * - * @param BrowserInterface $browser - * @param FixtureFactory $fixtureFactory - * @param AssertProductSaveMessage $assertProductSaveMessage - * @param AssertAddedProductToCartSuccessMessage $assertAddedProductToCartSuccessMessage - * @return void + * @var AssertProductCrossSellSection */ - public function __prepare( - BrowserInterface $browser, - FixtureFactory $fixtureFactory, - AssertProductSaveMessage $assertProductSaveMessage, - AssertAddedProductToCartSuccessMessage $assertAddedProductToCartSuccessMessage - ) { - $this->browser = $browser; - $this->fixtureFactory = $fixtureFactory; - $this->assertProductSaveMessage = $assertProductSaveMessage; - $this->assertAddedProductToCartSuccessMessage = $assertAddedProductToCartSuccessMessage; - } - - /** - * Inject data. - * - * @param CatalogProductIndex $catalogProductIndex - * @param CatalogProductEdit $catalogProductEdit - * @param CatalogProductView $catalogProductView - * @param CheckoutCart $checkoutCart - * @return void - */ - public function __inject( - CatalogProductIndex $catalogProductIndex, - CatalogProductEdit $catalogProductEdit, - CatalogProductView $catalogProductView, - CheckoutCart $checkoutCart - ) { - $this->catalogProductIndex = $catalogProductIndex; - $this->catalogProductEdit = $catalogProductEdit; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - } + protected $assertProductCrossSellSection; /** * Run test add to cart cross-sell products. * * @param string $products * @param string $promotedProducts - * @param string $order - * @param string $crossSell + * @param string $steps + * @param string $assert + * @param CmsIndex $cmsIndex + * @param CheckoutCart $checkoutCart + * @param AssertProductCrossSellSection $assertProductCrossSellSection * @return void */ - public function test($products, $promotedProducts, $order, $crossSell) - { + public function test( + $products, + $promotedProducts, + $steps, + $assert, + CmsIndex $cmsIndex, + CheckoutCart $checkoutCart, + AssertProductCrossSellSection $assertProductCrossSellSection + ) { // Preconditions $this->createProducts($products); - $this->assignPromotedProducts($promotedProducts); + $this->assignPromotedProducts($promotedProducts, 'cross_sell_products'); // Steps - $this->createOrder($order); - $this->verify($crossSell); - } - - /** - * Create products. - * - * @param string $products - * @return void - */ - protected function createProducts($products) - { - $list = array_map('trim', explode(',', $products)); - - foreach ($list as $item) { - list($productName, $fixtureCode, $dataSet) = array_map('trim', explode('::', $item)); - $product = $this->fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); - - $product->persist(); - $this->products[$productName] = $product; - } - } - - /** - * Assigning promoted products. - * - * @param string $promotedProducts - * @return void - */ - protected function assignPromotedProducts($promotedProducts) - { - $promotedProducts = $this->parsePromotedProducts($promotedProducts); - - foreach ($promotedProducts as $productName => $assignedNames) { - $initialProduct = $this->products[$productName]; - $filter = ['sku' => $initialProduct->getSku()]; - $assignedProducts = []; - - foreach ($assignedNames as $assignedName) { - $assignedProducts[] = $this->products[$assignedName]; - } - - $product = $this->fixtureFactory->create( - get_class($initialProduct), - [ - 'data' => [ - 'cross_sell_products' => [ - 'products' => $assignedProducts - ] - ] - ] - ); - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter); - $this->catalogProductEdit->getProductForm()->fill($product); - $this->catalogProductEdit->getFormPageActions()->save(); - $this->assertProductSaveMessage->processAssert($this->catalogProductEdit); - } - } - - /** - * Parse promoted products. - * - * @param string $promotedProducts - * @return array - */ - protected function parsePromotedProducts($promotedProducts) - { - $list = array_map('trim', explode(';', $promotedProducts)); - $result = []; - - foreach ($list as $item) { - list($productName, $promotedNames) = array_map('trim', explode(':', $item)); - $result[$productName] = array_map('trim', explode(',', $promotedNames)); - } - - return $result; - } - - /** - * Create order. - * - * @param string $order - * @return void - */ - protected function createOrder($order) - { - $products = $this->prepareOrder($order); - $initialProduct = array_shift($products); + $this->cmsIndex = $cmsIndex; + $this->checkoutCart = $checkoutCart; + $this->assertProductCrossSellSection = $assertProductCrossSellSection; + $steps = $this->parseSteps($steps); + $assert = $this->parseAssert($assert); + $initialProductName = array_shift($steps); + $initialProduct = $this->products[$initialProductName]; + $initialAssert = $assert[$initialProductName]; $this->checkoutCart->open(); $this->checkoutCart->getCartBlock()->clearShoppingCart(); $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); $this->catalogProductView->getViewBlock()->addToCart($initialProduct); - $this->assertAddedProductToCartSuccessMessage->processAssert($this->checkoutCart, $initialProduct); - foreach ($products as $product) { - $this->addToCartFromCrossSell($product); + $this->assertCrossSellSection($initialAssert); + foreach ($steps as $productName) { + $this->addToCart($this->products[$productName]); + $this->assertCrossSellSection($assert[$productName]); } } /** - * Convert short names products to products entities. + * Add product to cart from Cross-sell section. * - * @param string $order - * @return array - */ - protected function prepareOrder($order) - { - $productNames = array_map('trim', explode(',', $order)); - $products = []; - - foreach ($productNames as $productName) { - $products[] = $this->products[$productName]; - } - - return $products; - } - - /** - * Add product from cross-sell block to cart. - * - * @param FixtureInterface $product + * @param InjectableFixture $product * @return void */ - protected function addToCartFromCrossSell(FixtureInterface $product) + protected function addToCart(InjectableFixture $product) { - $productItem = $this->checkoutCart->getCrosssellBlock()->getProductItem($product); + $this->checkoutCart->open(); + $productItem = $this->checkoutCart->getCrosssellBlock()->getProductItem($product); \PHPUnit_Framework_Assert::assertTrue( $productItem->isVisible(), "Product {$product->getName()} is absent in cross-sell block." ); $productItem->clickAddToCart(); - if (false !== strpos($this->browser->getUrl(), $product->getUrlKey())) { + if ($this->cmsIndex->getTitleBlock()->getTitle() == $product->getName()) { $this->catalogProductView->getViewBlock()->addToCart($product); } - $this->assertAddedProductToCartSuccessMessage->processAssert($this->checkoutCart, $product); + $this->checkoutCart->getMessagesBlock()->waitSuccessMessage(); } /** - * Verify cross-sell block. + * Assert that correctly display cross-sell section. * - * @param string $crossSell + * @param array $promotedProductNames * @return void */ - protected function verify($crossSell) + protected function assertCrossSellSection(array $promotedProductNames) { - if (empty($crossSell)) { - \PHPUnit_Framework_Assert::assertFalse( - $this->checkoutCart->getCrosssellBlock()->isVisible(), - "Cross-sell block is present." - ); - return; - } + $promotedProducts = []; - $products = array_map('trim', explode(',', $crossSell)); - $productNames = []; - - foreach ($products as $shortName) { - $productNames[] = $this->products[$shortName]->getName(); + foreach ($promotedProductNames as $promotedProductName) { + $promotedProducts[] = $this->products[$promotedProductName]; } - \PHPUnit_Framework_Assert::assertEquals( - $productNames, - $this->checkoutCart->getCrosssellBlock()->getProductNames() - ); + + $this->assertProductCrossSellSection->processAssert($this->checkoutCart, $promotedProducts); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv index 80f8035884fa7..29896c717c8c8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv @@ -1,3 +1,2 @@ -"products";"promotedProducts";"order";"crossSell";"tag" -"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,simple3::catalogProductSimple::product_with_category";"simple1:simple2,simple3;simple3:simple1,simple2";"simple1,simple3";"simple2";"" -"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple1,simple2";"simple1,config1,simple2";"";"test_type:acceptance_test" +"products";"promotedProducts";"steps";"assert";"tag" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest.php deleted file mode 100644 index 7b3f526055af6..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest.php +++ /dev/null @@ -1,55 +0,0 @@ - Catalog - * 3. Start to create product according to dataset - * 4. Save product - * 5. Perform appropriate assertions - * - * @group Up-sells_(MX) - * @ZephyrId MAGETWO-29105 - */ -class AddUpSellEntityTest extends AbstractAddRelatedProductsEntityTest -{ - /* tags */ - const MVP = 'yes'; - const DOMAIN = 'MX'; - /* end tags */ - - /** - * Run test add up sell products entity - * - * @param string $productData - * @param string $upSellProductsData - * @return array - */ - public function test($productData, $upSellProductsData) - { - $product = $this->getProductByData($productData, ['up_sell_products' => $upSellProductsData]); - $this->createAndSaveProduct($product); - - /** @var UpSellProducts $upSellProducts */ - $upSellProducts = $product->getDataFieldConfig('up_sell_products')['source']; - return [ - 'product' => $product, - 'relatedProducts' => $upSellProducts->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest/test.csv deleted file mode 100644 index f7e6a3f0837ad..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddUpSellEntityTest/test.csv +++ /dev/null @@ -1,3 +0,0 @@ -"productData";"upSellProductsData";"constraint" -"catalogProductSimple::default";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertUpSellsProductsSection" -"configurableProductInjectable::default";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertUpSellsProductsSection" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index 87d2bcbb05efd..a1690213e37f5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,21 +1,23 @@ -"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"constraint";"tag" -"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" -"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" -"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" -"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" -"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" -"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" -"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" -"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" -"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" -"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" -"Create product with cros-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertCrossSellsProductsSection";"" -"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" +"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" +"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" +"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" +"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" +"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" +"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" +"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" +"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" +"Create product with cross-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" +"Create product with up-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" +"Create product with related products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" +"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php new file mode 100644 index 0000000000000..aa0ed1055b387 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php @@ -0,0 +1,191 @@ +createProducts($products); + $this->assignPromotedProducts($promotedProducts, 'related_products'); + $this->parseSelectable($selectable); + + // Steps + $this->checkoutCart = $checkoutCart; + $steps = $this->parseSteps($steps); + $assert = $this->parseAssert($assert); + $initialProductName = array_shift($steps); + $initialProduct = $this->products[$initialProductName]; + $initialAssert = $assert[$initialProductName]; + $lastProductName = end($steps); + $lastProduct = $this->products[$lastProductName]; + $lastAssert = $assert[$lastProductName]; + $checkoutProducts = []; + + // Clear shopping cart + $this->checkoutCart->open(); + $this->checkoutCart->getCartBlock()->clearShoppingCart(); + + // Navigate through related products + $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); + $this->assertRelatedSection($initialAssert); + foreach ($steps as $productName) { + $product = $this->products[$productName]; + $productAssert = $assert[$productName]; + + $this->catalogProductView->getRelatedProductBlock()->getProductItem($product)->open(); + if (empty($productAssert)) { + $this->assertAbsentRelatedSellSection(); + } else { + $this->assertRelatedSection($productAssert); + } + } + + // Add last product with related product to cart and verify + foreach ($lastAssert as $relatedProductName) { + $relatedProduct = $this->products[$relatedProductName]; + $isSelect = $this->selectable[$relatedProductName]; + + if ('yes' == $isSelect) { + $checkoutProducts[] = $relatedProduct; + $this->catalogProductView->getRelatedProductBlock()->getProductItem($relatedProduct)->select(); + } + } + $checkoutProducts[] = $lastProduct; + $this->catalogProductView->getViewBlock()->addToCart($lastProduct); + + $this->assertCheckoutCart($checkoutProducts); + } + + /** + * Parse selectable data. + * + * @param string $selectable + * @return void + */ + protected function parseSelectable($selectable) + { + $list = array_map('trim', explode(',', $selectable)); + + foreach ($list as $item) { + list($productName, $isSelectable) = array_map('trim', explode(':', $item)); + $this->selectable[$productName] = $isSelectable; + } + } + + /** + * Assert that absent related products section. + * + * @return void + */ + protected function assertAbsentRelatedSellSection() + { + \PHPUnit_Framework_Assert::assertFalse( + $this->catalogProductView->getRelatedProductBlock()->isVisible(), + "Related section is present." + ); + } + + /** + * Assert that correctly display related products section. + * + * @param array $promotedProductNames + * @return void + */ + protected function assertRelatedSection(array $promotedProductNames) + { + $fixtureData = []; + $pageData = []; + + foreach ($promotedProductNames as $promotedProductName) { + $productName = $this->products[$promotedProductName]->getName(); + $fixtureData[$productName] = $this->selectable[$promotedProductName]; + } + foreach ($this->catalogProductView->getRelatedProductBlock()->getProducts() as $productItem) { + $pageProductName = $productItem->getProductName(); + $pageData[$pageProductName] = $productItem->isSelectable() ? 'yes' : 'no'; + } + + asort($fixtureData); + asort($pageData); + \PHPUnit_Framework_Assert::assertEquals($pageData, $fixtureData, 'Wrong display related section.'); + } + + /** + * Verify checkout cart. + * + * @param array $checkoutProducts + * @return void + */ + protected function assertCheckoutCart(array $checkoutProducts) + { + $this->checkoutCart->open(); + + foreach ($checkoutProducts as $product) { + \PHPUnit_Framework_Assert::assertTrue( + $this->checkoutCart->getCartBlock()->getCartItem($product)->isVisible(), + "Product {$product->getName()} absent in cart." + ); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv new file mode 100644 index 0000000000000..37a382111726f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv @@ -0,0 +1,2 @@ +"products";"selectable";"promotedProducts";"steps";"assert";"tag" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:yes,simple2:yes,config1:no";"simple1:simple2,config1;config1:simple2";"simple1,config1";"simple1:simple2,config1;config1:simple2";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php new file mode 100644 index 0000000000000..f6f943e7d3020 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php @@ -0,0 +1,109 @@ +createProducts($products); + $this->assignPromotedProducts($promotedProducts, 'up_sell_products'); + + // Steps + $steps = $this->parseSteps($steps); + $assert = $this->parseAssert($assert); + $initialProductName = array_shift($steps); + $initialProduct = $this->products[$initialProductName]; + $initialAssert = $assert[$initialProductName]; + + $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); + $this->assertUpSellSection($initialAssert); + foreach ($steps as $productName) { + $product = $this->products[$productName]; + $productAssert = $assert[$productName]; + + $this->catalogProductView->getUpsellBlock()->getProductItem($product)->open(); + if (empty($productAssert)) { + $this->assertAbsentUpSellSection(); + } else { + $this->assertUpSellSection($productAssert); + } + } + } + + /** + * Assert that absent up-sell section. + * + * @return void + */ + protected function assertAbsentUpSellSection() + { + \PHPUnit_Framework_Assert::assertFalse( + $this->catalogProductView->getUpsellBlock()->isVisible(), + "Up-sell section is present." + ); + } + + /** + * Assert that correctly display up-sell section. + * + * @param array $promotedProductNames + * @return void + */ + protected function assertUpSellSection(array $promotedProductNames) + { + $productNames = []; + $pageProductNames = []; + + foreach ($promotedProductNames as $promotedProductName) { + $productNames[] = $this->products[$promotedProductName]->getName(); + } + foreach ($this->catalogProductView->getUpsellBlock()->getProducts() as $productItem) { + $pageProductNames[] = $productItem->getProductName(); + } + + sort($productNames); + sort($pageProductNames); + \PHPUnit_Framework_Assert::assertEquals($productNames, $pageProductNames, 'Wrong display up-sell section.'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv new file mode 100644 index 0000000000000..29896c717c8c8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv @@ -0,0 +1,2 @@ +"products";"promotedProducts";"steps";"assert";"tag" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php deleted file mode 100644 index 2dce365a7bcfa..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/RelatedProductTest.php +++ /dev/null @@ -1,120 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Promoting products as related - * - * @ZephyrId MAGETWO-12392 - * @return void - */ - public function testRelatedProduct() - { - // Precondition: create simple product 1 - $simple1 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $simple1->switchData('simple'); - $simple1->persist(); - $assignToSimple1 = Factory::getFixtureFactory()->getMagentoCatalogRelatedProducts(); - $assignToSimple1->switchData('add_related_products'); - $verify = [$assignToSimple1->getProduct('simple'), $assignToSimple1->getProduct('configurable')]; - //Data - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - //Steps - $productGridPage->open(); - $productGridPage->getProductGrid()->searchAndOpen(['sku' => $simple1->getSku()]); - $productForm = $editProductPage->getProductForm(); - $productForm->fill($assignToSimple1); - $editProductPage->getFormPageActions()->save(); - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - - $productGridPage->open(); - $productGridPage->getProductGrid()->searchAndOpen( - ['sku' => $assignToSimple1->getProduct('configurable')->getSku()] - ); - $assignToSimple1->switchData('add_related_product'); - $productForm = $editProductPage->getProductForm(); - $productForm->fill($assignToSimple1); - $editProductPage->getFormPageActions()->save(); - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - - $this->assertOnTheFrontend($simple1, $verify); - } - - /** - * Assert configurable product is added to cart together with the proper related product - * - * @param Product $product - * @param Product[] $assigned - * @return void - */ - protected function assertOnTheFrontEnd(Product $product, array $assigned) - { - /** @var Product $simple2 */ - /** @var Product $configurable */ - list($simple2, $configurable) = $assigned; - //Open up simple1 product page - $productPage = Factory::getPageFactory()->getCatalogProductView(); - Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->assertEquals($product->getName(), $productPage->getViewBlock()->getProductName()); - - /** @var \Magento\Catalog\Test\Block\Product\ProductList\Related $relatedBlock */ - $relatedBlock = $productPage->getRelatedProductBlock(); - //Verify related simple2 and configurable on Simple1 product page - $this->assertTrue($relatedBlock->isRelatedProductVisible($simple2->getName())); - $this->assertTrue($relatedBlock->isRelatedProductSelectable($simple2->getName())); - $this->assertTrue($relatedBlock->isRelatedProductVisible($configurable->getName())); - $this->assertFalse($relatedBlock->isRelatedProductSelectable($configurable->getName())); - //Open and verify configurable page - $relatedBlock->openRelatedProduct($configurable->getName()); - $this->assertEquals($configurable->getName(), $productPage->getViewBlock()->getProductName()); - //Verify related simple2 on Configurable product page and add to cart it - $relatedBlock = $productPage->getRelatedProductBlock(); - $this->assertTrue($relatedBlock->isRelatedProductVisible($simple2->getName())); - $this->assertTrue($relatedBlock->isRelatedProductSelectable($simple2->getName())); - $relatedBlock->selectProductForAddToCart($simple2->getName()); - $productPage->getViewBlock()->addToCart($configurable); - - //Verify that both configurable product and simple product 2 are added to shopping cart - $checkoutCartPage = Factory::getPageFactory()->getCheckoutCartIndex(); - $checkoutCartBlock = $checkoutCartPage->getCartBlock(); - $checkoutCartPage->getMessagesBlock()->waitSuccessMessage(); - $this->assertTrue( - $checkoutCartBlock->isProductInShoppingCart($configurable), - 'Configurable product was not found in the shopping cart.' - ); - $this->assertTrue( - $checkoutCartBlock->isProductInShoppingCart($simple2), - 'Related product was not found in the shopping cart.' - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php deleted file mode 100644 index 23d3a2a581361..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpsellTest.php +++ /dev/null @@ -1,102 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Product Up-selling. Assign upselling to products and see them related on the front-end. - * - * @ZephirId MAGETWO-12391 - * @return void - */ - public function testCreateUpsell() - { - // Precondition: create simple product 1 - $simple1 = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $simple1->switchData('simple'); - $simple1->persist(); - $assignToSimple1 = Factory::getFixtureFactory()->getMagentoCatalogUpsellProducts(); - $assignToSimple1->switchData('add_up_sell_products'); - $verify = [$assignToSimple1->getProduct('simple'), $assignToSimple1->getProduct('configurable')]; - //Data - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - //Steps - $productGridPage->open(); - $productGridPage->getProductGrid()->searchAndOpen(['sku' => $simple1->getSku()]); - $editProductPage->getProductForm()->fill($assignToSimple1); - $editProductPage->getFormPageActions()->save(); - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - - $productGridPage->open(); - $productGridPage->getProductGrid()->searchAndOpen( - ['sku' => $assignToSimple1->getProduct('configurable')->getSku()] - ); - $assignToSimple1->switchData('add_up_sell_product'); - $productForm = $editProductPage->getProductForm(); - $productForm->fill($assignToSimple1); - $editProductPage->getFormPageActions()->save(); - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - - $this->assertOnTheFrontend($simple1, $verify); - } - - /** - * @param Product $product - * @param Product[] $assigned - * @return void - */ - protected function assertOnTheFrontEnd(Product $product, array $assigned) - { - /** @var Product $simple2 */ - /** @var Product $configurable */ - list($simple2, $configurable) = $assigned; - //Open up simple1 product page - $productPage = Factory::getPageFactory()->getCatalogProductView(); - Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->assertEquals($product->getName(), $productPage->getViewBlock()->getProductName()); - - /** @var \Magento\Catalog\Test\Block\Product\ProductList\Upsell $upsellBlock */ - $upsellBlock = $productPage->getUpsellBlock(); - //Verify upsell simple2 and configurable on Simple1 product page - $this->assertTrue($upsellBlock->isUpsellProductVisible($simple2->getName())); - $this->assertTrue($upsellBlock->isUpsellProductVisible($configurable->getName())); - //Open and verify configurable page - $upsellBlock->openUpsellProduct($configurable->getName()); - $this->assertEquals($configurable->getName(), $productPage->getViewBlock()->getProductName()); - //Verify upsell simple2 on Configurable product page and open it - $upsellBlock = $productPage->getUpsellBlock(); - $this->assertTrue($upsellBlock->isUpsellProductVisible($simple2->getName())); - $upsellBlock->openUpsellProduct($simple2->getName()); - $this->assertEquals($simple2->getName(), $productPage->getViewBlock()->getProductName()); - $this->assertFalse($productPage->getUpsellBlock()->isVisible()); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml index 9ad414f26cb11..f1ccb323f0c27 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml @@ -213,7 +213,7 @@ low - + middle @@ -223,14 +223,14 @@ - + high - + middle - - + + middle @@ -239,14 +239,14 @@ - + high - + middle - - + + middle @@ -255,13 +255,13 @@ - + high - + middle - + low diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml index a63d9da454d4d..312f29100daba 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml @@ -10,7 +10,6 @@ - From 96488817f09527003fcb0ed58f6641ff96ba1c83 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Tue, 3 Feb 2015 18:32:08 +0200 Subject: [PATCH 17/50] MTA-550: Re-factor Tests for Assign Promoted Products - Fixed logical and code style errors --- .../AssertProductAbsentCrossSellSection.php | 47 ------ .../AssertProductCrossSellSection.php | 58 -------- .../AssertProductRelatedProducts.php | 2 +- .../Test/Constraint/AssertProductUpSells.php | 2 +- .../AbstractAddRelatedProductsEntityTest.php | 113 --------------- .../AbstractProductPromotedProductsTest.php | 16 +-- .../Product/AddToCartCrossSellTest.php | 85 ++++++----- .../Product/AddToCartCrossSellTest/test.csv | 2 +- .../Product/NavigateRelatedProductsTest.php | 136 ++++++++++++------ .../NavigateRelatedProductsTest/test.csv | 2 +- .../Product/NavigateUpSellProductsTest.php | 40 +++--- .../NavigateUpSellProductsTest/test.csv | 2 +- 12 files changed, 177 insertions(+), 328 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractAddRelatedProductsEntityTest.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php deleted file mode 100644 index 4903045bb95fe..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSellSection.php +++ /dev/null @@ -1,47 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertFalse( - $checkoutCart->getCrosssellBlock()->isVisible(), - "Cross-sell block is present." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cross-sell section is absent.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php deleted file mode 100644 index 512b3fb08269c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSellSection.php +++ /dev/null @@ -1,58 +0,0 @@ -getName(); - } - foreach ($checkoutCart->getCrosssellBlock()->getProducts() as $productItem) { - $pageProductNames[] = $productItem->getProductName(); - } - - \PHPUnit_Framework_Assert::assertEquals( - $productNames, - $pageProductNames, - 'Wrong display cross-sell section.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cross-sell section is correctly display.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php index dcb54175af889..d3f72bde99a8d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductRelatedProducts.php @@ -22,7 +22,7 @@ class AssertProductRelatedProducts extends AbstractConstraint /* end tags */ /** - * Assert that product is displayed in related products section. + * Assert that products are displayed in related products section. * * @param BrowserInterface $browser * @param CatalogProductSimple $product diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php index bf7d0a5d785d5..e9da750d5b53b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductUpSells.php @@ -22,7 +22,7 @@ class AssertProductUpSells extends AbstractConstraint /* end tags */ /** - * Assert that product is displayed in up-sell section. + * Assert that products are displayed in up-sell section. * * @param BrowserInterface $browser * @param CatalogProductView $catalogProductView diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractAddRelatedProductsEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractAddRelatedProductsEntityTest.php deleted file mode 100644 index c0200a2ccb2a6..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractAddRelatedProductsEntityTest.php +++ /dev/null @@ -1,113 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * Inject data - * - * @param CatalogProductIndex $catalogProductIndex - * @param CatalogProductNew $catalogProductNew - * @return void - */ - public function __inject(CatalogProductIndex $catalogProductIndex, CatalogProductNew $catalogProductNew) - { - $this->catalogProductIndex = $catalogProductIndex; - $this->catalogProductNew = $catalogProductNew; - } - - /** - * Get product by data - * - * @param string $productData - * @param array $relatedProductsData - * @return FixtureInterface - */ - protected function getProductByData($productData, array $relatedProductsData) - { - list($fixtureName, $dataSet) = explode('::', $productData); - $relatedProductsPresets = []; - foreach ($relatedProductsData as $type => $presets) { - $relatedProductsPresets[$type]['presets'] = $presets; - } - - return $this->fixtureFactory->createByCode( - $fixtureName, - [ - 'dataSet' => $dataSet, - 'data' => $relatedProductsPresets - ] - ); - } - - /** - * Create and save product - * - * @param FixtureInterface $product - * @return void - */ - protected function createAndSaveProduct(FixtureInterface $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addProduct($typeId); - $this->catalogProductNew->getProductForm()->fill($product); - $this->catalogProductNew->getFormPageActions()->save($product); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php index 33ecce16a4dde..a99ac0e951376 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php @@ -169,26 +169,26 @@ protected function parsePromotedProducts($promotedProducts) } /** - * Convert list steps to array. + * Convert list of navigate products to array. * - * @param string $steps + * @param string $navigateProductsOrder * @return array */ - protected function parseSteps($steps) + protected function parseNavigateProductsOrder($navigateProductsOrder) { - return array_map('trim', explode(',', $steps)); + return array_map('trim', explode(',', $navigateProductsOrder)); } /** - * Convert assert data to array. + * Convert products to verify data to array. * - * @param string $assert + * @param string $productsToVerify * @return array */ - protected function parseAssert($assert) + protected function parseProductsToVerify($productsToVerify) { $result = []; - $list = array_map('trim', explode(';', $assert)); + $list = array_map('trim', explode(';', $productsToVerify)); foreach ($list as $item) { list($step, $products) = array_map('trim', explode(':', $item)); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php index 58db34994efe4..0bc815ba47a5a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\TestCase\Product; -use Magento\Catalog\Test\Constraint\AssertProductCrossSellSection; use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\Fixture\InjectableFixture; @@ -47,57 +46,53 @@ class AddToCartCrossSellTest extends AbstractProductPromotedProductsTest */ protected $checkoutCart; - /** - * Assert that correctly display cross-sell section. - * - * @var AssertProductCrossSellSection - */ - protected $assertProductCrossSellSection; - /** * Run test add to cart cross-sell products. * * @param string $products * @param string $promotedProducts - * @param string $steps - * @param string $assert + * @param string $navigateProductsOrder + * @param string $productsToVerify * @param CmsIndex $cmsIndex * @param CheckoutCart $checkoutCart - * @param AssertProductCrossSellSection $assertProductCrossSellSection * @return void */ public function test( $products, $promotedProducts, - $steps, - $assert, + $navigateProductsOrder, + $productsToVerify, CmsIndex $cmsIndex, - CheckoutCart $checkoutCart, - AssertProductCrossSellSection $assertProductCrossSellSection + CheckoutCart $checkoutCart ) { // Preconditions $this->createProducts($products); $this->assignPromotedProducts($promotedProducts, 'cross_sell_products'); - // Steps + // Initialization $this->cmsIndex = $cmsIndex; $this->checkoutCart = $checkoutCart; - $this->assertProductCrossSellSection = $assertProductCrossSellSection; - $steps = $this->parseSteps($steps); - $assert = $this->parseAssert($assert); - $initialProductName = array_shift($steps); + $navigateProductsOrder = $this->parseNavigateProductsOrder($navigateProductsOrder); + $productsToVerify = $this->parseProductsToVerify($productsToVerify); + $initialProductName = array_shift($navigateProductsOrder); $initialProduct = $this->products[$initialProductName]; - $initialAssert = $assert[$initialProductName]; + $initialProductToVerify = $productsToVerify[$initialProductName]; + // Steps $this->checkoutCart->open(); $this->checkoutCart->getCartBlock()->clearShoppingCart(); $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); $this->catalogProductView->getViewBlock()->addToCart($initialProduct); - $this->assertCrossSellSection($initialAssert); - foreach ($steps as $productName) { + $this->assertCrossSellSection($initialProductToVerify); + foreach ($navigateProductsOrder as $productName) { $this->addToCart($this->products[$productName]); - $this->assertCrossSellSection($assert[$productName]); + + if (empty($productsToVerify[$productName])) { + $this->assertAbsentCrossSellSection(); + } else { + $this->assertCrossSellSection($productsToVerify[$productName]); + } } } @@ -109,35 +104,51 @@ public function test( */ protected function addToCart(InjectableFixture $product) { - $this->checkoutCart->open(); - - $productItem = $this->checkoutCart->getCrosssellBlock()->getProductItem($product); - \PHPUnit_Framework_Assert::assertTrue( - $productItem->isVisible(), - "Product {$product->getName()} is absent in cross-sell block." - ); - - $productItem->clickAddToCart(); + $this->checkoutCart->getCrosssellBlock()->getProductItem($product)->clickAddToCart(); if ($this->cmsIndex->getTitleBlock()->getTitle() == $product->getName()) { $this->catalogProductView->getViewBlock()->addToCart($product); } + $this->checkoutCart->getMessagesBlock()->waitSuccessMessage(); } /** - * Assert that correctly display cross-sell section. + * Assert that cross-sell products section is absent. + * + * @return void + */ + protected function assertAbsentCrossSellSection() + { + \PHPUnit_Framework_Assert::assertFalse( + $this->checkoutCart->getCrosssellBlock()->isVisible(), + "Cross-sell block is present." + ); + } + + /** + * Assert that cross-sell products section is displayed correctly. * * @param array $promotedProductNames * @return void */ protected function assertCrossSellSection(array $promotedProductNames) { - $promotedProducts = []; + $productNames = []; + $pageProductNames = []; foreach ($promotedProductNames as $promotedProductName) { - $promotedProducts[] = $this->products[$promotedProductName]; + $productNames[] = $this->products[$promotedProductName]->getName(); + } + foreach ($this->checkoutCart->getCrosssellBlock()->getProducts() as $productItem) { + $pageProductNames[] = $productItem->getProductName(); } - $this->assertProductCrossSellSection->processAssert($this->checkoutCart, $promotedProducts); + sort($productNames); + sort($pageProductNames); + \PHPUnit_Framework_Assert::assertEquals( + $productNames, + $pageProductNames, + 'Wrong products are displayed in cross-sell section.' + ); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv index 29896c717c8c8..b4b305ec3bfb4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv @@ -1,2 +1,2 @@ -"products";"promotedProducts";"steps";"assert";"tag" +"products";"promotedProducts";"navigateProductsOrder";"productsToVerify";"tag" "simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php index aa0ed1055b387..4779a5f916014 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php @@ -22,7 +22,7 @@ * 3. Verify checkout cart. * * @ZephyrId MAGETWO-12392 - * @group Cross-sells_(MX) + * @group Related_Products_(MX) */ class NavigateRelatedProductsTest extends AbstractProductPromotedProductsTest { @@ -32,6 +32,13 @@ class NavigateRelatedProductsTest extends AbstractProductPromotedProductsTest const DOMAIN = 'MX'; /* end tags */ + /** + * Products to verify. + * + * @var array + */ + protected $productsToVerify; + /** * Selectable data of products. * @@ -52,8 +59,8 @@ class NavigateRelatedProductsTest extends AbstractProductPromotedProductsTest * @param string $products * @param string $selectable * @param string $promotedProducts - * @param string $steps - * @param string $assert + * @param string $navigateProductsOrder + * @param string $productsToVerify * @param CheckoutCart $checkoutCart * @return void */ @@ -61,8 +68,8 @@ public function test( $products, $selectable, $promotedProducts, - $steps, - $assert, + $navigateProductsOrder, + $productsToVerify, CheckoutCart $checkoutCart ) { // Preconditions @@ -70,50 +77,31 @@ public function test( $this->assignPromotedProducts($promotedProducts, 'related_products'); $this->parseSelectable($selectable); - // Steps + // Initialization $this->checkoutCart = $checkoutCart; - $steps = $this->parseSteps($steps); - $assert = $this->parseAssert($assert); - $initialProductName = array_shift($steps); + $this->productsToVerify = $this->parseProductsToVerify($productsToVerify); + $navigateProductsOrder = $this->parseNavigateProductsOrder($navigateProductsOrder); + $initialProductName = array_shift($navigateProductsOrder); $initialProduct = $this->products[$initialProductName]; - $initialAssert = $assert[$initialProductName]; - $lastProductName = end($steps); + $lastProductName = end($navigateProductsOrder); $lastProduct = $this->products[$lastProductName]; - $lastAssert = $assert[$lastProductName]; - $checkoutProducts = []; + // Steps // Clear shopping cart $this->checkoutCart->open(); $this->checkoutCart->getCartBlock()->clearShoppingCart(); // Navigate through related products $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); - $this->assertRelatedSection($initialAssert); - foreach ($steps as $productName) { - $product = $this->products[$productName]; - $productAssert = $assert[$productName]; - - $this->catalogProductView->getRelatedProductBlock()->getProductItem($product)->open(); - if (empty($productAssert)) { - $this->assertAbsentRelatedSellSection(); - } else { - $this->assertRelatedSection($productAssert); - } + $this->assertRelatedSection($initialProductName); + foreach ($navigateProductsOrder as $productShortName) { + $this->navigate($productShortName); } // Add last product with related product to cart and verify - foreach ($lastAssert as $relatedProductName) { - $relatedProduct = $this->products[$relatedProductName]; - $isSelect = $this->selectable[$relatedProductName]; - - if ('yes' == $isSelect) { - $checkoutProducts[] = $relatedProduct; - $this->catalogProductView->getRelatedProductBlock()->getProductItem($relatedProduct)->select(); - } - } + $checkoutProducts = $this->selectRelatedProducts($lastProductName); $checkoutProducts[] = $lastProduct; $this->catalogProductView->getViewBlock()->addToCart($lastProduct); - $this->assertCheckoutCart($checkoutProducts); } @@ -134,7 +122,66 @@ protected function parseSelectable($selectable) } /** - * Assert that absent related products section. + * Return related products to verify for specified product. + * + * @param string $product + * @return InjectableFixture[] + */ + protected function getProductsToVerify($product) + { + $shortNames = $this->productsToVerify[$product]; + $products = []; + + foreach ($shortNames as $shortName) { + $products[$shortName] = $this->products[$shortName]; + } + + return $products; + } + + /** + * Open product in related products section and verify her promoted products. + * + * @param string $productShortName + * @return void + */ + protected function navigate($productShortName) + { + $product = $this->products[$productShortName]; + $this->catalogProductView->getRelatedProductBlock()->getProductItem($product)->open(); + + if (empty($this->productsToVerify[$productShortName])) { + $this->assertAbsentRelatedSellSection(); + } else { + $this->assertRelatedSection($productShortName); + } + } + + /** + * Select related products for specified product. + * + * @param string $product + * @return InjectableFixture[] + */ + protected function selectRelatedProducts($product) + { + $selected = []; + + foreach ($this->productsToVerify[$product] as $productShortName) { + $productToVerify = $this->products[$productShortName]; + $isSelect = $this->selectable[$productShortName]; + + if ('yes' == $isSelect) { + $this->catalogProductView->getRelatedProductBlock()->getProductItem($productToVerify)->select(); + $selected[] = $productToVerify; + } + } + + return $selected; + } + + /** + * Assert that related products section is absent. * * @return void */ @@ -147,19 +194,20 @@ protected function assertAbsentRelatedSellSection() } /** - * Assert that correctly display related products section. + * Assert that related products section is displayed correctly. * - * @param array $promotedProductNames + * @param string $product * @return void */ - protected function assertRelatedSection(array $promotedProductNames) + protected function assertRelatedSection($product) { + $productsToVerify = $this->getProductsToVerify($product); $fixtureData = []; $pageData = []; - foreach ($promotedProductNames as $promotedProductName) { - $productName = $this->products[$promotedProductName]->getName(); - $fixtureData[$productName] = $this->selectable[$promotedProductName]; + foreach ($productsToVerify as $shortName => $product) { + $productName = $product->getName(); + $fixtureData[$productName] = $this->selectable[$shortName]; } foreach ($this->catalogProductView->getRelatedProductBlock()->getProducts() as $productItem) { $pageProductName = $productItem->getProductName(); @@ -168,7 +216,11 @@ protected function assertRelatedSection(array $promotedProductNames) asort($fixtureData); asort($pageData); - \PHPUnit_Framework_Assert::assertEquals($pageData, $fixtureData, 'Wrong display related section.'); + \PHPUnit_Framework_Assert::assertEquals( + $pageData, + $fixtureData, + 'Wrong products are displayed in related section.' + ); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv index 37a382111726f..58efbf82ddef0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv @@ -1,2 +1,2 @@ -"products";"selectable";"promotedProducts";"steps";"assert";"tag" +"products";"selectable";"promotedProducts";"navigateProductsOrder";"productsToVerify";"tag" "simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:yes,simple2:yes,config1:no";"simple1:simple2,config1;config1:simple2";"simple1,config1";"simple1:simple2,config1;config1:simple2";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php index f6f943e7d3020..b5d12d96c0d2b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php @@ -18,8 +18,8 @@ * Steps: * 1. Navigate through up-sell products. * - * @ZephirId MAGETWO-1239 - * @group Cross-sells_(MX) + * @ZephirId MAGETWO-12391 + * @group Up-sells_(MX) */ class NavigateUpSellProductsTest extends AbstractProductPromotedProductsTest { @@ -29,38 +29,38 @@ class NavigateUpSellProductsTest extends AbstractProductPromotedProductsTest const DOMAIN = 'MX'; /* end tags */ - /** * Run test navigate up-sell products. * * @param string $products * @param string $promotedProducts - * @param string $steps - * @param string $assert + * @param string $navigateProductsOrder + * @param string $productsToVerify * @return void */ public function test( $products, $promotedProducts, - $steps, - $assert + $navigateProductsOrder, + $productsToVerify ) { // Preconditions $this->createProducts($products); $this->assignPromotedProducts($promotedProducts, 'up_sell_products'); - // Steps - $steps = $this->parseSteps($steps); - $assert = $this->parseAssert($assert); - $initialProductName = array_shift($steps); + // Initialization + $navigateProductsOrder = $this->parseNavigateProductsOrder($navigateProductsOrder); + $productsToVerify = $this->parseProductsToVerify($productsToVerify); + $initialProductName = array_shift($navigateProductsOrder); $initialProduct = $this->products[$initialProductName]; - $initialAssert = $assert[$initialProductName]; + $initialProductsToVerify = $productsToVerify[$initialProductName]; + // Steps $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); - $this->assertUpSellSection($initialAssert); - foreach ($steps as $productName) { + $this->assertUpSellSection($initialProductsToVerify); + foreach ($navigateProductsOrder as $productName) { $product = $this->products[$productName]; - $productAssert = $assert[$productName]; + $productAssert = $productsToVerify[$productName]; $this->catalogProductView->getUpsellBlock()->getProductItem($product)->open(); if (empty($productAssert)) { @@ -72,7 +72,7 @@ public function test( } /** - * Assert that absent up-sell section. + * Assert that up-sell products section is absent. * * @return void */ @@ -85,7 +85,7 @@ protected function assertAbsentUpSellSection() } /** - * Assert that correctly display up-sell section. + * Assert that up-sell products section is displayed correctly. * * @param array $promotedProductNames * @return void @@ -104,6 +104,10 @@ protected function assertUpSellSection(array $promotedProductNames) sort($productNames); sort($pageProductNames); - \PHPUnit_Framework_Assert::assertEquals($productNames, $pageProductNames, 'Wrong display up-sell section.'); + \PHPUnit_Framework_Assert::assertEquals( + $productNames, + $pageProductNames, + 'Wrong products are displayed in up-sell section.' + ); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv index 29896c717c8c8..b4b305ec3bfb4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv @@ -1,2 +1,2 @@ -"products";"promotedProducts";"steps";"assert";"tag" +"products";"promotedProducts";"navigateProductsOrder";"productsToVerify";"tag" "simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" From 4e39ad9ffea97370c2ef2373af21a21564730e80 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Wed, 4 Feb 2015 18:40:38 +0200 Subject: [PATCH 18/50] MTA-552: Re-factor Test for Create Product with New Category --- .../Product/Attribute/AttributeForm.php | 29 ++- .../Product/Edit/Tab/ProductDetails.php | 7 - .../Edit/Tab/ProductDetails/CategoryIds.php | 1 - .../Tab/ProductDetails/NewCategoryIds.php | 103 +++++++++ .../Block/Adminhtml/Product/ProductForm.php | 125 +++------- .../Test/Constraint/AssertProductForm.php | 12 + .../CatalogProductSimple/CategoryIds.php | 4 +- .../testCreate.csv | 47 ++-- .../Product/CreateSimpleWithCategoryTest.php | 111 --------- .../Edit/Tab/Super/Config/Attribute.php | 6 +- .../Block/Adminhtml/Product/ProductForm.php | 7 - .../ConfigurableAttributesData.php | 54 ++++- .../test.csv | 11 +- .../Test/TestCase/CreateWithAttributeTest.php | 214 ------------------ 14 files changed, 262 insertions(+), 469 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCategoryTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php index 75a6c1b1c8958..36d0851d515b9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php @@ -8,10 +8,14 @@ use Magento\Backend\Test\Block\Widget\Tab; use Magento\Backend\Test\Block\Widget\FormTabs; +use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Block\BlockFactory; +use Magento\Mtf\Block\Mapper; +use Magento\Mtf\Util\XmlConverter; /** * Edit attribute form on catalog product edit page. @@ -32,6 +36,28 @@ class AttributeForm extends FormTabs */ protected $saveButton = '#save'; + /** + * @constructor + * @param SimpleElement $element + * @param Mapper $mapper + * @param BlockFactory $blockFactory + * @param BrowserInterface $browser + * @param XmlConverter $xmlConverter + * @param array $config + */ + public function __construct( + SimpleElement $element, + Mapper $mapper, + BlockFactory $blockFactory, + BrowserInterface $browser, + XmlConverter $xmlConverter, + array $config = [] + ) + { + parent::__construct($element, $mapper, $blockFactory, $browser, $xmlConverter, $config); + $this->browser->switchToFrame(new Locator($this->iFrame)); + } + /** * Fill the attribute form. * @@ -41,7 +67,6 @@ class AttributeForm extends FormTabs */ public function fill(FixtureInterface $fixture, SimpleElement $element = null) { - $this->browser->switchToFrame(new Locator($this->iFrame)); $browser = $this->browser; $selector = $this->saveButton; $this->browser->waitUntil( @@ -65,8 +90,6 @@ public function openTab($tabName) ? $this->tabs[$tabName]['strategy'] : Locator::SELECTOR_CSS; $tab = $this->_rootElement->find($selector, $strategy); - $target = $this->browser->find('.page-footer-wrapper'); // Handle menu overlap problem - $this->_rootElement->dragAndDrop($target); $tab->click(); return $this; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php index 546719a20d459..86573add5c02c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php @@ -38,13 +38,6 @@ class ProductDetails extends \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ public function fillFormTab(array $fields, SimpleElement $element = null) { $data = $this->dataMapping($fields); - - if (isset($data['category_ids'])) { - /* Fix browser behavior for click by hidden list result of suggest(category) element */ - $this->scrollToCategory(); - $this->_fill([$data['category_ids']], $element); - unset($data['category_ids']); - } $this->_fill($data, $element); return $this; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php index 0e45e4c6cdd83..4806e3eee6398 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; -use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\Element\MultisuggestElement; /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php new file mode 100644 index 0000000000000..ac1175405f9d6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php @@ -0,0 +1,103 @@ +getName(); + $parentCategory = $fixture->getDataFieldConfig('parent_id')['source']->getParentCategory()->getName(); + + $this->openNewCategoryDialog(); + $this->_rootElement->find( + $this->createCategoryDialog . $this->fieldNewCategoryName, + Locator::SELECTOR_XPATH + )->setValue($categoryName); + + $this->selectParentCategory($parentCategory); + + $buttonCreateCategory = $this->createCategoryDialog . $this->createCategoryButton; + $this->_rootElement->find($buttonCreateCategory, Locator::SELECTOR_XPATH)->click(); + $this->waitForElementNotVisible($buttonCreateCategory, Locator::SELECTOR_XPATH); + } + + /** + * Select parent category for new one. + * + * @param string $categoryName + * @return void + */ + protected function selectParentCategory($categoryName) + { + $this->_rootElement->find( + $this->createCategoryDialog . $this->parentCategoryBlock, + Locator::SELECTOR_XPATH, + '\Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\ParentCategoryIds' + )->setValue($categoryName); + } + + /** + * Open new category dialog. + * + * @return void + */ + protected function openNewCategoryDialog() + { + $this->_rootElement->find($this->buttonNewCategory)->click(); + $this->waitForElementVisible($this->createCategoryDialog, Locator::SELECTOR_XPATH); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 51df922610d91..ffd388ed52e30 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -13,12 +13,11 @@ use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab; -use Magento\Catalog\Test\Fixture\Product; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\DataFixture; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; +use Magento\Catalog\Test\Fixture\Category; /** * Product form on backend product page. @@ -60,41 +59,6 @@ class ProductForm extends FormTabs */ protected $customTab = './/*/a[contains(@id,"product_info_tabs_%s")]'; - /** - * Button "New Category". - * - * @var string - */ - protected $buttonNewCategory = '#add_category_button'; - - /** - * Dialog box "Create Category". - * - * @var string - */ - protected $createCategoryDialog = './/ancestor::body//*[contains(@class,"mage-new-category-dialog")]'; - - /** - * "Parent Category" block on dialog box. - * - * @var string - */ - protected $parentCategoryBlock = '//*[contains(@class,"field-new_category_parent")]'; - - /** - * Field "Category Name" on dialog box. - * - * @var string - */ - protected $fieldNewCategoryName = '//input[@id="new_category_name"]'; - - /** - * Button "Create Category" on dialog box. - * - * @var string - */ - protected $createCategoryButton = '//button[contains(@class,"action-create")]'; - /** * Tabs title css selector. * @@ -148,14 +112,6 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } else { $tabs = $this->getFieldsByTabs($product); - if (null === $category && $product instanceof DataFixture) { - $categories = $product->getCategories(); - $category = reset($categories); - } - if ($category) { - $tabs['product-details']['category_ids']['value'] = $category->getName(); - } - $this->showAdvancedSettings(); $this->fillTabs($tabs, $element); @@ -164,9 +120,40 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } } + $category = $product->hasData('category_ids') + ? $product->getDataFieldConfig('category_ids')['source']->getCategories() + : [$category]; + if ($category[0]) { + $this->fillCategory($category, $element); + } + return $this; } + /** + * Fill category data from product fixture. + * + * @param array|null $categoryList + * @param SimpleElement|null $element + * @return void + */ + public function fillCategory($categoryList, $element) + { + /** @var Category $category */ + foreach ($categoryList as $category) { + if ($category->hasData('id')) { + $tabs['product-details']['category_ids']['value'] = $category->getName(); + $this->fillTabs($tabs, $element); + } else { + $this->openTab('product-details'); + $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\NewCategoryIds', + ['element' => $this->browser->find('body')] + )->addNewCategory($category); + } + } + } + /** * Create custom attribute. * @@ -226,43 +213,6 @@ public function openTab($tabName) return parent::openTab($tabName); } - /** - * Save new category. - * - * @param Product $fixture - * @return void - */ - public function addNewCategory(Product $fixture) - { - $this->openTab('product-details'); - $this->openNewCategoryDialog(); - $this->_rootElement->find( - $this->createCategoryDialog . $this->fieldNewCategoryName, - Locator::SELECTOR_XPATH - )->setValue($fixture->getNewCategoryName()); - - $this->clearCategorySelect(); - $this->selectParentCategory(); - - $buttonCreateCategory = $this->createCategoryDialog . $this->createCategoryButton; - $this->_rootElement->find($buttonCreateCategory, Locator::SELECTOR_XPATH)->click(); - $this->waitForElementNotVisible($buttonCreateCategory, Locator::SELECTOR_XPATH); - } - - /** - * Select parent category for new one. - * - * @return void - */ - protected function selectParentCategory() - { - $this->_rootElement->find( - $this->createCategoryDialog . $this->parentCategoryBlock, - Locator::SELECTOR_XPATH, - '\Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\ParentCategoryIds' - )->setValue('Default Category'); - } - /** * Clear category field. * @@ -276,17 +226,6 @@ public function clearCategorySelect() } } - /** - * Open new category dialog. - * - * @return void - */ - protected function openNewCategoryDialog() - { - $this->_rootElement->find($this->buttonNewCategory)->click(); - $this->waitForElementVisible($this->createCategoryDialog, Locator::SELECTOR_XPATH); - } - /** * Check visibility of the attribute on the product page. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index e10767e1eb658..78ec7a5753693 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -30,6 +30,18 @@ class AssertProductForm extends AbstractAssertForm 'checkout_data', ]; + /** + * Skipped fields for verify data. + * + * @var array + */ + protected $skippedFields = [ + 'is_searchable', + 'is_visible_in_advanced_search', + 'is_filterable', + 'is_filterable_in_search', + ]; + /** * Sort fields for fixture and form data * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index cf59c0bc7a19c..ef37aeabca27c 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -58,7 +58,9 @@ public function __construct( $presets = explode(',', $data['presets']); foreach ($presets as $preset) { $category = $fixtureFactory->createByCode('category', ['dataSet' => $preset]); - $category->persist(); + if ($data['persist'] !== 'no') { + $category->persist(); + } /** @var Category $category */ $this->data[] = $category->getName(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index a1690213e37f5..e9e4c5889d0f7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,23 +1,24 @@ -"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" -"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" -"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" -"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" -"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" -"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" -"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" -"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" -"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" -"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" -"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" -"Create product with cross-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" -"Create product with up-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" -"Create product with related products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" -"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" +"description";"configData";"product/data/category_ids/persist";"product/data/category_ids/presets";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" +"Create product with custom options(fixed price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with custom options(percent price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(fixed price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(percent price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(percent price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(fixed price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(percent price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(fixed price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product without custom options";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" +"Create product that is in stock";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" +"Create product that is out stock";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" +"Create product that visible only in search";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" +"Create simple product and check search by sku";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" +"Create simple product and check visibility in category";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Create product with tax class and group price";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Create product with tax class and check absent special price";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Create product without tax class and tier price";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" +"Create product wit suite of custom options";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" +"Create product with cross-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" +"Create product with up-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" +"Create product with related products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" +"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" +"MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)";"-";"no";"default_subcategory";"simple%isolation%";"simple%isolation%";"simple%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory, assertProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCategoryTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCategoryTest.php deleted file mode 100644 index 01f3fecddcaa5..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCategoryTest.php +++ /dev/null @@ -1,111 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Test product create - * - * @ZephyrId MAGETWO-13345 - * @return void - */ - public function testCreateProduct() - { - //Data - $product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $product->switchData('simple_with_new_category'); - - //Page & Blocks - $productListPage = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $addProductBlock = $productListPage->getGridPageActionBlock(); - $productForm = $createProductPage->getProductForm(); - - //Steps - $productListPage->open(); - $addProductBlock->addProduct(); - $productForm->fill($product); - $productForm->addNewCategory($product); - $createProductPage->getFormPageActions()->save(); - - //Verifying - $this->assertSuccessMessage("You saved the product."); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verifying - $this->assertProductOnFrontend($product); - } - - /** - * Assert success message - * - * @param string $messageText - */ - protected function assertSuccessMessage($messageText) - { - $productEditPage = Factory::getPageFactory()->getCatalogProductEdit(); - $messageBlock = $productEditPage->getMessagesBlock(); - $this->assertContains( - $messageText, - $messageBlock->getSuccessMessages(), - sprintf('Message "%s" is not appear.', $messageText) - ); - } - - /** - * Assert simple product on Frontend - * - * @param SimpleProduct $product - * @return void - */ - protected function assertProductOnFrontend(SimpleProduct $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getNewCategoryName()); - - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue( - $productListBlock->isProductVisible($product->getName()), - 'Product is absent on category page.' - ); - - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $productListBlock->openProductViewPage($product->getName()); - $this->assertEquals($product->getName(), $productViewBlock->getProductName()); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals(number_format($product->getProductPrice(), 2), $price); - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php index eecdf4f31ddbf..2c68d8e6fe403 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php @@ -6,6 +6,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config; +use Magento\Mtf\ObjectManager; use Magento\Mtf\Client\Locator; use Magento\Backend\Test\Block\Widget\Form; use Magento\Mtf\Client\Element\SimpleElement; @@ -159,7 +160,6 @@ public function fillAttributes(array $attributes) protected function createNewVariationSet(array $attribute) { $this->_rootElement->find($this->createNewVariationSet)->click(); - $this->browser->switchToFrame(new Locator($this->newAttributeFrame)); $newAttribute = $this->getEditAttributeForm(); $newAttribute->getTabElement('properties')->fillFormTab($attribute); @@ -268,12 +268,12 @@ protected function isVisibleOption(SimpleElement $attributeBlock, $number) /** * Get attribute form block * - * @return \Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\Edit\AttributeForm + * @return \Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\AttributeForm */ protected function getEditAttributeForm() { return $this->blockFactory->create( - 'Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\Edit\AttributeForm', + 'Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\AttributeForm', ['element' => $this->browser->find($this->newAttribute)] ); } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php index 7a666e370751a..7e2661c952954 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php @@ -34,13 +34,6 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F if ($product instanceof DataFixture) { $tabs = $this->normalizeDeprecateData($tabs); - $category = ($category === null) ? $product->getCategories()['category'] : $category; - } - - if ($category) { - $tabs['product-details']['category_ids']['value'] = ($category instanceof InjectableFixture) - ? $category->getName() - : $category->getCategoryName(); } $this->showAdvancedSettings(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php index fe5d1888b21e5..9a6448657e2fd 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php @@ -288,6 +288,53 @@ class ConfigurableAttributesData implements FixtureInterface ], ], + 'two_searchable_options' => [ + 'attributes_data' => [ + 'attribute_key_0' => [ + 'frontend_label' => 'two_searchable_options_%isolation%', + 'frontend_input' => 'Dropdown', + 'label' => 'two_searchable_options_%isolation%', + 'is_required' => 'No', + 'is_searchable' => 'Yes', + 'is_visible_in_advanced_search' => 'Yes', + 'is_filterable' => 'Filterable (with results)', + 'is_filterable_in_search' => 'Yes', + 'options' => [ + 'option_key_0' => [ + 'label' => 'option_key_1_%isolation%', + 'pricing_value' => 1, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + 'option_key_1' => [ + 'label' => 'option_key_2_%isolation%', + 'pricing_value' => 2, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + ], + ], + ], + 'attributes' => [], + 'products' => [], + 'matrix' => [ + 'attribute_key_0:option_key_0' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 100, + ], + 'weight' => 1, + ], + 'attribute_key_0:option_key_1' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 100, + ], + 'weight' => 2, + ], + ], + ], + 'one_new_options' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -827,7 +874,8 @@ protected function prepareVariationsMatrix(array $data) 'quantity_and_stock_status' => [ 'qty' => 10, ], - ] + ], + $row ); } @@ -892,6 +940,10 @@ protected function prepareData() 'frontend_input', 'attribute_code', 'attribute_id', + 'is_searchable', + 'is_visible_in_advanced_search', + 'is_filterable', + 'is_filterable_in_search', 'is_required', 'options', ]; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv index c282092f255db..abf2fc6d58b54 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv @@ -1,5 +1,6 @@ -"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"issue" -"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" -"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" -"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage";"" -"configurable-product-%isolation%";"two_options_with_assigned_product";"two_options_with_assigned_product";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" +"description";"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/persist";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"tag" +"Configurable product with two new options";"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" +"Configurable product with two options";"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" +"Configurable product with two new options and special price";"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage";"" +"Configurable product with two options and assigned product";"configurable-product-%isolation%";"two_options_with_assigned_product";"two_options_with_assigned_product";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" +"MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)";"-";"two_searchable_options";"-";"Configurable Product %isolation%";"-";"-";"100";"-";"no";"default_subcategory";"-";"-";"-";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php deleted file mode 100644 index 6d3a0ebdd9db0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php +++ /dev/null @@ -1,214 +0,0 @@ -getMagentoCatalogSimpleProduct(); - $product->switchData('simple_with_new_category'); - - $attribute = Factory::getFixtureFactory()->getMagentoCatalogProductAttribute(); - $attribute->switchData('new_attribute'); - - $variations = Factory::getFixtureFactory()->getMagentoConfigurableProductConfigurableProduct(); - $variations->switchData('product_variations'); - $variations->provideNewAttributeData($attribute); - - //Steps - $this->fillSimpleProductWithNewCategory($product); - $this->addNewAttribute($attribute); - $this->fillProductVariationsAndSave($variations); - - //Verifying - $this->assertProductSaved(); - $this->assertOnGrid($product); - $this->assertOnFrontend($product, $variations); - } - - /** - * Fill required fields for simple product with category creation - * - * @param Product $product - * @return void - */ - protected function fillSimpleProductWithNewCategory(Product $product) - { - //Page & Blocks - $manageProductsGrid = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - $productForm = $createProductPage->getProductForm(); - - //Steps - $manageProductsGrid->open(); - $manageProductsGrid->getGridPageActionBlock()->addProduct(); - $productForm->fill($product); - $productForm->openTab(Product::GROUP_PRODUCT_DETAILS); - $productForm->addNewCategory($product); - } - - /** - * Add new attribute to product - * - * @param ProductAttribute $attribute - * @return void - */ - protected function addNewAttribute(ProductAttribute $attribute) - { - $attributeData = $attribute->getData(); - $attributeFields = []; - foreach ($attributeData['fields'] as $name => $field) { - $attributeFields[$name] = $field['value']; - } - $attributeFields['options'] = $attributeData['options']['value']; - - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - $productForm->openTab('variations'); - - /** @var \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config $variations */ - $variations = $productForm->getTabElement('variations'); - $variations->showContent(); - $variations->getAttributeBlock()->fillAttributes([$attributeFields]); - } - - /** - * Fill product variations and save product - * - * @param ConfigurableProduct $variations - * @return void - */ - protected function fillProductVariationsAndSave(ConfigurableProduct $variations) - { - $variationsData = $variations->getData(); - $matrix = []; - foreach ($variationsData['fields']['variations-matrix']['value'] as $variation) { - $matrix[] = [ - 'quantity_and_stock_status' => [ - 'qty' => $variation['value']['qty']['value'], - ], - ]; - } - - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - $productForm->openTab('variations'); - - /** @var \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config $variationsTab */ - $variationsTab = $productForm->getTabElement('variations'); - $variationsTab->generateVariations(); - $variationsTab->getVariationsBlock()->fillVariations($matrix); - - $createProductPage->getFormPageActions()->save($variations); - } - - /** - * Assert product was saved - * - * @return void - */ - protected function assertProductSaved() - { - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $this->assertEquals( - 'You saved the product.', - $createProductPage->getMessagesBlock()->getSuccessMessages(), - 'Product was not saved' - ); - } - - /** - * Assert existing product on backend product grid - * - * @param Product $product - * @return void - */ - protected function assertOnGrid(Product $product) - { - $configurableSearch = [ - 'sku' => $product->getSku(), - 'type' => 'Configurable Product', - ]; - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible($configurableSearch), 'Configurable product was not found.'); - } - - /** - * Assert configurable product on frontend - * - * @param Product $product - * @param ConfigurableProduct $variations - * @return void - */ - protected function assertOnFrontend(Product $product, ConfigurableProduct $variations) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getNewCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue( - $productListBlock->isProductVisible($product->getName()), - 'Product is absent on category page.' - ); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $productListBlock->openProductViewPage($product->getName()); - $this->assertEquals( - $product->getName(), - $productViewBlock->getProductName(), - 'Product name does not correspond to specified.' - ); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals( - number_format($product->getProductPrice(), 2), - $price, - 'Product price does not correspond to specified.' - ); - - $pageOptions = $productViewBlock->getOptions($variations); - $configurableOptions = []; - foreach ($pageOptions['configurable_options'] as $attribute) { - $configurableOption = []; - foreach ($attribute['options'] as $option) { - $configurableOption[] = $option['title']; - } - - $configurableOptions[$attribute['title']] = $configurableOption; - } - $this->assertEquals($variations->getConfigurableOptions(), $configurableOptions); - } -} From 53717c8a574e22aa84f4f1074da95033e2cb0f3e Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Thu, 5 Feb 2015 11:21:08 +0200 Subject: [PATCH 19/50] MTA-1499: Analyse functional test failures --- .../Client/Element/OptgroupselectElement.php | 40 ++++++++++++++---- .../Test/Fixture/BundleProduct/Price.php | 2 + .../Test/Block/AbstractConfigureBlock.php | 2 +- .../Product/Attribute/AttributeForm.php | 16 ++++++-- .../Product/Attribute/AttributeForm.xml | 2 +- .../Product/Attribute/Edit/AttributeForm.php | 18 ++++---- .../Adminhtml/Product/Edit/Tab/Options.php | 13 +++--- .../Product/Edit/Tab/ProductDetails.php | 8 +++- .../Edit/Tab/ProductDetails/AttributeSet.php | 15 +++++++ .../Block/Adminhtml/Product/ProductForm.xml | 2 +- .../Test/Block/Product/View/CustomOptions.php | 18 ++++++-- .../AssertProductAttributeIsFilterable.php | 34 --------------- ...ssertProductCustomOptionsOnProductPage.php | 20 ++++----- .../CatalogProductAttribute/Options.php | 4 ++ .../CatalogProductSimple/CustomAttribute.php | 13 ++++-- .../CatalogProductSimple/CustomOptions.php | 41 +++++++++---------- .../Handler/CatalogProductSimple/Curl.php | 7 ++-- .../test.csv | 2 +- .../CreateProductAttributeEntityTest.php | 4 +- .../testCreateProductAttribute.csv | 20 ++++----- .../AddAttributeToProductTemplateStep.php | 1 - .../Test/Block/Advanced/Form.php | 2 +- .../DownloadableProductInjectable.xml | 6 +++ .../CustomerReviewReportEntityTest.php | 6 +-- ...CartFromCustomerWishlistOnFrontendTest.php | 8 ++-- 25 files changed, 175 insertions(+), 129 deletions(-) diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php index 5145f7575cac7..7d8d230174032 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php @@ -9,42 +9,62 @@ use Magento\Mtf\Client\Locator; /** - * Class OptgroupselectElement - * Typified element class for option group selectors + * Typified element class for option group selectors. */ class OptgroupselectElement extends SelectElement { /** - * Option locator + * Option locator. * * @var string */ - protected $optionByIndex = './/optgroup/option[%d]'; + protected $optionByIndex = './/option'; /** - * Option group selector + * Option group selector. * * @var string */ protected $optGroup = 'optgroup[option[contains(.,"%s")]]'; /** - * Get the value of form element + * Option group locator. + * + * @var string + */ + protected $optionGroupValue = ".//optgroup[@label = '%s']/option[text() = '%s']"; + + /** + * Get the value of form element. * * @return string + * @throws \Exception */ public function getValue() { $this->eventManager->dispatchEvent(['get_value'], [(string)$this->getAbsoluteSelector()]); - $selectedLabel = trim(parent::getValue()); + + $selectedLabel = ''; + $labels = $this->getElements($this->optionByIndex, Locator::SELECTOR_XPATH); + foreach ($labels as $label) { + if ($label->isSelected()) { + $selectedLabel = $label->getText(); + break; + } + } + if ($selectedLabel == '') { + throw new \Exception('Selected value has not been found in optgroup select.'); + } + $element = $this->find(sprintf($this->optGroup, $selectedLabel), Locator::SELECTOR_XPATH); $value = trim($element->getAttribute('label'), chr(0xC2) . chr(0xA0)); $value .= '/' . $selectedLabel; + return $value; } /** - * Select value in dropdown which has option groups + * Select value in dropdown which has option groups. * * @param string $value * @return void @@ -53,6 +73,8 @@ public function setValue($value) { $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); list($group, $option) = explode('/', $value); - parent::setOptionGroupValue($group, $option); + $xpath = sprintf($this->optionGroupValue, $group, $option); + $option = $this->find($xpath, Locator::SELECTOR_XPATH); + $option->click(); } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php index 1de9d3fdbaa56..64ccd97a2b841 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php @@ -92,6 +92,8 @@ public function getDataConfig() * Get preset array * * @return array|null + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function getPreset() { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php index 148e06c61fa1e..7827342b75979 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php @@ -97,7 +97,7 @@ protected function prepareCheckoutData(array $options, array $checkoutData) if (isset($options[$attribute])) { $result[] = [ - 'type' => strtolower(preg_replace('/[^a-z]/i', '', $options[$attribute]['type'])), + 'type' => $options[$attribute]['type'], 'title' => isset($options[$attribute]['title']) ? $options[$attribute]['title'] : $attribute, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php index 75a6c1b1c8958..2427b600546da 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php @@ -32,6 +32,13 @@ class AttributeForm extends FormTabs */ protected $saveButton = '#save'; + /** + * Attribute to determine whether tab is opened. + * + * @var string + */ + protected $isTabOpened = '.opened '; + /** * Fill the attribute form. * @@ -64,10 +71,11 @@ public function openTab($tabName) $strategy = isset($this->tabs[$tabName]['strategy']) ? $this->tabs[$tabName]['strategy'] : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $target = $this->browser->find('.page-footer-wrapper'); // Handle menu overlap problem - $this->_rootElement->dragAndDrop($target); - $tab->click(); + + $isTabOpened = $this->_rootElement->find($this->isTabOpened . $selector, $strategy); + if (!$isTabOpened->isVisible()) { + $this->_rootElement->find($selector, $strategy)->click(); + } return $this; } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.xml index 2bdcc112ebcaf..6c4f14ee43bfb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.xml @@ -28,7 +28,7 @@ - \Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced + \Magento\Backend\Test\Block\Widget\Tab [data-target="#advanced_fieldset-content"] css selector diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php index 0a3a1b52f4a50..b93210777488c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php @@ -33,6 +33,13 @@ class AttributeForm extends FormTabs */ protected $propertiesTab = '#product_attribute_tabs_main'; + /** + * Page title. + * + * @var string + */ + protected $pageTitle = '.page-title .title'; + /** * Get data of the tabs. * @@ -94,15 +101,8 @@ protected function expandAllToggles() */ public function openTab($tabName) { - $selector = $this->tabs[$tabName]['selector']; - $strategy = isset($this->tabs[$tabName]['strategy']) - ? $this->tabs[$tabName]['strategy'] - : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $target = $this->browser->find('.page-title .title');// Handle menu overlap problem - $this->_rootElement->dragAndDrop($target); - $tab->click(); - return $this; + $this->browser->find($this->pageTitle)->click(); // Handle menu overlap problem + return parent::openTab($tabName); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php index e1782ef6ca1f6..9219f363b747a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php @@ -204,16 +204,17 @@ protected function prepareCustomOptions(array $options) /** * Convert option name * - * @param string $str + * @param string $inputType * @return string */ - protected function optionNameConvert($str) + protected function optionNameConvert($inputType) { - $str = str_replace([' ', '&'], "", $str); - if ($end = strpos($str, '-')) { - $str = substr($str, 0, $end) . ucfirst(substr($str, ($end + 1))); + $option = substr($inputType, strpos($inputType, "/") + 1); + $option = str_replace([' ', '&'], "", $option); + if ($end = strpos($option, '-')) { + $option = substr($option, 0, $end) . ucfirst(substr($option, ($end + 1))); } - return $str; + return $option; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php index 546719a20d459..6cb8dc71ca05d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php @@ -38,13 +38,19 @@ class ProductDetails extends \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ public function fillFormTab(array $fields, SimpleElement $element = null) { $data = $this->dataMapping($fields); - + // Select attribute set + if (isset($data['attribute_set_id'])) { + $this->_fill([$data['attribute_set_id']], $element); + unset($data['attribute_set_id']); + } + // Select categories if (isset($data['category_ids'])) { /* Fix browser behavior for click by hidden list result of suggest(category) element */ $this->scrollToCategory(); $this->_fill([$data['category_ids']], $element); unset($data['category_ids']); } + $this->_fill($data, $element); return $this; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php index 56d6b46ed629a..93e96cf4e28eb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php @@ -28,6 +28,13 @@ class AttributeSet extends SuggestElement */ protected $actionToggle = '.action-toggle'; + /** + * Magento loader + * + * @var string + */ + protected $loader = '[data-role="loader"]'; + /** * Set value * @@ -40,6 +47,14 @@ public function setValue($value) $this->find($this->actionToggle)->click(); parent::setValue($value); } + // Wait loader + $element = $this->driver; + $selector = $this->loader; + $element->waitUntil( + function () use ($element, $selector) { + return $element->find($selector)->isVisible() == false ? true : null; + } + ); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index 10a1e931748ea..3ea93f0ab859b 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -162,7 +162,7 @@ .field [id$='_type'] css selector - strictselect + optgroupselect diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index ea07ff104aafa..313529e07980f 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -138,7 +138,7 @@ public function getOptions(FixtureInterface $product) /** @var SimpleElement $optionElement */ $optionElement = $listCustomOptions[$title]; - $typeMethod = preg_replace('/[^a-zA-Z]/', '', $option['type']); + $typeMethod = preg_replace('/[^a-zA-Z]/', '', $this->getOptionType($option['type'])); $getTypeData = 'get' . ucfirst(strtolower($typeMethod)) . 'Data'; $optionData = $this->$getTypeData($optionElement); @@ -423,7 +423,7 @@ protected function prepareOptions(array $options) $result = []; foreach ($options as $key => $option) { - switch ($option['type']) { + switch ($this->getOptionType($option['type'])) { case 'datetime': list($day, $month, $year, $hour, $minute, $dayPart) = explode('/', $option['value']); $option['value'] = [ @@ -472,7 +472,7 @@ protected function fillOptions(array $options) sprintf($this->optionByName, $option['title']), Locator::SELECTOR_XPATH ); - $type = $option['type']; + $type = $this->getOptionType($option['type']); $mapping = $this->dataMapping([$type => $option['value']]); if ('radiobuttons' == $type || 'checkbox' == $type) { @@ -486,4 +486,16 @@ protected function fillOptions(array $options) $this->_fill($mapping, $optionBlock); } } + + /** + * Get customer option type + * + * @param string $option + * @return string + */ + protected function getOptionType($option) + { + $option = substr($option, strpos($option, "/") + 1); + return strtolower(preg_replace('/[^a-z]/i', '', $option)); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php index bd3c2262147d1..2174ec7901e23 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php @@ -11,10 +11,7 @@ use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Catalog\Test\Fixture\CatalogProductAttribute; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Category\CatalogCategoryView; -use Magento\Catalog\Test\Block\Adminhtml\Product\ProductForm; /** * Check whether the attribute filter is displayed on the frontend in Layered navigation. @@ -32,8 +29,6 @@ class AssertProductAttributeIsFilterable extends AbstractConstraint * @param InjectableFixture $product * @param CatalogProductAttribute $attribute * @param CmsIndex $cmsIndex - * @param CatalogProductIndex $catalogProductIndex - * @param CatalogProductEdit $catalogProductEdit * @param FixtureFactory $fixtureFactory * @return void */ @@ -42,8 +37,6 @@ public function processAssert( InjectableFixture $product, CatalogProductAttribute $attribute, CmsIndex $cmsIndex, - CatalogProductIndex $catalogProductIndex, - CatalogProductEdit $catalogProductEdit, FixtureFactory $fixtureFactory ) { $fixtureFactory->createByCode( @@ -59,10 +52,6 @@ public function processAssert( ] )->persist(); - $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $productForm = $catalogProductEdit->getProductForm(); - $this->setDefaultAttributeValue($productForm, $attribute); - $catalogProductEdit->getFormPageActions()->save(); $cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() @@ -82,27 +71,4 @@ public function toString() { return 'Attribute is present in layered navigation on category page.'; } - - /** - * Set default attribute value. - * - * @param ProductForm $productForm - * @param CatalogProductAttribute $attribute - * @return void - */ - protected function setDefaultAttributeValue(ProductForm $productForm, CatalogProductAttribute $attribute) - { - $attributeData = $attribute->getData(); - if (isset($attributeData['options'])) { - foreach ($attributeData['options'] as $option) { - if ($option['is_default'] == 'Yes') { - $defaultValue = $option['admin']; - } - } - } else { - $field = preg_grep('@^default_value@', array_keys($attributeData)); - $defaultValue = $attributeData[array_shift($field)]; - } - $productForm->getAttributeElement($attribute)->setValue($defaultValue); - } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php index 7150626d7dcb9..f3b15be44d9cd 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php @@ -26,43 +26,43 @@ class AssertProductCustomOptionsOnProductPage extends AbstractAssertForm * @var array */ protected $skippedFieldOptions = [ - 'Field' => [ + 'Text/Field' => [ 'price_type', 'sku', ], - 'Area' => [ + 'Text/Area' => [ 'price_type', 'sku', ], - 'Drop-down' => [ + 'Select/Drop-down' => [ 'price_type', 'sku', ], - 'File' => [ + 'File/File' => [ 'price_type', 'sku', ], - 'Radio Buttons' => [ + 'Select/Radio Buttons' => [ 'price_type', 'sku', ], - 'Checkbox' => [ + 'Select/Checkbox' => [ 'price_type', 'sku', ], - 'Multiple Select' => [ + 'Select/Multiple Select' => [ 'price_type', 'sku', ], - 'Date' => [ + 'Date/Date' => [ 'price_type', 'sku', ], - 'Date & Time' => [ + 'Date/Date & Time' => [ 'price_type', 'sku', ], - 'Time' => [ + 'Date/Time' => [ 'price_type', 'sku', ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php index f05c63c30d733..e0a28bee41f49 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php @@ -93,6 +93,10 @@ protected function getPreset($name) 'view' => '', ], ], + 'two_options' => [ + ['admin' => 'black'], + ['admin' => 'white'], + ], ]; if (!isset($presets[$name])) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php index 024e8bc768069..49fb328876a9c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php @@ -58,6 +58,7 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data /** * Get default value of custom attribute considering to it's type. + * In case if default value isn't set for dropdown and multiselect return first option, for other types null. * * @param CatalogProductAttribute $attribute * @return string|null @@ -65,16 +66,22 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data protected function getDefaultAttributeValue(CatalogProductAttribute $attribute) { $data = $attribute->getData(); + $value = ''; if (isset($data['options'])) { foreach ($data['options'] as $option) { - if ($option['is_default'] == 'Yes') { - return $option['admin']; + if (isset($option['is_default']) && $option['is_default'] == 'Yes') { + $value = $option['admin']; } } + if ($value == '') { + $value = $data['options'][0]['admin']; + } } else { $defaultValue = preg_grep('/^default_value/', array_keys($data)); - return !empty($defaultValue) ? $data[array_shift($defaultValue)] : null; + $value = !empty($defaultValue) ? $data[array_shift($defaultValue)] : null; } + + return $value; } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php index 82d498b27c034..c6fa45ab95730 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php @@ -10,7 +10,6 @@ use Magento\Mtf\Fixture\FixtureInterface; /** - * Class CustomOptions * Custom options fixture * * Data keys: @@ -150,7 +149,7 @@ protected function getPreset($name) [ 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => '30 bucks', @@ -165,7 +164,7 @@ protected function getPreset($name) [ 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => '40 bucks', @@ -180,7 +179,7 @@ protected function getPreset($name) [ 'title' => 'Test1 option %isolation%', 'is_require' => 'Yes', - 'type' => 'Field', + 'type' => 'Text/Field', 'options' => [ [ 'price' => 120.03, @@ -193,7 +192,7 @@ protected function getPreset($name) [ 'title' => 'Test2 option %isolation%', 'is_require' => 'Yes', - 'type' => 'Field', + 'type' => 'Text/Field', 'options' => [ [ 'price' => 120.03, @@ -206,7 +205,7 @@ protected function getPreset($name) [ 'title' => 'Test3 option %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => 'Test3-1 %isolation%', @@ -225,7 +224,7 @@ protected function getPreset($name) [ 'title' => 'Test4 option %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => 'Test1 %isolation%', @@ -246,7 +245,7 @@ protected function getPreset($name) [ 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => '10 percent', @@ -259,7 +258,7 @@ protected function getPreset($name) [ 'title' => 'custom option drop down2 %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => '20 percent', @@ -274,7 +273,7 @@ protected function getPreset($name) [ 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => '10 percent', @@ -293,7 +292,7 @@ protected function getPreset($name) [ 'title' => 'custom option field %isolation%', 'is_require' => 'Yes', - 'type' => 'Field', + 'type' => 'Text/Field', 'options' => [ [ 'price' => 10, @@ -307,7 +306,7 @@ protected function getPreset($name) 'all_types' => [ [ 'title' => 'custom option field %isolation%', - 'type' => 'Field', + 'type' => 'Text/Field', 'is_require' => 'Yes', 'options' => [ [ @@ -321,7 +320,7 @@ protected function getPreset($name) [ 'title' => 'custom option Area %isolation%', 'is_require' => 'Yes', - 'type' => 'Area', + 'type' => 'Text/Area', 'options' => [ [ 'price' => 10, @@ -334,7 +333,7 @@ protected function getPreset($name) [ 'title' => 'custom option File %isolation%', 'is_require' => 'No', - 'type' => 'File', + 'type' => 'File/File', 'options' => [ [ 'price' => 10, @@ -349,7 +348,7 @@ protected function getPreset($name) [ 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => '10 percent', @@ -374,7 +373,7 @@ protected function getPreset($name) [ 'title' => 'custom option Radio Buttons %isolation%', 'is_require' => 'Yes', - 'type' => 'Radio Buttons', + 'type' => 'Select/Radio Buttons', 'options' => [ [ 'title' => '20 fixed', @@ -387,7 +386,7 @@ protected function getPreset($name) [ 'title' => 'custom option Checkbox %isolation%', 'is_require' => 'Yes', - 'type' => 'Checkbox', + 'type' => 'Select/Checkbox', 'options' => [ [ 'title' => '20 fixed', @@ -400,7 +399,7 @@ protected function getPreset($name) [ 'title' => 'custom option Multiple Select %isolation%', 'is_require' => 'Yes', - 'type' => 'Multiple Select', + 'type' => 'Select/Multiple Select', 'options' => [ [ 'title' => '20 fixed', @@ -413,7 +412,7 @@ protected function getPreset($name) [ 'title' => 'custom option Date %isolation%', 'is_require' => 'Yes', - 'type' => 'Date', + 'type' => 'Date/Date', 'options' => [ [ 'price' => 20, @@ -425,7 +424,7 @@ protected function getPreset($name) [ 'title' => 'custom option Date & Time %isolation%', 'is_require' => 'Yes', - 'type' => 'Date & Time', + 'type' => 'Date/Date & Time', 'options' => [ [ 'price' => 20, @@ -437,7 +436,7 @@ protected function getPreset($name) [ 'title' => 'custom option Time %isolation%', 'is_require' => 'Yes', - 'type' => 'Time', + 'type' => 'Date/Time', 'options' => [ [ 'price' => 20, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index c6ee44d2d0c53..a029a4e1d51cd 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -147,7 +147,7 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface * * @var array */ - protected $selectOptions = ['Drop-down', 'Radio Buttons', 'Checkbox', 'Multiple Select']; + protected $selectOptions = ['drop_down', 'radio', 'checkbox', 'multiple']; /** * Post request for creating simple product. @@ -264,12 +264,12 @@ protected function prepareCustomOptionsData(array $fields) $customOption['options'][$index]['is_delete'] = ''; $customOption['options'][$index]['price_type'] = strtolower($option['price_type']); } - $options[$key] += in_array($customOption['type'], $this->selectOptions) + $options[$key]['type'] = $this->optionNameConvert($customOption['type']); + $options[$key] += in_array($options[$key]['type'], $this->selectOptions) ? ['values' => $customOption['options']] : $customOption['options'][0]; unset($customOption['options']); $options[$key] += $customOption; - $options[$key]['type'] = $this->optionNameConvert($customOption['type']); } $fields['options'] = $options; unset($fields['custom_options']); @@ -285,6 +285,7 @@ protected function prepareCustomOptionsData(array $fields) */ protected function optionNameConvert($optionName) { + $optionName = substr($optionName, strpos($optionName, "/") + 1); $optionName = str_replace(['-', ' & '], "_", trim($optionName)); $end = strpos($optionName, ' '); if ($end !== false) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv index 4726bd31c8c9f..9a5786f663cf2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv @@ -1,5 +1,5 @@ attribute/data/frontend_label;attribute/data/frontend_input;attribute/data/options/preset;attribute/data/is_required;attribute/data/attribute_code;attribute/data/is_global;attribute/data/default_value_text;attribute/data/default_value_textarea;attribute/data/is_unique;attribute/data/manage_frontend_label;attribute/data/is_searchable;attribute/data/is_visible_in_advanced_search;attribute/data/is_comparable;attribute/data/is_filterable;attribute/data/is_filterable_in_search;attribute/data/is_used_for_promo_rules;attribute/data/is_html_allowed_on_front;attribute/data/is_visible_on_front;attribute/data/used_in_product_listing;attribute/data/used_for_sort_by;constraint Text_Field_Admin_%isolation%;Text Field;-;No;attr_text_%isolation%;Global;default_value_text%isolation%;-;Yes;-;Yes;Yes;Yes;-;-;-;Yes;Yes;-;Yes;assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend -Dropdown_Admin_%isolation%;Dropdown;default;No;attr_dropdown_%isolation%;Global;-;-;-;-;-;-;-;Filterable (with results);Yes;-;-;-;-;-;assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable +Dropdown_Admin_%isolation%;Dropdown;two_options;No;attr_dropdown_%isolation%;Global;-;-;-;-;-;-;-;Filterable (with results);Yes;-;-;-;-;-;assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable Text_Field_Admin_%isolation%;Text Field;-;Yes;attr_text_%isolation%;-;default_value_text%isolation%;-;-;-;-;-;-;-;-;-;-;-;-;-;assertProductAttributeIsRequired Text_Field_Admin_%isolation%;Text Field;-;No;attr_text_%isolation%;-;default_value_text%isolation%;-;Yes;-;-;-;-;-;-;-;-;-;-;-;assertProductAttributeIsUnique diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php index aa04e94af83eb..38bda956505c9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php @@ -11,9 +11,7 @@ use Magento\Mtf\TestCase\Scenario; /** - * Test Creation for CreateProductAttributeEntity - * - * Test Flow: + * Steps: * 1. Log in to Backend. * 2. Navigate to Stores > Attributes > Product. * 3. Start to create new Product Attribute. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv index 4bd4def3ccbb3..f2e551dc317ff 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv @@ -1,10 +1,10 @@ -"productTemplate/dataSet";"productAttribute/data/frontend_label";"productAttribute/data/frontend_input";"productAttribute/data/options/preset";"productAttribute/data/is_required";"productAttribute/data/attribute_code";"productAttribute/data/is_global";"productAttribute/data/default_value_text";"productAttribute/data/default_value_textarea";"productAttribute/data/default_value_date/pattern";"productAttribute/data/default_value_yesno";"productAttribute/data/is_unique";"productAttribute/data/is_searchable";"productAttribute/data/is_visible_in_advanced_search";"productAttribute/data/is_comparable";"productAttribute/data/is_filterable";"productAttribute/data/is_filterable_in_search";"productAttribute/data/is_used_for_promo_rules";"productAttribute/data/is_html_allowed_on_front";"productAttribute/data/is_visible_on_front";"productAttribute/data/used_in_product_listing";"productAttribute/data/used_for_sort_by";"constraint" -"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_textfield_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm" -"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Area";"-";"Yes";"attr_textarea_%isolation%";"Store View";"-";"default_value_textarea%isolation%";"-";"-";"No";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable" -"custom_attribute_set";"Date_Admin_%isolation%";"Date";"-";"No";"attr_date_%isolation%";"-";"-";"-";"n/j/y";"-";"No";"Date_Store_View";"Yes";"Yes";"No";"-";"-";"-";"-";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsUsedPromoRules" -"custom_attribute_set";"Yes/No_Admin_%isolation%";"Yes/No";"-";"Yes";"attr_yesno_%isolation%";"Global";"-";"-";"-";"No";"-";"Yes/No_Global";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm" -"custom_attribute_set";"Multiple_Select_Admin_%isolation%";"Multiple Select";"default";"No";"attr_multiselect_%isolation%";"Website";"-";"-";"-";"-";"Yes";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertAttributeSearchableByLabel, assertAttributeOptionsOnProductForm" -"custom_attribute_set";"Dropdown_Admin_%isolation%";"Dropdown";"default";"Yes";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"-";"No";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertAttributeSearchableByLabel, assertProductAttributeIsComparable, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsFilterable, assertProductAttributeIsConfigurable, assertProductAttributeIsFilterableInSearch, assertAttributeOptionsOnProductForm" -"custom_attribute_set";"Price_Admin_%isolation%";"Price";"-";"No";"attr_price_%isolation%";"-";"1000";"-";"-";"-";"No";"Price_StoreView";"Yes";"Yes";"No";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch" -"custom_attribute_set";"Fixed_Product_Tax_Admin_%isolation%";"Fixed Product Tax";"-";"-";"attr_fpt_code_%isolation%";"-";"-";"-";"-";"-";"-";"Fixed_Product_Tax_Storeview";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm" -"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_textfield_%isolation%";"Store View";"default_value_text%isolation%";"-";"-";"-";"Yes";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique" \ No newline at end of file +"productTemplate/dataSet";"productAttribute/data/frontend_label";"productAttribute/data/frontend_input";"productAttribute/data/options/preset";"productAttribute/data/is_required";"productAttribute/data/attribute_code";"productAttribute/data/is_global";"productAttribute/data/default_value_text";"productAttribute/data/default_value_textarea";"productAttribute/data/default_value_date/pattern";"productAttribute/data/default_value_yesno";"productAttribute/data/is_unique";"productAttribute/data/manage_frontend_label";"productAttribute/data/is_searchable";"productAttribute/data/is_visible_in_advanced_search";"productAttribute/data/is_comparable";"productAttribute/data/is_filterable";"productAttribute/data/is_filterable_in_search";"productAttribute/data/is_used_for_promo_rules";"productAttribute/data/is_html_allowed_on_front";"productAttribute/data/is_visible_on_front";"productAttribute/data/used_in_product_listing";"productAttribute/data/used_for_sort_by";"constraint";"issue" +"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_textfield_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" +"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Area";"-";"Yes";"attr_textarea_%isolation%";"Store View";"-";"default_value_textarea%isolation%";"-";"-";"No";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable";"" +"custom_attribute_set";"Date_Admin_%isolation%";"Date";"-";"No";"attr_date_%isolation%";"-";"-";"-";"n/j/y";"-";"No";"Date_Store_View";"Yes";"Yes";"No";"-";"-";"-";"-";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsUsedPromoRules";"" +"custom_attribute_set";"Yes/No_Admin_%isolation%";"Yes/No";"-";"Yes";"attr_yesno_%isolation%";"Global";"-";"-";"-";"No";"-";"Yes/No_Global";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" +"custom_attribute_set";"Multiple_Select_Admin_%isolation%";"Multiple Select";"default";"No";"attr_multiselect_%isolation%";"Website";"-";"-";"-";"-";"Yes";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertAttributeSearchableByLabel, assertAttributeOptionsOnProductForm";"" +"custom_attribute_set";"Dropdown_Admin_%isolation%";"Dropdown";"default";"Yes";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"-";"No";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertAttributeSearchableByLabel, assertProductAttributeIsComparable, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsFilterable, assertProductAttributeIsConfigurable, assertProductAttributeIsFilterableInSearch, assertAttributeOptionsOnProductForm";"" +"custom_attribute_set";"Price_Admin_%isolation%";"Price";"-";"No";"attr_price_%isolation%";"-";"1000";"-";"-";"-";"No";"Price_StoreView";"Yes";"Yes";"No";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch";"" +"custom_attribute_set";"Fixed_Product_Tax_Admin_%isolation%";"Fixed Product Tax";"-";"-";"attr_fpt_code_%isolation%";"-";"-";"-";"-";"-";"-";"Fixed_Product_Tax_Storeview";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" +"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_textfield_%isolation%";"Store View";"default_value_text%isolation%";"-";"-";"-";"Yes";"Text_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique"; "Bug: MAGETWO-33625" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php index ef52d2a94f015..e7b7313d2e542 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php @@ -87,7 +87,6 @@ public function run() 'dataSet' => 'product_with_category_with_anchor', 'data' => [ 'attribute_set_id' => ['attribute_set' => $this->productTemplate], - 'custom_attribute' => $this->attribute, ], ] ); diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php index c98608a606314..0f2a69ae8e95e 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.php @@ -36,7 +36,7 @@ class Form extends ParentForm * * @var string */ - protected $fieldSelector = '//div[label and div]'; + protected $fieldSelector = './/div[label and div]'; /** * Label element selector. diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProductInjectable.xml index 77e82d777f9a4..054570e4528a5 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProductInjectable.xml @@ -54,6 +54,9 @@ Product online Catalog, Search Yes + + Main Website + with_two_separately_links @@ -79,6 +82,9 @@ Product online Catalog, Search Yes + + Main Website + with_two_separately_links diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php index 705127c1d81d6..2b9801528d19e 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php @@ -20,8 +20,6 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for CustomerReviewReportEntity - * * Preconditions: * 1. Create customer * 2. Create simple product @@ -30,7 +28,7 @@ * 5. Fill data according to DataSet * 6. Click Submit review * - * Test Flow: + * Steps: * 1. Open Reports -> Review : By Customers * 2. Assert Reviews qty * 3. Click Show Reviews @@ -38,6 +36,8 @@ * * @group Reports_(MX) * @ZephyrId MAGETWO-27555 + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CustomerReviewReportEntityTest extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php index e4ba86d4db956..4ff44919fb99a 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php @@ -34,7 +34,7 @@ class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishli /* end tags */ /** - * Run suggest searching result test + * Run suggest searching result test. * * @param Customer $customer * @param string $products @@ -59,7 +59,7 @@ public function test(Customer $customer, $products, $qty) } /** - * Add products from wish list to cart + * Add products from wish list to cart. * * @param array $products * @param int $qty @@ -74,14 +74,14 @@ protected function addToCart(array $products, $qty) $this->wishlistIndex->getWishlistBlock()->clickUpdateWishlist(); } $this->wishlistIndex->getItemsBlock()->getItemProduct($product)->clickAddToCart(); - if ($this->wishlistIndex->getItemsBlock()->isVisible()) { + if (!$this->wishlistIndex->getWishlistBlock()->isVisible()) { $this->catalogProductView->getViewBlock()->addToCart($product); } } } /** - * Create cart fixture + * Create cart fixture. * * @param array $products * @return Cart From 829f0716a49129f2898a59d68027c561424d1dc2 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Thu, 5 Feb 2015 12:55:35 +0200 Subject: [PATCH 20/50] MTA-552: Re-factor Test for Create Product with New Category - Added check for the old fixture - Fixed test variation --- .../Test/Block/Adminhtml/Product/ProductForm.php | 10 +++++++++- .../Test/Fixture/CatalogProductSimple/CategoryIds.php | 2 +- .../CreateSimpleProductEntityTest/testCreate.csv | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index ffd388ed52e30..5649418c48071 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -15,6 +15,7 @@ use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\DataFixture; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; use Magento\Catalog\Test\Fixture\Category; @@ -112,6 +113,12 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } else { $tabs = $this->getFieldsByTabs($product); + //TODO: Remove after old product fixture will be deleted + if (null === $category && $product instanceof DataFixture) { + $categories = $product->getCategories(); + $category = reset($categories); + } + $this->showAdvancedSettings(); $this->fillTabs($tabs, $element); @@ -120,7 +127,8 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } } - $category = $product->hasData('category_ids') + //TODO: Remove "!($product instanceof DataFixture)" after old product fixture will be deleted + $category = !($product instanceof DataFixture) && $product->hasData('category_ids') ? $product->getDataFieldConfig('category_ids')['source']->getCategories() : [$category]; if ($category[0]) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index ef37aeabca27c..9054d8e2d7021 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -58,7 +58,7 @@ public function __construct( $presets = explode(',', $data['presets']); foreach ($presets as $preset) { $category = $fixtureFactory->createByCode('category', ['dataSet' => $preset]); - if ($data['persist'] !== 'no') { + if (!isset($data['persist']) || $data['persist'] !== 'no') { $category->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index e9e4c5889d0f7..a31a266399bcf 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -21,4 +21,4 @@ "Create product with up-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" "Create product with related products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" "MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" -"MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)";"-";"no";"default_subcategory";"simple%isolation%";"simple%isolation%";"simple%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory, assertProductPage";"test_type:acceptance_test" +"MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)";"-";"no";"default_subcategory";"simple%isolation%";"simple%isolation%";"simple%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory, assertProductPage";"test_type:acceptance_test" From d8e5aba260035d840bce8a67e20f14df9bf59bbb Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Thu, 5 Feb 2015 13:23:48 +0200 Subject: [PATCH 21/50] MTA-554: Re-factor Test for Unassign Products from Category --- .../Block/Adminhtml/Product/ProductForm.php | 121 +++++------------- .../CatalogProductSimple/CategoryIds.php | 4 + .../Product/UpdateSimpleProductEntityTest.php | 2 +- .../UpdateSimpleProductEntityTest/test.csv | 1 + 4 files changed, 40 insertions(+), 88 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 51df922610d91..5649418c48071 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -13,12 +13,12 @@ use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab; -use Magento\Catalog\Test\Fixture\Product; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\DataFixture; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; +use Magento\Catalog\Test\Fixture\Category; /** * Product form on backend product page. @@ -60,41 +60,6 @@ class ProductForm extends FormTabs */ protected $customTab = './/*/a[contains(@id,"product_info_tabs_%s")]'; - /** - * Button "New Category". - * - * @var string - */ - protected $buttonNewCategory = '#add_category_button'; - - /** - * Dialog box "Create Category". - * - * @var string - */ - protected $createCategoryDialog = './/ancestor::body//*[contains(@class,"mage-new-category-dialog")]'; - - /** - * "Parent Category" block on dialog box. - * - * @var string - */ - protected $parentCategoryBlock = '//*[contains(@class,"field-new_category_parent")]'; - - /** - * Field "Category Name" on dialog box. - * - * @var string - */ - protected $fieldNewCategoryName = '//input[@id="new_category_name"]'; - - /** - * Button "Create Category" on dialog box. - * - * @var string - */ - protected $createCategoryButton = '//button[contains(@class,"action-create")]'; - /** * Tabs title css selector. * @@ -148,13 +113,11 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } else { $tabs = $this->getFieldsByTabs($product); + //TODO: Remove after old product fixture will be deleted if (null === $category && $product instanceof DataFixture) { $categories = $product->getCategories(); $category = reset($categories); } - if ($category) { - $tabs['product-details']['category_ids']['value'] = $category->getName(); - } $this->showAdvancedSettings(); $this->fillTabs($tabs, $element); @@ -164,9 +127,41 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } } + //TODO: Remove "!($product instanceof DataFixture)" after old product fixture will be deleted + $category = !($product instanceof DataFixture) && $product->hasData('category_ids') + ? $product->getDataFieldConfig('category_ids')['source']->getCategories() + : [$category]; + if ($category[0]) { + $this->fillCategory($category, $element); + } + return $this; } + /** + * Fill category data from product fixture. + * + * @param array|null $categoryList + * @param SimpleElement|null $element + * @return void + */ + public function fillCategory($categoryList, $element) + { + /** @var Category $category */ + foreach ($categoryList as $category) { + if ($category->hasData('id')) { + $tabs['product-details']['category_ids']['value'] = $category->getName(); + $this->fillTabs($tabs, $element); + } else { + $this->openTab('product-details'); + $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\NewCategoryIds', + ['element' => $this->browser->find('body')] + )->addNewCategory($category); + } + } + } + /** * Create custom attribute. * @@ -226,43 +221,6 @@ public function openTab($tabName) return parent::openTab($tabName); } - /** - * Save new category. - * - * @param Product $fixture - * @return void - */ - public function addNewCategory(Product $fixture) - { - $this->openTab('product-details'); - $this->openNewCategoryDialog(); - $this->_rootElement->find( - $this->createCategoryDialog . $this->fieldNewCategoryName, - Locator::SELECTOR_XPATH - )->setValue($fixture->getNewCategoryName()); - - $this->clearCategorySelect(); - $this->selectParentCategory(); - - $buttonCreateCategory = $this->createCategoryDialog . $this->createCategoryButton; - $this->_rootElement->find($buttonCreateCategory, Locator::SELECTOR_XPATH)->click(); - $this->waitForElementNotVisible($buttonCreateCategory, Locator::SELECTOR_XPATH); - } - - /** - * Select parent category for new one. - * - * @return void - */ - protected function selectParentCategory() - { - $this->_rootElement->find( - $this->createCategoryDialog . $this->parentCategoryBlock, - Locator::SELECTOR_XPATH, - '\Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\ParentCategoryIds' - )->setValue('Default Category'); - } - /** * Clear category field. * @@ -276,17 +234,6 @@ public function clearCategorySelect() } } - /** - * Open new category dialog. - * - * @return void - */ - protected function openNewCategoryDialog() - { - $this->_rootElement->find($this->buttonNewCategory)->click(); - $this->waitForElementVisible($this->createCategoryDialog, Locator::SELECTOR_XPATH); - } - /** * Check visibility of the attribute on the product page. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index cf59c0bc7a19c..aae945d365e23 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -57,6 +57,10 @@ public function __construct( } elseif (isset($data['presets'])) { $presets = explode(',', $data['presets']); foreach ($presets as $preset) { + if ($preset == "") { + $this->data[] = ''; + continue; + } $category = $fixtureFactory->createByCode('category', ['dataSet' => $preset]); $category->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php index 50f0a80f2c518..7aa9172027c54 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php @@ -80,7 +80,7 @@ public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $initialCategory = $initialProduct->hasData('category_ids') ? $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0] : null; - $category = $product->hasData('category_ids') + $category = $product->hasData('category_ids') && $product->getCategoryIds()[0] ? $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] : $initialCategory; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv index 1e68045339dbb..3fc3a0be0810f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv @@ -7,3 +7,4 @@ "Update product status to offline";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" "Update category";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory" "MAGETWO-12428: Edit Simple Product";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"133.00";"-";"-";"test-simple-product-%isolation%";"-";"-";"-";"assertProductSaveMessage, assertProductPage" +"MAGETWO-12417: Unassign Products from the Category";"product_with_category";"";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductNotVisibleInCategory" From e3b25019c941485a7fcb48297ffd7a7c65cf5804 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Thu, 5 Feb 2015 17:57:54 +0200 Subject: [PATCH 22/50] MTA-552: Re-factor Test for Create Product with New Category - Fixed fill category --- .../Product/Attribute/AttributeForm.php | 3 +- .../Product/Edit/Tab/ProductDetails.php | 21 ++++++++- .../Tab/ProductDetails/NewCategoryIds.php | 43 +++++++------------ .../Tab/ProductDetails/NewCategoryIds.xml | 14 ++++++ .../Block/Adminhtml/Product/ProductForm.php | 36 ++-------------- .../Test/Constraint/AssertProductForm.php | 12 ------ .../CatalogProductSimple/CategoryIds.php | 2 +- .../testCreate.csv | 4 +- .../Product/Edit/Tab/Super/Config.php | 10 ++--- .../Edit/Tab/Super/Config/Attribute.php | 1 - .../ConfigurableAttributesData.php | 4 -- .../CreateConfigurableProductEntityTest.php | 1 + .../test.csv | 2 +- 13 files changed, 62 insertions(+), 91 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php index 36d0851d515b9..b54785a4dd6a6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php @@ -52,8 +52,7 @@ public function __construct( BrowserInterface $browser, XmlConverter $xmlConverter, array $config = [] - ) - { + ){ parent::__construct($element, $mapper, $blockFactory, $browser, $xmlConverter, $config); $this->browser->switchToFrame(new Locator($this->iFrame)); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php index 86573add5c02c..42e958e178ed1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php @@ -6,13 +6,15 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab; -use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Locator; +use Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Client\Element\SimpleElement; +use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab; /** * Product details tab. */ -class ProductDetails extends \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab +class ProductDetails extends ProductTab { /** * Locator for preceding sibling of category element. @@ -38,6 +40,21 @@ class ProductDetails extends \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ public function fillFormTab(array $fields, SimpleElement $element = null) { $data = $this->dataMapping($fields); + if (isset($data['category_ids'])) { + /* Fix browser behavior for click by hidden list result of suggest(category) element */ + $this->scrollToCategory(); + if (isset($fields['category_ids']['source']) + && !$fields['category_ids']['source']->getCategories()[0]->hasData('id') + ) { + $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\NewCategoryIds', + ['element' => $this->browser->find('body')] + )->addNewCategory($fields['category_ids']['source']->getCategories()[0]); + } else { + $this->_fill([$data['category_ids']], $element); + } + unset($data['category_ids']); + } $this->_fill($data, $element); return $this; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php index ac1175405f9d6..2542a61c873f6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php @@ -7,14 +7,13 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Catalog\Test\Fixture\Category; -use Magento\Backend\Test\Block\Widget\FormTabs; +use Magento\Backend\Test\Block\Widget\Form; /** * Create new category. */ -class NewCategoryIds extends FormTabs +class NewCategoryIds extends Form { /** * Button "New Category". @@ -28,51 +27,39 @@ class NewCategoryIds extends FormTabs * * @var string */ - protected $createCategoryDialog = './/ancestor::body//*[contains(@class,"mage-new-category-dialog")]'; + protected $createCategoryDialog = '.mage-new-category-dialog'; /** * "Parent Category" block on dialog box. * * @var string */ - protected $parentCategoryBlock = '//*[contains(@class,"field-new_category_parent")]'; - - /** - * Field "Category Name" on dialog box. - * - * @var string - */ - protected $fieldNewCategoryName = '//input[@id="new_category_name"]'; + protected $parentCategoryBlock = '.field-new_category_parent'; /** * Button "Create Category" on dialog box. * * @var string */ - protected $createCategoryButton = '//button[contains(@class,"action-create")]'; + protected $createCategoryButton = '.action-create'; /** - * Save new category. + * Add new category to product. * - * @param FixtureInterface $fixture + * @param Category $category * @return void */ - public function addNewCategory(FixtureInterface $fixture) + public function addNewCategory(Category $category) { - $categoryName = $fixture->getName(); - $parentCategory = $fixture->getDataFieldConfig('parent_id')['source']->getParentCategory()->getName(); + $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory()->getName(); $this->openNewCategoryDialog(); - $this->_rootElement->find( - $this->createCategoryDialog . $this->fieldNewCategoryName, - Locator::SELECTOR_XPATH - )->setValue($categoryName); + $this->fill($category); $this->selectParentCategory($parentCategory); - $buttonCreateCategory = $this->createCategoryDialog . $this->createCategoryButton; - $this->_rootElement->find($buttonCreateCategory, Locator::SELECTOR_XPATH)->click(); - $this->waitForElementNotVisible($buttonCreateCategory, Locator::SELECTOR_XPATH); + $this->_rootElement->find($this->createCategoryButton)->click(); + $this->waitForElementNotVisible($this->createCategoryButton); } /** @@ -84,8 +71,8 @@ public function addNewCategory(FixtureInterface $fixture) protected function selectParentCategory($categoryName) { $this->_rootElement->find( - $this->createCategoryDialog . $this->parentCategoryBlock, - Locator::SELECTOR_XPATH, + $this->parentCategoryBlock, + Locator::SELECTOR_CSS, '\Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\ParentCategoryIds' )->setValue($categoryName); } @@ -98,6 +85,6 @@ protected function selectParentCategory($categoryName) protected function openNewCategoryDialog() { $this->_rootElement->find($this->buttonNewCategory)->click(); - $this->waitForElementVisible($this->createCategoryDialog, Locator::SELECTOR_XPATH); + $this->waitForElementVisible($this->createCategoryDialog); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml new file mode 100644 index 0000000000000..3cd6b4515b223 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml @@ -0,0 +1,14 @@ + + + + + + [name="new_category_name"] + + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 5649418c48071..589dd0851310b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -118,7 +118,9 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F $categories = $product->getCategories(); $category = reset($categories); } - + if ($category) { + $tabs['product-details']['category_ids']['value'] = $category->getName(); + } $this->showAdvancedSettings(); $this->fillTabs($tabs, $element); @@ -127,41 +129,9 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F } } - //TODO: Remove "!($product instanceof DataFixture)" after old product fixture will be deleted - $category = !($product instanceof DataFixture) && $product->hasData('category_ids') - ? $product->getDataFieldConfig('category_ids')['source']->getCategories() - : [$category]; - if ($category[0]) { - $this->fillCategory($category, $element); - } - return $this; } - /** - * Fill category data from product fixture. - * - * @param array|null $categoryList - * @param SimpleElement|null $element - * @return void - */ - public function fillCategory($categoryList, $element) - { - /** @var Category $category */ - foreach ($categoryList as $category) { - if ($category->hasData('id')) { - $tabs['product-details']['category_ids']['value'] = $category->getName(); - $this->fillTabs($tabs, $element); - } else { - $this->openTab('product-details'); - $this->blockFactory->create( - 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\NewCategoryIds', - ['element' => $this->browser->find('body')] - )->addNewCategory($category); - } - } - } - /** * Create custom attribute. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index 78ec7a5753693..e10767e1eb658 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -30,18 +30,6 @@ class AssertProductForm extends AbstractAssertForm 'checkout_data', ]; - /** - * Skipped fields for verify data. - * - * @var array - */ - protected $skippedFields = [ - 'is_searchable', - 'is_visible_in_advanced_search', - 'is_filterable', - 'is_filterable_in_search', - ]; - /** * Sort fields for fixture and form data * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index 9054d8e2d7021..8125d5d10624b 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -58,7 +58,7 @@ public function __construct( $presets = explode(',', $data['presets']); foreach ($presets as $preset) { $category = $fixtureFactory->createByCode('category', ['dataSet' => $preset]); - if (!isset($data['persist']) || $data['persist'] !== 'no') { + if (!isset($data['new_category']) || $data['new_category'] !== 'no') { $category->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index a31a266399bcf..ffc9b996ed3a3 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,4 +1,4 @@ -"description";"configData";"product/data/category_ids/persist";"product/data/category_ids/presets";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" +"description";"configData";"product/data/category_ids/new_category";"product/data/category_ids/presets";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" "Create product with custom options(fixed price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" "Create product with custom options(percent price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" "Create product with special price and custom options(fixed price)";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" @@ -21,4 +21,4 @@ "Create product with up-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" "Create product with related products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" "MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" -"MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)";"-";"no";"default_subcategory";"simple%isolation%";"simple%isolation%";"simple%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory, assertProductPage";"test_type:acceptance_test" +"MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)";"-";"no";"default_subcategory";"simple%isolation%";"simple%isolation%";"simple%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory, assertProductPage";"" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index c402668ebfe69..c8a305647185d 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -91,15 +91,15 @@ class Config extends Tab */ public function fillFormTab(array $fields, SimpleElement $element = null) { - $attributes = isset($fields['configurable_attributes_data']['value']) + $attributes = isset($fields['configurable_attributes_data']['source']) ? $fields['configurable_attributes_data']['value'] : []; $this->showContent(); - - if (!empty($attributes['attributes_data'])) { - $this->getAttributeBlock()->fillAttributes($attributes['attributes_data']); - } + $attributesValue = isset($fields['configurable_attributes_data']['source']) + ? $fields['configurable_attributes_data']['source']->getAttributesData() + : []; + $this->getAttributeBlock()->fillAttributes($attributesValue); if (!empty($attributes['matrix'])) { $this->generateVariations(); $this->getVariationsBlock()->fillVariations($attributes['matrix']); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php index 2c68d8e6fe403..9415fc8448172 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php @@ -6,7 +6,6 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config; -use Magento\Mtf\ObjectManager; use Magento\Mtf\Client\Locator; use Magento\Backend\Test\Block\Widget\Form; use Magento\Mtf\Client\Element\SimpleElement; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php index 9a6448657e2fd..b84f3aa1c722b 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php @@ -940,10 +940,6 @@ protected function prepareData() 'frontend_input', 'attribute_code', 'attribute_id', - 'is_searchable', - 'is_visible_in_advanced_search', - 'is_filterable', - 'is_filterable_in_search', 'is_required', 'options', ]; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php index 95a0ed331c176..f463d6cc24257 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php @@ -39,6 +39,7 @@ class CreateConfigurableProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv index abf2fc6d58b54..533109bde7aed 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv @@ -1,4 +1,4 @@ -"description";"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/persist";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"tag" +"description";"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/new_category";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"tag" "Configurable product with two new options";"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" "Configurable product with two options";"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" "Configurable product with two new options and special price";"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage";"" From 25568d3c68f5bb57c057853a9ebe86daa41dcb9a Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 6 Feb 2015 09:48:50 +0200 Subject: [PATCH 23/50] MTA-552: Re-factor Test for Create Product with New Category - Fixed isolation on configurable variations --- .../Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index c8a305647185d..710bf66fbae4b 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -99,6 +99,9 @@ public function fillFormTab(array $fields, SimpleElement $element = null) $attributesValue = isset($fields['configurable_attributes_data']['source']) ? $fields['configurable_attributes_data']['source']->getAttributesData() : []; + foreach ($attributesValue as $key => $value) { + $attributesValue[$key] = array_merge($value, $attributes['attributes_data'][$key]); + } $this->getAttributeBlock()->fillAttributes($attributesValue); if (!empty($attributes['matrix'])) { $this->generateVariations(); From 9e709689ba7819928104ec075fc0461a27f56f44 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 6 Feb 2015 12:29:34 +0200 Subject: [PATCH 24/50] MTA-552: Re-factor Test for Create Product with New Category - Fixed fill category on product page --- .../Product/Attribute/AttributeForm.php | 2 +- .../Product/Edit/Tab/ProductDetails.php | 9 ++++++- .../Tab/ProductDetails/NewCategoryIds.php | 25 ++++--------------- .../Tab/ProductDetails/NewCategoryIds.xml | 4 +++ .../CreateConfigurableProductEntityTest.php | 1 + 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php index b54785a4dd6a6..5e6718e1e778a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php @@ -52,7 +52,7 @@ public function __construct( BrowserInterface $browser, XmlConverter $xmlConverter, array $config = [] - ){ + ) { parent::__construct($element, $mapper, $blockFactory, $browser, $xmlConverter, $config); $this->browser->switchToFrame(new Locator($this->iFrame)); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php index 42e958e178ed1..b3212ed8c1892 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php @@ -30,6 +30,13 @@ class ProductDetails extends ProductTab */ protected $categoryFollowingSibling = '//*[@id="attribute-category_ids-container"]/following-sibling::div[%d]'; + /** + * Locator for following sibling of category element. + * + * @var string + */ + protected $newCategoryRootElement = 'body'; + /** * Fill data to fields on tab. * @@ -48,7 +55,7 @@ public function fillFormTab(array $fields, SimpleElement $element = null) ) { $this->blockFactory->create( 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\NewCategoryIds', - ['element' => $this->browser->find('body')] + ['element' => $this->browser->find($this->newCategoryRootElement)] )->addNewCategory($fields['category_ids']['source']->getCategories()[0]); } else { $this->_fill([$data['category_ids']], $element); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php index 2542a61c873f6..dc4152a174991 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; -use Magento\Mtf\Client\Locator; use Magento\Catalog\Test\Fixture\Category; use Magento\Backend\Test\Block\Widget\Form; @@ -51,32 +50,18 @@ class NewCategoryIds extends Form */ public function addNewCategory(Category $category) { - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory()->getName(); + $data = [ + 'name' => $category->getName(), + 'parent_category' => $category->getDataFieldConfig('parent_id')['source']->getParentCategory()->getName() + ]; $this->openNewCategoryDialog(); - $this->fill($category); - - $this->selectParentCategory($parentCategory); + $this->_fill($this->dataMapping($data)); $this->_rootElement->find($this->createCategoryButton)->click(); $this->waitForElementNotVisible($this->createCategoryButton); } - /** - * Select parent category for new one. - * - * @param string $categoryName - * @return void - */ - protected function selectParentCategory($categoryName) - { - $this->_rootElement->find( - $this->parentCategoryBlock, - Locator::SELECTOR_CSS, - '\Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\ParentCategoryIds' - )->setValue($categoryName); - } - /** * Open new category dialog. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml index 3cd6b4515b223..a06cdcd333c26 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.xml @@ -10,5 +10,9 @@ [name="new_category_name"] + + .field-new_category_parent + Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails\ParentCategoryIds + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php index f463d6cc24257..572f4b16bb878 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php @@ -40,6 +40,7 @@ class CreateConfigurableProductEntityTest extends Injectable { /* tags */ const TEST_TYPE = 'acceptance_test'; + const STABLE = 'no'; const MVP = 'yes'; const DOMAIN = 'MX'; /* end tags */ From e7b5219701b4c3826c9ebe458278b1700309d281 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 6 Feb 2015 12:47:35 +0200 Subject: [PATCH 25/50] MTA-552: Re-factor Test for Create Product with New Category - Fixed root locator for new category --- .../Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php index b3212ed8c1892..a66e11c1e5d8c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php @@ -35,7 +35,7 @@ class ProductDetails extends ProductTab * * @var string */ - protected $newCategoryRootElement = 'body'; + protected $newCategoryRootElement = '.mage-new-category-dialog'; /** * Fill data to fields on tab. From ad727fd8f9b65b47d1ae702157daccc659d1c3db Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 6 Feb 2015 13:36:43 +0200 Subject: [PATCH 26/50] MTA-554: Re-factor Test for Unassign Products from Category - Deleted old test - Added tag --- .../TestCase/Product/UnassignCategoryTest.php | 80 ------------------- .../Product/UpdateSimpleProductEntityTest.php | 1 + .../UpdateSimpleProductEntityTest/test.csv | 20 ++--- 3 files changed, 11 insertions(+), 90 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UnassignCategoryTest.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UnassignCategoryTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UnassignCategoryTest.php deleted file mode 100644 index bf024a2a2a4b9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UnassignCategoryTest.php +++ /dev/null @@ -1,80 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Unassigning products from the category on Product Information page - * - * @ZephyrId MAGETWO-12417 - * @return void - */ - public function testUnassignOnProductPage() - { - //Data - $simple = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $simple->switchData('simple'); - $simple->persist(); - //Steps - $editProductPage = Factory::getPageFactory()->getCatalogProductEdit(); - $editProductPage->open(['id' => $simple->getProductId()]); - $productForm = $editProductPage->getProductForm(); - $productForm->clearCategorySelect(); - $editProductPage->getFormPageActions()->save(); - //Verifying - $editProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verifying - $this->assertAbsenceOnCategory($simple); - } - - /** - * Assert absence product on category page (frontend) - * - * @param Product $product - * @return void - */ - protected function assertAbsenceOnCategory(Product $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertFalse($productListBlock->isProductVisible($product->getName())); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php index 7aa9172027c54..e97c6a4a317c2 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php @@ -33,6 +33,7 @@ class UpdateSimpleProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv index 3fc3a0be0810f..b5294f4320971 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest/test.csv @@ -1,10 +1,10 @@ -"description";"initialProduct/dataSet";"product/data/category_ids/presets";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"product/data/weight";"product/data/visibility";"product/data/status";"constraint" -"Update visibility to Catalog, Search";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"245.00";"200.0000";"-";"test-simple-product-%isolation%";"120.0000";"Catalog, Search";"-";"assertProductSaveMessage, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage" -"Update visibility to Not Visible Individually";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.00";"123.0000";"-";"test-simple-product-%isolation%";"129.0000";"Not Visible Individually";"-";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" -"Update visibility to Catalog";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.01";"125.0000";"-";"test-simple-product-%isolation%";"25.0000";"Catalog";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductSearchableBySku, assertProductVisibleInCategory, assertProductPage" -"Update visibility to Search";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.02";"89.0000";"-";"test-simple-product-%isolation%";"89.0000";"Search";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductVisibleInCategory, assertProductPage, assertProductSearchableBySku, assertProductPage" -"Update stock to Out of Stock";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.03";"25.0000";"Out of Stock";"test-simple-product-%isolation%";"125.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertProductOutOfStock, assertProductPage, assertProductVisibleInCategory, assertProductSearchableBySku" -"Update product status to offline";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend" -"Update category";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory" -"MAGETWO-12428: Edit Simple Product";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"133.00";"-";"-";"test-simple-product-%isolation%";"-";"-";"-";"assertProductSaveMessage, assertProductPage" -"MAGETWO-12417: Unassign Products from the Category";"product_with_category";"";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductNotVisibleInCategory" +"description";"initialProduct/dataSet";"product/data/category_ids/presets";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/url_key";"product/data/weight";"product/data/visibility";"product/data/status";"constraint";"tag" +"Update visibility to Catalog, Search";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"245.00";"200.0000";"-";"test-simple-product-%isolation%";"120.0000";"Catalog, Search";"-";"assertProductSaveMessage, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Update visibility to Not Visible Individually";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.00";"123.0000";"-";"test-simple-product-%isolation%";"129.0000";"Not Visible Individually";"-";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend";"" +"Update visibility to Catalog";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.01";"125.0000";"-";"test-simple-product-%isolation%";"25.0000";"Catalog";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductSearchableBySku, assertProductVisibleInCategory, assertProductPage";"" +"Update visibility to Search";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.02";"89.0000";"-";"test-simple-product-%isolation%";"89.0000";"Search";"-";"assertProductSaveMessage, assertProductInStock, assertProductForm, assertProductVisibleInCategory, assertProductPage, assertProductSearchableBySku, assertProductPage";"" +"Update stock to Out of Stock";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"325.03";"25.0000";"Out of Stock";"test-simple-product-%isolation%";"125.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertProductOutOfStock, assertProductPage, assertProductVisibleInCategory, assertProductSearchableBySku";"" +"Update product status to offline";"product_with_category";"-";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"Product offline";"assertProductSaveMessage, assertProductForm, assertProductIsNotDisplayingOnFrontend";"" +"Update category";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"74.00";"87.0000";"-";"test-simple-product-%isolation%";"333.0000";"-";"-";"assertProductSaveMessage, assertProductForm, assertUrlRewriteUpdatedProductInGrid, assertProductVisibleInCategory";"" +"MAGETWO-12428: Edit Simple Product";"product_with_category";"default";"Test simple product %isolation%";"test_simple_product_%isolation%";"133.00";"-";"-";"test-simple-product-%isolation%";"-";"-";"-";"assertProductSaveMessage, assertProductPage";"" +"MAGETWO-12417: Unassign Products from the Category";"product_with_category";"";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductNotVisibleInCategory";"test_type:acceptance_test" From fd69ea34b0bb9ce44803800a3eb2a281048103fe Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Fri, 6 Feb 2015 15:17:24 +0200 Subject: [PATCH 27/50] MTA-548: Re-factor Tests for Create Products --- .../Block/Adminhtml/Product/ProductForm.php | 2 +- .../Test/Constraint/AssertProductInCart.php | 4 + .../GroupPriceOptions.php | 1 - .../Magento/Catalog/Test/Fixture/Product.php | 378 ------------------ .../Catalog/Test/Fixture/SimpleProduct.php | 100 ----- .../Catalog/Test/Fixture/VirtualProduct.php | 69 ---- .../Handler/CatalogProductAttribute/Curl.php | 5 + .../Test/Handler/Curl/CreateProduct.php | 120 ------ .../Catalog/Test/Handler/Ui/CreateProduct.php | 39 -- .../Repository/CatalogProductAttribute.xml | 21 + .../Test/Repository/CatalogProductSimple.xml | 105 +++++ .../Test/Repository/CatalogProductVirtual.xml | 14 + .../Catalog/Test/Repository/Product.php | 112 ------ .../Catalog/Test/Repository/SimpleProduct.php | 189 --------- .../Test/Repository/VirtualProduct.php | 16 - .../TestCase/Product/CreateProductTest.php | 100 ----- .../testCreate.csv | 49 +-- ...SimpleWithCustomOptionsAndCategoryTest.php | 112 ------ .../Test/TestCase/Product/CreateTest.php | 101 ----- .../testCreate.csv | 17 +- .../TestCase/Product/CreateVirtualTest.php | 102 ----- .../Product/NavigateRelatedProductsTest.php | 2 +- .../Test/Fixture/DownloadableProduct.php | 81 ---- .../LinksNotPurchasedSeparately.php | 38 -- .../LinksPurchasedSeparately.php | 59 --- .../CheckoutData.php | 15 + .../DownloadableProductInjectable/Links.php | 19 + .../Test/Handler/Curl/CreateDownloadable.php | 134 ------- .../Test/Repository/DownloadableProduct.php | 17 - .../DownloadableProductInjectable.xml | 18 + .../Create/LinksPurchasedSeparatelyTest.php | 120 ------ .../test.csv | 31 +- .../Catalog/Product/View/Type/Grouped.php | 10 +- .../Test/Fixture/GroupedProduct.php | 144 ------- .../GroupedProductInjectable/Associated.php | 23 ++ .../Test/Repository/GroupedProduct.php | 18 - .../CreateGroupedProductEntityTest/test.csv | 19 +- .../Test/TestCase/CreateGroupedTest.php | 123 ------ 38 files changed, 289 insertions(+), 2238 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/SimpleProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/VirtualProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Ui/CreateProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/VirtualProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateProductTest.php delete mode 100755 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCustomOptionsAndCategoryTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksNotPurchasedSeparately.php delete mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksPurchasedSeparately.php delete mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/Curl/CreateDownloadable.php delete mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.php delete mode 100755 dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/Create/LinksPurchasedSeparatelyTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedTest.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 51df922610d91..c38202370362a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -159,7 +159,7 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F $this->showAdvancedSettings(); $this->fillTabs($tabs, $element); - if ($product instanceof InjectableFixture && $product->hasData('custom_attribute')) { + if ($product->hasData('custom_attribute')) { $this->createCustomAttribute($product); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php index c231814db8b4d..dd4d70e89fbe7 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php @@ -59,6 +59,7 @@ protected function assertOnShoppingCart(FixtureInterface $product, CheckoutCart /** @var CatalogProductSimple $product */ $customOptions = $product->getCustomOptions(); $checkoutData = $product->getCheckoutData(); + $checkoutCartItem = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) ? $checkoutData['options']['custom_options'] : []; @@ -75,6 +76,9 @@ protected function assertOnShoppingCart(FixtureInterface $product, CheckoutCart if ($specialPrice) { $fixturePrice = $specialPrice; } + if (isset($checkoutCartItem['price'])) { + $fixturePrice = $checkoutCartItem['price']; + } $fixtureActualPrice = $fixturePrice; foreach ($checkoutCustomOptions as $checkoutOption) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php index ae26f43149b30..2640e83ddd9bd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product.php deleted file mode 100644 index ca49dbcb8743d..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product.php +++ /dev/null @@ -1,378 +0,0 @@ -categories = $placeholders['categories']; - } else { - $this->_placeholders['category::getName'] = [$this, 'categoryProvider']; - $this->_placeholders['category::getId'] = [$this, 'categoryProvider']; - } - } - - /** - * {@inheritdoc} - */ - protected function _initData() - { - $this->_data = array_merge_recursive( - $this->_data, - [ - 'fields' => [ - 'name' => [ - 'value' => substr(get_class($this), strrpos(get_class($this), '\\') + 1) . ' %isolation%', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'sku' => [ - 'value' => substr(get_class($this), strrpos(get_class($this), '\\') + 1) . '_sku_%isolation%', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - ] - ] - ); - } - - /** - * Get data from repository and reassign it - * - * @return void - */ - public function reset() - { - $default = $this->_repository->get('default'); - - $this->_dataConfig = $default['config']; - $this->_data = $default['data']; - } - - /** - * Retrieve specify data from product. - * - * @param string $placeholder - * @return mixed - */ - protected function productProvider($placeholder) - { - list($productData, $method) = explode('::', $placeholder); - $product = $this->getProduct($this->formatProductType($productData)); - return is_callable([$product, $method]) ? $product->$method() : null; - } - - /** - * @param string $productData - * @return string - */ - protected function formatProductType($productData) - { - return $productData; - } - - /** - * Create a new product - * - * @param string $productType - * @throws \InvalidArgumentException - * @return Product - */ - public function getProduct($productType) - { - if (!isset($this->products[$productType])) { - switch ($productType) { - case 'simple': - $product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $product->switchData($productType . '_required'); - break; - case 'virtual': - $product = Factory::getFixtureFactory()->getMagentoCatalogVirtualProduct(); - $product->switchData($productType . '_required'); - break; - case 'downloadable': - $product = Factory::getFixtureFactory() - ->getMagentoDownloadableDownloadableProductLinksNotPurchasedSeparately(); - break; - case 'configurable': - $product = Factory::getFixtureFactory()->getMagentoConfigurableProductConfigurableProduct(); - break; - default: - throw new \InvalidArgumentException( - "Product of type '$productType' cannot be added to grouped product." - ); - } - $product->persist(); - $this->products[$productType] = $product; - } - return $this->products[$productType]; - } - - /** - * Retrieve specify data from category. - * - * @param string $placeholder - * @return mixed - */ - protected function categoryProvider($placeholder) - { - list($key, $method) = explode('::', $placeholder); - $category = $this->getCategory($key); - return is_callable([$category, $method]) ? $category->$method() : null; - } - - /** - * Create a new category and retrieve category fixture - * - * @param string $key - * @return mixed - */ - protected function getCategory($key) - { - if (!isset($this->categories[$key])) { - $category = ObjectManager::getInstance()->create( - '\Magento\Catalog\Test\Fixture\Category', - ['dataSet' => 'default_subcategory'] - ); - $category->persist(); - $this->categories[$key] = $category; - } - return $this->categories[$key]; - } - - /** - * Get categories - * - * @return array - */ - public function getCategories() - { - return $this->categories; - } - - /** - * Get category Ids - * - * @return array - */ - public function getCategoryIds() - { - $categoryIds = []; - /** @var Category $category */ - foreach ($this->categories as $category) { - $categoryIds[] = $category->getId(); - } - return $categoryIds; - } - - /** - * Get product name - * - * @return string - */ - public function getName() - { - return $this->getData('fields/name/value'); - } - - /** - * Get product sku - * - * @return string - */ - public function getSku() - { - return $this->getData('fields/sku/value'); - } - - /** - * Get product price - * - * @return string - */ - public function getProductPrice() - { - return $this->getData('fields/price/value'); - } - - /** - * Get product special price - * - * @return string - */ - public function getProductSpecialPrice() - { - return $this->getData('fields/special_price/value'); - } - - /** - * Get category name - * - * @return string - */ - public function getCategoryName() - { - return $this->getData('category_name'); - } - - /** - * Get product url - * - * @return string - */ - public function getUrlKey() - { - $fields = $this->getData('fields'); - if (isset($fields['url'])) { - return $fields['url']; - } else { - return trim(strtolower(preg_replace('#[^0-9a-z]+#i', '-', $this->getName())), '-'); - } - } - - /** - * Get product id - * - * @return string - */ - public function getProductId() - { - return $this->getData('fields/id/value'); - } - - /** - * Create product - * - * @return void - */ - public function persist() - { - $id = Factory::getApp()->magentoCatalogCreateProduct($this); - $this->_data['fields']['id']['value'] = $id; - } - - /** - * Stab for filling product options - * - * @return void - */ - public function getProductOptions() - { - $selections = $this->getData('checkout/selections'); - $options = []; - if (!empty($selection)) { - foreach ($selections as $selection) { - $options[$selection['attribute_name']] = $selection['option_name']; - } - } - return $options; - } - - /** - * Get Url params - * - * @param string $urlKey - * @return string - */ - public function getUrlParams($urlKey) - { - $params = []; - $config = $this->getDataConfig(); - if (!empty($config[$urlKey]) && is_array($config[$urlKey])) { - foreach ($config[$urlKey] as $key => $value) { - $params[] = $key . '/' . $value; - } - } - return implode('/', $params); - } - - /** - * Get new category name - * - * @return string - */ - public function getNewCategoryName() - { - return $this->getData('category_new/category_name/value'); - } - - /** - * Get parent for new category - * - * @return string - */ - public function getNewCategoryParent() - { - return $this->getData('category_new/parent_category/value'); - } - - /** - * Get product Minimum Advertised Price - * - * @return string - */ - public function getProductMapPrice() - { - return $this->getData('fields/msrp/value'); - } - - /** - * Get checkout data for fill options of product - * - * @return array|null - */ - public function getCheckoutData() - { - return $this->getData('fields/checkout_data'); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/SimpleProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/SimpleProduct.php deleted file mode 100644 index 29ce1edf9252f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/SimpleProduct.php +++ /dev/null @@ -1,100 +0,0 @@ -_placeholders[self::PRICE_VALUE] = 10; - - parent::__construct($configuration, $placeholders); - } - - /** - * {inheritdoc} - */ - protected function _initData() - { - parent::_initData(); - $this->_dataConfig = [ - 'constraint' => 'Success', - 'grid_filter' => ['name'], - 'create_url_params' => ['type' => 'simple', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID], - 'input_prefix' => 'product', - ]; - - $data = $this->_getPreparedData(); - $this->_data['fields'] = array_merge($this->_data['fields'], $data); - - $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogSimpleProduct( - $this->_dataConfig, - $this->_data - ); - } - - /** - * Get data for the product - * - * @return array - */ - protected function _getPreparedData() - { - return [ - 'price' => [ - 'value' => '%' . self::PRICE_VALUE . '%', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'tax_class_id' => [ - 'value' => 'Taxable Goods', - 'input_value' => '2', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'qty' => [ - 'value' => 1000, - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input_name' => 'product[quantity_and_stock_status][qty]', - ], - 'quantity_and_stock_status' => [ - 'value' => 'In Stock', - 'input_value' => 1, - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input_name' => 'product[quantity_and_stock_status][is_in_stock]', - ], - 'weight' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS], - 'product_website_1' => [ - 'value' => 'Yes', - 'input_value' => 1, - 'group' => static::GROUP_PRODUCT_WEBSITE, - 'input' => 'checkbox', - 'input_name' => 'product[website_ids][]', - ], - 'inventory_manage_stock' => [ - 'value' => 'No', - 'input_value' => '0', - 'group' => static::GROUP_PRODUCT_INVENTORY, - 'input' => 'select', - 'input_name' => 'product[stock_data][manage_stock]', - ], - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/VirtualProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/VirtualProduct.php deleted file mode 100644 index be101be7e2874..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/VirtualProduct.php +++ /dev/null @@ -1,69 +0,0 @@ -_dataConfig = [ - 'constraint' => 'Success', - - 'grid_filter' => ['name'], - - 'create_url_params' => [ - 'type' => 'virtual', - 'set' => static::DEFAULT_ATTRIBUTE_SET_ID, - ], - 'input_prefix' => 'product', - ]; - - $data = [ - 'is_virtual' => ['value' => '', 'group' => null], // needed for CURL handler - 'price' => [ - 'value' => 15, - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'tax_class_id' => [ - 'value' => 'Taxable Goods', - 'input_value' => '2', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'qty' => [ - 'value' => 1000, - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input_name' => 'product[quantity_and_stock_status][qty]', - ], - 'product_website_1' => [ - 'value' => 'Yes', - 'input_value' => 1, - 'group' => static::GROUP_PRODUCT_WEBSITE, - 'input' => 'checkbox', - 'input_name' => 'product[website_ids][]', - ], - 'inventory_manage_stock' => [ - 'value' => 'No', - 'input_value' => '0', - 'group' => static::GROUP_PRODUCT_INVENTORY, - 'input' => 'select', - 'input_name' => 'product[stock_data][manage_stock]', - ], - ]; - - $this->_data['fields'] = array_merge($this->_data['fields'], $data); - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCatalogVirtualProduct($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php index 895d8fae593a3..f8ab8d9d02edc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php @@ -40,6 +40,11 @@ class Curl extends AbstractCurl implements CatalogProductAttributeInterface 'Yes' => 1, 'No' => 0, ], + 'is_filterable' => [ + 'No' => 0, + 'Filterable (with results)' => 1, + 'Filterable (no results)' => 2 + ] ]; /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProduct.php deleted file mode 100644 index 56db8d439a046..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProduct.php +++ /dev/null @@ -1,120 +0,0 @@ - $values) { - $value = $this->_getValue($values); - //do not add this data if value does not exist - if (null === $value) { - continue; - } - if (isset($values['input_name'])) { - $data[$values['input_name']] = $value; - } elseif ($prefix) { - $data[$prefix][$key] = $value; - } else { - $data[$key] = $value; - } - } - return $data; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function _getValue($values) - { - if (!isset($values['value'])) { - return null; - } - return isset($values['input_value']) ? $values['input_value'] : $values['value']; - } - - /** - * Retrieve URL for request with all necessary parameters - * - * @param array $config - * @return string - */ - protected function _getUrl(array $config) - { - $requestParams = isset($config['create_url_params']) ? $config['create_url_params'] : []; - $params = ''; - foreach ($requestParams as $key => $value) { - $params .= $key . '/' . $value . '/'; - } - return $_ENV['app_backend_url'] . 'catalog/product/save/' . $params . 'popup/1/back/edit'; - } - - /** - * Post request for creating simple product - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - * @throws \Exception - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function persist(FixtureInterface $fixture = null) - { - $config = $fixture->getDataConfig(); - $prefix = isset($config['input_prefix']) ? $config['input_prefix'] : null; - // @todo remove "if" when fixtures refactored - if ($fixture instanceof InjectableFixture) { - $fields = $fixture->getData(); - if ($prefix) { - $data[$prefix] = $fields; - } else { - $data = $fields; - } - } else { - $data = $this->_prepareData($fixture->getData('fields'), $prefix); - } - - if ($fixture->getData('category_id')) { - $data['product']['category_ids'] = $fixture->getCategoryIds(); - } - $url = $this->_getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), new Config()); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - preg_match("~Location: [^\s]*\/id\/(\d+)~", $response, $matches); - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Ui/CreateProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Ui/CreateProduct.php deleted file mode 100644 index acabe4b5e64f4..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Ui/CreateProduct.php +++ /dev/null @@ -1,39 +0,0 @@ -magentoBackendLoginUser(); - - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $createProductPage->open([ - 'type' => $fixture->getDataConfig()['create_url_params']['type'], - 'set' => $fixture->getDataConfig()['create_url_params']['set'], - ]); - - $createProductPage->getProductForm()->fill($fixture); - $createProductPage->getFormPageActions()->save(); - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml index 74294dba90c1e..2362b48385d61 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml @@ -118,5 +118,26 @@ fpt_%isolation% Fixed Product Tax + + + attribute_dropdown%isolation% + attribute_dropdown%isolation% + Dropdown + Yes + Yes + Filterable (with results) + + + Yes + black + option_0_%isolation% + + + No + white + option_1_%isolation% + + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index e55b1f0e5ce5c..5dc792b8fd268 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -961,5 +961,110 @@ one_fpt_for_all_states + + + + default + + Simple Product %isolation% + sku_simple_product_%isolation% + simple-product-%isolation% + 1 + + 1000 + In Stock + + + 10 + - + + + taxable_goods + + + Main Website + + Catalog, Search + + order_default + + + No + + + default_subcategory + + + + + + default + + Simple Product %isolation% + sku_simple_product_%isolation% + simple-product-%isolation% + 1 + + 1000 + In Stock + + + 10 + - + + + taxable_goods + + + Main Website + + Catalog, Search + + order_default + + + No + + + + + + default + + Simple Product %isolation% + sku_simple_product_%isolation% + + 1.99 + - + + + + + Simple Product with msrp %isolation% + sku_simple_product_with_msrp_%isolation% + 1 + + 1000 + In Stock + + + 10 + - + + + default_subcategory + + + taxable_goods + + + Main Website + + + No + + 15 + On Gesture + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index 6d8121608c524..ce58ef50ad5ba 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -36,6 +36,20 @@ + + virtual-product%isolation% + Virtual product %isolation% + sku_virtual_product_%isolation% + Yes + + 10 + - + + + default_subcategory + + + taxable_goods diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product.php deleted file mode 100644 index 4c9b8591ac016..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product.php +++ /dev/null @@ -1,112 +0,0 @@ -_data['default'] = [ - 'config' => $defaultConfig, - 'data' => $defaultData, - ]; - $type = str_replace('product', '', strtolower(substr(get_class($this), strrpos(get_class($this), '\\') + 1))); - $this->_data[$type . '_required'] = $this->_data['default']; - $this->_data[$type] = $this->_data['default']; - $this->_data[$type]['data']['category_name'] = '%category::getName%'; - $this->_data[$type]['data']['category_id'] = '%category::getId%'; - $this->_data[$type . '_edit_required_fields'] = $this->resetRequiredFields($type); - $this->_data['price_massaction'] = $this->_getMassActionPrice(); - } - - /** - * Retrieve product price for mass action - * - * @return array - */ - protected function _getMassActionPrice() - { - return [ - 'data' => [ - 'fields' => [ - 'price' => ['value' => '1.99', 'group' => 'attributes_update_tabs_attributes'], - ], - ] - ]; - } - - /** - * @param string $productType - * @return array - */ - protected function resetRequiredFields($productType) - { - return [ - 'data' => [ - 'fields' => [ - 'name' => [ - 'value' => 'edited ' . $productType . ' %isolation%', - 'group' => Fixture\Product::GROUP_PRODUCT_DETAILS, - ], - 'sku' => [ - 'value' => 'edited ' . $productType . '_sku_%isolation%', - 'group' => Fixture\Product::GROUP_PRODUCT_DETAILS, - ], - ], - ] - ]; - } - - /** - * Get simple product with advanced inventory - * - * @return array - */ - protected function _getSimpleOutOfStock() - { - $inventory = [ - 'data' => [ - 'fields' => [ - 'inventory_manage_stock' => [ - 'value' => 'Yes', - 'input_value' => 1, - ], - 'inventory_qty' => [ - 'value' => 0, - 'group' => Fixture\Product::GROUP_PRODUCT_INVENTORY, - ], - 'quantity_and_stock_status' => [ - 'value' => 'Out of Stock', - 'input_value' => 0, - 'group' => Fixture\Product::GROUP_PRODUCT_INVENTORY, - 'input_name' => 'product[quantity_and_stock_status][is_in_stock]', - ], - 'inventory_stock_availability' => [ - 'value' => 'Out of Stock', // Out of Stock - 'input_value' => 0, - 'group' => Fixture\Product::GROUP_PRODUCT_INVENTORY, - 'input' => 'select', - 'input_name' => 'product[stock_data][is_in_stock]', - ], - ], - ], - ]; - $product = array_replace_recursive($this->_data['simple'], $inventory); - - return $product; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php deleted file mode 100644 index 6bd64ae93df29..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php +++ /dev/null @@ -1,189 +0,0 @@ -_data[self::ADVANCED_INVENTORY] = $this->getSimpleAdvancedInventory(); - $this->_data[self::NEW_CATEGORY] = [ - 'config' => $defaultConfig, - 'data' => $this->buildSimpleWithNewCategoryData($defaultData), - ]; - $this->_data[self::ADVANCED_PRICING] = $this->getSimpleAdvancedPricing(); - $this->_data[self::CUSTOM_OPTIONS] = $this->getSimpleCustomOption(); - $this->_data[self::SIMPLE_WITH_MAP] = $this->getSimpleAppliedMap($defaultData); - $this->_data[self::SIMPLE_OUT_OF_STOCK] = $this->_getSimpleOutOfStock(); - } - - /** - * Build data for simple product with new category - * - * @param array $defaultData - * @return array - */ - protected function buildSimpleWithNewCategoryData($defaultData) - { - return [ - 'category_new' => [ - 'category_name' => ['value' => 'New category %isolation%'], - 'parent_category' => ['value' => 'Default'], - ], - 'category_name' => '%category::getName%', - 'category_id' => '%category::getId%', - 'fields' => array_intersect_key( - $defaultData['fields'], - array_flip(['name', 'sku', 'price', 'weight', 'product_website_1']) - ) - ]; - } - - /** - * Get simple product with advanced inventory - * - * @return array - */ - protected function getSimpleAdvancedInventory() - { - $inventory = [ - 'data' => [ - 'fields' => [ - 'inventory_manage_stock' => ['value' => 'Yes', 'input_value' => '1'], - 'inventory_qty' => ['value' => 1, 'group' => Fixture\Product::GROUP_PRODUCT_INVENTORY], - ], - ], - ]; - $product = array_replace_recursive($this->_data['simple'], $inventory); - unset($product['data']['fields']['qty']); - - return $product; - } - - /** - * Get simple product with advanced pricing - * - * @return array - */ - protected function getSimpleAdvancedPricing() - { - $pricing = [ - 'data' => [ - 'fields' => [ - 'special_price' => ['value' => '9', 'group' => Fixture\Product::GROUP_PRODUCT_PRICING], - ], - ], - ]; - $product = array_replace_recursive($this->_data['simple'], $pricing); - - return $product; - } - - /** - * @param string $productType - * @return array - */ - protected function resetRequiredFields($productType) - { - return array_replace_recursive( - parent::resetRequiredFields($productType), - [ - 'data' => [ - 'fields' => [ - 'price' => ['value' => '1.99', 'group' => Fixture\Product::GROUP_PRODUCT_DETAILS], - ], - ] - ] - ); - } - - /** - * @return array - */ - protected function getSimpleCustomOption() - { - return array_merge_recursive( - $this->_data['simple'], - [ - 'data' => [ - 'fields' => [ - 'custom_options' => [ - 'value' => [ - [ - 'title' => 'custom option drop down', - 'is_require' => true, - 'type' => 'Drop-down', - 'options' => [ - [ - 'title' => 'Title Drop - down 1', - 'price' => 2.56, - 'price_type' => 'Fixed', - 'sku' => 'sku_drop_down_row_1', - ], - ], - ], - ], - 'group' => Fixture\Product::GROUP_CUSTOM_OPTIONS, - ], - ], - ] - ] - ); - } - - /** - * Get simple product with advanced pricing (MAP) - * - * @return array - */ - protected function getSimpleAppliedMap() - { - $pricing = [ - 'data' => [ - 'fields' => [ - 'msrp_display_actual_price_type' => [ - 'value' => 'On Gesture', - 'input_value' => '1', - 'group' => Fixture\Product::GROUP_PRODUCT_PRICING, - 'input' => 'select', - ], - 'msrp' => [ - 'value' => '15', - 'group' => Fixture\Product::GROUP_PRODUCT_PRICING, - ], - ], - ], - ]; - $product = array_replace_recursive($this->_data['simple'], $pricing); - - return $product; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/VirtualProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/VirtualProduct.php deleted file mode 100644 index 04ea5c17e992f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/VirtualProduct.php +++ /dev/null @@ -1,16 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Create simple product with settings in advanced inventory tab - * - * @ZephyrId MAGETWO-12914 - * @return void - */ - public function testCreateProductAdvancedInventory() - { - $product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $product->switchData('simple_advanced_inventory'); - //Data - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - //Steps - $createProductPage->open(['type' => 'simple', 'set' => 4]); - $productForm->fill($product); - $createProductPage->getFormPageActions()->save(); - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verifying - $this->assertOnGrid($product); - $this->assertOnCategory($product); - } - - /** - * Assert existing product on admin product grid - * - * @param SimpleProduct $product - * @return void - */ - protected function assertOnGrid(SimpleProduct $product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Assert product data on category and product pages - * - * @param SimpleProduct $product - * @return void - */ - protected function assertOnCategory(SimpleProduct $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $this->assertEquals($product->getName(), $productViewBlock->getProductName()); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals(number_format($product->getProductPrice(), 2), $price); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index a1690213e37f5..52dda36653fa8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,23 +1,26 @@ -"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" -"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" -"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" -"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" -"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" -"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" -"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" -"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" -"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" -"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" -"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" -"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" -"Create product with cross-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" -"Create product with up-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" -"Create product with related products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" -"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" +"description";"configData";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/visibility";"product/data/custom_options/preset";"product/data/checkout_data/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/cross_sell_products/presets";"product/data/up_sell_products/presets";"product/data/related_products/presets";"constraint";"tag" +"Create product with custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with special price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with group price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(percent price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"-";"-";"drop_down_with_one_option_percent_price";"drop_down_with_one_option_percent_price";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product with tier price and custom options(fixed price)";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"-";"-";"drop_down_with_one_option_fixed_price";"drop_down_with_one_option_fixed_price";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Create product without custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" +"Create product that is in stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" +"Create product that is out stock";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" +"Create product that visible only in search";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"-";"-";"Search";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" +"Create simple product and check search by sku";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" +"Create simple product and check visibility in category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Create product with tax class and group price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Create product with tax class and check absent special price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Create product without tax class and tier price";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" +"Create product wit suite of custom options";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" +"Create product with cross-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" +"Create product with up-sell products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" +"Create product with related products";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" +"MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" +"MAGETWO-12514: Create Simple Product and Assigning It to Category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10";"-";"-";"-";"1";"1000";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage";"" +"MAGETWO-12703: Create Simple Product with Custom Options and Assign it to the Category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10";"-";"-";"-";"1";"1000";"In Stock";"-";"-";"-";"drop_down_with_one_option_fixed_price";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"test_type:acceptance_test" +"MAGETWO-12914: Create Simple Product with Advanced Inventory and Assign It to the Category";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"Yes";"1";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCustomOptionsAndCategoryTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCustomOptionsAndCategoryTest.php deleted file mode 100755 index 1f6c1e41b6ffb..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleWithCustomOptionsAndCategoryTest.php +++ /dev/null @@ -1,112 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Creating simple product with custom options and assigning it to the category - * - * @ZephyrId MAGETWO-12703 - * @return void - */ - public function testCreateProduct() - { - $product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $product->switchData('simple_custom_options'); - //Data - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - //Steps - $createProductPage->open([ - 'type' => $product->getDataConfig()['create_url_params']['type'], - 'set' => $product->getDataConfig()['create_url_params']['set'], - ]); - $category = $product->getCategories()['category']; - $productForm->fill($product, null, $category); - $createProductPage->getFormPageActions()->save(); - //Verifying - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - // Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - //Verifying - $this->assertOnGrid($product); - $this->assertOnCategory($product); - } - - /** - * Assert existing product on admin product grid - * - * @param Product $product - * @return void - */ - protected function assertOnGrid($product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Grid $gridBlock */ - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Assert product data on category and product pages - * - * @param Product $product - * @return void - */ - protected function assertOnCategory($product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $this->assertEquals($product->getName(), $productViewBlock->getProductName()); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals(number_format($product->getProductPrice(), 2), $price); - - $productOptionsBlock = $productPage->getViewBlock()->getCustomOptionsBlock(); - $fixture = $product->getData('fields/custom_options/value'); - $actualOptions = $productOptionsBlock->getOptions($product); - $this->assertCount(count($fixture), $actualOptions); - $this->assertTrue(isset($actualOptions['custom_options'][$fixture[0]['title']]['options'][0]['title'])); - $this->assertEquals($fixture[0]['title'], $actualOptions['custom_options'][$fixture[0]['title']]['title']); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php deleted file mode 100644 index a2b847339be75..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateTest.php +++ /dev/null @@ -1,101 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Creating simple product and assigning it to category - * - * @ZephyrId MAGETWO-12514 - * @return void - */ - public function testCreateProduct() - { - $product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $product->switchData('simple'); - //Data - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - //Steps - $createProductPage->open([ - 'type' => $product->getDataConfig()['create_url_params']['type'], - 'set' => $product->getDataConfig()['create_url_params']['set'], - ]); - $productForm->fill($product); - $createProductPage->getFormPageActions()->save(); - //Verifying - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verifying - $this->assertOnGrid($product); - $this->assertOnCategory($product); - } - - /** - * Assert existing product on admin product grid - * - * @param SimpleProduct $product - * @return void - */ - protected function assertOnGrid(SimpleProduct $product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Grid $gridBlock */ - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Assert product data on category and product pages - * - * @param SimpleProduct $product - * @return void - */ - protected function assertOnCategory(SimpleProduct $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $this->assertEquals($product->getName(), $productViewBlock->getProductName()); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals(number_format($product->getProductPrice(), 2), $price); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv index 721e089ac971b..ada1271ed8d8b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv @@ -1,8 +1,9 @@ -"product/data/url_key";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/is_virtual";"product/data/category";"product/data/group_price/preset";"product/data/price/preset";"product/data/tier_price/preset";"product/data/inventory_manage_stock";"product/data/quantity_and_stock_status/is_in_stock";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"constraint" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"None";"999";"Yes";"category_%isolation%";"-";"-";"MAGETWO-23002";"Yes";"In Stock";"-";"-";"Catalog, Search";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductForm, assertProductSearchableBySku" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"-";"10";"taxable_goods";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"-";"Out of Stock";"-";"-";"Search";"assertProductSaveMessage, assertProductForm, assertProductSkuAutoGenerated, assertProductSearchableBySku" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"category_%isolation%";"MAGETWO-23055";"-";"-";"-";"-";"-";"-";"Catalog";"assertProductSaveMessage, assertProductForm, assertProductVisibleInCategory" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"-";"Yes";"-";"MAGETWO-23055";"-";"-";"-";"-";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"assertProductSaveMessage, assertProductSearchableBySku, assertProductPage, assertProductGroupedPriceOnProductPage, assertProductCustomOptionsOnProductPage" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"No";"In Stock";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductSpecialPriceOnProductPage, assertProductInStock" -"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"999";"Yes";"-";"-";"-";"default";"-";"Out of Stock";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductTierPriceOnProductPage, assertProductOutOfStock" +"description";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/is_virtual";"product/data/category";"product/data/group_price/preset";"product/data/price/preset";"product/data/tier_price/preset";"product/data/inventory_manage_stock";"product/data/quantity_and_stock_status/is_in_stock";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"constraint";"tag" +"Create product with required fields";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid";"" +"Create product with tier price";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"None";"999";"Yes";"category_%isolation%";"-";"-";"MAGETWO-23002";"Yes";"In Stock";"-";"-";"Catalog, Search";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductForm, assertProductSearchableBySku";"" +"Create product with out of stock";"virtual-product-%isolation%";"VirtualProduct %isolation%";"-";"10";"taxable_goods";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"-";"Out of Stock";"-";"-";"Search";"assertProductSaveMessage, assertProductForm, assertProductSkuAutoGenerated, assertProductSearchableBySku";"" +"Create product with group price";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"category_%isolation%";"MAGETWO-23055";"-";"-";"-";"-";"-";"-";"Catalog";"assertProductSaveMessage, assertProductForm, assertProductVisibleInCategory";"" +"Create product with custom options suite and import options";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"-";"Yes";"-";"MAGETWO-23055";"-";"-";"-";"-";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"assertProductSaveMessage, assertProductSearchableBySku, assertProductPage, assertProductGroupedPriceOnProductPage, assertProductCustomOptionsOnProductPage";"" +"Create product without manage stock";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"No";"In Stock";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductSpecialPriceOnProductPage, assertProductInStock";"" +"Create product out of stock with tier price";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"999";"Yes";"-";"-";"-";"default";"-";"Out of Stock";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductTierPriceOnProductPage, assertProductOutOfStock";"" +"MAGETWO-13593: Create Virtual Product with Required Fields Only and Assign It to the Category";"virtual-product-%isolation%";"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualTest.php deleted file mode 100644 index 7e966ab4371dd..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualTest.php +++ /dev/null @@ -1,102 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Creating Virtual product with required fields only and assign it to the category - * - * @ZephyrId MAGETWO-13593 - * @return void - */ - public function testCreateProduct() - { - $product = Factory::getFixtureFactory()->getMagentoCatalogVirtualProduct(); - $product->switchData('virtual'); - //Data - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $createProductPage->open(['type' => 'virtual', 'set' => 4]); - $productForm = $createProductPage->getProductForm(); - //Steps - $productForm->fill($product); - $createProductPage->getFormPageActions()->save(); - //Verifying - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verifying - $this->assertOnGrid($product); - $this->assertOnCategory($product); - } - - /** - * Assert existing product on admin product grid - * - * @param VirtualProduct $product - * @return void - */ - protected function assertOnGrid(VirtualProduct $product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Grid $gridBlock */ - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Assert product data on category and product pages - * - * @param VirtualProduct $product - * @return void - */ - protected function assertOnCategory(VirtualProduct $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productPage = Factory::getPageFactory()->getCatalogProductView(); - $productViewBlock = $productPage->getViewBlock(); - $this->assertEquals($product->getName(), $productViewBlock->getProductName()); - $price = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals(number_format($product->getProductPrice(), 2), $price); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php index 4779a5f916014..e5052cab92c2a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php @@ -140,7 +140,7 @@ protected function getProductsToVerify($product) } /** - * Open product in related products section and verify her promoted products. + * Open product in related products section and verify its promoted products. * * @param string $productShortName * @return void diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.php deleted file mode 100644 index 96407f349a198..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.php +++ /dev/null @@ -1,81 +0,0 @@ -_dataConfig = [ - 'type_id' => 'downloadable', - 'constraint' => 'Success', - 'grid_filter' => ['name'], - 'create_url_params' => [ - 'type' => 'downloadable', - 'set' => static::DEFAULT_ATTRIBUTE_SET_ID, - ], - 'input_prefix' => 'product', - ]; - - $data = [ - 'is_virtual' => ['value' => '', 'group' => null], // needed for CURL handler - 'price' => [ - 'value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'qty' => [ - 'value' => 1000, - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input_name' => 'product[quantity_and_stock_status][qty]', - ], - 'quantity_and_stock_status' => [ - 'value' => 'In Stock', - 'input_value' => 1, - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input_name' => 'product[quantity_and_stock_status][is_in_stock]', - ], - 'product_website_1' => [ - 'value' => 'Yes', - 'input_value' => 1, - 'group' => static::GROUP_PRODUCT_WEBSITE, - 'input' => 'checkbox', - 'input_name' => 'product[website_ids][]', - ], - - ]; - - $this->_data['fields'] = $data + $this->_data['fields']; - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data); - } - - /** - * Create product - */ - public function persist() - { - $id = Factory::getApp()->magentoDownloadableCreateDownloadable($this); - $this->_data['fields']['id']['value'] = $id; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksNotPurchasedSeparately.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksNotPurchasedSeparately.php deleted file mode 100644 index cc71d919ab802..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksNotPurchasedSeparately.php +++ /dev/null @@ -1,38 +0,0 @@ -_data = array_replace_recursive( - $this->_data, - [ - 'fields' => [ - 'downloadable_link_purchase_type' => [ - 'value' => 'No', - 'input_value' => '0', - ], - ] - ] - ); - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksPurchasedSeparately.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksPurchasedSeparately.php deleted file mode 100644 index 0151c23348f83..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/LinksPurchasedSeparately.php +++ /dev/null @@ -1,59 +0,0 @@ -_data = array_replace_recursive( - $this->_data, - [ - 'fields' => [ - 'downloadable_links' => [ - 'value' => [ - 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'Yes', - 'downloadable' => [ - 'link' => [ - [ - 'title' => 'row1%isolation%', - 'price' => 2.43, - 'number_of_downloads' => 2, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.com', - 'is_shareable' => 'No', - 'sort_order' => 0, - ], - ], - ], - ], - 'group' => static::GROUP, - ], - ] - ] - ); - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php index 6273955c5ba95..9105b17ee73b1 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php @@ -97,6 +97,21 @@ protected function getPreset($name) ], ] ], + + 'one_dollar_product_with_one_separately_link' => [ + 'options' => [ + 'links' => [ + [ + 'label' => 'link_0', + 'value' => 'Yes' + ] + ], + ], + 'cartItem' => [ + 'price' => 3, + 'subtotal' => 3, + ], + ], ]; return isset($presets[$name]) ? $presets[$name] : []; } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php index 89189d993b235..268e3f20818e1 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php @@ -118,6 +118,25 @@ protected function getPreset($name) ], ], ], + 'one_separately_link' => [ + 'title' => 'Links%isolation%', + 'links_purchased_separately' => 'Yes', + 'downloadable' => [ + 'link' => [ + [ + 'title' => 'link1%isolation%', + 'price' => 2, + 'number_of_downloads' => 2, + 'sample' => [ + 'sample_type_url' => 'Yes', + 'sample_url' => 'http://example.com', + ], + 'file_type_url' => 'Yes', + 'file_link_url' => 'http://example.com', + ], + ], + ], + ], 'with_two_separately_links' => [ 'title' => 'Links%isolation%', 'links_purchased_separately' => 'Yes', diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/Curl/CreateDownloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/Curl/CreateDownloadable.php deleted file mode 100644 index 34466591d8665..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/Curl/CreateDownloadable.php +++ /dev/null @@ -1,134 +0,0 @@ - $values) { - if ($key === 'downloadable') { - $data += $this->prepareDownloadableData($key, $values); - } else { - $value = $this->getValue($values); - //do not add this data if value does not exist - if (null === $value) { - continue; - } - if (isset($values['input_name'])) { - $data[$values['input_name']] = $value; - } elseif ($prefix) { - $data[$prefix][$key] = $value; - } else { - $data[$key] = $value; - } - } - } - return $data; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function getValue($values) - { - return isset($values['value']) - ? (isset($values['input_value']) ? $values['input_value'] : $values['value']) - : null; - } - - /** - * Prepare downloadable data - * - * @param string $key - * @param string|array $value - * @return array - */ - protected function prepareDownloadableData($key, $value) - { - if (strpos($key, '][')) { - list($key1, $key2) = explode('][', $key); - return [$key1 => $this->prepareDownloadableData($key2, $value)]; - } - - if (!is_array($value)) { - return [$key => $value]; - } - - if (isset($value['value'])) { - return [$key => $value['value']]; - } - - $data = []; - foreach ($value as $subKey => $subValue) { - $data = array_replace_recursive($data, $this->prepareDownloadableData($subKey, $subValue)); - } - return [$key => $data]; - } - - /** - * Retrieve URL for request with all necessary parameters - * - * @param array $config - * @return string - */ - protected function getUrl(array $config) - { - $requestParams = isset($config['create_url_params']) ? $config['create_url_params'] : []; - $params = ''; - foreach ($requestParams as $key => $value) { - $params .= $key . '/' . $value . '/'; - } - return $_ENV['app_backend_url'] . 'catalog/product/save/' . $params . 'popup/1/back/edit'; - } - - /** - * POST request for creating downloadable product - * - * @param FixtureInterface $fixture [optional] - * @return int id of created product - */ - public function persist(FixtureInterface $fixture = null) - { - $config = $fixture->getDataConfig(); - - $curl = new BackendDecorator(new CurlTransport(), new Config()); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write( - CurlInterface::POST, - $this->getUrl($config), - '1.0', - [], - $this->prepareData( - $fixture->getData('fields'), - isset($config['input_prefix']) ? $config['input_prefix'] : null - ) - ); - $response = $curl->read(); - $curl->close(); - - preg_match("~Location: [^\s]*\/id\/(\d+)~", $response, $matches); - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.php deleted file mode 100644 index 53fc2a0fdb8b1..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.php +++ /dev/null @@ -1,17 +0,0 @@ -one_custom_option_and_downloadable_link + + + Downloadable product %isolation% + downloadable_product_%isolation% + downloadable-product-%isolation% + + 1 + + + default + + + one_separately_link + + + one_dollar_product_with_one_separately_link + + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/Create/LinksPurchasedSeparatelyTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/Create/LinksPurchasedSeparatelyTest.php deleted file mode 100755 index 3d92e2ab47b2b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/Create/LinksPurchasedSeparatelyTest.php +++ /dev/null @@ -1,120 +0,0 @@ -product = Factory::getFixtureFactory() - ->getMagentoDownloadableDownloadableProductLinksPurchasedSeparately(); - $this->product->switchData('downloadable'); - Factory::getApp()->magentoBackendLoginUser(); - } - - /** - * Creating Downloadable product with required fields only and assign it to the category - * - * @ZephyrId MAGETWO-13595 - * @return void - */ - public function test() - { - $createProductPage = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage->open(); - $createProductPage->getGridPageActionBlock()->addProduct('downloadable'); - - $createProductPageNew = Factory::getPageFactory()->getCatalogProductNew(); - $productBlockForm = $createProductPageNew->getProductForm(); - - $category = $this->product->getCategories()['category']; - $productBlockForm->fill($this->product, null, $category); - $createProductPageNew->getFormPageActions()->save(); - - $createProductPageNew->getMessagesBlock()->waitSuccessMessage(); - - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - - $this->assertOnBackend(); - $this->assertOnFrontend(); - } - - /** - * Assert existing product on admin product grid - * - * @return void - */ - protected function assertOnBackend() - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $this->product->getSku()])); - } - - /** - * Assert product data on category and product pages - * - * @return void - */ - protected function assertOnFrontend() - { - $product = $this->product; - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - - $productListBlock->openProductViewPage($product->getName()); - $productViewBlock = $productPage->getViewBlock(); - $this->assertEquals($product->getName(), $productViewBlock->getProductName()); - $this->assertEquals( - number_format($product->getProductPrice(), 2), - $productViewBlock->getPriceBlock()->getPrice() - ); - - $productDownloadableLinks = $product->getData('fields/downloadable_links/value/downloadable/link'); - $pageOptions = $productViewBlock->getOptions($product); - $pageDownloadableOptions = $pageOptions['downloadable_options']['downloadable_links']; - $pageDownloadableLinks = $pageDownloadableOptions['downloadable']['link']; - foreach ($productDownloadableLinks as $key => $link) { - $this->assertEquals( - $pageDownloadableLinks[$key]['title'], - $link['title'] - ); - $this->assertEquals( - $pageDownloadableLinks[$key]['price'], - $link['price'] - ); - } - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv index 35f2819c56f33..e33ab99f817b2 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv @@ -1,15 +1,16 @@ -"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/url_key";"constraint" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"taxable_goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"taxable_goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"taxable_goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage" +"description";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/checkout_data/preset";"product/data/url_key";"constraint" +"Create product with default set links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock" +"Create product with default sets samples and links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData" +"Create product with custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData" +"Create product without category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"taxable_goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku" +"Create product with out of stock status";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm" +"Create product with manage stock";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock" +"Create product without tax class id";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage" +"Create product with import custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" +"Create product with three links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" +"-";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage" +"Create product without filling quantity and stock";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage" +"Create product with special price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage" +"Create product with group price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"taxable_goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage" +"Create product with tier price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"taxable_goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage" +"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_one_separately_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart" diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php index 0cacb9adcf166..48da36e3f8727 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php @@ -105,15 +105,9 @@ public function fill(FixtureInterface $product) */ public function getOptions(FixtureInterface $product) { + /** @var GroupedProductInjectable $product */ + $associatedProducts = $product->getAssociated()['products']; $options = []; - if ($product instanceof InjectableFixture) { - /** @var GroupedProductInjectable $product */ - $associatedProducts = $product->getAssociated()['products']; - } else { - // TODO: Removed after refactoring(removed) old product fixture. - /** @var GroupedProduct $product */ - $associatedProducts = $product->getAssociatedProducts(); - } foreach ($associatedProducts as $subProduct) { /** @var CatalogProductSimple $subProduct */ diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.php deleted file mode 100644 index 1a9779e60448d..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.php +++ /dev/null @@ -1,144 +0,0 @@ -_placeholders['simple::getName'] = [$this, 'productProvider']; - $this->_placeholders['virtual::getName'] = [$this, 'productProvider']; - $this->_placeholders['downloadable::getName'] = [$this, 'productProvider']; - $this->_placeholders['simple::getProductId'] = [$this, 'productProvider']; - $this->_placeholders['virtual::getProductId'] = [$this, 'productProvider']; - $this->_placeholders['downloadable::getProductId'] = [$this, 'productProvider']; - } - - /** - * Get Associated Products - * - * @return array - */ - public function getAssociatedProducts() - { - return $this->products; - } - - /** - * Get Associated Product Names - * - * @return array - */ - public function getAssociatedProductNames() - { - $names = []; - foreach ($this->getData('fields/grouped_products/value') as $product) { - $names[] = $product['search_data']['name']; - } - return $names; - } - - /** - * Init Data - */ - protected function _initData() - { - $this->_dataConfig = [ - 'type_id' => 'grouped', - 'constraint' => 'Success', - 'create_url_params' => [ - 'type' => 'grouped', - 'set' => static::DEFAULT_ATTRIBUTE_SET_ID, - ], - ]; - $this->_data = [ - 'fields' => [ - 'name' => [ - 'value' => 'Grouped Product %isolation%', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'sku' => [ - 'value' => 'grouped_sku_%isolation%', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'grouped_products' => [ - 'value' => [ - 'assigned_product_0' => [ - 'search_data' => [ - 'name' => '%simple::getName%', - ], - 'data' => [ - 'selection_qty' => [ - 'value' => 1, - ], - 'product_id' => [ - 'value' => '%simple::getProductId%', - ], - ], - ], - 'assigned_product_1' => [ - 'search_data' => [ - 'name' => '%virtual::getName%', - ], - 'data' => [ - 'selection_qty' => [ - 'value' => 1, - ], - 'product_id' => [ - 'value' => '%virtual::getProductId%', - ], - ], - ], - 'assigned_product_2' => [ - 'search_data' => [ - 'name' => '%downloadable::getName%', - ], - 'data' => [ - 'selection_qty' => [ - 'value' => 1, - ], - 'product_id' => [ - 'value' => '%downloadable::getProductId%', - ], - ], - ], - ], - 'group' => static::GROUP, - ], - ], - ]; - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoGroupedProductGroupedProduct($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php index 8541be0f1dc01..9c459b9862463 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php @@ -219,6 +219,29 @@ protected function getPreset($name) 'catalogProductSimple::product_100_dollar', ], ], + 'simple_downloadable_virtual' => [ + 'assigned_products' => [ + [ + 'id' => '%id%', + 'name' => '%item1_simple::getProductName%', + 'position' => '%position%', + 'qty' => 3, + ], + [ + 'id' => '%id%', + 'name' => '%item2_downloadable::getProductName%', + 'position' => '%position%', + 'qty' => 7, + ], + [ + 'id' => '%id%', + 'name' => '%item3_virtual::getProductName%', + 'position' => '%position%', + 'qty' => 11, + ], + ], + 'products' => [], + ], ]; if (!isset($presets[$name])) { return null; diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.php deleted file mode 100644 index bea999a994040..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.php +++ /dev/null @@ -1,18 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Creating Grouped product and assigning it to category - * - * @ZephyrId MAGETWO-13610 - * @return void - */ - public function testCreateGroupedProduct() - { - //Data - $product = Factory::getFixtureFactory()->getMagentoGroupedProductGroupedProduct(); - $product->switchData('grouped'); - //Page & Blocks - $manageProductsGrid = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - //Steps - $manageProductsGrid->open(); - $manageProductsGrid->getGridPageActionBlock()->addProduct('grouped'); - $productForm->fill($product); - $createProductPage->getFormPageActions()->save(); - //Verifying - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - //Verifying - $this->assertOnGrid($product); - $this->assertOnFrontend($product); - } - - /** - * Assert existing product on admin product grid - * - * @param GroupedProduct $product - * @return void - */ - protected function assertOnGrid($product) - { - //Search data - $search = [ - 'sku' => $product->getSku(), - 'type' => 'Grouped Product', - ]; - //Page & Block - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Grid $gridBlock */ - $gridBlock = $productGridPage->getProductGrid(); - //Assertion - $this->assertTrue($gridBlock->isRowVisible($search), 'Grouped product was not found.'); - } - - /** - * Assert Grouped product on Frontend - * - * @param GroupedProduct $product - * @return void - */ - protected function assertOnFrontend(GroupedProduct $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue( - $productListBlock->isProductVisible($product->getName()), - 'Product is absent on category page.' - ); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $productListBlock->openProductViewPage($product->getName()); - $this->assertEquals( - $product->getName(), - $productViewBlock->getProductName(), - 'Product name does not correspond to specified.' - ); - - $optionsOnPage = $productViewBlock->getOptions($product); - $pageAssociatedProductNames = []; - foreach ($optionsOnPage['grouped_options'] as $optionOnPage) { - $pageAssociatedProductNames[] = $optionOnPage['name']; - } - $this->assertEquals($product->getAssociatedProductNames(), $pageAssociatedProductNames); - } -} From 89b534f0655dc03ab7f7e03bf44e2f9605708dbb Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Fri, 6 Feb 2015 15:51:38 +0200 Subject: [PATCH 28/50] MTA-552: Re-factor Test for Create Product with New Category - Fixed check of creation category --- .../Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php index a66e11c1e5d8c..096e0f27c703e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails.php @@ -51,6 +51,7 @@ public function fillFormTab(array $fields, SimpleElement $element = null) /* Fix browser behavior for click by hidden list result of suggest(category) element */ $this->scrollToCategory(); if (isset($fields['category_ids']['source']) + && $fields['category_ids']['source']->getCategories() !== null && !$fields['category_ids']['source']->getCategories()[0]->hasData('id') ) { $this->blockFactory->create( From 09400ec7602a69d52767c957b1a193447cb14952 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Fri, 6 Feb 2015 15:55:42 +0200 Subject: [PATCH 29/50] MTA-548: Re-factor Tests for Create Products - Removed SimpleProduct --- .../Mtf/Util/Generate/Factory/Block.php | 2 +- .../Mtf/Util/Generate/Factory/Fixture.php | 2 +- .../Mtf/Util/Generate/Factory/Page.php | 2 +- .../Mtf/Util/Generate/Factory/Repository.php | 2 +- .../Test/Block/Catalog/Product/View.php | 17 +- .../Catalog/Product/View/Type/Bundle.php | 13 +- .../Magento/Bundle/Test/Fixture/Bundle.php | 143 ------- .../Bundle/Test/Fixture/BundleDynamic.php | 101 ----- .../Bundle/Test/Fixture/BundleFixed.php | 121 ------ .../BundleProduct/BundleSelections.php | 24 ++ .../Bundle/Test/Handler/Curl/CreateBundle.php | 208 --------- .../Magento/Bundle/Test/Repository/Bundle.php | 50 --- .../Test/TestCase/BundleDynamicTest.php | 118 ------ .../Bundle/Test/TestCase/BundleFixedTest.php | 115 ----- .../CreateBundleProductEntityTest.php | 1 + .../CreateBundleProductEntityTest/test.csv | 32 +- .../Test/Block/AbstractConfigureBlock.php | 22 +- .../Adminhtml/Product/Composite/Configure.php | 7 +- .../Edit/Tab/ProductDetails/CategoryIds.php | 1 - .../Test/Block/Category/ProductPagination.php | 2 +- .../Block/Product/ProductList/Related.php | 4 +- .../Catalog/Test/Block/Product/View.php | 7 +- .../Test/Block/Product/View/CustomOptions.php | 12 +- .../Test/Constraint/AssertCategoryPage.php | 1 + .../app/Magento/Catalog/Test/etc/fixture.xml | 35 -- .../Block/Adminhtml/Product/ProductForm.php | 11 +- .../Test/Block/Product/View.php | 53 +-- .../Product/View/ConfigurableOptions.php | 21 +- .../Test/Fixture/ConfigurableProduct.php | 394 ------------------ .../CheckoutData.php | 14 + .../ConfigurableAttributesData.php | 88 +++- .../Test/Handler/Curl/CreateConfigurable.php | 168 -------- .../Test/Repository/ConfigurableProduct.php | 232 ----------- .../ConfigurableProductInjectable.xml | 94 +++++ .../test.csv | 11 +- .../Test/TestCase/CreateConfigurableTest.php | 128 ------ .../Test/TestCase/CreateWithAttributeTest.php | 6 +- .../Test/Fixture/Customer/GroupId.php | 3 + .../Test/TestStep/PlaceOrderStep.php | 1 - .../Test/Block/Adminhtml/ReviewForm.php | 1 - .../Block/Adminhtml/Order/Invoice/Totals.php | 1 - .../Test/Block/Adminhtml/Order/View/Items.php | 45 +- .../Tax/Test/Handler/Curl/RemoveTaxRule.php | 1 + .../Magento/Tax/Test/Repository/TaxClass.xml | 2 - .../User/Test/Handler/Curl/CreateUser.php | 2 +- .../Magento/Weee/Test/Block/Product/View.php | 2 +- 46 files changed, 331 insertions(+), 1989 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Bundle.php delete mode 100644 dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleDynamic.php delete mode 100644 dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleFixed.php delete mode 100644 dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/Curl/CreateBundle.php delete mode 100644 dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/Bundle.php delete mode 100755 dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleDynamicTest.php delete mode 100755 dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleFixedTest.php delete mode 100644 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/Curl/CreateConfigurable.php delete mode 100644 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.php delete mode 100644 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableTest.php diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Block.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Block.php index b564d6aca69dc..21c75bc58f694 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Block.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Block.php @@ -44,7 +44,7 @@ protected function addBlockToFactory(array $item) $params = "\$element, \$driver = null, \$config = []"; $this->factoryContent .= "\n /**\n"; - $this->factoryContent .= " * @return \\{$item['class']}\n"; + $this->factoryContent .= " * @return {$item['class']}\n"; $this->factoryContent .= " */\n"; $this->factoryContent .= " public function get{$methodNameSuffix}({$params})\n"; $this->factoryContent .= " {"; diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Fixture.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Fixture.php index 174a17a271875..2de422bed3404 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Fixture.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Fixture.php @@ -43,7 +43,7 @@ protected function addFixtureToFactory($item) $this->factoryContent .= "\n"; $this->factoryContent .= " /**\n"; - $this->factoryContent .= " * @return \\{$item['class']}\n"; + $this->factoryContent .= " * @return {$item['class']}\n"; $this->factoryContent .= " */\n"; $this->factoryContent .= " public function get{$methodNameSuffix}(array \$placeholders = [])\n"; $this->factoryContent .= " {"; diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Page.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Page.php index c1cb6f22762be..b8c47ab57e9ec 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Page.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Page.php @@ -44,7 +44,7 @@ protected function _addPageToFactory($item) $fallbackComment = $this->_buildFallbackComment($item); $this->factoryContent .= "\n /**\n"; - $this->factoryContent .= " * @return \\{$item['class']}\n"; + $this->factoryContent .= " * @return {$item['class']}\n"; $this->factoryContent .= " */\n"; $this->factoryContent .= " public function get{$methodNameSuffix}()\n"; $this->factoryContent .= " {"; diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Repository.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Repository.php index 79facfdcb13f3..727ad5e43d8ea 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Repository.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/Repository.php @@ -44,7 +44,7 @@ protected function _addToFactory($item) $fallbackComment = $this->_buildFallbackComment($item); $this->factoryContent .= "\n /**\n"; - $this->factoryContent .= " * @return \\{$item['class']}\n"; + $this->factoryContent .= " * @return {$item['class']}\n"; $this->factoryContent .= " */\n"; $this->factoryContent .= " public function get{$methodNameSuffix}(array \$defaultConfig = [], " . "array \$defaultData = [])\n"; diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php index 5f99ab3bce393..37fc771244114 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php @@ -103,17 +103,12 @@ public function getOptions(FixtureInterface $product = null) */ public function fillOptions(FixtureInterface $product) { - if ($product instanceof InjectableFixture) { - /** @var \Magento\Bundle\Test\Fixture\BundleProduct $product */ - $checkoutData = $product->getCheckoutData(); - $bundleCheckoutData = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - } else { - // TODO: Removed after refactoring(removed) old product fixture. - /** @var \Magento\Bundle\Test\Fixture\BundleFixed $product */ - $bundleCheckoutData = $product->getSelectionData(); - } + /** @var \Magento\Bundle\Test\Fixture\BundleProduct $product */ + $checkoutData = $product->getCheckoutData(); + $bundleCheckoutData = isset($checkoutData['options']['bundle_options']) + ? $checkoutData['options']['bundle_options'] + : []; + if (!$this->getBundleBlock()->isVisible()) { $this->clickCustomize(); } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php index 137eadb438b48..696395534ddaa 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php @@ -6,7 +6,6 @@ namespace Magento\Bundle\Test\Block\Catalog\Product\View\Type; -use Magento\Bundle\Test\Fixture\Bundle as BundleDataFixture; use Magento\Bundle\Test\Fixture\BundleProduct; use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Bundle\Test\Block\Catalog\Product\View\Type\Option; @@ -93,15 +92,9 @@ public function addToCart(BundleProduct $product, CatalogProductView $catalogPro */ public function getOptions(FixtureInterface $product) { - if ($product instanceof InjectableFixture) { - /** @var BundleProduct $product */ - $bundleSelections = $product->getBundleSelections(); - $bundleOptions = isset($bundleSelections['bundle_options']) ? $bundleSelections['bundle_options'] : []; - } else { - // TODO: Removed after refactoring(removed) old product fixture. - /** @var BundleDataFixture $product */ - $bundleOptions = $product->getBundleOptions(); - } + /** @var BundleProduct $product */ + $bundleSelections = $product->getBundleSelections(); + $bundleOptions = isset($bundleSelections['bundle_options']) ? $bundleSelections['bundle_options'] : []; $listFormOptions = $this->getListOptions(); $formOptions = []; diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Bundle.php deleted file mode 100644 index 082ce5fa3dbee..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Bundle.php +++ /dev/null @@ -1,143 +0,0 @@ -_placeholders['item1_simple1::getName'] = [$this, 'productProvider']; - $this->_placeholders['item1_simple1::getProductId'] = [$this, 'productProvider']; - $this->_placeholders['item1_virtual2::getName'] = [$this, 'productProvider']; - $this->_placeholders['item1_virtual2::getProductId'] = [$this, 'productProvider']; - } - - /** - * @param string $productData - * @return string - */ - protected function formatProductType($productData) - { - list(, $productData) = explode('_', $productData); - return preg_replace('/\d/', '', $productData); - } - - /** - * Create bundle product - * - * @return $this|void - */ - public function persist() - { - Factory::getApp()->magentoBundleCreateBundle($this); - - return $this; - } - - /** - * Get bundle options data to add product to shopping cart - */ - public function getBundleOptions() - { - $options = []; - $bundleOptions = $this->getData('fields/bundle_selections/value'); - foreach ($bundleOptions['bundle_options'] as $optionData) { - $option = [ - 'title' => $optionData['title'], - 'type' => $optionData['type'], - 'options' => [], - ]; - - foreach ($optionData['assigned_products'] as $productData) { - $option['options'][] = ['title' => $productData['search_data']['name']]; - } - $options[] = $option; - } - - return $options; - } - - /** - * Get prices for verification - * - * @return array|string - */ - public function getProductPrice() - { - $prices = $this->getData('checkout/prices'); - return $prices ?: parent::getProductPrice(); - } - - /** - * Get options type, value and qty to select for adding to shopping cart - * - * @return array - */ - public function getSelectionData() - { - $options = $this->getData('checkout/selection'); - $selectionData = []; - foreach ($options as $option => $selection) { - $fieldPrefix = 'fields/bundle_selections/value/bundle_options/'; - $selectionItem['type'] = $this->getData($fieldPrefix . $option . '/type'); - $selectionItem['title'] = $this->getData($fieldPrefix . $option . '/title'); - $selectionItem['value']['qty'] = $this->getData( - $fieldPrefix . $option . '/assigned_products/' . $selection . '/data/selection_qty' - ); - $selectionItem['value']['name'] = $this->getData( - $fieldPrefix . $option . '/assigned_products/' . $selection . '/search_data/name' - ); - $selectionData[] = $selectionItem; - } - - return $selectionData; - } - - /** - * Initialize fixture data - */ - protected function _initData() - { - parent::_initData(); - $this->_dataConfig = [ - 'type_id' => 'bundle', - 'constraint' => 'Success', - 'create_url_params' => [ - 'type' => 'bundle', - 'set' => static::DEFAULT_ATTRIBUTE_SET_ID, - ], - 'input_prefix' => 'product', - ]; - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoBundleBundle($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleDynamic.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleDynamic.php deleted file mode 100644 index 18f692eeda8fe..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleDynamic.php +++ /dev/null @@ -1,101 +0,0 @@ -_data['checkout'] = [ - 'prices' => [ - 'price_from' => 10, - 'price_to' => 15, - ], - 'selection' => [0], - ]; - parent::_initData(); - $this->_data['fields'] = array_merge_recursive( - $this->_data['fields'], - [ - 'sku_type' => [ - 'value' => 'Dynamic', - 'input_value' => '0', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'price_type' => [ - 'value' => 'Dynamic', - 'input_value' => '0', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'weight_type' => [ - 'value' => 'Dynamic', - 'input_value' => '0', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'product_website_1' => [ - 'value' => 'Yes', - 'input_value' => [1], - 'group' => static::GROUP_PRODUCT_WEBSITE, - 'input' => 'checkbox', - 'input_name' => 'website_ids', - ], - 'shipment_type' => [ - 'value' => 'Separately', - 'input_value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'bundle_selections' => [ - 'value' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%item1_simple1::getName%', - ], - 'data' => [ - 'selection_qty' => 1, - 'product_id' => '%item1_simple1::getProductId%', - ], - ], - [ - 'search_data' => [ - 'name' => '%item1_virtual2::getName%', - ], - 'data' => [ - 'selection_qty' => 1, - 'product_id' => '%item1_virtual2::getProductId%', - ] - ], - ], - ], - ], - ], - 'group' => static::GROUP, - ] - ] - ); - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoBundleBundle($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleFixed.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleFixed.php deleted file mode 100644 index 3cebc6dfa36b2..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleFixed.php +++ /dev/null @@ -1,121 +0,0 @@ -_data['checkout'] = [ - 'prices' => [ - 'price_from' => 110, - 'price_to' => 120, - ], - 'selection' => [0], - ]; - parent::_initData(); - $this->_data['fields'] = array_merge_recursive( - $this->_data['fields'], - [ - 'sku_type' => [ - 'value' => 'Fixed', - 'input_value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'price_type' => [ - 'value' => 'Fixed', - 'input_value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'price' => [ - 'value' => 100, - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'tax_class_id' => [ - 'value' => 'Taxable Goods', - 'input_value' => '2', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'weight_type' => [ - 'value' => 'Fixed', - 'input_value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'weight' => [ - 'value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'product_website_1' => [ - 'value' => 'Yes', - 'input_value' => [1], - 'group' => static::GROUP_PRODUCT_WEBSITE, - 'input' => 'checkbox', - 'input_name' => 'website_ids', - ], - 'shipment_type' => [ - 'value' => 'Separately', - 'input_value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - ], - 'bundle_selections' => [ - 'value' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%item1_simple1::getName%', - ], - 'data' => [ - 'selection_price_value' => 10, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - 'product_id' => '%item1_simple1::getProductId%', - ], - ], - [ - 'search_data' => [ - 'name' => '%item1_virtual2::getName%', - ], - 'data' => [ - 'selection_price_value' => 20, - 'selection_price_type' => 'Percent', - 'selection_qty' => 1, - 'product_id' => '%item1_virtual2::getProductId%', - ] - ], - ], - ], - ], - ], - 'group' => static::GROUP, - ] - ] - ); - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoBundleBundle($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index 6f5a58cba9766..99a1c73b32002 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -614,6 +614,30 @@ protected function getPreset($name) ], ], ], + + 'one_options_assigned_simple_big_qty' => [ + 'bundle_options' => [ + [ + 'title' => 'Drop-down Option', + 'type' => 'Drop-down', + 'assigned_products' => [ + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_qty' => 1, + ], + ], + ], + ], + ], + 'products' => [ + [ + 'catalogProductSimple::simple_big_qty', + ], + ], + ], ]; if (!isset($presets[$name])) { throw new \InvalidArgumentException( diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/Curl/CreateBundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/Curl/CreateBundle.php deleted file mode 100644 index 7afa0f40e967f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/Curl/CreateBundle.php +++ /dev/null @@ -1,208 +0,0 @@ - [ - 'Yes' => 1, - 'No' => 0, - ], - 'required' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'sku_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'price_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'weight_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'shipment_type' => [ - 'Together' => 0, - 'Separately' => 1, - ], - 'type' => [ - 'Drop-down' => 'select', - 'Radio Buttons' => 'radio', - 'Checkbox' => 'checkbox', - 'Multiple Select' => 'multi', - ], - 'selection_price_type' => [ - 'Fixed' => 0, - 'Percent' => 1, - ], - ]; - - /** - * Prepare POST data for creating bundle product request - * - * @param array $params - * @param string|null $prefix [optional] - * @return array - */ - protected function _prepareData(array $params, $prefix = null) - { - $data = []; - foreach ($params as $key => $values) { - if ($key == 'bundle_selections') { - $data = array_merge($data, $this->_getBundleData($values['value'])); - } else { - $value = $this->_getValue($values); - // do not add this data if value does not exist - if (null === $value) { - continue; - } - if (isset($values['input_name'])) { - $key = $values['input_name']; - } - if ($prefix) { - $data[$prefix][$key] = $value; - } else { - $data[$key] = $value; - } - } - } - - return $data; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function _getValue(array $values) - { - if (!isset($values['value'])) { - return null; - } - return isset($values['input_value']) ? $values['input_value'] : $values['value']; - } - - /** - * Prepare bundle specific data - * - * @param array $params - * @return array - */ - protected function _getBundleData(array $params) - { - $data = [ - 'bundle_options' => [], - 'bundle_selections' => [], - ]; - $index = 0; - foreach ($params['bundle_options'] as $option) { - $data['bundle_options'][] = [ - 'title' => $option['title'], - 'type' => $option['type'], - 'required' => $option['required'], - 'delete' => '', - 'position' => $index, - ]; - - $position = 0; - foreach ($option['assigned_products'] as $assignedProduct) { - $assignedProduct['data'] += [ - 'delete' => '', - 'position' => ++$position - ]; - $data['bundle_selections'][$index][] = $assignedProduct['data']; - } - ++$index; - } - - return $this->replaceMappingData($data); - } - - /** - * Retrieve URL for request with all necessary parameters - * - * @param array $config - * @return string - */ - protected function _getUrl(array $config) - { - $requestParams = isset($config['create_url_params']) ? $config['create_url_params'] : []; - $params = ''; - foreach ($requestParams as $key => $value) { - $params .= $key . '/' . $value . '/'; - } - return $_ENV['app_backend_url'] . 'catalog/product/save/' . $params . 'popup/1/back/edit'; - } - - /** - * Prepare product selections data - * - * @param array $products - * @return array - */ - protected function _getSelections(array $products) - { - $data = []; - foreach ($products as $product) { - $product = isset($product['data']) ? $product['data'] : []; - $data[] = $this->_prepareData($product) + ['delete' => '']; - } - return $data; - } - - /** - * Post request for creating bundle product - * - * @param FixtureInterface|null $fixture [optional] - * @return mixed|string - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $config = $fixture->getDataConfig(); - - $prefix = isset($config['input_prefix']) ? $config['input_prefix'] : null; - $data = $this->_prepareData($fixture->getData('fields'), $prefix); - if ($fixture->getData('category_id')) { - $data['product']['category_ids'] = $fixture->getData('category_id'); - } - $url = $this->_getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), new Config()); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - preg_match("~Location: [^\s]*\/id\/(\d+)~", $response, $matches); - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/Bundle.php deleted file mode 100644 index 08623189e4ac3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/Bundle.php +++ /dev/null @@ -1,50 +0,0 @@ -_data[$productType]['data']['fields']['price'])) { - $required = array_merge_recursive( - $required, - [ - 'data' => [ - 'fields' => [ - 'price' => [ - 'value' => 60, - 'group' => Fixture\Product::GROUP_PRODUCT_DETAILS, - ], - ], - 'checkout' => [ - 'prices' => [ - 'price_from' => 70, - 'price_to' => 72, - ], - ], - ] - ] - ); - } else { - $required['data']['checkout']['prices'] = $this->_data[$productType]['data']['checkout']['prices']; - } - return $required; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleDynamicTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleDynamicTest.php deleted file mode 100755 index fcdff4b9407d0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleDynamicTest.php +++ /dev/null @@ -1,118 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Creating bundle (dynamic) product and assigning it to the category - * - * @ZephyrId MAGETWO-12702 - * @return void - */ - public function testCreate() - { - //Data - $bundle = Factory::getFixtureFactory()->getMagentoBundleBundleDynamic(); - $bundle->switchData('bundle'); - //Pages & Blocks - $manageProductsGrid = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - $productForm = $createProductPage->getProductForm(); - //Steps - $manageProductsGrid->open(); - $manageProductsGrid->getGridPageActionBlock()->addProduct('bundle'); - $category = $bundle->getCategories()['category']; - $productForm->fill($bundle, null, $category); - $createProductPage->getFormPageActions()->save(); - //Verification - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - // Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verification - $this->assertOnGrid($bundle); - $this->assertOnCategory($bundle); - } - - /** - * Assert existing product on admin product grid - * - * @param Bundle $product - * @return void - */ - protected function assertOnGrid($product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Checking the product on the category page - * - * @param Bundle $product - * @return void - */ - protected function assertOnCategory($product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue( - $productListBlock->isProductVisible($product->getName()), - 'Product "' . $product->getName() . '" is absent on category page' - ); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $this->assertSame($product->getName(), $productViewBlock->getProductName()); - $this->assertEquals( - $product->getProductPrice(), - [ - 'price_from' => $productViewBlock->getPriceBlock()->getPriceFrom(), - 'price_to' => $productViewBlock->getPriceBlock()->getPriceTo() - ] - ); - $expectedOptions = $product->getBundleOptions(); - $actualOptions = $productViewBlock->getOptions($product)['bundle_options']; - foreach ($actualOptions as $key => $actualOption) { - $this->assertContains($expectedOptions[$key]['title'], $actualOption); - } - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleFixedTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleFixedTest.php deleted file mode 100755 index ba309fcd6ed5f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/BundleFixedTest.php +++ /dev/null @@ -1,115 +0,0 @@ -magentoBackendLoginUser(); - } - - /** - * Creating bundle (fixed) product and assigning it to the category - * - * @ZephyrId MAGETWO-12622 - * @return void - */ - public function testCreate() - { - //Data - $bundle = Factory::getFixtureFactory()->getMagentoBundleBundleFixed(); - $bundle->switchData('bundle'); - //Pages & Blocks - $manageProductsGrid = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - //Steps - $manageProductsGrid->open(); - $manageProductsGrid->getGridPageActionBlock()->addProduct('bundle'); - $productForm = $createProductPage->getProductForm(); - $category = $bundle->getCategories()['category']; - $productForm->fill($bundle, null, $category); - $createProductPage->getFormPageActions()->save(); - //Verification - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - // Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verification - $this->assertOnGrid($bundle); - $this->assertOnCategory($bundle); - } - - /** - * Assert existing product on admin product grid - * - * @param Bundle $product - * @return void - */ - protected function assertOnGrid($product) - { - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - $gridBlock = $productGridPage->getProductGrid(); - $this->assertTrue($gridBlock->isRowVisible(['sku' => $product->getSku()])); - } - - /** - * Checking the product on the category page - * - * @param Bundle $product - * @return void - */ - protected function assertOnCategory($product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue($productListBlock->isProductVisible($product->getName())); - $productListBlock->openProductViewPage($product->getName()); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $this->assertSame($product->getName(), $productViewBlock->getProductName()); - $this->assertEquals( - $product->getProductPrice(), - [ - 'price_from' => $productViewBlock->getPriceBlock()->getPriceFrom(), - 'price_to' => $productViewBlock->getPriceBlock()->getPriceTo() - ] - ); - $expectedOptions = $product->getBundleOptions(); - $actualOptions = $productViewBlock->getOptions($product)['bundle_options']; - foreach ($actualOptions as $key => $actualOption) { - $this->assertContains($expectedOptions[$key]['title'], $actualOption); - } - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php index 3dc5fec8c7a2d..77de6573802fc 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php @@ -29,6 +29,7 @@ class CreateBundleProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv index 4879de57fde4d..91902b8946af4 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv @@ -1,15 +1,17 @@ -"product/data/url_key";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint" -"bundle-product-%isolation%";"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage" -"bundle-product-%isolation%";"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"default";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku" -"bundle-product-%isolation%";"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"all_types_bundle_options";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType" -"bundle-product-%isolation%";"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage" -"bundle-product-%isolation%";"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"taxable_goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"all_types_bundle_fixed_and_custom_options";"all_types";"-";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType" -"bundle-product-%isolation%";"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"taxable_goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"with_not_required_options";"-";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView" -"bundle-product-%isolation%";"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar";"default";"-";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage" -"bundle-product-%isolation%";"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory" -"bundle-product-%isolation%";"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"bundle-product-%isolation%";"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"bundle-product-%isolation%";"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"with_custom_options_1";"drop_down_with_one_option_fixed_price";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage" -"bundle-product-%isolation%";"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-159";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"with_custom_options_2";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"bundle-product-%isolation%";"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage" -"bundle-product-%isolation%";"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage" +"description;product/data/url_key;product/data/name;product/data/sku_type;product/data/sku;product/data/status;product/data/price_type;product/data/price/value;product/data/price/preset;product/data/tax_class_id/dataSet;product/data/quantity_and_stock_status/is_in_stock;product/data/weight_type;product/data/weight;product/data/category;product/data/description;product/data/group_price/preset;product/data/special_price;product/data/special_from_date/pattern;product/data/special_to_date/pattern;product/data/tier_price/preset;product/data/price_view;product/data/stock_data/use_config_manage_stock;product/data/stock_data/manage_stock;product/data/shipment_type;product/data/bundle_selections/preset;product/data/bundle_selections/products;product/data/checkout_data/preset;product/data/custom_options/preset;product/data/custom_options/import_products;product/data/visibility;product/data/use_config_gift_message_available;product/data/gift_message_available;constraint";"tag" +"Create default bundle with dynamic options;bundle-product-%isolation%;BundleProduct %isolation%;-;bundle_sku_%isolation%;-;-;-;-;-;-;-;-;-;Bundle Product Dynamic Required;-;-;-;-;-;-;No;No;-;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;default;-;-;-;-;-;assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage";"" +"Create offline dynamic bundle with dynamic price and out of stock;bundle-product-%isolation%;BundleProduct %isolation%;Fixed;bundle_sku_%isolation%;Product offline;Dynamic;-;-;-;Out of Stock;Dynamic;-;category_%isolation%;-;-;-;-;-;-;-;-;-;Separately;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;default;-;-;Catalog, Search;No;Yes;assertProductSaveMessage, assertProductNotSearchableBySku";"" +"Create dynamic bundle with price randle and all types options;bundle-product-%isolation%;BundleProduct %isolation%;Dynamic;bundle_sku_%isolation%;Product online;Dynamic;-;dynamic-200;-;In Stock;Dynamic;-;category_%isolation%;Bundle Product Dynamic;-;-;-;-;-;Price Range;-;-;Together;all_types_dynamic;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;all_types_bundle_options;-;-;Catalog, Search;No;Yes;assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Create fixed bundle;bundle-product-%isolation%;BundleProduct %isolation%;Fixed;bundle_sku_%isolation%;-;Fixed;10;fixed-15;None;-;Fixed;10;-;Bundle Product Fixed Required;-;-;-;-;-;-;-;-;-;default_fixed;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;default;-;-;-;-;-;assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage";"" +"Create fixed bundle with all types options;bundle-product-%isolation%;BundleProduct %isolation%;Fixed;bundle_sku_%isolation%;Product online;Fixed;100;fixed-24;taxable_goods;In Stock;Fixed;10;category_%isolation%;Bundle Product Fixed;default;-;-;-;-;As Low as;-;-;Separately;all_types_fixed;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;all_types_bundle_fixed_and_custom_options;all_types;-;Catalog, Search;No;No;assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType";"" +"Create offline fixed bundle;bundle-product-%isolation%;BundleProduct %isolation%;Fixed;bundle_sku_%isolation%;Product online;Fixed;10;fixed-1;taxable_goods;Out of Stock;Fixed;10;category_%isolation%;-;-;10;m/d/Y;m/d/Y +3 days;-;Price Range;No;Yes;Together;with_not_required_options;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;with_not_required_options;-;-;Catalog;No;No;assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView";"" +"Create dynamic bundle with tier price;bundle-product-%isolation%;BundleProduct %isolation%;Dynamic;bundle_sku_%isolation%;-;Dynamic;-;dynamic-50;-;-;Fixed;10;-;-;-;-;-;-;default;As Low as;No;No;Together;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar;default;-;-;Search;-;-;assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage";"" +"Create dynamic bundle with special price;bundle-product-%isolation%;Bundle Dynamic %isolation%;Dynamic;sku_bundle_dynamic_%isolation%;-;Dynamic;-;dynamic-8;-;-;-;-;-;-;-;20;-;-;-;-;-;-;-;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;default;-;-;-;-;-;assertProductSaveMessage, assertBundleInCategory";"" +"Create dynamic bundle with group price;bundle-product-%isolation%;Bundle Dynamic %isolation%;Dynamic;sku_bundle_dynamic_%isolation%;-;Dynamic;-;dynamic-32;-;-;-;-;-;-;MAGETWO-23061;-;-;-;-;-;-;-;-;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;default;-;-;-;-;-;assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Create dynamic bundle;bundle-product-%isolation%;Bundle Dynamic %isolation%;Dynamic;sku_bundle_dynamic_%isolation%;-;Dynamic;-;dynamic-40;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;default;-;-;-;-;-;assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Create fixed product with checkout first option;bundle-product-%isolation%;Bundle Fixed %isolation%;Fixed;sku_bundle_fixed_%isolation%;-;Fixed;110;fixed-115;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;second;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;with_custom_options_1;drop_down_with_one_option_fixed_price;catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option;-;-;-;assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage";"" +"Create fixed product with checkout second option;bundle-product-%isolation%;Bundle Fixed %isolation%;Fixed;sku_bundle_fixed_%isolation%;-;Fixed;110;fixed-159;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;second;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;with_custom_options_2;drop_down_with_one_option_percent_price;-;-;-;-;assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Create default dynamic bundle;bundle-product-%isolation%;Bundle Dynamic %isolation%;Dynamic;sku_bundle_dynamic_%isolation%;-;Dynamic;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;default_dynamic;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;default;-;-;-;-;-;assertProductSaveMessage";"" +"Create default fixed bundle;bundle-product-%isolation%;Bundle Fixed %isolation%;Fixed;sku_bundle_fixed_%isolation%;-;Fixed;10;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;-;second;catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar;default;-;-;-;-;-;assertProductSaveMessage";"" +"MAGETWO-12622: Create Bundle (fixed) Product and Assign it to Category;bundle-product-%isolation%;Bundle Fixed %isolation%;Fixed;sku_bundle_fixed_%isolation%;-;Fixed;100;-;taxable_goods;-;Fixed;1;category_%isolation%;-;-;-;-;-;-;-;-;-;Together;two_options_with_fixed_and_percent_prices;-;-;-;-;-;-;-;assertProductSaveMessage, assertBundleInGrid, assertBundleInCategory, assertBundleProductPage";"test_type:acceptance_test" +"MAGETWO-12702: Create Bundle (dynamic) Product and Assign it to the Category;bundle-product-%isolation%;Bundle Dynamic %isolation%;-;sku_bundle_dynamic_%isolation%;-;Dynamic;-;-;-;-;-;-;category_%isolation%;-;-;-;-;-;-;-;-;-;Together;one_options_assigned_simple_big_qty;-;-;-;-;-;-;-;assertProductSaveMessage, assertBundleInGrid, assertBundleInCategory, assertBundleProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php index 148e06c61fa1e..3dab674ca17f4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/AbstractConfigureBlock.php @@ -57,19 +57,17 @@ public function fillOptions(FixtureInterface $product) $this->callRender($typeId, 'fillOptions', ['product' => $product]); } - if ($product instanceof InjectableFixture) { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) - ? $checkoutData['options']['custom_options'] - : []; - $customOptions = $product->hasData('custom_options') - ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() - : []; + /** @var CatalogProductSimple $product */ + $checkoutData = $product->getCheckoutData(); + $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) + ? $checkoutData['options']['custom_options'] + : []; + $customOptions = $product->hasData('custom_options') + ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() + : []; - $checkoutCustomOptions = $this->prepareCheckoutData($customOptions, $checkoutCustomOptions); - $this->getCustomOptionsBlock()->fillCustomOptions($checkoutCustomOptions); - } + $checkoutCustomOptions = $this->prepareCheckoutData($customOptions, $checkoutCustomOptions); + $this->getCustomOptionsBlock()->fillCustomOptions($checkoutCustomOptions); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php index f991eddf9ce4e..e10890ff2cb78 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php @@ -58,11 +58,8 @@ public function setQty($qty) */ public function configProduct(FixtureInterface $product) { - $checkoutData = null; - if ($product instanceof InjectableFixture) { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - } + /** @var CatalogProductSimple $product */ + $checkoutData = $product->getCheckoutData(); $this->fillOptions($product); if (isset($checkoutData['qty'])) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php index 0e45e4c6cdd83..4806e3eee6398 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; -use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\Element\MultisuggestElement; /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php index 7051e8d5372ea..6d111afb3183c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php @@ -26,7 +26,7 @@ class ProductPagination extends Block /** * Getting the active element to go to the next page * - * @return \Magento\Mtf\Client\Element|null + * @return \Magento\Mtf\Client\ElementInterface|null */ public function getNextPage() { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php index cbd00b28c0551..b5073eb734ceb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php @@ -6,7 +6,7 @@ namespace Magento\Catalog\Test\Block\Product\ProductList; -use Magento\Catalog\Test\Block\Product\ProductList\Related\ProductItem; +use Magento\Catalog\Test\Block\Product\ProductList\Related\ProductItem as RelatedProductItem; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; @@ -34,7 +34,7 @@ public function getProductItem(FixtureInterface $product) /** * Return list of products. * - * @return ProductItem[] + * @return RelatedProductItem[] */ public function getProducts() { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php index e29a8a6716a36..d57ddfb967f63 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php @@ -161,11 +161,8 @@ public function getPriceBlock() */ public function addToCart(FixtureInterface $product) { - $checkoutData = null; - if ($product instanceof InjectableFixture) { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - } + /** @var CatalogProductSimple $product */ + $checkoutData = $product->getCheckoutData(); $this->fillOptions($product); if (isset($checkoutData['qty'])) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index ea07ff104aafa..a75d894927497 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -118,15 +118,9 @@ class CustomOptions extends Form */ public function getOptions(FixtureInterface $product) { - if ($product instanceof InjectableFixture) { - $dataOptions = $product->hasData('custom_options') - ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() - : []; - } else { - // TODO: Removed after refactoring(removed) old product fixture. - $dataOptions = $product->getData('fields/custom_options/value'); - $dataOptions = $dataOptions ? $dataOptions : []; - } + $dataOptions = $product->hasData('custom_options') + ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() + : []; $listCustomOptions = $this->getListOptions(); $result = []; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php index 3197b59c3d55c..a4cd285326b01 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php @@ -9,6 +9,7 @@ use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Fixture\Category\LandingPage; use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Magento\Mtf\Client\Browser; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureFactory; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/fixture.xml index da083faf4a546..9335bd62740a9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/fixture.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/fixture.xml @@ -81,41 +81,6 @@ catalog_category_entity Magento\Catalog\Model\Resource\Category\Collection - - eav - catalog_product - virtual - Magento\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - - - - - - - - - - - - virtual - 4 - - product - - composite diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php index 7a666e370751a..80b0cdcbe7d3e 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php @@ -6,8 +6,6 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product; -use Magento\Mtf\Client\Element; -use Magento\Mtf\Fixture\DataFixture; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; use Magento\Backend\Test\Block\Widget\FormTabs; @@ -32,15 +30,8 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F $tabs = $this->getFieldsByTabs($product); ksort($tabs); - if ($product instanceof DataFixture) { - $tabs = $this->normalizeDeprecateData($tabs); - $category = ($category === null) ? $product->getCategories()['category'] : $category; - } - if ($category) { - $tabs['product-details']['category_ids']['value'] = ($category instanceof InjectableFixture) - ? $category->getName() - : $category->getCategoryName(); + $tabs['product-details']['category_ids']['value'] = $category->getName(); } $this->showAdvancedSettings(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php index f7b417ba6583d..80aafd73b2f5d 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php @@ -7,7 +7,6 @@ namespace Magento\ConfigurableProduct\Test\Block\Product; use Magento\ConfigurableProduct\Test\Block\Product\View\ConfigurableOptions; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; @@ -39,48 +38,26 @@ public function getConfigurableOptionsBlock() */ public function fillOptions(FixtureInterface $product) { - if ($product instanceof InjectableFixture) { - /** @var ConfigurableProductInjectable $product */ - $attributesData = $product->getConfigurableAttributesData()['attributes_data']; - $checkoutData = $product->getCheckoutData(); + /** @var ConfigurableProductInjectable $product */ + $attributesData = $product->getConfigurableAttributesData()['attributes_data']; + $checkoutData = $product->getCheckoutData(); - // Prepare attribute data - foreach ($attributesData as $attributeKey => $attribute) { - $attributesData[$attributeKey] = [ - 'type' => $attribute['frontend_input'], - 'title' => $attribute['label'], - 'options' => [], - ]; - - foreach ($attribute['options'] as $optionKey => $option) { - $attributesData[$attributeKey]['options'][$optionKey] = [ - 'title' => $option['label'], - ]; - } - $attributesData[$attributeKey]['options'] = array_values($attributesData[$attributeKey]['options']); - } - $attributesData = array_values($attributesData); - } else { - // TODO: Removed after refactoring(removed) old product fixture. - /** @var ConfigurableProduct $product */ - $attributesData = $product->getConfigurableAttributes(); - $checkoutData = $product->getCheckoutData(); + // Prepare attribute data + foreach ($attributesData as $attributeKey => $attribute) { + $attributesData[$attributeKey] = [ + 'type' => $attribute['frontend_input'], + 'title' => $attribute['label'], + 'options' => [], + ]; - // Prepare attributes data - foreach ($attributesData as $attributeKey => $attribute) { - $attributesData[$attributeKey] = [ - 'type' => 'dropdown', - 'title' => $attribute['label']['value'], + foreach ($attribute['options'] as $optionKey => $option) { + $attributesData[$attributeKey]['options'][$optionKey] = [ + 'title' => $option['label'], ]; - - unset($attribute['label']); - foreach ($attribute as $optionKey => $option) { - $attributesData[$attributeKey]['options'][$optionKey] = [ - 'title' => $option['option_label']['value'], - ]; - } } + $attributesData[$attributeKey]['options'] = array_values($attributesData[$attributeKey]['options']); } + $attributesData = array_values($attributesData); $configurableCheckoutData = isset($checkoutData['options']['configurable_options']) ? $checkoutData['options']['configurable_options'] diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php index c191f1397062d..ca2ccc4239775 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php @@ -7,7 +7,6 @@ namespace Magento\ConfigurableProduct\Test\Block\Product\View; use Magento\Catalog\Test\Block\Product\View\CustomOptions; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; @@ -37,22 +36,10 @@ class ConfigurableOptions extends CustomOptions */ public function getOptions(FixtureInterface $product) { - if ($product instanceof InjectableFixture) { - /** @var ConfigurableProductInjectable $product */ - $attributesData = $product->hasData('configurable_attributes_data') - ? $product->getConfigurableAttributesData()['attributes_data'] - : []; - } else { - /** @var ConfigurableProduct $product */ - $attributesData = $product->getConfigurableAttributes(); - foreach ($attributesData as $key => $attributeData) { - $attributeData['label'] = $attributeData['label']['value']; - $attributeData['frontend_input'] = 'dropdown'; - - $attributesData[$key] = $attributeData; - } - } - + /** @var ConfigurableProductInjectable $product */ + $attributesData = $product->hasData('configurable_attributes_data') + ? $product->getConfigurableAttributesData()['attributes_data'] + : []; $listOptions = $this->getListOptions(); $result = []; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.php deleted file mode 100644 index 8dedc81897241..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.php +++ /dev/null @@ -1,394 +0,0 @@ -_placeholders['attribute_label_1'] = [$this, 'attributeProvider']; - } - - /** - * Provide data to product from new attribute - * - * @param ProductAttribute $attribute - * @return void - */ - public function provideNewAttributeData(ProductAttribute $attribute) - { - $options = $attribute->getOptionLabels(); - $placeholders['new_attribute_label'] = $attribute->getFrontendLabel(); - $placeholders['new_attribute_option_1_label'] = $options[0]; - $placeholders['new_attribute_option_2_label'] = $options[1]; - $this->_applyPlaceholders($this->_data, $placeholders); - } - - /** - * Create new configurable attribute and add it to product - * - * @return string - */ - protected function attributeProvider() - { - $attribute = Factory::getFixtureFactory()->getMagentoCatalogProductAttribute(); - $attribute->switchData('configurable_attribute'); - $attribute->persist(); - $this->_dataConfig['attributes']['id'][] = $attribute->getAttributeId(); - $this->_dataConfig['attributes'][$attribute->getAttributeId()]['code'] = $attribute->getAttributeCode(); - $this->_dataConfig['options'][$attribute->getAttributeId()]['id'] = $attribute->getOptionIds(); - - $options = $attribute->getOptionLabels(); - $placeholders['attribute_1_name'] = $attribute->getFrontendLabel(); - $placeholders['attribute_1_option_label_1'] = $options[0]; - $placeholders['attribute_1_option_label_2'] = $options[1]; - $this->_applyPlaceholders($this->_data, $placeholders); - - return $attribute->getFrontendLabel(); - } - - /** - * Create product - * Get affected attribute set - * - * @return string|null - */ - public function getAffectedAttributeSet() - { - return $this->getData('affected_attribute_set') - ? $this->getData('affected_attribute_set') - : null; - } - - /** - * Returns the sku for the specified option. - * - * @param string $selectedOption - * @return string - */ - public function getVariationSku($selectedOption) - { - $sku = ''; - $configurableAttributes = $this->getConfigurableAttributes(); - $attributeKey = $selectedOption['title']; - $optionKey = $selectedOption['value']; - $optionValue = $configurableAttributes[$attributeKey][$optionKey]['option_label']['value']; - - foreach ($this->getVariationsMatrix() as $variation) { - foreach ($configurableAttributes as $configurableAttribute) { - foreach ($configurableAttribute as $option) { - if (isset($option['option_label']['value']) - && $option['option_label']['value'] == $optionValue) { - $sku = $variation['value']['sku']['value']; - break 3; - } - } - } - } - return $sku; - } - - /** - * Get variations SKUs - * - * @return $this|ConfigurableProduct - */ - public function getVariationSkus() - { - $variationSkus = []; - foreach ($this->getVariationsMatrix() as $variation) { - if (is_array($variation) && isset($variation['value']['name']['value'])) { - $variationSkus[] = $variation['value']['name']['value']; - } - } - - return $variationSkus; - } - - /** - * Get variations matrix - * - * @return array - */ - public function getVariationsMatrix() - { - $variations = $this->getData('fields/variations-matrix/value'); - return is_array($variations) ? $variations : []; - } - - /** - * Create product - * - * @return $this|ConfigurableProduct - */ - public function persist() - { - $id = Factory::getApp()->magentoConfigurableProductCreateConfigurable($this); - $this->_data['id']['value'] = $id; - - return $this; - } - - /** - * Get configurable attributes data - * - * @return array - */ - public function getConfigurableAttributes() - { - $attributes = $this->getData('fields/configurable_attributes_data/value'); - return is_array($attributes) ? $attributes : []; - } - - /** - * Get configurable product options - * - * @return array - */ - public function getConfigurableOptions() - { - $options = []; - foreach ($this->getConfigurableAttributes() as $attribute) { - foreach ($attribute as $option) { - if (isset($option['option_label']['value'])) { - $options[$attribute['label']['value']][] = $option['option_label']['value']; - } - } - } - return $options; - } - - /** - * Init Data - * - * @return void - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function _initData() - { - parent::_initData(); - $this->_dataConfig = [ - 'type_id' => 'configurable', - 'constraint' => 'Success', - 'create_url_params' => [ - 'type' => Repository::CONFIGURABLE, - 'set' => static::DEFAULT_ATTRIBUTE_SET_ID, - ], - ]; - $data = [ - 'fields' => [ - 'price' => [ - 'value' => '10', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'tax_class_id' => [ - 'value' => 'Taxable Goods', - 'group' => static::GROUP_PRODUCT_DETAILS, - 'input' => 'select', - 'input_value' => '2', - ], - 'weight' => [ - 'value' => '1', - 'group' => static::GROUP_PRODUCT_DETAILS, - ], - 'product_website_1' => [ - 'value' => 'Yes', - 'input_value' => [1], - 'group' => static::GROUP_PRODUCT_WEBSITE, - 'input' => 'checkbox', - 'input_name' => 'website_ids', - ], - 'configurable_attributes_data' => [ - 'value' => [ - '0' => [ - 'label' => [ - 'value' => '%attribute_label_1%', - ], - '0' => [ - 'option_label' => [ - 'value' => '%attribute_1_option_label_1%', - ], - 'pricing_value' => [ - 'value' => '1', - ], - 'is_percent' => [ - 'value' => 'No', - ], - 'include' => [ - 'value' => 'Yes', - ], - ], - '1' => [ - 'option_label' => [ - 'value' => '%attribute_1_option_label_2%', - ], - 'pricing_value' => [ - 'value' => '2', - ], - 'is_percent' => [ - 'value' => 'No', - ], - 'include' => [ - 'value' => 'Yes', - ], - ], - ], - ], - 'group' => static::GROUP, - ], - 'variations-matrix' => [ - 'value' => [ - '0' => [ - 'configurable_attribute' => [ - '0' => [ - 'attribute_option' => '%attribute_1_option_label_1%', - ], - ], - 'value' => [ - 'display' => [ - 'value' => 'Yes', - 'input' => 'checkbox', - ], - 'name' => [ - 'value' => 'Variation 0-%isolation%', - ], - 'sku' => [ - 'value' => 'Variation 0-%isolation%', - ], - 'qty' => [ - 'value' => '100', - ], - ], - ], - '1' => [ - 'configurable_attribute' => [ - '0' => [ - 'attribute_option' => '%attribute_1_option_label_2%', - ], - ], - 'value' => [ - 'display' => [ - 'value' => 'Yes', - 'input' => 'checkbox', - ], - 'name' => [ - 'value' => 'Variation 1-%isolation%', - ], - 'sku' => [ - 'value' => 'Variation 1-%isolation%', - ], - 'qty' => [ - 'value' => '200', - ], - ], - ], - ], - 'group' => static::GROUP, - ], - ], - 'checkout_data' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => '0', - 'value' => '0', - ], - ], - 'qty' => 1, - ], - 'special_price' => '10', - ], - ]; - - $this->_data = array_merge_recursive($this->_data, $data); - - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoConfigurableProductConfigurableProduct($this->_dataConfig, $this->_data); - } - - /** - * Get checkout data configurable product - * - * @return array - */ - public function getCheckoutData() - { - return $this->getData('checkout_data'); - } - - /** - * Return special price for first configurable option - * This value is used to validate value on the cart and order - * - * @return string - */ - public function getProductSpecialPrice() - { - return $this->getData('checkout_data/special_price'); - } - - /** - * Get product options price - * - * @return float|int - */ - public function getProductOptionsPrice() - { - $price = 0; - $configurableOptions = $this->getData('checkout_data/options/configurable_options'); - $attributes = $this->getData('fields/configurable_attributes_data/value'); - - foreach ($configurableOptions as $option) { - $price += $attributes[$option['title']][$option['value']]['pricing_value']['value']; - } - return $price; - } - - /** - * Prepare edit configurable product data - * - * @return $this - */ - public function getEditData() - { - $data = $this->getData(); - $this->switchData('edit_configurable'); - $editData = $this->getData(); - $data['fields']['variations-matrix'] = $editData['fields']['variations-matrix']; - $this->_data = array_replace_recursive($data, $editData); - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php index 4734c9f5ea751..c0c6109271198 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php @@ -176,6 +176,20 @@ protected function getPreset($name) ], ], 'qty' => 1, + ], + 'two_options_one_two_dollars' => [ + 'options' => [ + 'configurable_options' => [ + [ + 'title' => 'attribute_key_0', + 'value' => 'option_key_0', + ], + ], + ], + 'cartItem' => [ + 'price' => 11, + ], + 'qty' => 1, ] ]; return isset($presets[$name]) ? $presets[$name] : null; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php index fe5d1888b21e5..7a608af4a450e 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php @@ -245,6 +245,47 @@ class ConfigurableAttributesData implements FixtureInterface ], ], + 'filterable_two_options_with_zero_price' => [ + 'attributes_data' => [ + 'attribute_key_0' => [ + 'options' => [ + 'option_key_0' => [ + 'label' => 'option_key_1_%isolation%', + 'pricing_value' => 0, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + 'option_key_1' => [ + 'label' => 'option_2_%isolation%', + 'pricing_value' => 0, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + ], + ], + ], + 'attributes' => [ + 'attribute_key_0' => 'catalogProductAttribute::filterable_dropdown_two_options', + ], + 'products' => [], + 'matrix' => [ + 'attribute_key_0:option_key_0' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 10, + ], + 'weight' => 1, + ], + 'attribute_key_0:option_key_1' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 20, + ], + 'weight' => 2, + ], + ], + ], + 'two_new_options' => [ 'attributes_data' => [ 'attribute_key_0' => [ @@ -568,10 +609,48 @@ class ConfigurableAttributesData implements FixtureInterface 'attributes' => [ 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', ], - 'products' => [ - 'attribute_key_0:option_key_0' => 'catalogProductSimple::product_without_category', - 'attribute_key_0:option_key_1' => 'catalogProductSimple::product_without_category', + 'products' => [], + 'matrix' => [ + 'attribute_key_0:option_key_0' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 100, + ], + 'weight' => 1, + ], + 'attribute_key_0:option_key_1' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 200, + ], + 'weight' => 1, + ], + ], + ], + + 'two_options_one_two_dollars' => [ + 'attributes_data' => [ + 'attribute_key_0' => [ + 'options' => [ + 'option_key_0' => [ + 'label' => 'option_key_1_%isolation%', + 'pricing_value' => 1, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + 'option_key_1' => [ + 'label' => 'option_2_%isolation%', + 'pricing_value' => 1, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + ], + ], + ], + 'attributes' => [ + 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', ], + 'products' => [], 'matrix' => [ 'attribute_key_0:option_key_0' => [ 'display' => 'Yes', @@ -827,7 +906,8 @@ protected function prepareVariationsMatrix(array $data) 'quantity_and_stock_status' => [ 'qty' => 10, ], - ] + ], + $row ); } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/Curl/CreateConfigurable.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/Curl/CreateConfigurable.php deleted file mode 100644 index f7056fc4af858..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/Curl/CreateConfigurable.php +++ /dev/null @@ -1,168 +0,0 @@ -_getProductData($fixture); - $curlData['product']['configurable_attributes_data'] = $this->_getConfigurableData($fixture); - $curlData['variations-matrix'] = $this->_getVariationMatrix($fixture); - $curlData['attributes'] = $fixture->getDataConfig()['attributes']['id']; - $curlData['affected_attribute_set'] = 1; - $curlData['new-variations-attribute-set-id'] = 4; - $curlData['product']['category_ids'] = $fixture->getCategoryIds(); - - $curlEncoded = json_encode($curlData, true); - $curlEncoded = str_replace('"Yes"', '1', $curlEncoded); - $curlEncoded = str_replace('"No"', '0', $curlEncoded); - - return json_decode($curlEncoded, true); - } - - /** - * Get product data for curl - * - * @param ConfigurableProduct $fixture - * @return array - */ - protected function _getProductData(ConfigurableProduct $fixture) - { - $curlData = []; - $baseData = $fixture->getData('fields'); - unset($baseData['configurable_attributes_data']); - unset($baseData['variations-matrix']); - foreach ($baseData as $key => $field) { - $fieldName = isset($field['input_name']) ? $field['input_name'] : $key; - if (isset($field['input_value'])) { - $curlData[$fieldName] = $field['input_value']; - } elseif (isset($field['value'])) { - $curlData[$fieldName] = $field['value']; - } - } - - $curlData['quantity_and_stock_status']['is_in_stock'] = 1; - $curlData['stock_data'] = [ - 'use_config_manage_stock' => 1, - 'is_in_stock' => 1, - ]; - - return $curlData; - } - - /** - * Get configurable product data for curl - * - * @param ConfigurableProduct $fixture - * @return array - */ - protected function _getConfigurableData(ConfigurableProduct $fixture) - { - $configurableAttribute = $fixture->getData('fields/configurable_attributes_data/value'); - $config = $fixture->getDataConfig(); - $curlData = []; - - foreach ($configurableAttribute as $attributeNumber => $attribute) { - $attributeId = $config['attributes']['id'][$attributeNumber]; - $optionNumber = 0; - foreach ($attribute as $attributeFieldName => $attributeField) { - if (isset($attributeField['value'])) { - $curlData[$attributeId][$attributeFieldName] = $attributeField['value']; - } else { - $optionsId = $config['options'][$attributeId]['id'][$optionNumber]; - foreach ($attributeField as $optionName => $optionField) { - $curlData[$attributeId]['values'][$optionsId][$optionName] = $optionField['value']; - } - $curlData[$attributeId]['values'][$optionsId]['value_index'] = $optionsId; - ++$optionNumber; - } - } - $curlData[$attributeId]['code'] = $config['attributes'][$attributeId]['code']; - $curlData[$attributeId]['attribute_id'] = $attributeId; - } - - return $curlData; - } - - /** - * Get variations data for curl - * - * @param ConfigurableProduct $fixture - * @return array - */ - protected function _getVariationMatrix(ConfigurableProduct $fixture) - { - $config = $fixture->getDataConfig(); - $variationData = $fixture->getData('fields/variations-matrix/value'); - $curlData = []; - $variationNumber = 0; - foreach ($config['options'] as $attributeId => $options) { - foreach ($options['id'] as $option) { - foreach ($variationData[$variationNumber]['value'] as $fieldName => $fieldData) { - if ($fieldName == 'qty') { - $curlData[$option]['quantity_and_stock_status'][$fieldName] = $fieldData['value']; - } else { - $curlData[$option][$fieldName] = $fieldData['value']; - } - } - if (!isset($curlData[$option]['weight']) && $fixture->getData('fields/weight/value')) { - $curlData[$option]['weight'] = $fixture->getData('fields/weight/value'); - } - $curlData[$option]['configurable_attribute'] = - '{"' . $config['attributes'][$attributeId]['code'] . '":"' . $option . '"}'; - ++$variationNumber; - } - } - return $curlData; - } - - /** - * Create configurable product - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] - . 'catalog/product/save/' - . $fixture->getUrlParams('create_url_params') . '/popup/1/back/edit'; - $params = $this->_prepareData($fixture); - $curl = new BackendDecorator(new CurlTransport(), new Config()); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $params); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - preg_match("~Location: [^\s]*\/id\/(\d+)~", $response, $matches); - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.php deleted file mode 100644 index db60f10991aec..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.php +++ /dev/null @@ -1,232 +0,0 @@ -_data[self::CONFIGURABLE]['data']['affect_configurable_product_attributes'] = 'Template %isolation%'; - $this->_data[self::CONFIGURABLE_ADVANCED_PRICING] = $this->getConfigurableAdvancedPricing(); - $this->_data[self::CONFIGURABLE_MAP] = $this->addMapToConfigurable($this->_data[self::CONFIGURABLE]); - $this->_data[self::PRODUCT_VARIATIONS] = [ - 'config' => $defaultConfig, - 'data' => $this->buildProductVariations($defaultData), - ]; - $this->_data['edit_configurable'] = $this->editConfigurable(); - } - - /** - * Get configurable product with advanced pricing - * - * @return array - */ - protected function getConfigurableAdvancedPricing() - { - $pricing = [ - 'data' => [ - 'fields' => [ - 'special_price' => [ - 'value' => '9', 'group' => ConfigurableProductFixture::GROUP_PRODUCT_PRICING, - ], - ], - ], - ]; - $product = array_replace_recursive($this->_data[self::CONFIGURABLE], $pricing); - - return $product; - } - - /** - * Add advanced pricing (MAP) to configurable product - * - * @param array $data - * @return array - */ - protected function addMapToConfigurable(array $data) - { - $pricing = [ - 'data' => [ - 'fields' => [ - 'msrp_display_actual_price_type' => [ - 'value' => 'On Gesture', - 'input_value' => '1', - 'group' => ConfigurableProductFixture::GROUP_PRODUCT_PRICING, - 'input' => 'select', - ], - 'msrp' => ['value' => '15', 'group' => ConfigurableProductFixture::GROUP_PRODUCT_PRICING], - ], - ], - ]; - $product = array_replace_recursive($data, $pricing); - - return $product; - } - - /** - * Build product variations data set - * - * @param array $defaultData - * @return array - */ - protected function buildProductVariations(array $defaultData) - { - $data = $defaultData; - $data['affected_attribute_set'] = 'Template %isolation%'; - $data['fields'] = [ - 'configurable_attributes_data' => [ - 'value' => [ - '0' => [ - 'label' => ['value' => '%new_attribute_label%'], - '0' => [ - 'option_label' => ['value' => '%new_attribute_option_1_label%'], - 'include' => ['value' => 'Yes'], - ], - '1' => [ - 'option_label' => ['value' => '%new_attribute_option_2_label%'], - 'include' => ['value' => 'Yes'], - ], - ], - ], - 'group' => ConfigurableProductFixture::GROUP, - ], - 'variations-matrix' => [ - 'value' => [ - '0' => [ - 'configurable_attribute' => [ - '0' => ['attribute_option' => '%new_attribute_option_1_label%'], - ], - 'value' => ['qty' => ['value' => 100]], - ], - '1' => [ - 'configurable_attribute' => [ - '0' => ['attribute_option' => '%new_attribute_option_2_label%'], - ], - 'value' => ['qty' => ['value' => 100]], - ], - ], - 'group' => ConfigurableProductFixture::GROUP, - ], - ]; - return $data; - } - - /** - * Build product edit data set - * - * @return array - */ - protected function editConfigurable() - { - $editData = [ - 'config' => [ - 'type_id' => 'configurable', - ], - 'data' => [ - 'fields' => [ - 'name' => [ - 'value' => substr(get_class($this), strrpos(get_class($this), '\\') + 1) . ' %isolation%_edit', - ], - 'sku' => [ - 'value' => - substr(get_class($this), strrpos(get_class($this), '\\') + 1) . '_sku_%isolation%_edit', - ], - 'price' => [ - 'value' => '15', - ], - 'configurable_attributes_data' => [ - 'value' => [ - '0' => [ - '2' => [ - 'option_label' => [ - 'value' => 'Option3_%isolation%', - ], - 'pricing_value' => [ - 'value' => '4', - ], - 'is_percent' => [ - 'value' => 'No', - ], - 'include' => [ - 'value' => 'Yes', - ], - ], - ], - ], - 'group' => ConfigurableProductFixture::GROUP, - ], - 'variations-matrix' => [ - 'value' => [ - '0' => [ - 'value' => [ - 'display' => [ - 'value' => 'Yes', - 'input' => 'checkbox', - ], - ], - ], - '1' => [ - 'value' => [ - 'display' => [ - 'value' => 'Yes', - 'input' => 'checkbox', - ], - ], - ], - '2' => [ - 'configurable_attribute' => [ - '0' => [ - 'attribute_option' => 'Option3_%isolation%', - ], - ], - 'value' => [ - 'display' => [ - 'value' => 'Yes', - 'input' => 'checkbox', - ], - 'name' => [ - 'value' => 'Variation 2-%isolation%', - ], - 'sku' => [ - 'value' => 'Variation 2-%isolation%', - ], - 'qty' => [ - 'value' => '100', - ], - ], - ], - ], - 'group' => ConfigurableProductFixture::GROUP, - ], - ], - ], - ]; - - return $editData; - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml index 745beff544789..fc21547f725ad 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml @@ -239,5 +239,99 @@ two_options_with_fixed_price + + + Test configurable product %isolation% + sku_test_configurable_product_%isolation% + + 10 + + 1 + Product online + Catalog, Search + + taxable_goods + + configurable-product-%isolation% + + filterable_two_options_with_zero_price + + + 1 + In Stock + + + Main Website + + + custom_attribute_set + + + + + Test configurable product %isolation% + sku_test_configurable_product_%isolation% + + 10 + + 30 + + taxable_goods + + test-configurable-product-%isolation% + + default_subcategory + + + 1 + In Stock + + + one_variation + + + Main Website + + + custom_attribute_set + + + with_one_option + + 15 + On Gesture + + + + Configurable product %isolation% + test-configurable-product-%isolation% + sku_configurable_product_%isolation% + + 10 + + + taxable_goods + + 1 + + 1 + In Stock + + + default_subcategory + + + Main Website + + + two_options_one_two_dollars + + + custom_attribute_set + + + two_options_one_two_dollars + + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv index c282092f255db..da5a515bb5448 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv @@ -1,5 +1,6 @@ -"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"issue" -"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" -"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" -"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage";"" -"configurable-product-%isolation%";"two_options_with_assigned_product";"two_options_with_assigned_product";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" +"description";"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint" +"Create product with category and two new options";"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" +"Create product with two options";"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" +"Create product with special price";"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage" +"Create product with assigned products to options";"configurable-product-%isolation%";"two_options_with_assigned_product";"two_options_with_assigned_product";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" +"MAGETWO-12620: Create Configurable Product and Assign it to Category";"configurable-product-%isolation%";"two_options_with_fixed_price";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"Taxable Goods";"10";"-";"default_subcategory";"-";"-";"1";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertConfigurableProductPage" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableTest.php deleted file mode 100644 index d2b92908b86e7..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableTest.php +++ /dev/null @@ -1,128 +0,0 @@ -getMagentoConfigurableProductConfigurableProduct(); - $product->switchData('configurable'); - //Page & Blocks - $manageProductsGrid = Factory::getPageFactory()->getCatalogProductIndex(); - $createProductPage = Factory::getPageFactory()->getCatalogProductNew(); - //Steps - $manageProductsGrid->open(); - $manageProductsGrid->getGridPageActionBlock()->addProduct('configurable'); - $createProductPage->getProductForm()->fill($product); - $createProductPage->getFormPageActions()->save($product); - //Verifying - $createProductPage->getMessagesBlock()->waitSuccessMessage(); - //Flush cache - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushMagentoCache(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - //Verifying - $this->assertOnGrid($product); - $this->assertOnFrontend($product); - } - - /** - * Assert existing product on admin product grid - * - * @param ConfigurableProduct $product - * @return void - */ - protected function assertOnGrid(ConfigurableProduct $product) - { - //Search data - $configurableSearch = [ - 'sku' => $product->getSku(), - 'type' => 'Configurable Product', - ]; - $variationSkus = $product->getVariationSkus(); - //Page & Block - $productGridPage = Factory::getPageFactory()->getCatalogProductIndex(); - $productGridPage->open(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Grid */ - $gridBlock = $productGridPage->getProductGrid(); - //Assertion - $this->assertTrue($gridBlock->isRowVisible($configurableSearch), 'Configurable product was not found.'); - foreach ($variationSkus as $sku) { - $this->assertTrue( - $gridBlock->isRowVisible(['sku' => $sku, 'type' => 'Simple Product']), - 'Variation with sku "' . $sku . '" was not found.' - ); - } - } - - /** - * Assert configurable product on Frontend - * - * @param ConfigurableProduct $product - * @return void - */ - protected function assertOnFrontend(ConfigurableProduct $product) - { - //Pages - $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex(); - $categoryPage = Factory::getPageFactory()->getCatalogCategoryView(); - $productPage = Factory::getPageFactory()->getCatalogProductView(); - //Steps - $frontendHomePage->open(); - $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName()); - //Verification on category product list - $productListBlock = $categoryPage->getListProductBlock(); - $this->assertTrue( - $productListBlock->isProductVisible($product->getName()), - 'Product is absent on category page.' - ); - //Verification on product detail page - $productViewBlock = $productPage->getViewBlock(); - $productListBlock->openProductViewPage($product->getName()); - $this->assertEquals( - $product->getName(), - $productViewBlock->getProductName(), - 'Product name does not correspond to specified.' - ); - $price = $product->getProductPrice(); - $priceOnPage = $productViewBlock->getPriceBlock()->getPrice(); - $this->assertEquals( - number_format($price, 2), - number_format($priceOnPage, 2), - 'Product price does not correspond to specified.' - ); - - $pageOptions = $productViewBlock->getOptions($product); - $configurableOptions = []; - foreach ($pageOptions['configurable_options'] as $attribute) { - $configurableOption = []; - foreach ($attribute['options'] as $option) { - $configurableOption[] = $option['title']; - } - - $configurableOptions[$attribute['title']] = $configurableOption; - } - $this->assertEquals($product->getConfigurableOptions(), $configurableOptions); - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php index 6d3a0ebdd9db0..2a76a05858176 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateWithAttributeTest.php @@ -6,9 +6,9 @@ namespace Magento\ConfigurableProduct\Test\TestCase; -use Magento\Catalog\Test\Fixture\Product; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Fixture\ProductAttribute; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; use Magento\Mtf\Factory\Factory; use Magento\Mtf\TestCase\Functional; @@ -194,7 +194,7 @@ protected function assertOnFrontend(Product $product, ConfigurableProduct $varia ); $price = $productViewBlock->getPriceBlock()->getPrice(); $this->assertEquals( - number_format($product->getProductPrice(), 2), + number_format($product->getPrice(), 2), $price, 'Product price does not correspond to specified.' ); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php index 972073d270220..6c39f68fc7591 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php @@ -60,6 +60,9 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array $this->data = $data['customerGroup']->getCustomerGroupCode(); $this->customerGroupFixture = $data['customerGroup']; } + if (isset($data['value'])) { + $this->data = $data['value']; + } } /** diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/PlaceOrderStep.php index a4f72f980c332..0bdb87addfd46 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/PlaceOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/PlaceOrderStep.php @@ -5,7 +5,6 @@ */ namespace Magento\Multishipping\Test\TestStep; -use Magento\Multishipping\Test\Page\MultishippingCheckoutBilling; use Magento\Mtf\TestStep\TestStepInterface; use Magento\Multishipping\Test\Page\MultishippingCheckoutOverview; diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php index 76f821b010e92..a9499d608da3f 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php @@ -7,7 +7,6 @@ namespace Magento\Review\Test\Block\Adminhtml; use Magento\Backend\Test\Block\Widget\Form; -use Magento\Review\Test\Fixture\ReviewInjectable; use Magento\Mtf\Client\Locator; /** diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php index 0d6ea9e35f77a..c59dbd6e9b52d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Totals.php @@ -6,7 +6,6 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\Invoice; -use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; /** diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php index 00da4a3db47cf..d952ebfa9da29 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php @@ -6,10 +6,10 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\View; -use Magento\Catalog\Test\Fixture\Product; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\InjectableFixture; /** * Class Items @@ -57,31 +57,42 @@ class Items extends Block /** * Returns the item price for the specified product. * - * @param Product $product + * @param InjectableFixture $product * @return array|string */ - public function getPrice(Product $product) + public function getPrice(InjectableFixture $product) { $productName = $product->getName(); - if ($product instanceof ConfigurableProduct) { + if ($product instanceof ConfigurableProductInjectable) { // Find the price for the specific configurable product that was purchased - $configurableAttributes = $product->getConfigurableAttributes(); - $productOptions = $product->getCheckoutData()['options']['configurable_options']; - $checkoutOption = reset($productOptions); - $attributeKey = $checkoutOption['title']; - $optionKey = $checkoutOption['value']; - $attributeValue = $configurableAttributes[$attributeKey]['label']['value']; - $optionValue = $configurableAttributes[$attributeKey][$optionKey]['option_label']['value']; - - $productDisplay = $productName . ' SKU: ' . $product->getVariationSku($checkoutOption); - $productDisplay .= ' ' . $attributeValue . ' ' . $optionValue; + $attributesData = $product->getConfigurableAttributesData()['attributes_data']; + $matrix = $product->getConfigurableAttributesData()['matrix']; + $checkoutOptions = $product->getCheckoutData()['options']['configurable_options']; + $optionsDetails = []; + $matrixKey = []; + $optionsPrice = 0; + + foreach ($checkoutOptions as $checkoutOption) { + $titleKey = $checkoutOption['title']; + $valueKey = $checkoutOption['value']; + $attributeName = $attributesData[$titleKey]['frontend_label']; + $optionLabel = $attributesData[$titleKey]['options'][$valueKey]['label']; + $optionsDetails[] = "{$attributeName} {$optionLabel}"; + $matrixKey[] = "{$titleKey}:{$valueKey}"; + + $optionsPrice += $attributesData[$titleKey]['options'][$valueKey]['pricing_value']; + } + $optionsDetails = implode(' ', $optionsDetails); + $matrixKey = implode(' ', $matrixKey); + + $productDisplay = $productName . ' SKU: ' . $matrix[$matrixKey]['sku'] . ' ' . $optionsDetails; } else { $productDisplay = $productName . ' SKU: ' . $product->getSku(); } - $selector = '//tr[normalize-space(td)="' . $productDisplay . '"]' . $this->priceSelector; - return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->getText(); + $selector = '//tr[normalize-space(td)="' . $productDisplay . '"]' . $this->priceSelector; + return $this->escapeCurrency($this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->getText()); } /** diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php index 4493f800006d0..863a4d19edbde 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php @@ -64,6 +64,7 @@ protected function _getCurl($url) * Recursively remove tax rules * * @param string $data + * @return mixed */ protected function _removeTaxRules($data) { diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml index a48e7e788ae52..727f98843aa44 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml @@ -12,7 +12,6 @@ Taxable Goods PRODUCT 2 - Taxable Goods @@ -20,7 +19,6 @@ Retail Customer CUSTOMER 3 - Retail Customer diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php index e3598d5173060..0dfa8aebe837f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php @@ -85,7 +85,7 @@ public function persist(FixtureInterface $fixture = null) $curl = new BackendDecorator(new CurlTransport(), new Config()); $curl->addOption(CURLOPT_HEADER, 1); $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $response = $curl->read(); + $curl->read(); $curl->close(); $data['id'] = $this->_getUserId($data); return $data; diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php index 1fd1a7814e335..e2c66423d8e52 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/View.php @@ -6,7 +6,7 @@ namespace Magento\Weee\Test\Block\Product; -use Magento\Mtf\Client\Element\Locator; +use Magento\Mtf\Client\Locator; /** * Product view block on the product page From 31f4b7a3ca4c44a17bc1dec571d2aa3caa440654 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Fri, 6 Feb 2015 16:30:15 +0200 Subject: [PATCH 30/50] MTA-1499: Analyse functional test failures --- .../CurlTransport/FrontendDecorator.php | 10 ++++----- .../Adminhtml/Product/GridPageAction.php | 21 +++++++++++++++++++ .../Test/Block/Product/View/CustomOptions.php | 4 ++-- .../AssertAddToCartButtonAbsent.php | 9 ++++---- .../AssertAddToCartButtonPresent.php | 9 ++++---- .../Catalog/Test/Repository/SimpleProduct.php | 2 +- .../Reports/Test/Repository/ConfigData.xml | 2 +- .../Mtf/TestSuite/InjectableTests/basic.xml | 5 +++++ 8 files changed, 45 insertions(+), 17 deletions(-) diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php index 97b29483cbac7..200d32b0b8f6c 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php @@ -6,7 +6,7 @@ namespace Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Customer\Test\Fixture\CustomerInjectable; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; @@ -48,9 +48,9 @@ class FrontendDecorator implements CurlInterface * Constructor * * @param CurlTransport $transport - * @param CustomerInjectable $customer + * @param Customer $customer */ - public function __construct(CurlTransport $transport, CustomerInjectable $customer) + public function __construct(CurlTransport $transport, Customer $customer) { $this->transport = $transport; $this->authorize($customer); @@ -59,11 +59,11 @@ public function __construct(CurlTransport $transport, CustomerInjectable $custom /** * Authorize customer on frontend * - * @param CustomerInjectable $customer + * @param Customer $customer * @throws \Exception * @return void */ - protected function authorize(CustomerInjectable $customer) + protected function authorize(Customer $customer) { $url = $_ENV['app_frontend_url'] . 'customer/account/login/'; $this->transport->write(CurlInterface::POST, $url); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/GridPageAction.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/GridPageAction.php index bafda38e5f53d..a9119f8c90377 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/GridPageAction.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/GridPageAction.php @@ -29,6 +29,13 @@ class GridPageAction extends ParentGridPageActions */ protected $productItem = '[data-ui-id=products-list-add-new-product-button-item-%productType%]'; + /** + * Product type list + * + * @var string + */ + protected $typeList = '[data-ui-id=products-list-add-new-product-button-dropdown-menu]'; + /** * Add product using split button * @@ -43,4 +50,18 @@ public function addProduct($productType = 'simple') Locator::SELECTOR_CSS )->click(); } + + /** + * Get product list + * + * @return array + */ + public function getTypeList() + { + $this->_rootElement->find($this->toggleButton, Locator::SELECTOR_CSS)->click(); + return $this->_rootElement->find( + $this->typeList, + Locator::SELECTOR_CSS + )->getText(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index 313529e07980f..69a89ba9c4dc1 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -138,7 +138,7 @@ public function getOptions(FixtureInterface $product) /** @var SimpleElement $optionElement */ $optionElement = $listCustomOptions[$title]; - $typeMethod = preg_replace('/[^a-zA-Z]/', '', $this->getOptionType($option['type'])); + $typeMethod = preg_replace('/[^a-zA-Z]/i', '', $this->getOptionType($option['type'])); $getTypeData = 'get' . ucfirst(strtolower($typeMethod)) . 'Data'; $optionData = $this->$getTypeData($optionElement); @@ -495,7 +495,7 @@ protected function fillOptions(array $options) */ protected function getOptionType($option) { - $option = substr($option, strpos($option, "/") + 1); + $option = strpos($option, "/") !== false ? substr($option, strpos($option, "/") + 1) : $option; return strtolower(preg_replace('/[^a-z]/i', '', $option)); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php index 41d280ebf40ed..5550751b72739 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php @@ -26,22 +26,23 @@ class AssertAddToCartButtonAbsent extends AbstractConstraint * Assert that "Add to cart" button is not display on page. * * @param InjectableFixture $product - * @param Category $category * @param CmsIndex $cmsIndex * @param CatalogCategoryView $catalogCategoryView * @param CatalogProductView $catalogProductView + * @param Category $category [optional] * * @return void */ public function processAssert( InjectableFixture $product, - Category $category, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, - CatalogProductView $catalogProductView + CatalogProductView $catalogProductView, + Category $category = null ) { $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); + $categoryName = $category === null ? $product->getCategoryIds()[0] : $category->getName(); + $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php index 3626d4c98de44..225f15cd02e4b 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php @@ -26,22 +26,23 @@ class AssertAddToCartButtonPresent extends AbstractConstraint * Assert that "Add to cart" button is present on page. * * @param InjectableFixture $product - * @param Category $category * @param CmsIndex $cmsIndex * @param CatalogCategoryView $catalogCategoryView * @param CatalogProductView $catalogProductView + * @param Category $category [optional] * * @return void */ public function processAssert( InjectableFixture $product, - Category $category, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, - CatalogProductView $catalogProductView + CatalogProductView $catalogProductView, + Category $category = null ) { $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); + $categoryName = $category === null ? $product->getCategoryIds()[0] : $category->getName(); + $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName()); while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php index 6bd64ae93df29..1addf9b0098c1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/SimpleProduct.php @@ -140,7 +140,7 @@ protected function getSimpleCustomOption() [ 'title' => 'custom option drop down', 'is_require' => true, - 'type' => 'Drop-down', + 'type' => 'Select/Drop-down', 'options' => [ [ 'title' => 'Title Drop - down 1', diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Repository/ConfigData.xml index 39b04be4a6f88..bf3a300df91ce 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Repository/ConfigData.xml @@ -8,7 +8,7 @@ - website + Website 5 12 diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml index 312f29100daba..43a4b90d06a5f 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml @@ -12,4 +12,9 @@ + + + + + From 5d8cac21edce22b4e7c4ea455d6c87eef47a62ed Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Fri, 6 Feb 2015 18:30:33 +0200 Subject: [PATCH 31/50] MTA-1499: Analyse functional test failures --- .../Test/Block/Navigation.php | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php new file mode 100644 index 0000000000000..41376ef7a3735 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php @@ -0,0 +1,97 @@ +_rootElement->find($this->clearAll, locator::SELECTOR_CSS)->click(); + } + + /** + * Select product price range. + * + * @param string $range + * @return void + */ + public function selectPriceRange($range) + { + $this->_rootElement->find(sprintf($this->priceRange, $range))->click(); + } + + /** + * Select attribute option. + * + * @param string $optionName + * @return void + */ + public function selectAttributeOption($optionName) + { + $this->_rootElement->find(sprintf($this->attributeOption, $optionName), Locator::SELECTOR_XPATH)->click(); + } + + /** + * Get array of available filters. + * + * @return array + */ + public function getFilters() + { + $options = $this->_rootElement->getElements($this->optionTitle); + $data = []; + foreach ($options as $option) { + $data[] = $option->getText(); + } + return $data; + } +} From 14b5ed47d20ed926c8bf662b21d85816a2a57a29 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Fri, 6 Feb 2015 19:00:58 +0200 Subject: [PATCH 32/50] MTA-548: Re-factor Tests for Create Products - Removed deprecated product fixture call via FixtureFactory --- .../BundleProduct/BundleSelections.php | 38 +++++++++++++++++++ .../Fixture/BundleProduct/CheckoutData.php | 13 +++++++ .../Bundle/Test/Repository/BundleProduct.xml | 26 +++++++++++++ .../Test/Repository/CatalogProductVirtual.xml | 27 +++++++++++++ .../CheckoutData.php | 2 +- .../ConfigurableAttributesData.php | 2 +- .../ConfigurableProductInjectable.xml | 10 +++-- 7 files changed, 113 insertions(+), 5 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index 99a1c73b32002..d4f5fa075e073 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -638,6 +638,44 @@ protected function getPreset($name) ], ], ], + + 'bundle_required' => [ + 'bundle_options' => [ + [ + 'title' => 'Drop-down Option', + 'type' => 'Drop-down', + 'required' => 'Yes', + 'assigned_products' => [ + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_price_value' => 10.00, + 'selection_price_type' => 'Fixed', + 'selection_qty' => 1, + ], + ], + [ + 'search_data' => [ + 'name' => '%product_name%', + ], + 'data' => [ + 'selection_price_value' => 20.00, + 'selection_price_type' => 'Fixed', + 'selection_qty' => 1, + ] + ], + ], + ], + ], + 'products' => [ + [ + 'catalogProductSimple::simple', + 'catalogProductVirtual::for_bundle_required', + ], + ], + ], ]; if (!isset($presets[$name])) { throw new \InvalidArgumentException( diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php index 055c7f80488c3..71ae77ca064d6 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php @@ -304,6 +304,19 @@ protected function getPreset($name) ], ], ], + 'bundle_required' => [ + 'options' => [ + 'bundle_options' => [ + [ + 'title' => 'Drop-down Option', + 'type' => 'Drop-down', + 'value' => [ + 'name' => 'Simple Product', + ], + ], + ], + ], + ], ]; return isset($presets[$name]) ? $presets[$name] : null; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index 6208d62898007..ce4b1092454d2 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -177,5 +177,31 @@ two_options_assigned_products_without_category + + + Bundle fixed product %isolation% + bundle-fixed-product-%isolation% + sku_bundle_fixed_product_%isolation% + Fixed + Fixed + + 100 + + + taxable_goods + + 1 + Fixed + + Main Website + + Separately + + bundle_required + + + bundle_required + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index ce58ef50ad5ba..bc708ff87bfdf 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -136,5 +136,32 @@ product_50_dollar + + + + taxable_goods + + + Main Website + + Yes + virtual-product%isolation% + Virtual product %isolation% + sku_virtual_product_%isolation% + + 1000 + In Stock + + + No + + + 15 + - + + + order_default + + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php index c0c6109271198..d7b39bfe56be2 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php @@ -177,7 +177,7 @@ protected function getPreset($name) ], 'qty' => 1, ], - 'two_options_one_two_dollars' => [ + 'configurable_required' => [ 'options' => [ 'configurable_options' => [ [ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php index 7a608af4a450e..a59a887431d4b 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php @@ -628,7 +628,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], - 'two_options_one_two_dollars' => [ + 'configurable_required' => [ 'attributes_data' => [ 'attribute_key_0' => [ 'options' => [ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml index fc21547f725ad..2e5ca13606a97 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml @@ -223,6 +223,10 @@ taxable_goods 1 + + 1 + In Stock + default_subcategory @@ -302,7 +306,7 @@ On Gesture - + Configurable product %isolation% test-configurable-product-%isolation% sku_configurable_product_%isolation% @@ -324,13 +328,13 @@ Main Website - two_options_one_two_dollars + configurable_required custom_attribute_set - two_options_one_two_dollars + configurable_required From fe0e0e6d1d9616061966d512d0ed0c874cdd3a57 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Mon, 9 Feb 2015 11:38:10 +0200 Subject: [PATCH 33/50] MTA-548: Re-factor Tests for Create Products - Fixed logical and code style errors --- dev/tests/functional/.gitignore | 8 +- dev/tests/functional/client_error.log | 61 ---------------- .../Mtf/Client/Element/SuggestElement.php | 4 + dev/tests/functional/logger.log | 7 +- .../BundleProduct/BundleSelections.php | 4 +- .../Fixture/BundleProduct/CheckoutData.php | 2 +- .../Bundle/Test/Repository/BundleProduct.xml | 6 +- .../Test/Constraint/AssertCategoryPage.php | 3 +- .../Test/Constraint/AssertProductPage.php | 4 +- .../Test/Repository/CatalogProductSimple.xml | 73 +------------------ .../Test/Repository/CatalogProductVirtual.xml | 2 +- .../CreateCategoryEntityTest/test.csv | 2 +- .../Product/AddToCartCrossSellTest/test.csv | 2 +- .../testCreate.csv | 6 +- .../CreateVirtualProductEntityTest.php | 1 + .../NavigateRelatedProductsTest/test.csv | 2 +- .../NavigateUpSellProductsTest/test.csv | 2 +- .../test.csv | 6 +- .../ProductTypeSwitchingOnUpdateTest/test.csv | 10 +-- .../Product/var/log/test-cases-report.xml | 6 -- ...UsedInConfigurableProductAttributeTest.php | 6 +- .../TestCase/SearchEntityResultsTest/test.csv | 2 +- .../test.csv | 4 +- .../test.csv | 4 +- .../test.csv | 2 +- .../Test/Block/Product/View.php | 4 +- .../Product/View/ConfigurableOptions.php | 4 +- ...rtChildProductIsNotDisplayedSeparately.php | 6 +- .../Constraint/AssertChildProductsInGrid.php | 6 +- ...figurableAttributesAbsentOnProductPage.php | 6 +- ...leAttributesBlockIsAbsentOnProductPage.php | 6 +- .../AssertConfigurableProductInCart.php | 6 +- ...ProductInCustomerWishlistOnBackendGrid.php | 4 +- ...tConfigurableProductInItemsOrderedGrid.php | 4 +- .../Test/Fixture/Cart/Item.php | 4 +- ...Injectable.xml => ConfigurableProduct.xml} | 10 +-- .../CheckoutData.php | 4 +- .../ConfigurableAttributesData.php | 4 +- .../ConfigurableProductInterface.php} | 6 +- .../Curl.php | 6 +- ...Injectable.xml => ConfigurableProduct.xml} | 42 +---------- .../CreateConfigurableProductEntityTest.php | 6 +- .../test.csv | 10 +-- .../UpdateConfigurableProductStep.php | 30 ++++---- .../ConfigurableProduct/Test/etc/curl/di.xml | 2 +- .../ConfigurableProduct/Test/etc/fixture.xml | 6 +- .../CreateDownloadableProductEntityTest.php | 1 + .../test.csv | 32 ++++---- .../CreateGroupedProductEntityTest.php | 1 + .../CreateGroupedProductEntityTest/test.csv | 20 ++--- .../ViewedProductsReportEntityTest/test.csv | 2 +- .../Test/Block/Adminhtml/Order/View/Items.php | 4 +- .../AddProductToWishlistEntityTest/test.csv | 2 +- .../test.csv | 2 +- .../test.csv | 2 +- .../test.csv | 2 +- .../test.csv | 2 +- .../test.csv | 2 +- .../test.csv | 2 +- .../test.csv | 2 +- .../TestSuite/var/log/test-cases-report.xml | 0 61 files changed, 155 insertions(+), 326 deletions(-) delete mode 100644 dev/tests/functional/client_error.log delete mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/var/log/test-cases-report.xml rename dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/{ConfigurableProductInjectable.xml => ConfigurableProduct.xml} (98%) rename dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/{ConfigurableProductInjectable => ConfigurableProduct}/CheckoutData.php (99%) rename dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/{ConfigurableProductInjectable => ConfigurableProduct}/ConfigurableAttributesData.php (99%) rename dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/{ConfigurableProductInjectable/ConfigurableProductInjectableInterface.php => ConfigurableProduct/ConfigurableProductInterface.php} (61%) rename dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/{ConfigurableProductInjectable => ConfigurableProduct}/Curl.php (97%) rename dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/{ConfigurableProductInjectable.xml => ConfigurableProduct.xml} (88%) delete mode 100644 dev/tests/functional/testsuites/Magento/Mtf/TestSuite/var/log/test-cases-report.xml diff --git a/dev/tests/functional/.gitignore b/dev/tests/functional/.gitignore index 06440a2b35e9a..7e46f3cf256a6 100755 --- a/dev/tests/functional/.gitignore +++ b/dev/tests/functional/.gitignore @@ -1,12 +1,12 @@ +**/var /composer.lock -/vendor -/generated -/var /config/* +/generated +/lib/Magento/Mtf/Util/Generate/testcase.xml +/vendor !/config/application.yml.dist !/config/handler.yml.dist !/config/isolation.yml.dist !/config/server.yml.dist phpunit.xml credentials.xml -/lib/Magento/Mtf/Util/Generate/testcase.xml diff --git a/dev/tests/functional/client_error.log b/dev/tests/functional/client_error.log deleted file mode 100644 index 9050ffd36cb20..0000000000000 --- a/dev/tests/functional/client_error.log +++ /dev/null @@ -1,61 +0,0 @@ -Unable to get Js Errors. Exception: -exception 'PHPUnit_Extensions_Selenium2TestCase_WebDriverException' with message 'Error communicating with the remote browser. It may have died. -Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37' -System info: host: 'D-KBP-00441599', ip: '10.224.53.134', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_26' -Driver info: driver.version: EventFiringWebDriver -org.openqa.selenium.remote.UnreachableBrowserException' in C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\Driver.php:147 -Stack trace: -#0 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\Driver.php(156): PHPUnit_Extensions_Selenium2TestCase_Driver->curl('POST', Object(PHPUnit_Extensions_Selenium2TestCase_URL), Array) -#1 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\CommandsHolder.php(100): PHPUnit_Extensions_Selenium2TestCase_Driver->execute(Object(PHPUnit_Extensions_Selenium2TestCase_ElementCommand_GenericPost)) -#2 [internal function]: PHPUnit_Extensions_Selenium2TestCase_CommandsHolder->__call('execute', Array) -#3 [internal function]: PHPUnit_Extensions_Selenium2TestCase_Session->execute(Array) -#4 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase.php(344): call_user_func_array(Array, Array) -#5 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\Client\Driver\Selenium\Driver.php(228): PHPUnit_Extensions_Selenium2TestCase->__call('execute', Array) -#6 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\Client\Driver\Selenium\Driver.php(228): Magento\Mtf\Client\Driver\Selenium\RemoteDriver->execute(Array) -#7 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\Client\Browser.php(265): Magento\Mtf\Client\Driver\Selenium\Driver->getJsErrors() -#8 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\System\Observer\ClientError.php(67): Magento\Mtf\Client\Browser->getJsErrors() -#9 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\System\Event\EventManager.php(101): Magento\Mtf\System\Observer\ClientError->process(Object(Magento\Mtf\System\Event\Event)) -#10 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestCase\Functional.php(343): Magento\Mtf\System\Event\EventManager->dispatchEvent(Array, Array) -#11 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\Framework\TestResult.php(686): Magento\Mtf\TestCase\Functional->runBare() -#12 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\Framework\TestCase.php(753): PHPUnit_Framework_TestResult->run(Object(Magento\Catalog\Test\TestCase\Product\NavigateUpSellProductsTest)) -#13 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestCase\Functional.php(222): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult)) -#14 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestCase\Injectable.php(209): Magento\Mtf\TestCase\Functional->run(Object(PHPUnit_Framework_TestResult)) -#15 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestCase\Injectable.php(169): Magento\Mtf\TestCase\Injectable->executeTestVariation(Object(PHPUnit_Framework_TestResult), Array) -#16 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\Framework\TestSuite.php(714): Magento\Mtf\TestCase\Injectable->run(Object(PHPUnit_Framework_TestResult)) -#17 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestSuite\TestSuite.php(169): PHPUnit_Framework_TestSuite->runTest(Object(Magento\Catalog\Test\TestCase\Product\NavigateUpSellProductsTest), Object(PHPUnit_Framework_TestResult)) -#18 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestSuite\TestSuite.php(131): Magento\Mtf\TestSuite\TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false) -#19 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestSuite\Callback.php(76): Magento\Mtf\TestSuite\TestSuite->run(Object(PHPUnit_Framework_TestResult)) -#20 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestSuite\TestSuite.php(131): Magento\Mtf\TestSuite\Callback->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false) -#21 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestSuite\TestCase.php(107): Magento\Mtf\TestSuite\TestSuite->run(Object(PHPUnit_Framework_TestResult)) -#22 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestSuite\TestSuite.php(131): Magento\Mtf\TestSuite\TestCase->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false) -#23 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(426): Magento\Mtf\TestSuite\TestSuite->run(Object(PHPUnit_Framework_TestResult)) -#24 C:\PEAR\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(Magento\Mtf\TestSuite\AppState), Array) -#25 C:\Users\omanchenko\AppData\Local\Temp\ide-phpunit.php(243): PHPUnit_TextUI_Command->run(Array, true) -#26 C:\Users\omanchenko\AppData\Local\Temp\ide-phpunit.php(501): IDE_Base_PHPUnit_TextUI_Command::main() -#27 {main} -Unable to get Js Errors. Exception: -exception 'PHPUnit_Extensions_Selenium2TestCase_WebDriverException' with message 'Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37' -System info: host: 'D-KBP-00441599', ip: '10.224.53.134', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_26' -Driver info: driver.version: unknown -org.openqa.selenium.remote.SessionNotFoundException' in C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\Driver.php:147 -Stack trace: -#0 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\Driver.php(156): PHPUnit_Extensions_Selenium2TestCase_Driver->curl('POST', Object(PHPUnit_Extensions_Selenium2TestCase_URL), Array) -#1 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\CommandsHolder.php(100): PHPUnit_Extensions_Selenium2TestCase_Driver->execute(Object(PHPUnit_Extensions_Selenium2TestCase_ElementCommand_GenericPost)) -#2 [internal function]: PHPUnit_Extensions_Selenium2TestCase_CommandsHolder->__call('execute', Array) -#3 [internal function]: PHPUnit_Extensions_Selenium2TestCase_Session->execute(Array) -#4 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase.php(344): call_user_func_array(Array, Array) -#5 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\Client\Driver\Selenium\Driver.php(228): PHPUnit_Extensions_Selenium2TestCase->__call('execute', Array) -#6 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\Client\Driver\Selenium\Driver.php(228): Magento\Mtf\Client\Driver\Selenium\RemoteDriver->execute(Array) -#7 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\Client\Browser.php(265): Magento\Mtf\Client\Driver\Selenium\Driver->getJsErrors() -#8 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\System\Observer\ClientError.php(67): Magento\Mtf\Client\Browser->getJsErrors() -#9 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\System\Event\EventManager.php(101): Magento\Mtf\System\Observer\ClientError->process(Object(Magento\Mtf\System\Event\Event)) -#10 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestCase\Functional.php(343): Magento\Mtf\System\Event\EventManager->dispatchEvent(Array, Array) -#11 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\Framework\TestResult.php(686): Magento\Mtf\TestCase\Functional->runBare() -#12 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\Framework\TestCase.php(753): PHPUnit_Framework_TestResult->run(Object(Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest)) -#13 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\magento\mtf\Magento\Mtf\TestCase\Functional.php(222): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult)) -#14 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\Framework\TestSuite.php(675): Magento\Mtf\TestCase\Functional->run(Object(PHPUnit_Framework_TestResult)) -#15 C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(426): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult)) -#16 C:\PEAR\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array) -#17 C:\Users\omanchenko\AppData\Local\Temp\ide-phpunit.php(243): PHPUnit_TextUI_Command->run(Array, true) -#18 C:\Users\omanchenko\AppData\Local\Temp\ide-phpunit.php(501): IDE_Base_PHPUnit_TextUI_Command::main() -#19 {main} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php index a44151e5a9829..bb2236203efba 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php @@ -58,6 +58,10 @@ public function setValue($value) $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); $this->clear(); + + if ($value == ''){ + return; + } foreach (str_split($value) as $symbol) { $input = $this->find($this->suggest); $input->click(); diff --git a/dev/tests/functional/logger.log b/dev/tests/functional/logger.log index 58e50630d2c88..ff47635d12065 100644 --- a/dev/tests/functional/logger.log +++ b/dev/tests/functional/logger.log @@ -1,6 +1 @@ -2015-02-06 14:27:38+00:00 5a8199584ce11f8690dd54de28280ebf7c2036c8 Magento\Catalog\Test\TestCase\Product\AddToCartCrossSellTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable Wrong products are displayed in cross-sell section. -Failed asserting that two arrays are equal. -2015-02-06 14:37:27+00:00 c67be221e7e04f061c1f6530c083a31adf73b13f Magento\Catalog\Test\TestCase\Product\NavigateRelatedProductsTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable Error occurred on attempt to get element. Message: "Timed out after 90 seconds". Locator: "css selector(#maincontent) -> css selector(#qty)" . Wait: "1" -2015-02-06 15:36:41+00:00 0224e53ffc5b7752b664ed28fb4d528bf8a81c20 Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest testOnepageCheckout Magento\Bundle\Test\Fixture\BundleProduct Argument 2 passed to Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest::checkProductPrice() must be an instance of Magento\Catalog\Test\Fixture\Product, instance of Magento\Catalog\Test\Fixture\CatalogProductSimple given, called in C:\magento\m2dev2\magento2ee\dev\tests\functional\tests\app\Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest.php on line 66 and defined -2015-02-06 15:41:00+00:00 6e899646febacc64057f1b1067927992c2d78e0e Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest testOnepageCheckout Magento\Bundle\Test\Fixture\BundleProduct Failed asserting that '10.00' matches expected null. -2015-02-06 16:28:08+00:00 2fbdd569fec39c684105c195c1a83c7f60cb9438 Magento\Checkout\Test\TestCase\Guest\CheckMoneyOrderTest testOnepageCheckout Magento\Bundle\Test\Fixture\BundleProduct Error occurred on attempt to get element. Message: "Timed out after 90 seconds". Locator: "css selector(#checkout-step-review) -> css selector(.totals-tax span)" . Wait: "1" +2015-02-09 09:15:34+00:00 abf3e3e3650feeb10be9a15e297541ba33dcf681 Magento\Catalog\Test\TestCase\Product\NavigateUpSellProductsTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct include(C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor/sebastian/recursion-context/src/Context.php): failed to open stream: No such file or directory diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index d4f5fa075e073..9498192040d2c 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -639,7 +639,7 @@ protected function getPreset($name) ], ], - 'bundle_required' => [ + 'required_two_fixed_options' => [ 'bundle_options' => [ [ 'title' => 'Drop-down Option', @@ -672,7 +672,7 @@ protected function getPreset($name) 'products' => [ [ 'catalogProductSimple::simple', - 'catalogProductVirtual::for_bundle_required', + 'catalogProductVirtual::for_bundle_fixed', ], ], ], diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php index daa1abe36726b..0f8095665e7f0 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php @@ -304,7 +304,7 @@ protected function getPreset($name) ], ], ], - 'bundle_required' => [ + 'required_two_fixed_options' => [ 'options' => [ 'bundle_options' => [ [ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index ce4b1092454d2..1a48633dd238d 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -178,7 +178,7 @@ - + Bundle fixed product %isolation% bundle-fixed-product-%isolation% sku_bundle_fixed_product_%isolation% @@ -197,10 +197,10 @@ Separately - bundle_required + required_two_fixed_options - bundle_required + required_two_fixed_options diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php index a4cd285326b01..f8a88c489d33b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php @@ -9,7 +9,6 @@ use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Fixture\Category\LandingPage; use Magento\Catalog\Test\Page\Category\CatalogCategoryView; -use Magento\Mtf\Client\Browser; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureFactory; @@ -43,7 +42,7 @@ class AssertCategoryPage extends AbstractConstraint /** * Browser instance * - * @var Browser + * @var BrowserInterface */ protected $browser; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php index 94bd2b2647082..268b2e15fd310 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Test\Constraint; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractAssertForm; use Magento\Mtf\Fixture\FixtureInterface; @@ -32,7 +32,7 @@ class AssertProductPage extends AbstractAssertForm /** * Product fixture * - * @var ConfigurableProductInjectable + * @var ConfigurableProduct */ protected $product; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index 4d82ea497b36a..6f862fbf2cd9d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -965,7 +965,7 @@ - + default @@ -998,76 +998,5 @@ default_subcategory - - - - default - - Simple Product %isolation% - sku_simple_product_%isolation% - simple-product-%isolation% - 1 - - 1000 - In Stock - - - 10 - - - - - taxable_goods - - - Main Website - - Catalog, Search - - order_default - - - No - - - - - - default - - Simple Product %isolation% - sku_simple_product_%isolation% - - 1.99 - - - - - - - Simple Product with msrp %isolation% - sku_simple_product_with_msrp_%isolation% - 1 - - 1000 - In Stock - - - 10 - - - - - default_subcategory - - - taxable_goods - - - Main Website - - - No - - 15 - On Gesture - diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index bc708ff87bfdf..58018fb81be38 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -137,7 +137,7 @@ - + taxable_goods diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv index a7a0fb8c4babb..ca7f5c8f39175 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest/test.csv @@ -7,4 +7,4 @@ "Create not active subcategory";"addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Not active category";"-";"Yes";"-";"-";"-";"Yes";"-";"-";"-";"Yes";"-";"Yes";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm";"" "Create not included in menu subcategory";"addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Not included in menu";"-";"No";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm";"" "MAGETWO-12513: Create Category from Category page with Required Fields Only";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage";"test_type:acceptance_test" -"MAGETWO-16351: Assign Products at the Category Level";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default, bundleProduct::bundle_fixed_product";"assertCategorySaveMessage, assertCategoryForAssignedProducts";"test_type:acceptance_test" +"MAGETWO-16351: Assign Products at the Category Level";"addSubcategory";"default_category";"Subcategory%isolation%";"-";"Yes";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product";"assertCategorySaveMessage, assertCategoryForAssignedProducts";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv index b4b305ec3bfb4..11fe1afbe0f2a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest/test.csv @@ -1,2 +1,2 @@ "products";"promotedProducts";"navigateProductsOrder";"productsToVerify";"tag" -"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index c3d5571932ffc..f81f055865d86 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -17,9 +17,9 @@ "Create product with tax class and check absent special price";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" "Create product without tax class and tier price";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"" "Create product wit suite of custom options";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"-";"-";"options-suite";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" -"Create product with cross-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" -"Create product with up-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" -"Create product with related products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" +"Create product with cross-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10018";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProduct::default";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductCrossSells";"" +"Create product with up-sell products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10019";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProduct::default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductUpSells";"" +"Create product with related products";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10020";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"catalogProductSimple::default, configurableProduct::default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductRelatedProducts";"" "MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart";"display_out_of_stock";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10021";"-";"-";"-";"68";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertAddToCartButtonAbsent";"test_type:acceptance_test" "MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)";"-";"no";"default_subcategory";"simple%isolation%";"simple%isolation%";"simple%isolation%";"-";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInCategory, assertProductPage";"" "MAGETWO-12514: Create Simple Product and Assigning It to Category";"-";"-";"-";"simple-product-%isolation%";"Simple Product %isolation%";"simple_sku_%isolation%";"taxable_goods";"10";"-";"-";"-";"1";"1000";"In Stock";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage";"" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php index b7e1955b146b5..cef8d25f3a568 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php @@ -29,6 +29,7 @@ class CreateVirtualProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'no'; const DOMAIN = 'MX'; /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv index 58efbf82ddef0..222ce3f357360 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest/test.csv @@ -1,2 +1,2 @@ "products";"selectable";"promotedProducts";"navigateProductsOrder";"productsToVerify";"tag" -"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:yes,simple2:yes,config1:no";"simple1:simple2,config1;config1:simple2";"simple1,config1";"simple1:simple2,config1;config1:simple2";"test_type:acceptance_test" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price";"simple1:yes,simple2:yes,config1:no";"simple1:simple2,config1;config1:simple2";"simple1,config1";"simple1:simple2,config1;config1:simple2";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv index b4b305ec3bfb4..11fe1afbe0f2a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest/test.csv @@ -1,2 +1,2 @@ "products";"promotedProducts";"navigateProductsOrder";"productsToVerify";"tag" -"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProductInjectable::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" +"simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price";"simple1:simple2,config1;config1:simple2";"simple1,config1,simple2";"simple1:simple2,config1;config1:simple2;simple2:";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv index 7881421044acd..c42a2565f1b13 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv @@ -1,10 +1,10 @@ "createProduct";"product";"constraint" -"simple";"configurableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" +"simple";"configurableProduct::default";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" "simple";"catalogProductVirtual::default";"assertProductSaveMessage, assertProductInGrid" "configurable";"catalogProductSimple::default";"assertProductSaveMessage, assertProductInGrid" "configurable";"catalogProductVirtual::default";"assertProductSaveMessage, assertProductInGrid" "virtual";"catalogProductSimple::default";"assertProductSaveMessage, assertProductInGrid" -"virtual";"configurableProductInjectable::not_virtual_for_type_switching";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" +"virtual";"configurableProduct::not_virtual_for_type_switching";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" "virtual";"downloadableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock" "downloadable";"catalogProductSimple::default";"assertProductSaveMessage, assertProductInGrid" -"downloadable";"configurableProductInjectable::not_virtual_for_type_switching";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" +"downloadable";"configurableProduct::not_virtual_for_type_switching";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv index afbcec37babe9..d3b81d626a0ce 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv @@ -1,12 +1,12 @@ "productOrigin";"product";"actionName";"constraint" -"catalogProductSimple::default";"configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"catalogProductSimple::default";"configurableProduct::default";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" "catalogProductSimple::default";"catalogProductVirtual::default";"-";"assertProductSaveMessage, assertProductInGrid" -"configurableProductInjectable::default";"catalogProductSimple::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" -"configurableProductInjectable::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" +"configurableProduct::default";"catalogProductSimple::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" +"configurableProduct::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" "catalogProductVirtual::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" -"catalogProductVirtual::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"catalogProductVirtual::default";"configurableProduct::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" "catalogProductVirtual::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" "downloadableProductInjectable::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" -"downloadableProductInjectable::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"downloadableProductInjectable::default";"configurableProduct::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" "downloadableProductInjectable::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid" "catalogProductSimple::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/var/log/test-cases-report.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/var/log/test-cases-report.xml deleted file mode 100644 index 71ba10b421529..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/var/log/test-cases-report.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.php index 9485ebe8e0841..4b5c4403e8c87 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeNew; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\TestCase\Injectable; /** @@ -68,10 +68,10 @@ public function __inject(CatalogProductAttributeIndex $attributeIndex, CatalogPr /** * Run Delete used in configurable product attribute test * - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return array */ - public function test(ConfigurableProductInjectable $product) + public function test(ConfigurableProduct $product) { // Precondition $product->persist(); diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv index 27c6e337beb15..be73d2327c97c 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv @@ -2,7 +2,7 @@ "MAGETWO-12420: Use Quick Search to Find the Product";"catalogProductSimple::default::sku";"assertProductCanBeOpenedFromSearchResult";"test_type:acceptance_test" "Search simple product";"catalogProductSimple::default::simple";"assertCatalogSearchResult";"" "Search virtual product";"catalogProductVirtual::default::virtual";"assertCatalogSearchResult";"" -"Search configurable product";"configurableProductInjectable::default::configurable";"assertCatalogSearchResult";"" +"Search configurable product";"configurableProduct::default::configurable";"assertCatalogSearchResult";"" "Search downloadable product";"downloadableProductInjectable::default::downloadable";"assertCatalogSearchResult";"" "Search grouped product";"groupedProductInjectable::default::grouped";"assertCatalogSearchResult";"" "Search bundle dynamic product";"bundleProduct::bundle_dynamic_product::bundle";"assertCatalogSearchResult";"" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv index 65e0f5e88ed2e..30ed16715ce79 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv @@ -3,7 +3,7 @@ "bundleProduct::bundle_fixed_product";"756";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" "catalogProductSimple::with_two_custom_option";"340";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" "catalogProductVirtual::product_50_dollar";"50";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" -"configurableProductInjectable::default";"516";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"configurableProduct::default";"516";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" "downloadableProductInjectable::with_two_separately_links";"46";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" "groupedProductInjectable::three_simple_products";"1920";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" -"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProductInjectable::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3249";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3249";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv index 78905d9e68380..7d5404b4b4139 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv @@ -3,7 +3,7 @@ "bundleProduct::bundle_fixed_product";"assertCartIsEmpty" "catalogProductSimple::with_two_custom_option";"assertCartIsEmpty" "catalogProductVirtual::product_50_dollar";"assertCartIsEmpty" -"configurableProductInjectable::default";"assertCartIsEmpty" +"configurableProduct::default";"assertCartIsEmpty" "downloadableProductInjectable::with_two_separately_links";"assertCartIsEmpty" "groupedProductInjectable::three_simple_products";"assertCartIsEmpty" -"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProductInjectable::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"assertCartIsEmpty" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"assertCartIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv index 9c6f1765f49da..5670febe8a187 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv @@ -1,5 +1,5 @@ "description";"originalProduct";"checkoutData/preset";"constraint";"issue" "Update Simple";"catalogProductSimple::with_two_custom_option";"forUpdateMiniShoppingCart";"assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart";"" -"Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart";"configurableProductInjectable::default";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" +"Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart";"configurableProduct::default";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" "Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart";"bundleProduct::bundle_fixed_product";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" "Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart";"downloadableProductInjectable::with_two_separately_links";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"Bug: MAGETWO-24195" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php index 80aafd73b2f5d..ea17b756ba571 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php @@ -7,7 +7,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Product; use Magento\ConfigurableProduct\Test\Block\Product\View\ConfigurableOptions; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; @@ -38,7 +38,7 @@ public function getConfigurableOptionsBlock() */ public function fillOptions(FixtureInterface $product) { - /** @var ConfigurableProductInjectable $product */ + /** @var ConfigurableProduct $product */ $attributesData = $product->getConfigurableAttributesData()['attributes_data']; $checkoutData = $product->getCheckoutData(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php index ca2ccc4239775..88493e7896719 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View/ConfigurableOptions.php @@ -7,7 +7,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Product\View; use Magento\Catalog\Test\Block\Product\View\CustomOptions; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; @@ -36,7 +36,7 @@ class ConfigurableOptions extends CustomOptions */ public function getOptions(FixtureInterface $product) { - /** @var ConfigurableProductInjectable $product */ + /** @var ConfigurableProduct $product */ $attributesData = $product->hasData('configurable_attributes_data') ? $product->getConfigurableAttributesData()['attributes_data'] : []; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php index 49ed7543a0122..21dba7044b98d 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php @@ -8,7 +8,7 @@ use Magento\CatalogSearch\Test\Page\CatalogsearchResult; use Magento\Cms\Test\Page\CmsIndex; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -26,13 +26,13 @@ class AssertChildProductIsNotDisplayedSeparately extends AbstractConstraint * * @param CatalogSearchResult $catalogSearchResult * @param CmsIndex $cmsIndex - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ public function processAssert( CatalogsearchResult $catalogSearchResult, CmsIndex $cmsIndex, - ConfigurableProductInjectable $product + ConfigurableProduct $product ) { $configurableAttributesData = $product->getConfigurableAttributesData(); $errors = []; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php index 80446fef97879..430ade3218409 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php @@ -7,7 +7,7 @@ namespace Magento\ConfigurableProduct\Test\Constraint; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -29,10 +29,10 @@ class AssertChildProductsInGrid extends AbstractConstraint * Assert that child products generated during configurable product are present in products grid * * @param CatalogProductIndex $productGrid - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ - public function processAssert(CatalogProductIndex $productGrid, ConfigurableProductInjectable $product) + public function processAssert(CatalogProductIndex $productGrid, ConfigurableProduct $product) { $configurableAttributesData = $product->getConfigurableAttributesData(); $productType = $product->getIsVirtual() === "Yes" ? 'Virtual Product' : 'Simple Product'; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php index 22695040b347c..771365a6e1fcb 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; @@ -27,14 +27,14 @@ class AssertConfigurableAttributesAbsentOnProductPage extends AbstractConstraint * @param CatalogProductAttribute[] $deletedProductAttributes * @param BrowserInterface $browser * @param CatalogProductView $catalogProductView - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ public function processAssert( array $deletedProductAttributes, BrowserInterface $browser, CatalogProductView $catalogProductView, - ConfigurableProductInjectable $product + ConfigurableProduct $product ) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $pageOptions = $catalogProductView->getViewBlock()->getOptions($product)['configurable_options']; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php index e43779622b8f1..44afc33ab2532 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php @@ -7,7 +7,7 @@ namespace Magento\ConfigurableProduct\Test\Constraint; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; @@ -25,13 +25,13 @@ class AssertConfigurableAttributesBlockIsAbsentOnProductPage extends AbstractCon * * @param BrowserInterface $browser * @param CatalogProductView $catalogProductView - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ public function processAssert( BrowserInterface $browser, CatalogProductView $catalogProductView, - ConfigurableProductInjectable $product + ConfigurableProduct $product ) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); \PHPUnit_Framework_Assert::assertFalse( diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php index 0cf25ed3ed81e..39a749d3cc341 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Checkout\Test\Page\CheckoutCart; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; @@ -24,14 +24,14 @@ class AssertConfigurableProductInCart extends AbstractConstraint * @param BrowserInterface $browser * @param CatalogProductView $catalogProductView * @param CheckoutCart $checkoutCart - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ public function processAssert( BrowserInterface $browser, CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, - ConfigurableProductInjectable $product + ConfigurableProduct $product ) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCustomerWishlistOnBackendGrid.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCustomerWishlistOnBackendGrid.php index 2b27a259c1eb5..1261383aeb0bb 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCustomerWishlistOnBackendGrid.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCustomerWishlistOnBackendGrid.php @@ -6,7 +6,7 @@ namespace Magento\ConfigurableProduct\Test\Constraint; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Wishlist\Test\Constraint\AssertProductInCustomerWishlistOnBackendGrid; use Magento\Mtf\Fixture\FixtureInterface; @@ -24,7 +24,7 @@ class AssertConfigurableProductInCustomerWishlistOnBackendGrid extends AssertPro */ protected function prepareOptions(FixtureInterface $product) { - /** @var ConfigurableProductInjectable $product */ + /** @var ConfigurableProduct $product */ $productOptions = parent::prepareOptions($product); $checkoutData = $product->getCheckoutData()['options']; if (!empty($checkoutData['configurable_options'])) { diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php index 5b7a08c049a62..6efeed51c24e8 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php @@ -6,7 +6,7 @@ namespace Magento\ConfigurableProduct\Test\Constraint; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid; use Magento\Mtf\Fixture\FixtureInterface; @@ -29,7 +29,7 @@ protected function getProductPrice(FixtureInterface $product) if (!$this->productsIsConfigured) { return $price; } - if (!$product instanceof ConfigurableProductInjectable) { + if (!$product instanceof ConfigurableProduct) { throw new \Exception("Product '$product->getName()' is not configurable product."); } $checkoutData = $product->getCheckoutData(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php index 80aa5bd293b9f..1e6169606f5e1 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php @@ -6,7 +6,7 @@ namespace Magento\ConfigurableProduct\Test\Fixture\Cart; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Fixture\FixtureInterface; /** @@ -28,7 +28,7 @@ public function __construct(FixtureInterface $product) { parent::__construct($product); - /** @var ConfigurableProductInjectable $product */ + /** @var ConfigurableProduct $product */ $checkoutData = $product->getCheckoutData(); $cartItem = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; $attributesData = $product->getConfigurableAttributesData()['attributes_data']; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml similarity index 98% rename from dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml rename to dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml index ede1655eb7c97..33e9081c11b5c 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml @@ -7,15 +7,15 @@ --> + class="Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct"> Magento_ConfigurableProduct eav catalog_product configurable Magento\Catalog\Model\Resource\Product\Collection sku - Magento\ConfigurableProduct\Test\Repository\ConfigurableProductInjectable - Magento\ConfigurableProduct\Test\Handler\ConfigurableProductInjectable\ConfigurableProductInjectableInterface + Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct + Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct\ConfigurableProductInterface Configurable Product %isolation% sku_configurable_product_%isolation% @@ -468,7 +468,7 @@ 0 variations variations - Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable\ConfigurableAttributesData + Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\ConfigurableAttributesData default @@ -485,7 +485,7 @@ checkout_data virtual null - Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable\CheckoutData + Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\CheckoutData cross_sell_products diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php similarity index 99% rename from dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php rename to dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php index d7b39bfe56be2..f3ea49540b3bd 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +namespace Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; /** * Data for fill product form on frontend. @@ -177,7 +177,7 @@ protected function getPreset($name) ], 'qty' => 1, ], - 'configurable_required' => [ + 'two_options_by_one_dollar' => [ 'options' => [ 'configurable_options' => [ [ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php similarity index 99% rename from dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php rename to dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php index 1dd85d6227c8c..e00f4e4e90f07 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +namespace Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Fixture\CatalogProductSimple; @@ -675,7 +675,7 @@ class ConfigurableAttributesData implements FixtureInterface ], ], - 'configurable_required' => [ + 'two_options_by_one_dollar' => [ 'attributes_data' => [ 'attribute_key_0' => [ 'options' => [ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProductInjectable/ConfigurableProductInjectableInterface.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProduct/ConfigurableProductInterface.php similarity index 61% rename from dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProductInjectable/ConfigurableProductInjectableInterface.php rename to dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProduct/ConfigurableProductInterface.php index ac4eed63d169f..0ab00fec85862 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProductInjectable/ConfigurableProductInjectableInterface.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProduct/ConfigurableProductInterface.php @@ -4,14 +4,14 @@ * See COPYING.txt for license details. */ -namespace Magento\ConfigurableProduct\Test\Handler\ConfigurableProductInjectable; +namespace Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct; use Magento\Mtf\Handler\HandlerInterface; /** - * Interface ConfigurableProductInjectableInterface + * Interface ConfigurableProductInterface */ -interface ConfigurableProductInjectableInterface extends HandlerInterface +interface ConfigurableProductInterface extends HandlerInterface { // } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProductInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProduct/Curl.php similarity index 97% rename from dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProductInjectable/Curl.php rename to dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProduct/Curl.php index 2a354d1e6d4ae..106da0c843ed7 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProductInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Handler/ConfigurableProduct/Curl.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ -namespace Magento\ConfigurableProduct\Test\Handler\ConfigurableProductInjectable; +namespace Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct; use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Handler\CatalogProductSimple\Curl as ProductCurl; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable\ConfigurableAttributesData; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\ConfigurableAttributesData; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\System\Config; @@ -16,7 +16,7 @@ * Class Curl * Create new configurable product via curl */ -class Curl extends ProductCurl implements ConfigurableProductInjectableInterface +class Curl extends ProductCurl implements ConfigurableProductInterface { /** * Constructor diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml similarity index 88% rename from dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml rename to dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml index 2e5ca13606a97..9704898edab7e 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml @@ -6,7 +6,7 @@ */ --> - + Test configurable product %isolation% sku_test_configurable_product_%isolation% @@ -272,41 +272,7 @@ - - Test configurable product %isolation% - sku_test_configurable_product_%isolation% - - 10 - - 30 - - taxable_goods - - test-configurable-product-%isolation% - - default_subcategory - - - 1 - In Stock - - - one_variation - - - Main Website - - - custom_attribute_set - - - with_one_option - - 15 - On Gesture - - - + Configurable product %isolation% test-configurable-product-%isolation% sku_configurable_product_%isolation% @@ -328,13 +294,13 @@ Main Website - configurable_required + two_options_by_one_dollar custom_attribute_set - configurable_required + two_options_by_one_dollar diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php index 572f4b16bb878..50615a121e3ab 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\TestCase\Injectable; /** @@ -75,10 +75,10 @@ public function __inject(CatalogProductIndex $productIndex, CatalogProductNew $p /** * Test create catalog Configurable product run * - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ - public function test(ConfigurableProductInjectable $product) + public function test(ConfigurableProduct $product) { // Steps $this->productIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv index 03d41b617cb51..fdbaa7cbf74d8 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv @@ -1,6 +1,6 @@ "description";"attributeTypeAction";"product";"updatedProduct/data/url_key";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"updatedProduct/data/affected_attribute_set";"constraint" -"Add new option to existed Attribute";"addOptions";"configurableProductInjectable::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" -"Add new variations";"";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" -"Delete one attribute and add another";"deleteLast";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage" -"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProductInjectable::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock" -"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProductInjectable::two_options_with_fixed_price";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage" +"Add new option to existed Attribute";"addOptions";"configurableProduct::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" +"Add new variations";"";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" +"Delete one attribute and add another";"deleteLast";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage" +"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock" +"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProduct::two_options_with_fixed_price";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php index d750752c96047..5289324d5c837 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestStep\TestStepInterface; @@ -41,14 +41,14 @@ class UpdateConfigurableProductStep implements TestStepInterface /** * Old configurable product fixture. * - * @var ConfigurableProductInjectable + * @var ConfigurableProduct */ protected $initialProduct; /** * New configurable product fixture. * - * @var ConfigurableProductInjectable + * @var ConfigurableProduct */ protected $product; @@ -63,15 +63,15 @@ class UpdateConfigurableProductStep implements TestStepInterface * @constructor * @param FixtureFactory $fixtureFactory * @param CatalogProductEdit $catalogProductEdit - * @param ConfigurableProductInjectable $product - * @param ConfigurableProductInjectable $updatedProduct + * @param ConfigurableProduct $product + * @param ConfigurableProduct $updatedProduct * @param string $attributeTypeAction */ public function __construct( FixtureFactory $fixtureFactory, CatalogProductEdit $catalogProductEdit, - ConfigurableProductInjectable $product, - ConfigurableProductInjectable $updatedProduct, + ConfigurableProduct $product, + ConfigurableProduct $updatedProduct, $attributeTypeAction ) { $this->fixtureFactory = $fixtureFactory; @@ -97,14 +97,14 @@ public function run() /** * Prepare new product for update. * - * @param ConfigurableProductInjectable $initialProduct - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $initialProduct + * @param ConfigurableProduct $product * @param string $attributeTypeAction - * @return ConfigurableProductInjectable + * @return ConfigurableProduct */ protected function prepareProduct( - ConfigurableProductInjectable $initialProduct, - ConfigurableProductInjectable $product, + ConfigurableProduct $initialProduct, + ConfigurableProduct $product, $attributeTypeAction ) { if ($attributeTypeAction == 'deleteAll') { @@ -142,7 +142,7 @@ protected function prepareProduct( ->getCategories()[0]; } - return $this->fixtureFactory->createByCode('configurableProductInjectable', ['data' => $dataProduct]); + return $this->fixtureFactory->createByCode('configurableProduct', ['data' => $dataProduct]); } /** @@ -184,10 +184,10 @@ protected function addAttributes(array &$attributes, array $data) /** * Update product. * - * @param ConfigurableProductInjectable $product + * @param ConfigurableProduct $product * @return void */ - protected function updateProduct(ConfigurableProductInjectable $product) + protected function updateProduct(ConfigurableProduct $product) { $productForm = $this->catalogProductEdit->getProductForm(); $productForm->openTab('variations'); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml index c0daaeb3a865b..21d79c446c314 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml @@ -6,5 +6,5 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/fixture.xml index 0e17df6aa1ac2..129140e06db3d 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/fixture.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/fixture.xml @@ -7,7 +7,7 @@ --> - + eav catalog_product configurable @@ -31,7 +31,7 @@ virtual 0 variations - Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable\ConfigurableOptions + Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\ConfigurableOptions @@ -48,5 +48,5 @@ product - + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php index 5256ad90ced94..3a3d9c245b59d 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php @@ -30,6 +30,7 @@ class CreateDownloadableProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv index e33ab99f817b2..bea94e719123a 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv @@ -1,16 +1,16 @@ -"description";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/checkout_data/preset";"product/data/url_key";"constraint" -"Create product with default set links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock" -"Create product with default sets samples and links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData" -"Create product with custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData" -"Create product without category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"taxable_goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku" -"Create product with out of stock status";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm" -"Create product with manage stock";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock" -"Create product without tax class id";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage" -"Create product with import custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" -"Create product with three links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" -"-";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage" -"Create product without filling quantity and stock";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage" -"Create product with special price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage" -"Create product with group price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"taxable_goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage" -"Create product with tier price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"taxable_goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage" -"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_one_separately_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart" +"description";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/checkout_data/preset";"product/data/url_key";"constraint";"tag" +"Create product with default set links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock";"" +"Create product with default sets samples and links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData";"" +"Create product with custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData";"" +"Create product without category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"taxable_goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku";"" +"Create product with out of stock status";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm";"" +"Create product with manage stock";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock";"" +"Create product without tax class id";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage";"" +"Create product with import custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"" +"Create product with three links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"" +"Create product with three links without description";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"taxable_goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage";"" +"Create product without filling quantity and stock";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage";"" +"Create product with special price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Create product with group price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"taxable_goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Create product with tier price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"taxable_goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage";"" +"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_one_separately_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php index 7220342574099..8e3dee039d1b1 100755 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php @@ -35,6 +35,7 @@ class CreateGroupedProductEntityTest extends Injectable { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'no'; const DOMAIN = 'MX'; /* end tags */ diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv index 88ff37c889a07..40699aadd73e7 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv @@ -1,10 +1,10 @@ -"description";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/quantity_and_stock_status/is_in_stock";"product/data/category";"product/data/description";"product/data/associated/products";"product/data/associated/preset";"product/data/short_description";"isRequired";"constraint" -"Create with required products and description";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"This is description for grouped product";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"This is short description for grouped product";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty" -"Create product without category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"-";"In Stock";"-";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertProductInStock, assertProductSkuAutoGenerated, assertProductSearchableBySku" -"Create product out of stock";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"Out of Stock";"category_%isolation%";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertProductOutOfStock" -"Create with no required products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertGroupedProductsDefaultQty, assertGroupedProductForm, assertProductPage" -"Create with special price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice";"defaultSimpleProduct";"-";"No";"assertSpecialPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage" -"Create with group price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price";"defaultSimpleProduct";"-";"No";"assertGroupedPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage" -"Create with virtual products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product";"defaultVirtualProduct";"-";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty" -"Create with tier price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price";"defaultSimpleProduct";"-";"No";"assertTierPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage" -"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProductInjectable::one_dollar_product_with_one_separately_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage" +"description";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/quantity_and_stock_status/is_in_stock";"product/data/category";"product/data/description";"product/data/associated/products";"product/data/associated/preset";"product/data/short_description";"isRequired";"constraint";"tag" +"Create with required products and description";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"This is description for grouped product";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"This is short description for grouped product";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty";"" +"Create product without category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"-";"In Stock";"-";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertProductInStock, assertProductSkuAutoGenerated, assertProductSearchableBySku";"" +"Create product out of stock";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"Out of Stock";"category_%isolation%";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertProductOutOfStock";"" +"Create with no required products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertGroupedProductsDefaultQty, assertGroupedProductForm, assertProductPage";"" +"Create with special price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice";"defaultSimpleProduct";"-";"No";"assertSpecialPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" +"Create with group price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price";"defaultSimpleProduct";"-";"No";"assertGroupedPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" +"Create with virtual products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product";"defaultVirtualProduct";"-";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty";"" +"Create with tier price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price";"defaultSimpleProduct";"-";"No";"assertTierPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" +"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProductInjectable::one_dollar_product_with_one_separately_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv index fd637ffda83b6..fe06abf491815 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv @@ -1,4 +1,4 @@ "description";"total";"products";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_empty_rows";"constraint" "view products on front and verify they all reflected in Year report";"2, 1";"catalogProductSimple::default, catalogProductVirtual::default";"Year";"m/d/Y -1 year";"m/d/Y";"No";"assertProductViewsReportTotalResult" "view products on front and verify they all reflected in Month report";"1, 1";"downloadableProductInjectable::default, bundleProduct::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Day report";"1, 1";"configurableProductInjectable::default, groupedProductInjectable::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Day report";"1, 1";"configurableProduct::default, groupedProductInjectable::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php index d952ebfa9da29..42eb4514d2411 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\View; -use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProductInjectable; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\InjectableFixture; @@ -64,7 +64,7 @@ public function getPrice(InjectableFixture $product) { $productName = $product->getName(); - if ($product instanceof ConfigurableProductInjectable) { + if ($product instanceof ConfigurableProduct) { // Find the price for the specific configurable product that was purchased $attributesData = $product->getConfigurableAttributesData()['attributes_data']; $matrix = $product->getConfigurableAttributesData()['matrix']; diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv index 92def772d1f25..41ffe61d95d3b 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv @@ -3,6 +3,6 @@ "catalogProductVirtual::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" "downloadableProductInjectable::with_two_separately_links";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" "groupedProductInjectable::three_simple_products";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"configurableProductInjectable::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" +"configurableProduct::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" "bundleProduct::bundle_dynamic_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" "bundleProduct::bundle_fixed_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv index 4ced4df743d7e..30b82e7e8bfcf 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv @@ -4,6 +4,6 @@ "catalogProductSimple::default,catalogProductVirtual::product_50_dollar,catalogProductSimple::default,catalogProductVirtual::product_50_dollar";"-";"assertProductQtyInShoppingCart, assertWishlistIsEmpty" "groupedProductInjectable::three_simple_products";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "downloadableProductInjectable::with_two_separately_links";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"configurableProductInjectable::default";"3";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" +"configurableProduct::default";"3";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "bundleProduct::bundle_dynamic_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "bundleProduct::bundle_fixed_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv index 740881766b87f..c8bf871b8f02f 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv @@ -1,6 +1,6 @@ "product";"constraint" "catalogProductSimple::with_two_custom_option";"assertProductInCustomerWishlistOnBackendGrid" -"configurableProductInjectable::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" +"configurableProduct::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" "bundleProduct::bundle_dynamic_product";"assertBundleProductInCustomerWishlistOnBackendGrid" "downloadableProductInjectable::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" "groupedProductInjectable::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv index 7b192fe4280b0..263b5021f7c11 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv @@ -1,6 +1,6 @@ "product";"constraint" "catalogProductSimple::with_two_custom_option";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"configurableProductInjectable::default";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" +"configurableProduct::default";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" "bundleProduct::bundle_dynamic_product";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" "downloadableProductInjectable::with_two_separately_links";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" "groupedProductInjectable::three_simple_products";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv index de3b53115610c..4173cb2f1a4be 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest/test.csv @@ -1,3 +1,3 @@ "product";"constraint" -"configurableProductInjectable::default";"assertProductsIsAbsentInWishlist" +"configurableProduct::default";"assertProductsIsAbsentInWishlist" "catalogProductSimple::simple_for_composite_products";"assertProductsIsAbsentInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv index b516c80b40710..114541983b472 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv @@ -4,6 +4,6 @@ "catalogProductSimple::default,catalogProductVirtual::product_50_dollar,catalogProductSimple::default,catalogProductVirtual::product_50_dollar";"";"assertWishlistIsEmpty" "bundleProduct::bundle_dynamic_product";"1";"assertWishlistIsEmpty" "bundleProduct::bundle_fixed_product";"1";"assertWishlistIsEmpty" -"configurableProductInjectable::default";"1";"assertWishlistIsEmpty" +"configurableProduct::default";"1";"assertWishlistIsEmpty" "downloadableProductInjectable::with_two_separately_links";"1";"assertWishlistIsEmpty" "groupedProductInjectable::three_simple_products";"1";"assertWishlistIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv index d330b2779a670..d64bb9e5e7bf6 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv @@ -2,6 +2,6 @@ "catalogProductSimple::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty" "catalogProductVirtual::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty" "downloadableProductInjectable::with_two_separately_links";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" -"configurableProductInjectable::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" +"configurableProduct::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" "bundleProduct::bundle_dynamic_product";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" "bundleProduct::bundle_fixed_product";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv index 740881766b87f..c8bf871b8f02f 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv @@ -1,6 +1,6 @@ "product";"constraint" "catalogProductSimple::with_two_custom_option";"assertProductInCustomerWishlistOnBackendGrid" -"configurableProductInjectable::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" +"configurableProduct::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" "bundleProduct::bundle_dynamic_product";"assertBundleProductInCustomerWishlistOnBackendGrid" "downloadableProductInjectable::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" "groupedProductInjectable::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/var/log/test-cases-report.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/var/log/test-cases-report.xml deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 85476e7fb53ac598f7c5b443e41bc4f3296ce21d Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Mon, 9 Feb 2015 13:00:21 +0200 Subject: [PATCH 34/50] MTA-548: Re-factor Tests for Create Products - Fixed Bundle, Downloadable modules --- dev/tests/functional/logger.log | 1 - .../Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php | 2 +- .../Test/Fixture/DownloadableProductInjectable/Links.php | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 dev/tests/functional/logger.log diff --git a/dev/tests/functional/logger.log b/dev/tests/functional/logger.log deleted file mode 100644 index ff47635d12065..0000000000000 --- a/dev/tests/functional/logger.log +++ /dev/null @@ -1 +0,0 @@ -2015-02-09 09:15:34+00:00 abf3e3e3650feeb10be9a15e297541ba33dcf681 Magento\Catalog\Test\TestCase\Product\NavigateUpSellProductsTest test with data set #1 Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct include(C:\magento\m2dev2\magento2ce\dev\tests\functional\vendor/sebastian/recursion-context/src/Context.php): failed to open stream: No such file or directory diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php index 0f8095665e7f0..7c5481ba7d5f1 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php @@ -311,7 +311,7 @@ protected function getPreset($name) 'title' => 'Drop-down Option', 'type' => 'Drop-down', 'value' => [ - 'name' => 'Simple Product', + 'name' => 'Test simple product', ], ], ], diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php index 268e3f20818e1..de8822677c441 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php @@ -127,6 +127,8 @@ protected function getPreset($name) 'title' => 'link1%isolation%', 'price' => 2, 'number_of_downloads' => 2, + 'is_shareable' => 'Use config', + 'sort_order' => 1, 'sample' => [ 'sample_type_url' => 'Yes', 'sample_url' => 'http://example.com', From d87e9ab47e6d58a0af1bbe5e42c4403e59d507b8 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Mon, 9 Feb 2015 15:32:04 +0200 Subject: [PATCH 35/50] MTA-548: Re-factor Tests for Create Products - Renamed product fixtures --- .../ProductTypeSwitchingOnCreationTest/test.csv | 2 +- .../ProductTypeSwitchingOnUpdateTest/test.csv | 10 +++++----- .../TestCase/SearchEntityResultsTest/test.csv | 4 ++-- .../test.csv | 6 +++--- .../DeleteProductsFromShoppingCartTest/test.csv | 6 +++--- .../test.csv | 2 +- .../Test/Block/Catalog/Product/View.php | 4 ++-- .../Constraint/AssertDownloadableLinksData.php | 10 +++++----- ...leProductInCustomerWishlistOnBackendGrid.php | 4 ++-- .../AssertDownloadableSamplesData.php | 10 +++++----- .../Downloadable/Test/Fixture/Cart/Item.php | 4 ++-- ...ctInjectable.xml => DownloadableProduct.xml} | 14 +++++++------- .../CheckoutData.php | 2 +- .../GroupPriceOptions.php | 2 +- .../Links.php | 2 +- .../Samples.php | 2 +- .../Curl.php | 4 ++-- .../DownloadableProductInterface.php | 16 ++++++++++++++++ .../DownloadableProductInjectableInterface.php | 16 ---------------- ...ctInjectable.xml => DownloadableProduct.xml} | 3 ++- .../CreateDownloadableProductEntityTest.php | 6 +++--- .../UpdateDownloadableProductEntityTest.php | 10 +++++----- .../Magento/Downloadable/Test/etc/curl/di.xml | 2 +- .../Magento/Downloadable/Test/etc/fixture.xml | 4 ++-- .../Block/Catalog/Product/View/Type/Grouped.php | 5 ++--- .../GroupedProduct/Test/Block/Checkout/Cart.php | 4 ++-- .../AbstractAssertPriceOnGroupedProductPage.php | 6 +++--- .../AssertGroupedPriceOnGroupedProductPage.php | 6 +++--- ...edProductInCustomerWishlistOnBackendGrid.php | 4 ++-- .../AssertGroupedProductsDefaultQty.php | 6 +++--- .../AssertSpecialPriceOnGroupedProductPage.php | 6 +++--- .../AssertTierPriceOnGroupedProductPage.php | 6 +++--- .../GroupedProduct/Test/Fixture/Cart/Item.php | 4 ++-- ...ProductInjectable.xml => GroupedProduct.xml} | 12 ++++++------ .../Associated.php | 2 +- .../CheckoutData.php | 2 +- .../Price.php | 2 +- .../Curl.php | 4 ++-- .../GroupedProduct/GroupedProductInterface.php | 17 +++++++++++++++++ .../GroupedProductInjectableInterface.php | 17 ----------------- .../Repository/GroupedProductInjectable.xml | 2 +- .../TestCase/CreateGroupedProductEntityTest.php | 6 +++--- .../CreateGroupedProductEntityTest/test.csv | 2 +- .../TestCase/UpdateGroupedProductEntityTest.php | 8 ++++---- .../Magento/GroupedProduct/Test/etc/curl/di.xml | 2 +- .../Magento/GroupedProduct/Test/etc/fixture.xml | 4 ++-- .../ViewedProductsReportEntityTest/test.csv | 4 ++-- .../AddProductToWishlistEntityTest/test.csv | 4 ++-- .../test.csv | 4 ++-- .../test.csv | 4 ++-- .../test.csv | 4 ++-- .../test.csv | 4 ++-- .../test.csv | 2 +- .../test.csv | 4 ++-- 54 files changed, 151 insertions(+), 151 deletions(-) rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/{DownloadableProductInjectable.xml => DownloadableProduct.xml} (98%) rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/{DownloadableProductInjectable => DownloadableProduct}/CheckoutData.php (97%) rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/{DownloadableProductInjectable => DownloadableProduct}/GroupPriceOptions.php (93%) rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/{DownloadableProductInjectable => DownloadableProduct}/Links.php (99%) rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/{DownloadableProductInjectable => DownloadableProduct}/Samples.php (97%) rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/{DownloadableProductInjectable => DownloadableProduct}/Curl.php (96%) create mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/DownloadableProductInterface.php delete mode 100644 dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProductInjectable/DownloadableProductInjectableInterface.php rename dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/{DownloadableProductInjectable.xml => DownloadableProduct.xml} (99%) rename dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/{GroupedProductInjectable.xml => GroupedProduct.xml} (98%) rename dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/{GroupedProductInjectable => GroupedProduct}/Associated.php (99%) rename dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/{GroupedProductInjectable => GroupedProduct}/CheckoutData.php (96%) rename dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/{GroupedProductInjectable => GroupedProduct}/Price.php (92%) rename dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/{GroupedProductInjectable => GroupedProduct}/Curl.php (87%) create mode 100644 dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/GroupedProductInterface.php delete mode 100644 dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProductInjectable/GroupedProductInjectableInterface.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv index c42a2565f1b13..963950547a693 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest/test.csv @@ -5,6 +5,6 @@ "configurable";"catalogProductVirtual::default";"assertProductSaveMessage, assertProductInGrid" "virtual";"catalogProductSimple::default";"assertProductSaveMessage, assertProductInGrid" "virtual";"configurableProduct::not_virtual_for_type_switching";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" -"virtual";"downloadableProductInjectable::default";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock" +"virtual";"downloadableProduct::default";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock" "downloadable";"catalogProductSimple::default";"assertProductSaveMessage, assertProductInGrid" "downloadable";"configurableProduct::not_virtual_for_type_switching";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv index d3b81d626a0ce..bde5c7fd6b1b0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv @@ -5,8 +5,8 @@ "configurableProduct::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" "catalogProductVirtual::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" "catalogProductVirtual::default";"configurableProduct::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" -"catalogProductVirtual::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" -"downloadableProductInjectable::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" -"downloadableProductInjectable::default";"configurableProduct::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" -"downloadableProductInjectable::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid" -"catalogProductSimple::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" +"catalogProductVirtual::default";"downloadableProduct::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" +"downloadableProduct::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" +"downloadableProduct::default";"configurableProduct::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"downloadableProduct::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid" +"catalogProductSimple::default";"downloadableProduct::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv index be73d2327c97c..abc1b206e4460 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv @@ -3,7 +3,7 @@ "Search simple product";"catalogProductSimple::default::simple";"assertCatalogSearchResult";"" "Search virtual product";"catalogProductVirtual::default::virtual";"assertCatalogSearchResult";"" "Search configurable product";"configurableProduct::default::configurable";"assertCatalogSearchResult";"" -"Search downloadable product";"downloadableProductInjectable::default::downloadable";"assertCatalogSearchResult";"" -"Search grouped product";"groupedProductInjectable::default::grouped";"assertCatalogSearchResult";"" +"Search downloadable product";"downloadableProduct::default::downloadable";"assertCatalogSearchResult";"" +"Search grouped product";"groupedProduct::default::grouped";"assertCatalogSearchResult";"" "Search bundle dynamic product";"bundleProduct::bundle_dynamic_product::bundle";"assertCatalogSearchResult";"" "Search fixed product";"bundleProduct::bundle_fixed_product::bundle";"assertCatalogSearchResult";"" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv index 30ed16715ce79..271eacb659ba5 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest/test.csv @@ -4,6 +4,6 @@ "catalogProductSimple::with_two_custom_option";"340";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" "catalogProductVirtual::product_50_dollar";"50";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" "configurableProduct::default";"516";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" -"downloadableProductInjectable::with_two_separately_links";"46";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" -"groupedProductInjectable::three_simple_products";"1920";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" -"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3249";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" +"downloadableProduct::with_two_separately_links";"46";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" +"groupedProduct::three_simple_products";"1920";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProduct::with_two_separately_links, groupedProduct::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"3249";"assertPriceInShoppingCart, assertProductQtyInShoppingCart, assertSubtotalInShoppingCart, assertCartItemsOptions, assertGrandTotalInShoppingCart";"Bug: MAGETWO-24195" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv index 7d5404b4b4139..8e75460cfa18d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest/test.csv @@ -4,6 +4,6 @@ "catalogProductSimple::with_two_custom_option";"assertCartIsEmpty" "catalogProductVirtual::product_50_dollar";"assertCartIsEmpty" "configurableProduct::default";"assertCartIsEmpty" -"downloadableProductInjectable::with_two_separately_links";"assertCartIsEmpty" -"groupedProductInjectable::three_simple_products";"assertCartIsEmpty" -"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProductInjectable::with_two_separately_links, groupedProductInjectable::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"assertCartIsEmpty" +"downloadableProduct::with_two_separately_links";"assertCartIsEmpty" +"groupedProduct::three_simple_products";"assertCartIsEmpty" +"catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProduct::with_two_separately_links, groupedProduct::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product";"assertCartIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv index 5670febe8a187..ce2e4cb01b18c 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest/test.csv @@ -2,4 +2,4 @@ "Update Simple";"catalogProductSimple::with_two_custom_option";"forUpdateMiniShoppingCart";"assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart";"" "Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart";"configurableProduct::default";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" "Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart";"bundleProduct::bundle_fixed_product";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"" -"Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart";"downloadableProductInjectable::with_two_separately_links";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"Bug: MAGETWO-24195" +"Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart";"downloadableProduct::with_two_separately_links";"forUpdateMiniShoppingCart";"assertCartItemsOptions, assertProductQtyInMiniShoppingCart, assertProductQtyInShoppingCart, assertProductOptionsAbsentInShoppingCart";"Bug: MAGETWO-24195" diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Catalog/Product/View.php index c15b0acc3ee5d..8ed1aabf571d4 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Catalog/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Catalog/Product/View.php @@ -6,7 +6,7 @@ namespace Magento\Downloadable\Test\Block\Catalog\Product; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; @@ -68,7 +68,7 @@ public function getDownloadableSamplesBlock() */ public function fillOptions(FixtureInterface $product) { - /** @var DownloadableProductInjectable $product */ + /** @var DownloadableProduct $product */ $productData = $product->getData(); $downloadableLinks = isset($productData['downloadable_links']['downloadable']['link']) ? $productData['downloadable_links']['downloadable']['link'] diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php index 376b7af496f51..256b3a05bb0c1 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php @@ -7,7 +7,7 @@ namespace Magento\Downloadable\Test\Constraint; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractAssertForm; @@ -47,13 +47,13 @@ class AssertDownloadableLinksData extends AbstractAssertForm * Assert Link block for downloadable product on front-end * * @param CatalogProductView $catalogProductView - * @param DownloadableProductInjectable $product + * @param DownloadableProduct $product * @param BrowserInterface $browser * @return void */ public function processAssert( CatalogProductView $catalogProductView, - DownloadableProductInjectable $product, + DownloadableProduct $product, BrowserInterface $browser ) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); @@ -68,10 +68,10 @@ public function processAssert( /** * Prepare fixture data for verify * - * @param DownloadableProductInjectable $product + * @param DownloadableProduct $product * @return array */ - protected function prepareFixtureData(DownloadableProductInjectable $product) + protected function prepareFixtureData(DownloadableProduct $product) { $data = $this->sortDataByPath($product->getDownloadableLinks(), 'downloadable/link::sort_order'); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductInCustomerWishlistOnBackendGrid.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductInCustomerWishlistOnBackendGrid.php index e1be5aba24be8..1a6710e493fd0 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductInCustomerWishlistOnBackendGrid.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductInCustomerWishlistOnBackendGrid.php @@ -6,7 +6,7 @@ namespace Magento\Downloadable\Test\Constraint; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Wishlist\Test\Constraint\AssertProductInCustomerWishlistOnBackendGrid; use Magento\Mtf\Fixture\FixtureInterface; @@ -24,7 +24,7 @@ class AssertDownloadableProductInCustomerWishlistOnBackendGrid extends AssertPro */ protected function prepareOptions(FixtureInterface $product) { - /** @var DownloadableProductInjectable $product */ + /** @var DownloadableProduct $product */ $productOptions = parent::prepareOptions($product); $checkoutData = $product->getCheckoutData()['options']; if (!empty($checkoutData['links'])) { diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php index 17c1132ce7109..4622edbd3539d 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php @@ -7,7 +7,7 @@ namespace Magento\Downloadable\Test\Constraint; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractAssertForm; @@ -45,13 +45,13 @@ class AssertDownloadableSamplesData extends AbstractAssertForm * Assert Sample block for downloadable product on front-end * * @param CatalogProductView $productView - * @param DownloadableProductInjectable $product + * @param DownloadableProduct $product * @param BrowserInterface $browser * @return void */ public function processAssert( CatalogProductView $productView, - DownloadableProductInjectable $product, + DownloadableProduct $product, BrowserInterface $browser ) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); @@ -68,10 +68,10 @@ public function processAssert( /** * Prepare fixture data for verify * - * @param DownloadableProductInjectable $product + * @param DownloadableProduct $product * @return array */ - protected function prepareFixtureData(DownloadableProductInjectable $product) + protected function prepareFixtureData(DownloadableProduct $product) { $data = $this->sortDataByPath($product->getDownloadableSample(), 'downloadable/sample::sort_order'); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php index 6962509496d83..76c76772f8f8b 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php @@ -6,7 +6,7 @@ namespace Magento\Downloadable\Test\Fixture\Cart; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Fixture\FixtureInterface; /** @@ -26,7 +26,7 @@ public function __construct(FixtureInterface $product) { parent::__construct($product); - /** @var DownloadableProductInjectable $product */ + /** @var DownloadableProduct $product */ $checkoutDownloadableOptions = []; $checkoutData = $product->getCheckoutData(); $downloadableOptions = $product->getDownloadableLinks(); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml similarity index 98% rename from dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml rename to dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml index 9b6be090039a3..234d0bd162a33 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml @@ -7,15 +7,15 @@ --> + class="Magento\Downloadable\Test\Fixture\DownloadableProduct"> Magento_Downloadable eav catalog_product downloadable Magento\Catalog\Model\Resource\Product\Collection sku - Magento\Downloadable\Test\Repository\DownloadableProductInjectable - Magento\Downloadable\Test\Handler\DownloadableProductInjectable\DownloadableProductInjectableInterface + Magento\Downloadable\Test\Repository\DownloadableProduct + Magento\Downloadable\Test\Handler\DownloadableProduct\DownloadableProductInterface DownloadableProduct_%isolation% DownloadableProduct_%isolation% @@ -126,7 +126,7 @@ text advanced-pricing - Magento\Downloadable\Test\Fixture\DownloadableProductInjectable\GroupPriceOptions + Magento\Downloadable\Test\Fixture\DownloadableProduct\GroupPriceOptions has_options @@ -347,7 +347,7 @@ text downloadable_information - Magento\Downloadable\Test\Fixture\DownloadableProductInjectable\Links + Magento\Downloadable\Test\Fixture\DownloadableProduct\Links downloadable_sample @@ -356,7 +356,7 @@ dafault text downloadable_information - Magento\Downloadable\Test\Fixture\DownloadableProductInjectable\Samples + Magento\Downloadable\Test\Fixture\DownloadableProduct\Samples sku @@ -525,7 +525,7 @@ checkout_data virtual null - Magento\Downloadable\Test\Fixture\DownloadableProductInjectable\CheckoutData + Magento\Downloadable\Test\Fixture\DownloadableProduct\CheckoutData cross_sell_products diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php similarity index 97% rename from dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php rename to dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php index 9105b17ee73b1..d3d4841281b85 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; /** * Class CheckoutData diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/GroupPriceOptions.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php similarity index 93% rename from dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/GroupPriceOptions.php rename to dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php index 2d0b2c8f339df..552f201300fe3 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/GroupPriceOptions.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; /** * Group price options fixture for downloadable product diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php similarity index 99% rename from dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php rename to dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php index de8822677c441..fb7655a87e3d8 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Fixture\FixtureInterface; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Samples.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php similarity index 97% rename from dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Samples.php rename to dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php index e7e7a3a1bc878..5399800e8a67c 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProductInjectable/Samples.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Fixture\FixtureInterface; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProductInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/Curl.php similarity index 96% rename from dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProductInjectable/Curl.php rename to dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/Curl.php index fc45d141f131b..c0cf440dc0eaf 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProductInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/Curl.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Downloadable\Test\Handler\DownloadableProductInjectable; +namespace Magento\Downloadable\Test\Handler\DownloadableProduct; use Magento\Catalog\Test\Handler\CatalogProductSimple\Curl as ProductCurl; use Magento\Mtf\Fixture\FixtureInterface; @@ -17,7 +17,7 @@ * Class Curl * Create new downloadable product via curl */ -class Curl extends ProductCurl implements DownloadableProductInjectableInterface +class Curl extends ProductCurl implements DownloadableProductInterface { /** * Constructor diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/DownloadableProductInterface.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/DownloadableProductInterface.php new file mode 100644 index 0000000000000..91adc8c85609b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Handler/DownloadableProduct/DownloadableProductInterface.php @@ -0,0 +1,16 @@ + - + Test downloadable product %isolation% sku_test_downloadable_product_%isolation% @@ -197,6 +197,7 @@ Downloadable product %isolation% downloadable_product_%isolation% downloadable-product-%isolation% + Yes 1 diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php index 3a3d9c245b59d..6295a6b54cb8d 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\TestCase\Injectable; /** @@ -91,11 +91,11 @@ public function __inject( /** * Test create downloadable product * - * @param DownloadableProductInjectable $product + * @param DownloadableProduct $product * @param Category $category * @return void */ - public function test(DownloadableProductInjectable $product, Category $category) + public function test(DownloadableProduct $product, Category $category) { // Steps $this->catalogProductIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php index cdc9b9946008a..7fd60c8a21085 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Magento\Downloadable\Test\Fixture\DownloadableProductInjectable; +use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; @@ -43,7 +43,7 @@ class UpdateDownloadableProductEntityTest extends Injectable /** * Downloadable product fixture * - * @var DownloadableProductInjectable + * @var DownloadableProduct */ protected $product; @@ -89,7 +89,7 @@ public function __inject( FixtureFactory $fixtureFactory ) { $this->product = $fixtureFactory->createByCode( - 'downloadableProductInjectable', + 'downloadableProduct', ['dataSet' => 'default'] ); $this->product->persist(); @@ -100,11 +100,11 @@ public function __inject( /** * Test update downloadable product * - * @param DownloadableProductInjectable $product + * @param DownloadableProduct $product * @param Category $category * @return void */ - public function test(DownloadableProductInjectable $product, Category $category) + public function test(DownloadableProduct $product, Category $category) { // Steps $filter = ['sku' => $this->product->getSku()]; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml index 8d55352dcad35..b5ca90d139bce 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml @@ -6,5 +6,5 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/fixture.xml index c387993df2b0a..87513a9ffe0fa 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/fixture.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/fixture.xml @@ -6,7 +6,7 @@ */ --> - + eav catalog_product downloadable @@ -36,5 +36,5 @@ product - + diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php index c1d014aecf9f9..ae38f5f3a7653 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View/Type/Grouped.php @@ -8,7 +8,6 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\GroupedProduct\Test\Fixture\GroupedProduct; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; @@ -74,7 +73,7 @@ public function getQty($subProductId) */ public function fill(FixtureInterface $product) { - /** @var GroupedProductInjectable $product */ + /** @var GroupedProduct $product */ $associatedProducts = $product->getAssociated()['products']; $checkoutData = $product->getCheckoutData(); if (isset($checkoutData['options'])) { @@ -105,7 +104,7 @@ public function fill(FixtureInterface $product) */ public function getOptions(FixtureInterface $product) { - /** @var GroupedProductInjectable $product */ + /** @var GroupedProduct $product */ $associatedProducts = $product->getAssociated()['products']; $options = []; diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Checkout/Cart.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Checkout/Cart.php index 3826d9a341e5d..3b5cf512165c1 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Checkout/Cart.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Checkout/Cart.php @@ -6,7 +6,7 @@ namespace Magento\GroupedProduct\Test\Block\Checkout; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Fixture\FixtureInterface; /** @@ -44,7 +44,7 @@ protected function findCartItems(FixtureInterface $product) { $cartItems = []; - /** @var GroupedProductInjectable $product */ + /** @var GroupedProduct $product */ $associatedProducts = $product->getAssociated()['products']; foreach ($associatedProducts as $product) { $cartItems[$product->getSku()] = parent::getCartItem($product); diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php index 5627b7785a3be..9e6771afefaa1 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Constraint\AssertPriceOnProductPageInterface; use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractConstraint; @@ -35,7 +35,7 @@ abstract class AbstractAssertPriceOnGroupedProductPage extends AbstractConstrain /** * Verify product price on grouped product view page * - * @param GroupedProductInjectable $product + * @param GroupedProduct $product * @param CatalogProductView $catalogProductView * @param AssertPriceOnProductPageInterface $object * @param BrowserInterface $browser @@ -43,7 +43,7 @@ abstract class AbstractAssertPriceOnGroupedProductPage extends AbstractConstrain * @return bool|string */ protected function processAssertPrice( - GroupedProductInjectable $product, + GroupedProduct $product, CatalogProductView $catalogProductView, AssertPriceOnProductPageInterface $object, BrowserInterface $browser, diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php index d471c60f1eed2..d5b6acbe66dcb 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Client\BrowserInterface; /** @@ -39,14 +39,14 @@ class AssertGroupedPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupe * Assert that displayed grouped price on grouped product page equals passed from fixture * * @param CatalogProductView $catalogProductView - * @param GroupedProductInjectable $product + * @param GroupedProduct $product * @param AssertProductGroupedPriceOnProductPage $groupedPrice * @param BrowserInterface $browser * @return void */ public function processAssert( CatalogProductView $catalogProductView, - GroupedProductInjectable $product, + GroupedProduct $product, AssertProductGroupedPriceOnProductPage $groupedPrice, BrowserInterface $browser ) { diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInCustomerWishlistOnBackendGrid.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInCustomerWishlistOnBackendGrid.php index 4128f39dede6b..b9b255d09090a 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInCustomerWishlistOnBackendGrid.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInCustomerWishlistOnBackendGrid.php @@ -6,7 +6,7 @@ namespace Magento\GroupedProduct\Test\Constraint; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Wishlist\Test\Constraint\AssertProductInCustomerWishlistOnBackendGrid; use Magento\Mtf\Fixture\FixtureInterface; @@ -37,7 +37,7 @@ protected function prepareFilter(FixtureInterface $product) */ protected function prepareOptions(FixtureInterface $product) { - /** @var GroupedProductInjectable $product */ + /** @var GroupedProduct $product */ $productOptions = []; $checkoutData = $product->getCheckoutData()['options']; if (count($checkoutData)) { diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php index 0ec0c06eff5b8..435582d26ec76 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php @@ -7,7 +7,7 @@ namespace Magento\GroupedProduct\Test\Constraint; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractAssertForm; @@ -25,13 +25,13 @@ class AssertGroupedProductsDefaultQty extends AbstractAssertForm * Assert that default qty for sub products in grouped product displays according to dataset on product page * * @param CatalogProductView $groupedProductView - * @param GroupedProductInjectable $product + * @param GroupedProduct $product * @param BrowserInterface $browser * @return void */ public function processAssert( CatalogProductView $groupedProductView, - GroupedProductInjectable $product, + GroupedProduct $product, BrowserInterface $browser ) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php index 0fd5cdd5b924a..90baf6660116d 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Client\BrowserInterface; /** @@ -38,14 +38,14 @@ class AssertSpecialPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupe * Assert that displayed grouped price on grouped product page equals passed from fixture * * @param CatalogProductView $catalogProductView - * @param GroupedProductInjectable $product + * @param GroupedProduct $product * @param AssertProductSpecialPriceOnProductPage $specialPrice * @param BrowserInterface $browser * @return void */ public function processAssert( CatalogProductView $catalogProductView, - GroupedProductInjectable $product, + GroupedProduct $product, AssertProductSpecialPriceOnProductPage $specialPrice, BrowserInterface $browser ) { diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php index c640d5b6aa25b..00a1803affa28 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Client\BrowserInterface; /** @@ -39,14 +39,14 @@ class AssertTierPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedPr * Assert that displayed grouped price on grouped product page equals passed from fixture * * @param CatalogProductView $catalogProductView - * @param GroupedProductInjectable $product + * @param GroupedProduct $product * @param AssertProductTierPriceOnProductPage $tierPrice * @param BrowserInterface $browser * @return void */ public function processAssert( CatalogProductView $catalogProductView, - GroupedProductInjectable $product, + GroupedProduct $product, AssertProductTierPriceOnProductPage $tierPrice, BrowserInterface $browser ) { diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php index 3e91ccb257870..bd6f991bce9ee 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php @@ -6,7 +6,7 @@ namespace Magento\GroupedProduct\Test\Fixture\Cart; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Fixture\FixtureInterface; /** @@ -24,7 +24,7 @@ class Item extends \Magento\Catalog\Test\Fixture\Cart\Item */ public function __construct(FixtureInterface $product) { - /** @var GroupedProductInjectable $product */ + /** @var GroupedProduct $product */ $checkoutData = $product->getCheckoutData(); $this->data = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; $associatedProducts = []; diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml similarity index 98% rename from dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable.xml rename to dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml index c06f177fb98d2..cf1410f4fa5a8 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml @@ -7,15 +7,15 @@ --> + class="Magento\GroupedProduct\Test\Fixture\GroupedProduct"> Magento_GroupedProduct eav catalog_product grouped Magento\Catalog\Model\Resource\Product\Collection sku - Magento\GroupedProduct\Test\Repository\GroupedProductInjectable - Magento\GroupedProduct\Test\Handler\GroupedProductInjectable\GroupedProductInjectableInterface + Magento\GroupedProduct\Test\Repository\GroupedProduct + Magento\GroupedProduct\Test\Handler\GroupedProduct\GroupedProductInterface GroupedProduct_%isolation% GroupedProduct_%isolation% @@ -71,7 +71,7 @@ virtual 1 grouped - Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable\Associated + Magento\GroupedProduct\Test\Fixture\GroupedProduct\Associated custom_design_from @@ -370,13 +370,13 @@ price virtual - Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable\Price + Magento\GroupedProduct\Test\Fixture\GroupedProduct\Price checkout_data virtual null - Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable\CheckoutData + Magento\GroupedProduct\Test\Fixture\GroupedProduct\CheckoutData taxable_goods diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php similarity index 99% rename from dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php rename to dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php index 9c459b9862463..00e3a4896a7fd 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Associated.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +namespace Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/CheckoutData.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php similarity index 96% rename from dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/CheckoutData.php rename to dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php index 73a885f7dc577..2871ec912db01 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +namespace Magento\GroupedProduct\Test\Fixture\GroupedProduct; /** * Class CheckoutData diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Price.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php similarity index 92% rename from dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Price.php rename to dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php index b6811384f498b..d2ff084c6e070 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProductInjectable/Price.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +namespace Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Catalog\Test\Fixture\CatalogProductSimple\Price as ParentPrice; use Magento\Mtf\Fixture\FixtureInterface; diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProductInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/Curl.php similarity index 87% rename from dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProductInjectable/Curl.php rename to dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/Curl.php index 1880721ab7e36..0abdc62fea308 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProductInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/Curl.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\GroupedProduct\Test\Handler\GroupedProductInjectable; +namespace Magento\GroupedProduct\Test\Handler\GroupedProduct; use Magento\Catalog\Test\Handler\CatalogProductSimple\Curl as AbstractCurl; use Magento\Mtf\Fixture\FixtureInterface; @@ -13,7 +13,7 @@ * Class Curl * Create new grouped product via curl */ -class Curl extends AbstractCurl implements GroupedProductInjectableInterface +class Curl extends AbstractCurl implements GroupedProductInterface { /** * Prepare POST data for creating product request diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/GroupedProductInterface.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/GroupedProductInterface.php new file mode 100644 index 0000000000000..e9f289da3acea --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Handler/GroupedProduct/GroupedProductInterface.php @@ -0,0 +1,17 @@ + - + Test grouped product %isolation% sku_test_grouped_product_%isolation% diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php index 8e3dee039d1b1..3ec286bfe03e1 100755 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.php @@ -9,7 +9,7 @@ use Magento\Catalog\Test\Fixture\Category; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\TestCase\Injectable; /** @@ -84,11 +84,11 @@ public function __inject( /** * Test create grouped product * - * @param GroupedProductInjectable $product + * @param GroupedProduct $product * @param Category $category * @return void */ - public function test(GroupedProductInjectable $product, Category $category) + public function test(GroupedProduct $product, Category $category) { //Steps $this->catalogProductIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv index 40699aadd73e7..95ac3e05f3528 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv @@ -7,4 +7,4 @@ "Create with group price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price";"defaultSimpleProduct";"-";"No";"assertGroupedPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" "Create with virtual products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product";"defaultVirtualProduct";"-";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty";"" "Create with tier price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price";"defaultSimpleProduct";"-";"No";"assertTierPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" -"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProductInjectable::one_dollar_product_with_one_separately_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" +"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_one_separately_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php index a437d49447bf0..e7605924ad258 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Magento\GroupedProduct\Test\Fixture\GroupedProductInjectable; +use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\TestCase\Injectable; /** @@ -69,11 +69,11 @@ public function __inject( /** * Test update grouped product * - * @param GroupedProductInjectable $product - * @param GroupedProductInjectable $originalProduct + * @param GroupedProduct $product + * @param GroupedProduct $originalProduct * @return void */ - public function test(GroupedProductInjectable $product, GroupedProductInjectable $originalProduct) + public function test(GroupedProduct $product, GroupedProduct $originalProduct) { // Precondition $originalProduct->persist(); diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml index dd7868a205101..9618f07622f4a 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml @@ -6,5 +6,5 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/fixture.xml index 5c5bf092d8ec0..129278ee6464e 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/fixture.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/fixture.xml @@ -6,7 +6,7 @@ */ --> - + eav catalog_product grouped @@ -33,5 +33,5 @@ product - + diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv index fe06abf491815..39e9970576f2a 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv @@ -1,4 +1,4 @@ "description";"total";"products";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_empty_rows";"constraint" "view products on front and verify they all reflected in Year report";"2, 1";"catalogProductSimple::default, catalogProductVirtual::default";"Year";"m/d/Y -1 year";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Month report";"1, 1";"downloadableProductInjectable::default, bundleProduct::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Day report";"1, 1";"configurableProduct::default, groupedProductInjectable::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Month report";"1, 1";"downloadableProduct::default, bundleProduct::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Day report";"1, 1";"configurableProduct::default, groupedProduct::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv index 41ffe61d95d3b..525b9eeda9ba5 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv @@ -1,8 +1,8 @@ "product";"constraint" "catalogProductSimple::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" "catalogProductVirtual::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"downloadableProductInjectable::with_two_separately_links";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"groupedProductInjectable::three_simple_products";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" +"downloadableProduct::with_two_separately_links";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" +"groupedProduct::three_simple_products";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" "configurableProduct::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" "bundleProduct::bundle_dynamic_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" "bundleProduct::bundle_fixed_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv index 30b82e7e8bfcf..905d8ddb22a1d 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest/test.csv @@ -2,8 +2,8 @@ "catalogProductSimple::product_100_dollar";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "catalogProductVirtual::product_50_dollar";"1";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "catalogProductSimple::default,catalogProductVirtual::product_50_dollar,catalogProductSimple::default,catalogProductVirtual::product_50_dollar";"-";"assertProductQtyInShoppingCart, assertWishlistIsEmpty" -"groupedProductInjectable::three_simple_products";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" -"downloadableProductInjectable::with_two_separately_links";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" +"groupedProduct::three_simple_products";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" +"downloadableProduct::with_two_separately_links";"-";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "configurableProduct::default";"3";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "bundleProduct::bundle_dynamic_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" "bundleProduct::bundle_fixed_product";"2";"assertProductQtyInShoppingCart, assertProductsIsAbsentInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv index c8bf871b8f02f..3f7f62346894a 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest/test.csv @@ -2,5 +2,5 @@ "catalogProductSimple::with_two_custom_option";"assertProductInCustomerWishlistOnBackendGrid" "configurableProduct::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" "bundleProduct::bundle_dynamic_product";"assertBundleProductInCustomerWishlistOnBackendGrid" -"downloadableProductInjectable::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" -"groupedProductInjectable::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" +"downloadableProduct::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" +"groupedProduct::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv index 263b5021f7c11..137e5d2a86d06 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest/test.csv @@ -2,5 +2,5 @@ "catalogProductSimple::with_two_custom_option";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" "configurableProduct::default";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" "bundleProduct::bundle_dynamic_product";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"downloadableProductInjectable::with_two_separately_links";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" -"groupedProductInjectable::three_simple_products";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" +"downloadableProduct::with_two_separately_links";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" +"groupedProduct::three_simple_products";"assertProductIsPresentInWishlist, assertProductDetailsInWishlist" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv index 114541983b472..3affe869adbac 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest/test.csv @@ -5,5 +5,5 @@ "bundleProduct::bundle_dynamic_product";"1";"assertWishlistIsEmpty" "bundleProduct::bundle_fixed_product";"1";"assertWishlistIsEmpty" "configurableProduct::default";"1";"assertWishlistIsEmpty" -"downloadableProductInjectable::with_two_separately_links";"1";"assertWishlistIsEmpty" -"groupedProductInjectable::three_simple_products";"1";"assertWishlistIsEmpty" +"downloadableProduct::with_two_separately_links";"1";"assertWishlistIsEmpty" +"groupedProduct::three_simple_products";"1";"assertWishlistIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv index d64bb9e5e7bf6..d346ba53b299c 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest/test.csv @@ -1,7 +1,7 @@ "product";"constraint" "catalogProductSimple::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty" "catalogProductVirtual::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty" -"downloadableProductInjectable::with_two_separately_links";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" +"downloadableProduct::with_two_separately_links";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" "configurableProduct::default";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" "bundleProduct::bundle_dynamic_product";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" "bundleProduct::bundle_fixed_product";"assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv index c8bf871b8f02f..3f7f62346894a 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest/test.csv @@ -2,5 +2,5 @@ "catalogProductSimple::with_two_custom_option";"assertProductInCustomerWishlistOnBackendGrid" "configurableProduct::default";"assertConfigurableProductInCustomerWishlistOnBackendGrid" "bundleProduct::bundle_dynamic_product";"assertBundleProductInCustomerWishlistOnBackendGrid" -"downloadableProductInjectable::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" -"groupedProductInjectable::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" +"downloadableProduct::with_two_separately_links";"assertDownloadableProductInCustomerWishlistOnBackendGrid" +"groupedProduct::three_simple_products";"assertGroupedProductInCustomerWishlistOnBackendGrid" From 0de193a335091e74fcba782a1108c0b547d11825 Mon Sep 17 00:00:00 2001 From: Oleksandr Rykh Date: Mon, 9 Feb 2015 16:14:28 +0200 Subject: [PATCH 36/50] MTA-1478: Resolve issue with generating repository xml files using collection provider --- .../Mtf/Util/Generate/Repository/CollectionProvider.php | 2 +- .../tests/app/Magento/Checkout/Test/Fixture/Cart.xml | 1 - .../functional/tests/app/Magento/Checkout/Test/etc/fixture.xml | 1 - dev/tests/functional/utils/bootstrap.php | 3 +++ dev/tests/functional/utils/generate/factory.php | 2 -- dev/tests/functional/utils/generate/fixture.php | 2 -- 6 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Repository/CollectionProvider.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Repository/CollectionProvider.php index 68909363bfb9c..584b17cdc9b20 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Repository/CollectionProvider.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Repository/CollectionProvider.php @@ -62,7 +62,7 @@ public function getCollection(array $fixture) { $type = $fixture['type']; $method = $type . 'Collection'; - if (!method_exists($this, $method)) { + if (!method_exists($this, $method) || empty($fixture['collection'])) { return []; } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml index a787298d02a6f..5bce87d08e05f 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml @@ -11,7 +11,6 @@ Magento_Checkout flat quote - Magento\Checkout\Model\Resource\Cart Magento\Checkout\Test\Repository\Cart Magento\Checkout\Test\Handler\Cart\CartInterface diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/fixture.xml index b5e91b59757e4..0d26153611393 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/fixture.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/fixture.xml @@ -9,6 +9,5 @@ flat quote - Magento\Checkout\Model\Resource\Cart diff --git a/dev/tests/functional/utils/bootstrap.php b/dev/tests/functional/utils/bootstrap.php index b2a8e0792a011..e31b1c76497a7 100644 --- a/dev/tests/functional/utils/bootstrap.php +++ b/dev/tests/functional/utils/bootstrap.php @@ -16,3 +16,6 @@ $objectManager = \Magento\Mtf\ObjectManagerFactory::getObjectManager(); \Magento\Mtf\ObjectManagerFactory::configure($objectManager); + +$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); +$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); diff --git a/dev/tests/functional/utils/generate/factory.php b/dev/tests/functional/utils/generate/factory.php index 615550efbfea5..5c5c4b6fdb45f 100644 --- a/dev/tests/functional/utils/generate/factory.php +++ b/dev/tests/functional/utils/generate/factory.php @@ -5,7 +5,5 @@ */ require_once dirname(__DIR__) . '/' . 'bootstrap.php'; -$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); -$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); $magentoObjectManager->create('Magento\Mtf\Util\Generate\Factory')->launch(); \Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/fixture.php b/dev/tests/functional/utils/generate/fixture.php index 982286f75f194..08e3c53c3ed9c 100644 --- a/dev/tests/functional/utils/generate/fixture.php +++ b/dev/tests/functional/utils/generate/fixture.php @@ -5,7 +5,5 @@ */ require_once dirname(__DIR__) . '/' . 'bootstrap.php'; -$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); -$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); $fieldsProvider = $magentoObjectManager->create('\Magento\Mtf\Util\Generate\Fixture\FieldsProvider'); $objectManager->create('Magento\Mtf\Util\Generate\Fixture', ['fieldsProvider' => $fieldsProvider])->launch(); From a43e23d6d48e448d66eefe45f333f4d50583c418 Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Mon, 9 Feb 2015 17:27:04 +0200 Subject: [PATCH 37/50] MTA-548: Re-factor Tests for Create Products - Fixed Downloadable repository --- .../Test/Repository/CatalogProductVirtual.xml | 6 ++++++ .../Test/Fixture/DownloadableProduct.xml | 2 +- .../Fixture/DownloadableProduct/CheckoutData.php | 2 +- .../Test/Fixture/DownloadableProduct/Links.php | 4 ++-- .../Test/Repository/DownloadableProduct.xml | 16 +++++++++++++--- .../CreateDownloadableProductEntityTest/test.csv | 2 +- .../CreateGroupedProductEntityTest/test.csv | 2 +- 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index 58018fb81be38..8f0d40fba323a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -48,6 +48,12 @@ default_subcategory + + taxable_goods + + + Main Website + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml index 234d0bd162a33..96c8fa9730305 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml @@ -24,7 +24,7 @@ 100.00 - Taxable Goods + taxable_goods This is description for downloadable product This is short description for downloadable product diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php index d3d4841281b85..8339ce9ed18f1 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php @@ -98,7 +98,7 @@ protected function getPreset($name) ] ], - 'one_dollar_product_with_one_separately_link' => [ + 'one_dollar_product_with_one_link' => [ 'options' => [ 'links' => [ [ diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php index fb7655a87e3d8..853d849f8f604 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php @@ -118,9 +118,9 @@ protected function getPreset($name) ], ], ], - 'one_separately_link' => [ + 'one_no_separately_link' => [ 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'Yes', + 'links_purchased_separately' => 'No', 'downloadable' => [ 'link' => [ [ diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml index 0fa6ef960ca26..625a32829af16 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml @@ -193,7 +193,7 @@ - + Downloadable product %isolation% downloadable_product_%isolation% downloadable-product-%isolation% @@ -205,10 +205,20 @@ default - one_separately_link + one_no_separately_link + + + 10 + In Stock + + + taxable_goods + + + Main Website - one_dollar_product_with_one_separately_link + one_dollar_product_with_one_link diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv index bea94e719123a..87a1316c30c81 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv @@ -13,4 +13,4 @@ "Create product with special price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage";"" "Create product with group price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"taxable_goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage";"" "Create product with tier price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"taxable_goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage";"" -"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_one_separately_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart";"test_type:acceptance_test" +"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_no_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_one_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv index 95ac3e05f3528..5aabc259b04b6 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv @@ -7,4 +7,4 @@ "Create with group price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price";"defaultSimpleProduct";"-";"No";"assertGroupedPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" "Create with virtual products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product";"defaultVirtualProduct";"-";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty";"" "Create with tier price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price";"defaultSimpleProduct";"-";"No";"assertTierPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" -"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_one_separately_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" +"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_one_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" From 21ac18abe5cc7892eb33dae5a8642d71920070de Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Mon, 9 Feb 2015 18:25:03 +0200 Subject: [PATCH 38/50] MTA-548: Re-factor Tests for Create Products - Fixed Downloadable checkout data --- .../DownloadableProduct/CheckoutData.php | 9 +++++++- .../Fixture/DownloadableProduct/Links.php | 21 +++++++++++++++++++ .../Test/Repository/DownloadableProduct.xml | 4 ++-- .../test.csv | 2 +- .../CreateGroupedProductEntityTest/test.csv | 2 +- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php index 8339ce9ed18f1..df4a2deaa1625 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php @@ -98,7 +98,7 @@ protected function getPreset($name) ] ], - 'one_dollar_product_with_one_link' => [ + 'one_dollar_product_with_separated_link' => [ 'options' => [ 'links' => [ [ @@ -112,6 +112,13 @@ protected function getPreset($name) 'subtotal' => 3, ], ], + + 'one_dollar_product_with_no_separated_link' => [ + 'cartItem' => [ + 'price' => 1, + 'subtotal' => 1, + ], + ], ]; return isset($presets[$name]) ? $presets[$name] : []; } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php index 853d849f8f604..3dd27e94ec34b 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php @@ -118,6 +118,27 @@ protected function getPreset($name) ], ], ], + 'one_separately_link' => [ + 'title' => 'Links%isolation%', + 'links_purchased_separately' => 'Yes', + 'downloadable' => [ + 'link' => [ + [ + 'title' => 'link1%isolation%', + 'price' => 2, + 'number_of_downloads' => 2, + 'is_shareable' => 'Use config', + 'sort_order' => 1, + 'sample' => [ + 'sample_type_url' => 'Yes', + 'sample_url' => 'http://example.com', + ], + 'file_type_url' => 'Yes', + 'file_link_url' => 'http://example.com', + ], + ], + ], + ], 'one_no_separately_link' => [ 'title' => 'Links%isolation%', 'links_purchased_separately' => 'No', diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml index 625a32829af16..6521b9d20a2eb 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml @@ -193,7 +193,7 @@ - + Downloadable product %isolation% downloadable_product_%isolation% downloadable-product-%isolation% @@ -218,7 +218,7 @@ Main Website - one_dollar_product_with_one_link + one_dollar_product_with_no_separated_link diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv index 87a1316c30c81..12d3bf68c5256 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv @@ -1,4 +1,5 @@ "description";"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/checkout_data/preset";"product/data/url_key";"constraint";"tag" +"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_separated_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart";"test_type:acceptance_test" "Create product with default set links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"taxable_goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock";"" "Create product with default sets samples and links";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData";"" "Create product with custom options";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData";"" @@ -13,4 +14,3 @@ "Create product with special price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"taxable_goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage";"" "Create product with group price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"taxable_goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage";"" "Create product with tier price";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"taxable_goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage";"" -"MAGETWO-13595: Create Downloadable Product with Required Fields Only and Assign it to the Category";"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"-";"-";"-";"-";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"one_no_separately_link";"-";"-";"-";"-";"-";"one_dollar_product_with_one_link";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage, assertProductInCart";"test_type:acceptance_test" diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv index 5aabc259b04b6..3a66df77cf4b6 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest/test.csv @@ -1,4 +1,5 @@ "description";"product/data/url_key";"product/data/name";"product/data/sku";"product/data/quantity_and_stock_status/is_in_stock";"product/data/category";"product/data/description";"product/data/associated/products";"product/data/associated/preset";"product/data/short_description";"isRequired";"constraint";"tag" +"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_no_separated_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" "Create with required products and description";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"This is description for grouped product";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"This is short description for grouped product";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty";"" "Create product without category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"-";"In Stock";"-";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertProductInStock, assertProductSkuAutoGenerated, assertProductSearchableBySku";"" "Create product out of stock";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"Out of Stock";"category_%isolation%";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products";"defaultSimpleProduct";"-";"No";"assertProductOutOfStock";"" @@ -7,4 +8,3 @@ "Create with group price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price";"defaultSimpleProduct";"-";"No";"assertGroupedPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" "Create with virtual products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product";"defaultVirtualProduct";"-";"Yes";"assertProductSaveMessage, assertGroupedProductsDefaultQty";"" "Create with tier price products";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"In Stock";"category_%isolation%";"-";"catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price";"defaultSimpleProduct";"-";"No";"assertTierPriceOnGroupedProductPage, assertGroupedProductForm, assertProductPage";"" -"MAGETWO-13610: Create Grouped Product and Assign It to the Category";"test-grouped-product-%isolation%";"GroupedProduct %isolation%";"GroupedProduct_sku%isolation%";"-";"category_%isolation%";"-";"catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_one_link,catalogProductVirtual::required_fields_with_category";"simple_downloadable_virtual";"-";"-";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductPage";"test_type:acceptance_test" From e6e6f38b699c25d54b79c7b0da4292204bcc5dbc Mon Sep 17 00:00:00 2001 From: Oleksandr Manchenko Date: Tue, 10 Feb 2015 10:44:34 +0200 Subject: [PATCH 39/50] MTA-548: Re-factor Tests for Create Products - Fixed logical and code style errors --- .../Mtf/Client/Element/SuggestElement.php | 2 +- .../BundleProduct/BundleSelections.php | 2 +- .../Block/Product/ProductList/Related.php | 2 +- .../Test/Repository/CatalogProductSimple.xml | 29 ------------------- .../Test/Repository/CatalogProductVirtual.xml | 2 +- ...oductInjectable.xml => GroupedProduct.xml} | 0 6 files changed, 4 insertions(+), 33 deletions(-) rename dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/{GroupedProductInjectable.xml => GroupedProduct.xml} (100%) diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php index bb2236203efba..08ab8d2ce0b4d 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php @@ -59,7 +59,7 @@ public function setValue($value) $this->clear(); - if ($value == ''){ + if ($value == '') { return; } foreach (str_split($value) as $symbol) { diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index 9498192040d2c..243a18930ec25 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -672,7 +672,7 @@ protected function getPreset($name) 'products' => [ [ 'catalogProductSimple::simple', - 'catalogProductVirtual::for_bundle_fixed', + 'catalogProductVirtual::product_15_dollar', ], ], ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php index b5073eb734ceb..0d6c776eea753 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Related.php @@ -19,7 +19,7 @@ class Related extends PromotedSection * Return product item block. * * @param FixtureInterface $product - * @return ProductItem + * @return RelatedProductItem */ public function getProductItem(FixtureInterface $product) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index 6f862fbf2cd9d..adb0ea8e6206b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -856,35 +856,6 @@ - - - default - - Simple Product with msrp %isolation% - sku_simple_product_with_msrp_%isolation% - 1 - - 25 - In Stock - - - 560 - - - - - taxable_goods - - - Main Website - - Catalog, Search - - order_default - - 600 - Before Order Confirmation - - simple_product_with_category_%isolation% Simple product with category %isolation% diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index 8f0d40fba323a..5057300a38f8f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -143,7 +143,7 @@ - + taxable_goods diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProductInjectable.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml similarity index 100% rename from dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProductInjectable.xml rename to dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml From 1827c4ece1711cf09731866bf6346986ae8ae3f8 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Tue, 10 Feb 2015 18:02:17 +0200 Subject: [PATCH 40/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- ...ProductAttributeEntityFromProductPageTest.php | 1 + .../CreateConfigurableProductEntityTest/test.csv | 14 +++++++------- .../UpdateConfigurableProductEntityTest/test.csv | 12 ++++++------ .../UpdateGroupedProductEntityTest/test.csv | 2 +- .../CreateProductReviewBackendEntityTest.php | 10 ++++++++++ .../Magento/Weee/Test/Repository/ConfigData.xml | 2 +- .../Weee/Test/TestCase/CreateTaxWithFptTest.php | 3 +-- .../AddProductToWishlistEntityTest/test.csv | 16 ++++++++-------- 8 files changed, 35 insertions(+), 25 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php index d17441b09b1fc..897c4eb57180a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php @@ -54,6 +54,7 @@ class CreateProductAttributeEntityFromProductPageTest extends Scenario */ public function __prepare(FixtureFactory $fixtureFactory) { + $this->markTestIncomplete('Bug: MTA-1616'); $product = $fixtureFactory->createByCode( 'catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor'] diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv index 3ae5406d9d0e5..38abec61f08e9 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest/test.csv @@ -1,7 +1,7 @@ -"description";"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/new_category";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"" -"Create product with category and two new options";"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" -"Create product with two options";"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" -"Create product with special price";"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage";"" -"Create product with assigned products to options";"configurable-product-%isolation%";"two_options_with_assigned_product";"two_options_with_assigned_product";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"" -"MAGETWO-12620: Create Configurable Product and Assign it to Category";"configurable-product-%isolation%";"two_options_with_fixed_price";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"Taxable Goods";"10";"-";"-";"default_subcategory";"-";"-";"1";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertConfigurableProductPage";"" -"MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)";"-";"two_searchable_options";"-";"Configurable Product %isolation%";"-";"-";"100";"-";"no";"default_subcategory";"-";"-";"-";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage";"test_type:acceptance_test" +"description";"product/data/url_key";"product/data/configurable_attributes_data/preset";"product/data/checkout_data/preset";"product/data/name";"product/data/sku";"product/data/tax_class_id";"product/data/price/value";"product/data/special_price";"product/data/category_ids/new_category";"product/data/category_ids/presets";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/is_in_stock";"product/data/affected_attribute_set";"constraint";"tag";"issue" +"Create product with category and two new options";"configurable-product-%isolation%";"two_new_options";"two_new_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"Bug: MTA-1616" +"Create product with two options";"configurable-product-%isolation%";"two_options";"two_options";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"";"" +"Create product with special price";"configurable-product-%isolation%";"two_new_options";"two_new_options_with_special_price";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"10";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertProductSpecialPriceOnProductPage";"";"Bug: MTA-1616" +"Create product with assigned products to options";"configurable-product-%isolation%";"two_options_with_assigned_product";"two_options_with_assigned_product";"Configurable Product %isolation%";"configurable_sku_%isolation%";"-";"100";"-";"-";"-";"Configurable short description";"Configurable Product description %isolation%";"2";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"";"" +"MAGETWO-12620: Create Configurable Product and Assign it to Category";"configurable-product-%isolation%";"two_options_with_fixed_price";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"Taxable Goods";"10";"-";"-";"default_subcategory";"-";"-";"1";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertConfigurableProductPage";"";"" +"MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)";"-";"two_searchable_options";"-";"Configurable Product %isolation%";"-";"-";"100";"-";"no";"default_subcategory";"-";"-";"-";"-";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage";"test_type:acceptance_test";"" diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv index fdbaa7cbf74d8..4b6d5988d9917 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest/test.csv @@ -1,6 +1,6 @@ -"description";"attributeTypeAction";"product";"updatedProduct/data/url_key";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"updatedProduct/data/affected_attribute_set";"constraint" -"Add new option to existed Attribute";"addOptions";"configurableProduct::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately" -"Add new variations";"";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart" -"Delete one attribute and add another";"deleteLast";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage" -"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock" -"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProduct::two_options_with_fixed_price";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage" +"description";"attributeTypeAction";"product";"updatedProduct/data/url_key";"updatedProduct/data/configurable_attributes_data/preset";"updatedProduct/data/checkout_data/preset";"updatedProduct/data/checkout_data/cartItem/price";"updatedProduct/data/name";"updatedProduct/data/sku";"updatedProduct/data/price/value";"updatedProduct/data/category_ids/presets";"updatedProduct/data/short_description";"updatedProduct/data/description";"updatedProduct/data/weight";"updatedProduct/data/quantity_and_stock_status/is_in_stock";"updatedProduct/data/affected_attribute_set";"constraint";"issue" +"Add new option to existed Attribute";"addOptions";"configurableProduct::default";"configurable-product-%isolation%";"one_new_options";"two_attributes";"153";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertProductInCategory, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart, assertChildProductIsNotDisplayedSeparately";"" +"Add new variations";"";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options";"three_attributes";"154";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"custom_attribute_set_%isolation%";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertConfigurableProductInCart";"Bug: MTA-1616" +"Delete one attribute and add another";"deleteLast";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options";"two_attributes";"112";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"default_subcategory";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertProductInCategory, assertProductInStock, assertConfigurableProductInCart, assertConfigurableAttributesAbsentOnProductPage";"Bug: MTA-1616" +"Delete attribute and add another with products qty = 0";"deleteAll";"configurableProduct::default";"configurable-product-%isolation%";"two_new_options_with_zero_products";"two_attributes";"";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"Configurable short description";"Configurable Product description %isolation%";"3";"In Stock";"-";"assertProductSaveMessage, assertProductInGrid, assertConfigurableProductForm, assertConfigurableAttributesBlockIsAbsentOnProductPage, assertProductOutOfStock";"" +"MAGETWO-12840: Edit Configurable Product";"addOptions";"configurableProduct::two_options_with_fixed_price";"configurable-product-%isolation%";"one_new_options";"-";"-";"Configurable Product %isolation%";"configurable_sku_%isolation%";"99";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertConfigurableProductPage";"" diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest/test.csv index 1b28e2cfc5e19..85e971db756fb 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest/test.csv @@ -3,4 +3,4 @@ "default";"GroupedProduct_edited %isolation%";"GroupedProduct_sku_edited %isolation%";"-";"-";"catalogProductVirtual::default,catalogProductVirtual::product_50_dollar";"defaultVirtualProduct";"-";"-";"updated-grouped-product-%isolation%";"assertProductSaveMessage, assertGroupedProductForm" "default";"GroupedProduct_edited %isolation%";"GroupedProduct_sku_edited %isolation%";"-";"-";"catalogProductSimple::simple_for_composite_products,catalogProductSimple::default";"defaultSimpleProduct_without_qty";"-";"-";"updated-grouped-product-%isolation%";"assertProductSaveMessage, assertGroupedProductsDefaultQty, assertGroupedProductForm" "default";"GroupedProduct_edited %isolation%";"GroupedProduct_sku_edited %isolation%";"-";"-";"catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice";"defaultSimpleProduct_with_specialPrice";"-";"-";"updated-grouped-product-%isolation%";"assertProductSaveMessage, assertSpecialPriceOnGroupedProductPage" -"default";"GroupedProduct_edited %isolation%";"GroupedProduct_sku_edited %isolation%";"Out of Stock";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock" +"default";"GroupedProduct_edited %isolation%";"GroupedProduct_sku_edited %isolation%";"Out of Stock";"-";"-";"-";"-";"-";"updated-grouped-product-%isolation%";"assertProductSaveMessage, assertProductOutOfStock" diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php index d2042d8a8370e..6d38c764c63b9 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php @@ -80,6 +80,16 @@ class CreateProductReviewBackendEntityTest extends Injectable */ protected $review; + /** + * Skip test due to a Magento bug. + * + * @return void + */ + public function __prepare() + { + $this->markTestIncomplete('Bug: MAGETWO-33912'); + } + /** * Inject pages into test * diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml index 8472f3bbe08f4..31d6ea158d516 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml @@ -6,7 +6,7 @@ */ --> - + 0 1 diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php index 5269a408dd3e7..d0fa6ae59fe80 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php @@ -14,8 +14,6 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test CreateTaxWithFptTest. - * * Test Flow: * * Preconditions: @@ -71,6 +69,7 @@ class CreateTaxWithFptTest extends Injectable public function __prepare( FixtureFactory $fixtureFactory ) { + $this->markTestIncomplete("Epic: MAGETWO-30073. FPC issue."); $this->fixtureFactory = $fixtureFactory; $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_with_addresses']); $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv index 525b9eeda9ba5..1b8b09b934920 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest/test.csv @@ -1,8 +1,8 @@ -"product";"constraint" -"catalogProductSimple::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"catalogProductVirtual::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"downloadableProduct::with_two_separately_links";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"groupedProduct::three_simple_products";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"configurableProduct::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"bundleProduct::bundle_dynamic_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" -"bundleProduct::bundle_fixed_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist" \ No newline at end of file +"product";"constraint";"issue" +"catalogProductSimple::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist";"" +"catalogProductVirtual::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist";"" +"downloadableProduct::with_two_separately_links";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist";"" +"groupedProduct::three_simple_products";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist";"" +"configurableProduct::default";"assertAddProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertProductIsPresentInCustomerBackendWishlist";"" +"bundleProduct::bundle_dynamic_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist";"Bug: MAGETWO-33952" +"bundleProduct::bundle_fixed_product";"assertAddProductToWishlistSuccessMessage, assertProductDetailsInWishlist, assertProductIsPresentInCustomerBackendWishlist";"Bug: MAGETWO-33952" \ No newline at end of file From 4a8238eb0958d0575128533e46e3ebec47df2a81 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Wed, 11 Feb 2015 18:31:16 +0200 Subject: [PATCH 41/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../BundleProduct/BundleSelections.php | 2 + .../Test/Fixture/BundleProduct/Price.php | 79 +++++++++++-------- .../CreateBundleProductEntityTest.php | 2 - .../CreateBundleProductEntityTest.xml | 10 +-- .../CatalogProductSimple/CategoryIds.php | 2 +- .../Product/UpdateSimpleProductEntityTest.xml | 1 + 6 files changed, 53 insertions(+), 43 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index 243a18930ec25..6d3ac0770f133 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -587,6 +587,7 @@ protected function getPreset($name) [ 'title' => 'Drop-down Option', 'type' => 'Drop-down', + 'required' => 'Yes', 'assigned_products' => [ [ 'search_data' => [ @@ -620,6 +621,7 @@ protected function getPreset($name) [ 'title' => 'Drop-down Option', 'type' => 'Drop-down', + 'required' => 'Yes', 'assigned_products' => [ [ 'search_data' => [ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php index 64ccd97a2b841..1738c4cad0a2c 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php @@ -118,38 +118,25 @@ public function getPreset() 'price_to' => '80.00', 'cart_price' => '80.00', ], - 'dynamic-200' => [ - 'price_from' => '200.00', - 'price_to' => '500.00', - 'cart_price' => '400.00', - ], - 'fixed-24' => [ - 'price_from' => '96.00', - 'price_to' => '97.00', - 'cart_price' => '244.00', - ], + // Bundle fixed 'fixed-1' => [ 'price_from' => '1.00', 'price_to' => '10.00', 'cart_price' => '80.00', ], - 'dynamic-8' => [ - 'price_from' => '8.00', - 'price_to' => '20.00', - 'cart_price' => '80.00', - ], - 'dynamic-32' => [ - 'price_from' => '32.00', - 'price_to' => '80.00', + 'fixed-15' => [ + 'price_from' => '15.00', + 'price_to' => '16.00', 'cart_price' => '80.00', ], - 'dynamic-40' => [ - 'price_from' => '40.00', - 'price_to' => '100.00', - 'cart_price' => '100.00', + 'fixed-24' => [ + 'price_from' => '96.00', + 'price_to' => '97.00', + 'cart_price' => '244.00', ], - 'dynamic-50' => [ - 'price_from' => '50.00', + 'fixed-100' => [ + 'price_from' => '110.00', + 'price_to' => '120.00', ], 'fixed-115' => [ 'price_from' => '115.00', @@ -161,10 +148,10 @@ public function getPreset() 'price_to' => '120.00', 'cart_price' => '159.00', ], - 'fixed-15' => [ - 'price_from' => '15.00', - 'price_to' => '16.00', - 'cart_price' => '80.00', + 'fixed-756' => [ + 'price_from' => '755.00', + 'price_to' => '756.00', + 'cart_price' => '756.00', ], 'default_fixed' => [ 'compare_price' => [ @@ -172,25 +159,47 @@ public function getPreset() 'price_to' => '756.00', ], ], + 'bundle_fixed_with_category' => [ + 'price_from' => '130.00', + 'price_to' => '144.00', + ], + // Bundle dynamic 'default_dynamic' => [ 'compare_price' => [ 'price_from' => '100.00', 'price_to' => '560.00', ], ], + 'dynamic-8' => [ + 'price_from' => '8.00', + 'price_to' => '20.00', + 'cart_price' => '80.00', + ], + 'dynamic-32' => [ + 'price_from' => '32.00', + 'price_to' => '80.00', + 'cart_price' => '80.00', + ], + 'dynamic-40' => [ + 'price_from' => '40.00', + 'price_to' => '100.00', + 'cart_price' => '100.00', + ], + 'dynamic-50' => [ + 'price_from' => '50.00', + ], 'dynamic-100' => [ 'price_from' => '100.00', 'price_to' => '560.00', 'cart_price' => '100.00', ], - 'fixed-756' => [ - 'price_from' => '755.00', - 'price_to' => '756.00', - 'cart_price' => '756.00', + 'dynamic-200' => [ + 'price_from' => '200.00', + 'price_to' => '500.00', + 'cart_price' => '400.00', ], - 'bundle_fixed_with_category' => [ - 'price_from' => '130.00', - 'price_to' => '144.00', + 'dynamic-560' => [ + 'price_from' => '560.00', ], 'bundle_dynamic_with_category' => [ 'price_from' => '100.00', diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php index 77de6573802fc..57a87e1942f4a 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.php @@ -13,8 +13,6 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for CreateBundleProductEntity - * * Test Flow: * 1. Login as admin * 2. Navigate to the Products>Inventory>Catalog diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index 16fee7457f7fb..b3de3b715eb88 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -75,7 +75,7 @@ Catalog, Search No Yes - assertProductSaveMessage, assertProductNotSearchableBySku + assertProductSaveMessage, assertProductNotSearchableBySku Create dynamic bundle with price randle and all types options @@ -506,7 +506,7 @@ - Fixed 100 - - + fixed-100 taxable_goods - Fixed @@ -530,7 +530,7 @@ - - - - assertProductSaveMessage, assertBundleInGrid, assertBundleInCategory, assertBundleProductPage + assertProductSaveMessage, assertProductInGrid, assertBundleInCategory, assertBundleProductPage test_type:acceptance_test @@ -542,7 +542,7 @@ - Dynamic - - - + dynamic-560 - - - @@ -566,7 +566,7 @@ - - - - assertProductSaveMessage, assertBundleInGrid, assertBundleInCategory, assertBundleProductPage + assertProductSaveMessage, assertProductInGrid, assertBundleInCategory, assertBundleProductPage test_type:acceptance_test diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index dbe5ba5433a7c..b551287bfcc93 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -57,7 +57,7 @@ public function __construct( } elseif (isset($data['presets'])) { $presets = explode(',', $data['presets']); foreach ($presets as $preset) { - if ($preset == "") { + if (trim($preset) == '-') { $this->data[] = ''; continue; } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index 4c010c54a72d9..f31bdd652572b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -130,6 +130,7 @@ MAGETWO-12417: Unassign Products from the Category product_with_category + - - - - From e0abe0a34a17aa450ffeb063dd1cb7e381c59646 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Thu, 12 Feb 2015 10:27:50 +0200 Subject: [PATCH 42/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../Constraint/AssertBundleInCategory.php | 36 ++++--------------- .../Tab/ProductDetails/NewCategoryIds.php | 2 +- .../CatalogProductSimple/CategoryIds.php | 2 +- .../Product/CreateSimpleProductEntityTest.xml | 2 +- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php index d05b7beb50e61..d9bcd808b2b83 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php @@ -6,53 +6,31 @@ namespace Magento\Bundle\Test\Constraint; -use Magento\Bundle\Test\Fixture\BundleProduct; use Magento\Catalog\Test\Fixture\Category; +use Magento\Bundle\Test\Fixture\BundleProduct; use Magento\Catalog\Test\Page\Category\CatalogCategoryView; -use Magento\Cms\Test\Page\CmsIndex; -use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Catalog\Test\Constraint\AssertProductInCategory; +use Magento\Mtf\Fixture\FixtureInterface; /** * Check bundle product on the category page. */ -class AssertBundleInCategory extends AbstractConstraint +class AssertBundleInCategory extends AssertProductInCategory { /* tags */ const SEVERITY = 'low'; /* end tags */ - /** - * Check bundle product on the category page. - * - * @param CatalogCategoryView $catalogCategoryView - * @param CmsIndex $cmsIndex - * @param BundleProduct $product - * @param Category $category - * @return void - */ - public function processAssert( - CatalogCategoryView $catalogCategoryView, - CmsIndex $cmsIndex, - BundleProduct $product, - Category $category - ) { - //Open category view page - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); - - //Process asserts - $this->assertPrice($product, $catalogCategoryView); - } - /** * Verify product price on category view page. * - * @param BundleProduct $bundle + * @param FixtureInterface $bundle * @param CatalogCategoryView $catalogCategoryView * @return void */ - protected function assertPrice(BundleProduct $bundle, CatalogCategoryView $catalogCategoryView) + protected function assertPrice(FixtureInterface $bundle, CatalogCategoryView $catalogCategoryView) { + /** @var BundleProduct $bundle */ $priceData = $bundle->getDataFieldConfig('price')['source']->getPreset(); //Price from/to verification $priceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($bundle->getName()); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php index dc4152a174991..e922260c4c9b4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php @@ -69,7 +69,7 @@ public function addNewCategory(Category $category) */ protected function openNewCategoryDialog() { - $this->_rootElement->find($this->buttonNewCategory)->click(); + $this->browser->find($this->buttonNewCategory)->click(); $this->waitForElementVisible($this->createCategoryDialog); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index b551287bfcc93..0e7cd3e00442d 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -62,7 +62,7 @@ public function __construct( continue; } $category = $fixtureFactory->createByCode('category', ['dataSet' => $preset]); - if (!isset($data['new_category']) || $data['new_category'] !== 'no') { + if (!isset($data['new_category']) || $data['new_category'] !== 'yes') { $category->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml index f6604e509e738..44b0da35be129 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml @@ -671,7 +671,7 @@ MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only) - - no + yes default_subcategory simple%isolation% simple%isolation% From 4679cd38ffb0f1a9e9e66c96926e2e6bd892ac1f Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Thu, 12 Feb 2015 19:17:42 +0200 Subject: [PATCH 43/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../Catalog/Test/Handler/CatalogProductAttribute/Curl.php | 1 - .../Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php | 1 - .../tests/app/Magento/Customer/Test/Handler/Customer/Curl.php | 1 - .../tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php | 1 - .../tests/app/Magento/User/Test/Handler/Curl/CreateUser.php | 1 - 5 files changed, 5 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php index 25a089505e6cc..692126a34d1d3 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php @@ -8,7 +8,6 @@ use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Handler\Curl as AbstractCurl; -use Magento\Mtf\Config; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index 6e0d797fb6dc0..123ef506c991e 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\Handler\CatalogProductSimple; -use Magento\Mtf\Config; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php index f59fb83a1c2e4..7e8cfe0865fd6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php @@ -9,7 +9,6 @@ use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Handler\Curl as AbstractCurl; -use Magento\Mtf\Config; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php index 363e2c81e88d4..b646dc996e339 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/Curl/RemoveTaxRule.php @@ -8,7 +8,6 @@ use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Config; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php index 2609003124a80..40c939b4658bf 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php @@ -8,7 +8,6 @@ use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Config; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; From 3e72d0bcd1617b6b74ff3f882f9b349ae9e16302 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Mon, 16 Feb 2015 11:10:57 +0200 Subject: [PATCH 44/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../Core/Test/Constraint/AssertCustomVariableForm.php | 4 ++-- .../Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php | 8 +++----- .../Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php | 7 ++----- .../ConfigureProductInCustomerWishlistOnFrontendTest.php | 3 --- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php index 331d1d315840e..9ec94498d8d6c 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php @@ -70,13 +70,13 @@ public function processAssert( $systemVariableIndex->open(); $systemVariableIndex->getSystemVariableGrid()->searchAndOpen(['code' => $data['code']]); - $formData = $systemVariableNew->getSystemVariableForm()->getData($customVariable); + $formData = $systemVariableNew->getSystemVariableForm()->getData(); $errors = $this->verifyData($dataOrigin, $formData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); if ($storeOrigin !== null) { $systemVariableNew->getFormPageActions()->selectStoreView($storeOrigin->getName()); - $formData = $systemVariableNew->getSystemVariableForm()->getData($customVariable); + $formData = $systemVariableNew->getSystemVariableForm()->getData(); $errors = $this->verifyData($data, $formData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php index b4faef417a77a..dcd2894854675 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php @@ -9,12 +9,10 @@ use Magento\Tax\Test\Fixture\TaxRule; use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex; use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew; -use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: - * + * Steps: * 1. Log in as default admin user. * 2. Go to Stores > Tax Rules. * 3. Click 'Add New Tax Rule' button. @@ -83,8 +81,8 @@ public function testCreateTaxRule(TaxRule $taxRule) * * @return void */ - public static function tearDownAfterClass() + public function tearDown() { - ObjectManager::getInstance()->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep', [])->run(); + $this->objectManager->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep', [])->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php index b99a60f66df7f..49c320262784e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php @@ -10,12 +10,9 @@ use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex; use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: - * * Preconditions: * 1. 1 simple product is created. * 2. Tax Rule is created. @@ -105,8 +102,8 @@ public function testUpdateTaxRule( * * @return void */ - public static function tearDownAfterClass() + public function tearDown() { - ObjectManager::getInstance()->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep', [])->run(); + $this->objectManager->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep', [])->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php index 522c26c35f17e..875f3afe95a7c 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php @@ -9,8 +9,6 @@ use Magento\Customer\Test\Fixture\Customer; /** - * Test Flow: - * * Preconditions: * 1. Create customer * 2. Create composite products @@ -56,7 +54,6 @@ public function __prepare(Customer $customer) */ public function test(Customer $customer, $product) { - $this->markTestIncomplete('Bug: MAGETWO-32815'); // Preconditions $product = $this->createProducts($product)[0]; $this->loginCustomer($customer); From 6325f9d2f7fc69c25e512fa7c964c04621570ffa Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Mon, 16 Feb 2015 16:02:24 +0200 Subject: [PATCH 45/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../CreateBundleProductEntityTest.xml | 1187 +++++++++-------- .../Product/AddToCartCrossSellTest.xml | 20 +- .../Product/NavigateRelatedProductsTest.xml | 22 +- .../Product/NavigateUpSellProductsTest.xml | 20 +- .../Magento/Customer/Test/etc/constraint.xml | 8 +- ...roductInCustomerWishlistOnFrontendTest.xml | 52 +- ...oductFromCustomerWishlistOnBackendTest.xml | 22 +- ...leteProductsFromWishlistOnFrontendTest.xml | 84 +- ...eProductFromShoppingCartToWishlistTest.xml | 70 +- .../Test/TestCase/ShareWishlistEntityTest.xml | 16 +- ...ProductInCustomerWishlistOnBackendTest.xml | 46 +- 11 files changed, 812 insertions(+), 735 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index b3de3b715eb88..64a23137b0a26 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -5,569 +5,626 @@ * See COPYING.txt for license details. */ --> - - - - Create default bundle with dynamic options - bundle-product-%isolation% - BundleProduct %isolation% - - - bundle_sku_%isolation% - - - - - - - - - - - - - - - - - - - Bundle Product Dynamic Required - - - - - - - - - - - - - No - No - - - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default - - - - - - - - - - - assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage - - - Create offline dynamic bundle with dynamic price and out of stock - bundle-product-%isolation% - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - Product offline - Dynamic - - - - - - - Out of Stock - Dynamic - - - category_%isolation% - - - - - - - - - - - - - - - - - - - Separately - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default - - - - - Catalog, Search - No - Yes - assertProductSaveMessage, assertProductNotSearchableBySku - - - Create dynamic bundle with price randle and all types options - bundle-product-%isolation% - BundleProduct %isolation% - Dynamic - bundle_sku_%isolation% - Product online - Dynamic - - - dynamic-200 - - - In Stock - Dynamic - - - category_%isolation% - Bundle Product Dynamic - - - - - - - - - - - Price Range - - - - - Together - all_types_dynamic - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - all_types_bundle_options - - - - - Catalog, Search - No - Yes - assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType - - - Create fixed bundle - bundle-product-%isolation% - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - - - Fixed - 10 - fixed-15 - None - - - Fixed - 10 - - - Bundle Product Fixed Required - - - - - - - - - - - - - - - - - - - default_fixed - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default - - - - - - - - - - - assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage - - - Create fixed bundle with all types options - bundle-product-%isolation% - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - Product online - Fixed - 100 - fixed-24 - taxable_goods - In Stock - Fixed - 10 - category_%isolation% - Bundle Product Fixed - default - - - - - - - - - As Low as - - - - - Separately - all_types_fixed - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - all_types_bundle_fixed_and_custom_options - all_types - - - Catalog, Search - No - No - assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType - - - Create offline fixed bundle - bundle-product-%isolation% - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - Product online - Fixed - 10 - fixed-1 - taxable_goods - Out of Stock - Fixed - 10 - category_%isolation% - - - - - 10 - m/d/Y - m/d/Y +3 days - - - Price Range - No - Yes - Together - with_not_required_options - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - with_not_required_options - - - - - Catalog - No - No - assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView - - - Create dynamic bundle with tier price - bundle-product-%isolation% - BundleProduct %isolation% - Dynamic - bundle_sku_%isolation% - - - Dynamic - - - dynamic-50 - - - - - Fixed - 10 - - - - - - - - - - - - - default - As Low as - No - No - Together - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default - - - - - Search - - - - - assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage - - - Create dynamic bundle with special price - bundle-product-%isolation% - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - - - Dynamic - - - dynamic-8 - - - - - - - - - - - - - - - 20 - - - - - - - - - - - - - - - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default - - - - - - - - - - - assertProductSaveMessage, assertBundleInCategory - - - Create dynamic bundle with group price - bundle-product-%isolation% - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - - - Dynamic - - - dynamic-32 - - - - - - - - - - - - - MAGETWO-23061 - - - - - - - - - - - - - - - - - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default - - - - - - - - - - - assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType - - - Create dynamic bundle - bundle-product-%isolation% - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - - - Dynamic - - - dynamic-40 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default - - - - - - - - - - - assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType - - - Create fixed product with checkout first option - bundle-product-%isolation% - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - - - Fixed - 110 - fixed-115 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - second - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - with_custom_options_1 - drop_down_with_one_option_fixed_price - catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option - - - - - - - assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage - - - Create fixed product with checkout second option - bundle-product-%isolation% - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - - - Fixed - 110 - fixed-159 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - second - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - with_custom_options_2 - drop_down_with_one_option_percent_price - - - - - - - - - assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType - - - Create default dynamic bundle - bundle-product-%isolation% - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - - - Dynamic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default_dynamic - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default - - - - - - - - - - - assertProductSaveMessage - - - Create default fixed bundle - bundle-product-%isolation% - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - - - Fixed - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - second - catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default - - - - - - - - - - - assertProductSaveMessage - - - MAGETWO-12622: Create Bundle (fixed) Product and Assign it to Category - bundle-product-%isolation% - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - - - Fixed - 100 - fixed-100 - taxable_goods - - - Fixed - 1 - category_%isolation% - - - - - - - - - - - - - - - - - - - Together - two_options_with_fixed_and_percent_prices - - - - - - - - - - - - - - - assertProductSaveMessage, assertProductInGrid, assertBundleInCategory, assertBundleProductPage - test_type:acceptance_test - - - MAGETWO-12702: Create Bundle (dynamic) Product and Assign it to the Category - bundle-product-%isolation% - Bundle Dynamic %isolation% - - - sku_bundle_dynamic_%isolation% - - - Dynamic - - - dynamic-560 - - - - - - - - - category_%isolation% - - - - - - - - - - - - - - - - - - - Together - one_options_assigned_simple_big_qty - - - - - - - - - - - - - - - assertProductSaveMessage, assertProductInGrid, assertBundleInCategory, assertBundleProductPage - test_type:acceptance_test - - + + + + Create default bundle with dynamic options + bundle-product-%isolation% + BundleProduct %isolation% + - + bundle_sku_%isolation% + - + - + - + - + - + - + - + - + - + Bundle Product Dynamic Required + - + - + - + - + - + - + No + No + - + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + default + - + - + - + - + - + + + + + + Create offline dynamic bundle with dynamic price and out of stock + bundle-product-%isolation% + BundleProduct %isolation% + Fixed + bundle_sku_%isolation% + Product offline + Dynamic + - + - + - + Out of Stock + Dynamic + - + category_%isolation% + - + - + - + - + - + - + - + - + - + Separately + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + default + - + - + Catalog, Search + No + Yes + + + + + Create dynamic bundle with price randle and all types options + bundle-product-%isolation% + BundleProduct %isolation% + Dynamic + bundle_sku_%isolation% + Product online + Dynamic + - + dynamic-200 + - + In Stock + Dynamic + - + category_%isolation% + Bundle Product Dynamic + - + - + - + - + - + Price Range + - + - + Together + all_types_dynamic + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + all_types_bundle_options + - + - + Catalog, Search + No + Yes + + + + + + + + + + + + + Create fixed bundle + bundle-product-%isolation% + BundleProduct %isolation% + Fixed + bundle_sku_%isolation% + - + Fixed + 10 + fixed-15 + None + - + Fixed + 10 + - + Bundle Product Fixed Required + - + - + - + - + - + - + - + - + - + default_fixed + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + default + - + - + - + - + - + + + + + + + + + Create fixed bundle with all types options + bundle-product-%isolation% + BundleProduct %isolation% + Fixed + bundle_sku_%isolation% + Product online + Fixed + 100 + fixed-24 + taxable_goods + In Stock + Fixed + 10 + category_%isolation% + Bundle Product Fixed + default + - + - + - + - + As Low as + - + - + Separately + all_types_fixed + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + all_types_bundle_fixed_and_custom_options + all_types + - + Catalog, Search + No + No + + + + + + + + + + + + + Create offline fixed bundle + bundle-product-%isolation% + BundleProduct %isolation% + Fixed + bundle_sku_%isolation% + Product online + Fixed + 10 + fixed-1 + taxable_goods + Out of Stock + Fixed + 10 + category_%isolation% + - + - + 10 + m/d/Y + m/d/Y +3 days + - + Price Range + No + Yes + Together + with_not_required_options + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + with_not_required_options + - + - + Catalog + No + No + + + + + + + + + Create dynamic bundle with tier price + bundle-product-%isolation% + BundleProduct %isolation% + Dynamic + bundle_sku_%isolation% + - + Dynamic + - + dynamic-50 + - + - + Fixed + 10 + - + - + - + - + - + - + default + As Low as + No + No + Together + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + default + - + - + Search + - + - + + + + + + + + + + Create dynamic bundle with special price + bundle-product-%isolation% + Bundle Dynamic %isolation% + Dynamic + sku_bundle_dynamic_%isolation% + - + Dynamic + - + dynamic-8 + - + - + - + - + - + - + - + 20 + - + - + - + - + - + - + - + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + default + - + - + - + - + - + + + + + Create dynamic bundle with group price + bundle-product-%isolation% + Bundle Dynamic %isolation% + Dynamic + sku_bundle_dynamic_%isolation% + - + Dynamic + - + dynamic-32 + - + - + - + - + - + - + MAGETWO-23061 + - + - + - + - + - + - + - + - + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + default + - + - + - + - + - + + + + + + + Create dynamic bundle + bundle-product-%isolation% + Bundle Dynamic %isolation% + Dynamic + sku_bundle_dynamic_%isolation% + - + Dynamic + - + dynamic-40 + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + default + - + - + - + - + - + + + + + + + Create fixed product with checkout first option + bundle-product-%isolation% + Bundle Fixed %isolation% + Fixed + sku_bundle_fixed_%isolation% + - + Fixed + 110 + fixed-115 + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + second + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + with_custom_options_1 + drop_down_with_one_option_fixed_price + catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option + - + - + - + + + + + + + + Create fixed product with checkout second option + bundle-product-%isolation% + Bundle Fixed %isolation% + Fixed + sku_bundle_fixed_%isolation% + - + Fixed + 110 + fixed-159 + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + second + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + with_custom_options_2 + drop_down_with_one_option_percent_price + - + - + - + - + + + + + + + Create default dynamic bundle + bundle-product-%isolation% + Bundle Dynamic %isolation% + Dynamic + sku_bundle_dynamic_%isolation% + - + Dynamic + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + default_dynamic + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + default + - + - + - + - + - + + + + Create default fixed bundle + bundle-product-%isolation% + Bundle Fixed %isolation% + Fixed + sku_bundle_fixed_%isolation% + - + Fixed + 10 + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + second + catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar + default + - + - + - + - + - + + + + MAGETWO-12622: Create Bundle (fixed) Product and Assign it to Category + bundle-product-%isolation% + Bundle Fixed %isolation% + Fixed + sku_bundle_fixed_%isolation% + - + Fixed + 100 + fixed-100 + taxable_goods + - + Fixed + 1 + category_%isolation% + - + - + - + - + - + - + - + - + - + Together + two_options_with_fixed_and_percent_prices + - + - + - + - + - + - + - + test_type:acceptance_test + + + + + + + MAGETWO-12702: Create Bundle (dynamic) Product and Assign it to the Category + bundle-product-%isolation% + Bundle Dynamic %isolation% + - + sku_bundle_dynamic_%isolation% + - + Dynamic + - + dynamic-560 + - + - + - + - + category_%isolation% + - + - + - + - + - + - + - + - + - + Together + one_options_assigned_simple_big_qty + - + - + - + - + - + - + - + test_type:acceptance_test + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.xml index d96234a59f8b6..29d2c444e426e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.xml @@ -5,14 +5,14 @@ * See COPYING.txt for license details. */ --> - - - - simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price - simple1:simple2,config1;config1:simple2 - simple1,config1,simple2 - simple1:simple2,config1;config1:simple2;simple2: - test_type:acceptance_test - - + + + + simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price + simple1:simple2,config1;config1:simple2 + simple1,config1,simple2 + simple1:simple2,config1;config1:simple2;simple2: + test_type:acceptance_test + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.xml index 98c1a2ca763b8..8eb330e74eb7a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.xml @@ -5,15 +5,15 @@ * See COPYING.txt for license details. */ --> - - - - simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price - simple1:yes,simple2:yes,config1:no - simple1:simple2,config1;config1:simple2 - simple1,config1 - simple1:simple2,config1;config1:simple2 - test_type:acceptance_test - - + + + + simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price + simple1:yes,simple2:yes,config1:no + simple1:simple2,config1;config1:simple2 + simple1,config1 + simple1:simple2,config1;config1:simple2 + test_type:acceptance_test + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.xml index 57b4ba6dc4f57..ab5dc8fd21ffe 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.xml @@ -5,14 +5,14 @@ * See COPYING.txt for license details. */ --> - - - - simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price - simple1:simple2,config1;config1:simple2 - simple1,config1,simple2 - simple1:simple2,config1;config1:simple2;simple2: - test_type:acceptance_test - - + + + + simple1::catalogProductSimple::product_with_category,simple2::catalogProductSimple::product_with_category,config1::configurableProduct::two_options_with_fixed_price + simple1:simple2,config1;config1:simple2 + simple1,config1,simple2 + simple1:simple2,config1;config1:simple2;simple2: + test_type:acceptance_test + + diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml index 0081f89c60ffe..12f0e8575e9ac 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml @@ -16,20 +16,20 @@ Magento\Customer\Test\Page\CustomerAccountCreate - Magento\Customer\Test\Fixture\CustomerInjectable + Magento\Customer\Test\Fixture\Customer Magento\Customer\Test\Page\Adminhtml\CustomerIndex - Magento\Customer\Test\Fixture\CustomerInjectable + Magento\Customer\Test\Fixture\Customer Magento\Customer\Test\Page\Adminhtml\CustomerIndex - Magento\Customer\Test\Fixture\CustomerInjectable + Magento\Customer\Test\Fixture\Customer Magento\Customer\Test\Page\Adminhtml\CustomerIndex Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit - Magento\Customer\Test\Fixture\CustomerInjectable + Magento\Customer\Test\Fixture\Customer Magento\Customer\Test\Fixture\AddressInjectable Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml index be53127bf0ca0..27f7ac4692753 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml @@ -5,28 +5,32 @@ * See COPYING.txt for license details. */ --> -<<<<<<< HEAD - - - - catalogProductSimple::with_two_custom_option - assertProductIsPresentInWishlist, assertProductDetailsInWishlist - - - configurableProduct::default - assertProductIsPresentInWishlist, assertProductDetailsInWishlist - - - bundleProduct::bundle_dynamic_product - assertProductIsPresentInWishlist, assertProductDetailsInWishlist - - - downloadableProduct::with_two_separately_links - assertProductIsPresentInWishlist, assertProductDetailsInWishlist - - - groupedProduct::three_simple_products - assertProductIsPresentInWishlist, assertProductDetailsInWishlist - - + + + + catalogProductSimple::with_two_custom_option + + + + + configurableProduct::default + + + + + bundleProduct::bundle_dynamic_product + + + + + downloadableProduct::with_two_separately_links + + + + + groupedProduct::three_simple_products + + + + diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.xml index 6eefdc6040641..a4eafe00b4056 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.xml @@ -5,15 +5,15 @@ * See COPYING.txt for license details. */ --> - - - - configurableProduct::default - assertProductsIsAbsentInWishlist - - - catalogProductSimple::simple_for_composite_products - assertProductsIsAbsentInWishlist - - + + + + configurableProduct::default + + + + catalogProductSimple::simple_for_composite_products + + + diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.xml index bd828f141028e..0a308bd209238 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.xml @@ -5,46 +5,46 @@ * See COPYING.txt for license details. */ --> - - - - catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - 1 - assertProductsIsAbsentInWishlist - - - catalogProductVirtual::product_50_dollar - 1 - assertWishlistIsEmpty - - - catalogProductSimple::default,catalogProductVirtual::product_50_dollar,catalogProductSimple::default,catalogProductVirtual::product_50_dollar - assertWishlistIsEmpty - - - bundleProduct::bundle_dynamic_product - 1 - assertWishlistIsEmpty - - - bundleProduct::bundle_fixed_product - 1 - assertWishlistIsEmpty - - - configurableProduct::default - 1 - assertWishlistIsEmpty - - - downloadableProduct::with_two_separately_links - 1 - assertWishlistIsEmpty - - - groupedProduct::three_simple_products - 1 - assertWishlistIsEmpty - - + + + + catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar + 1 + + + + catalogProductVirtual::product_50_dollar + 1 + + + + catalogProductSimple::default,catalogProductVirtual::product_50_dollar,catalogProductSimple::default,catalogProductVirtual::product_50_dollar + + + + bundleProduct::bundle_dynamic_product + 1 + + + + bundleProduct::bundle_fixed_product + 1 + + + + configurableProduct::default + 1 + + + + downloadableProduct::with_two_separately_links + 1 + + + + groupedProduct::three_simple_products + 1 + + + diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml index b4b3d6321966f..289fb51cd6b04 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml @@ -5,31 +5,47 @@ * See COPYING.txt for license details. */ --> - - - - catalogProductSimple::default - assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty - - - catalogProductVirtual::default - assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty - - - downloadableProduct::with_two_separately_links - assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist - - - configurableProduct::default - assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist - - - bundleProduct::bundle_dynamic_product - assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist - - - bundleProduct::bundle_fixed_product - assertMoveProductToWishlistSuccessMessage, assertProductIsPresentInWishlist, assertCartIsEmpty, assertProductDetailsInWishlist - - + + + + catalogProductSimple::default + + + + + + catalogProductVirtual::default + + + + + + downloadableProduct::with_two_separately_links + + + + + + + configurableProduct::default + + + + + + + bundleProduct::bundle_dynamic_product + + + + + + + bundleProduct::bundle_fixed_product + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.xml index fa1e7f3966b80..23132cdec5f24 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.xml @@ -5,12 +5,12 @@ * See COPYING.txt for license details. */ --> - - - - JohnDoe123456789@example.com,JohnDoe987654321@example.com,JohnDoe123456abc@example.com - Sharing message. - assertWishlistShareMessage - - + + + + JohnDoe123456789@example.com,JohnDoe987654321@example.com,JohnDoe123456abc@example.com + Sharing message. + + + diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml index f1ec7a7488d71..9a07eb9dfea14 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml @@ -5,27 +5,27 @@ * See COPYING.txt for license details. */ --> - - - - catalogProductSimple::with_two_custom_option - assertProductInCustomerWishlistOnBackendGrid - - - configurableProduct::default - assertConfigurableProductInCustomerWishlistOnBackendGrid - - - bundleProduct::bundle_dynamic_product - assertBundleProductInCustomerWishlistOnBackendGrid - - - downloadableProduct::with_two_separately_links - assertDownloadableProductInCustomerWishlistOnBackendGrid - - - groupedProduct::three_simple_products - assertGroupedProductInCustomerWishlistOnBackendGrid - - + + + + catalogProductSimple::with_two_custom_option + + + + configurableProduct::default + + + + bundleProduct::bundle_dynamic_product + + + + downloadableProduct::with_two_separately_links + + + + groupedProduct::three_simple_products + + + From 7402791828c36275d59322e8d401ba901d73ed98 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Tue, 17 Feb 2015 17:08:05 +0200 Subject: [PATCH 46/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- dev/tests/functional/composer.json | 2 +- .../app/Magento/Catalog/Test/etc/constraint.xml | 14 +++++++------- .../AssertCustomVariableNotInCmsPageForm.php | 10 +++++----- ...sertTaxCalculationAfterCheckoutDownloadable.php | 8 ++++---- ...erCheckoutDownloadableExcludingIncludingTax.php | 2 +- ...lationAfterCheckoutDownloadableExcludingTax.php | 2 +- ...lationAfterCheckoutDownloadableIncludingTax.php | 2 +- .../Adminhtml/Order/View/Items/ItemProduct.php | 2 +- .../Constraint/AssertGiftMessageInBackendOrder.php | 8 ++++---- .../AssertGiftMessageInFrontendOrder.php | 8 ++++---- .../AssertGiftMessageInFrontendOrderItems.php | 8 ++++---- .../Page/{OrderView.xml => CustomerOrderView.xml} | 2 +- .../Magento/Multishipping/Test/etc/constraint.xml | 2 +- .../Test/Constraint/AssertCreditMemoButton.php | 7 +++---- .../Test/Constraint/AssertInvoiceInInvoicesTab.php | 9 ++++----- .../AssertInvoiceSuccessCreateMessage.php | 7 +++---- .../AssertInvoiceWithShipmentSuccessMessage.php | 7 +++---- .../Constraint/AssertInvoicedAmountOnFrontend.php | 8 ++++---- .../Test/Constraint/AssertNoCreditMemoButton.php | 7 +++---- .../Test/Constraint/AssertNoInvoiceButton.php | 7 +++---- .../Constraint/AssertOrderButtonsUnavailable.php | 7 +++---- .../Constraint/AssertOrderCancelSuccessMessage.php | 7 +++---- .../Test/Constraint/AssertOrderGrandTotal.php | 1 - .../Constraint/AssertOrderSuccessCreateMessage.php | 7 +++---- .../Constraint/AssertRefundInCreditMemoTab.php | 9 ++++----- .../AssertRefundSuccessCreateMessage.php | 7 +++---- .../AssertRefundedGrandTotalOnFrontend.php | 9 ++++----- .../Sales/Test/Constraint/AssertUnholdButton.php | 7 +++---- .../Page/{OrderView.xml => CustomerOrderView.xml} | 2 +- .../Magento/Sales/Test/TestStep/ReorderStep.php | 10 +++++----- .../Sales/Test/TestStep/SubmitOrderStep.php | 12 ++++++------ .../Test/Constraint/AssertNoShipButton.php | 7 +++---- .../Test/Constraint/AssertShipTotalQuantity.php | 8 ++++---- .../Constraint/AssertShipmentInShipmentsTab.php | 9 ++++----- .../AssertShipmentSuccessCreateMessage.php | 7 +++---- .../Constraint/AbstractAssertOrderTaxOnBackend.php | 14 +++++++------- .../AbstractAssertTaxCalculationAfterCheckout.php | 14 +++++++------- ...ssertOrderTaxOnBackendExcludingIncludingTax.php | 2 +- .../AssertOrderTaxOnBackendExcludingTax.php | 2 +- .../AssertOrderTaxOnBackendIncludingTax.php | 2 +- ...lculationAfterCheckoutExcludingIncludingTax.php | 2 +- ...sertTaxCalculationAfterCheckoutExcludingTax.php | 2 +- ...sertTaxCalculationAfterCheckoutIncludingTax.php | 2 +- 43 files changed, 127 insertions(+), 144 deletions(-) rename dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/{OrderView.xml => CustomerOrderView.xml} (90%) rename dev/tests/functional/tests/app/Magento/Sales/Test/Page/{OrderView.xml => CustomerOrderView.xml} (86%) diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index b825d0de50031..2a9ac7bf60518 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc17", + "magento/mtf": "1.0.0-rc18", "php": "~5.5.0|~5.6.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml index 0bf843b5c6ccb..54fd4f618bf95 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml @@ -119,7 +119,7 @@ - + Magento\Catalog\Test\Fixture\CatalogProductSimple Magento\Catalog\Test\Fixture\CatalogProductSimple Magento\Cms\Test\Page\CmsIndex @@ -128,25 +128,25 @@ Magento\Checkout\Test\Page\CheckoutCart - - + + Magento\Catalog\Test\Fixture\CatalogProductSimple Magento\Catalog\Test\Fixture\CatalogProductSimple Magento\Cms\Test\Page\CmsIndex Magento\Catalog\Test\Page\Category\CatalogCategoryView Magento\Catalog\Test\Page\Product\CatalogProductView - - - + + Magento\Catalog\Test\Fixture\CatalogProductSimple Magento\Catalog\Test\Fixture\CatalogProductSimple Magento\Cms\Test\Page\CmsIndex Magento\Catalog\Test\Page\Category\CatalogCategoryView Magento\Catalog\Test\Page\Product\CatalogProductView + + - diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php index ba47a15cbc34d..b809d11d2d881 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php @@ -6,7 +6,7 @@ namespace Magento\Core\Test\Constraint; -use Magento\Cms\Test\Page\Adminhtml\CmsNew; +use Magento\Cms\Test\Page\Adminhtml\CmsPageNew; use Magento\Core\Test\Fixture\SystemVariable; use Magento\Mtf\Constraint\AbstractConstraint; @@ -22,17 +22,17 @@ class AssertCustomVariableNotInCmsPageForm extends AbstractConstraint /** * Assert that custom system variable not in cms page form * - * @param CmsNew $cmsNewPage + * @param CmsPageNew $cmsPageNew * @param SystemVariable $systemVariable * @return void */ public function processAssert( - CmsNew $cmsNewPage, + CmsPageNew $cmsPageNew, SystemVariable $systemVariable ) { $customVariableName = $systemVariable->getName(); - $cmsNewPage->open(); - $cmsPageForm = $cmsNewPage->getPageForm(); + $cmsPageNew->open(); + $cmsPageForm = $cmsPageNew->getPageForm(); $variables = $cmsPageForm->getSystemVariables(); \PHPUnit_Framework_Assert::assertFalse( diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php index bb4eedec5fd96..8d8542cb82c1b 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php @@ -10,7 +10,7 @@ use Magento\Checkout\Test\Page\CheckoutOnepage; use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; use Magento\Customer\Test\Fixture\Customer; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Mtf\Fixture\InjectableFixture; use Magento\Tax\Test\Constraint\AbstractAssertTaxCalculationAfterCheckout; @@ -34,7 +34,7 @@ abstract class AbstractAssertTaxCalculationAfterCheckoutDownloadable extends Abs * @param CheckoutCart $checkoutCart * @param CheckoutOnepage $checkoutOnepage * @param CheckoutOnepageSuccess $checkoutOnepageSuccess - * @param OrderView $orderView + * @param CustomerOrderView $customerOrderView * @return void */ public function processAssert( @@ -43,10 +43,10 @@ public function processAssert( CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, - OrderView $orderView + CustomerOrderView $customerOrderView ) { $this->checkoutOnepage = $checkoutOnepage; - $this->orderView = $orderView; + $this->customerOrderView = $customerOrderView; $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout(); $checkoutOnepage->getBillingBlock()->clickContinue(); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingIncludingTax.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingIncludingTax.php index 64896843ae68b..f5187aaed61af 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingIncludingTax.php @@ -48,7 +48,7 @@ public function getReviewTotals($actualPrices) */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotalExclTax(); $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotalInclTax(); $actualPrices['discount'] = $viewBlock->getDiscount(); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php index c0e21c6d332e4..bfc7559b48012 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableExcludingTax.php @@ -50,7 +50,7 @@ public function getReviewTotals($actualPrices) */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotal(); $actualPrices['subtotal_incl_tax'] = null; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableIncludingTax.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableIncludingTax.php index 653b30217dbb1..42ab57ba89122 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxCalculationAfterCheckoutDownloadableIncludingTax.php @@ -48,7 +48,7 @@ public function getReviewTotals($actualPrices) */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = null; $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotal(); $actualPrices['discount'] = $viewBlock->getDiscount(); diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/View/Items/ItemProduct.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/View/Items/ItemProduct.php index 46440c49f3c40..e60e0c2b9b3bf 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/View/Items/ItemProduct.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/View/Items/ItemProduct.php @@ -11,7 +11,7 @@ /** * Class ItemProduct - * Item product block on OrderView page. + * Item product block on SalesOrderView page. */ class ItemProduct extends \Magento\Sales\Test\Block\Adminhtml\Order\Create\Items\ItemProduct { diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php index af6c6b3a319be..d049c42099a5b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php @@ -37,7 +37,7 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm * Assert that message from dataSet is displayed on order(s) view page on backend. * * @param GiftMessage $giftMessage - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param array $products * @param string $orderId @@ -45,7 +45,7 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm */ public function processAssert( GiftMessage $giftMessage, - SalesOrderView $orderView, + SalesOrderView $salesOrderView, OrderIndex $orderIndex, array $products, $orderId @@ -54,13 +54,13 @@ public function processAssert( if ($giftMessage->getAllowGiftMessagesForOrder()) { $expectedData[] = $giftMessage->getData(); - $actualData[] = $orderView->getGiftOptionsBlock()->getData($giftMessage); + $actualData[] = $salesOrderView->getGiftOptionsBlock()->getData($giftMessage); } if ($giftMessage->getAllowGiftOptionsForItems()) { foreach ($products as $key => $product) { $expectedData[] = $giftMessage->getItems()[$key]->getData(); - $actualData[] = $orderView->getGiftItemsBlock()->getItemProduct($product) + $actualData[] = $salesOrderView->getGiftItemsBlock()->getItemProduct($product) ->getGiftMessageFormData($giftMessage); } } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php index 49d37759fbac9..1f63e18a0534b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php @@ -10,7 +10,7 @@ use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\SalesOrderView; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -29,7 +29,7 @@ class AssertGiftMessageInFrontendOrder extends AbstractConstraint * @param GiftMessage $giftMessage * @param Customer $customer * @param OrderHistory $orderHistory - * @param OrderView $orderView + * @param SalesOrderView $salesOrderView * @param CustomerAccountLogout $customerAccountLogout * @param string $orderId * @return void @@ -38,7 +38,7 @@ public function processAssert( GiftMessage $giftMessage, Customer $customer, OrderHistory $orderHistory, - OrderView $orderView, + SalesOrderView $salesOrderView, CustomerAccountLogout $customerAccountLogout, $orderId ) { @@ -57,7 +57,7 @@ public function processAssert( \PHPUnit_Framework_Assert::assertEquals( $expectedData, - $orderView->getGiftMessageForOrderBlock()->getGiftMessage(), + $salesOrderView->getGiftMessageForOrderBlock()->getGiftMessage(), 'Wrong gift message is displayed on order.' ); $customerAccountLogout->open(); diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index bdfb649759a89..6b10b111cc6f2 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -10,7 +10,7 @@ use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\SalesOrderView; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -29,7 +29,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint * @param GiftMessage $giftMessage * @param Customer $customer * @param OrderHistory $orderHistory - * @param OrderView $orderView + * @param SalesOrderView $salesOrderView * @param CustomerAccountLogout $customerAccountLogout * @param string $orderId * @param array $products @@ -39,7 +39,7 @@ public function processAssert( GiftMessage $giftMessage, Customer $customer, OrderHistory $orderHistory, - OrderView $orderView, + SalesOrderView $salesOrderView, CustomerAccountLogout $customerAccountLogout, $orderId, $products = [] @@ -68,7 +68,7 @@ public function processAssert( } \PHPUnit_Framework_Assert::assertEquals( $expectedData, - $orderView->getGiftMessageForItemBlock()->getGiftMessage($product->getName()), + $salesOrderView->getGiftMessageForItemBlock()->getGiftMessage($product->getName()), 'Wrong gift message is displayed on "' . $product->getName() . '" item.' ); } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/CustomerOrderView.xml similarity index 90% rename from dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/OrderView.xml rename to dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/CustomerOrderView.xml index fbe40d388971c..da7cfe94d2aa0 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/OrderView.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/CustomerOrderView.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml index 5dee4e716ca15..03f89671b8e45 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/constraint.xml @@ -6,5 +6,5 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php index 8476f6a782b99..bb780836ebd8b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertCreditMemoButton * Assert that 'Credit Memo' button is present on order's page */ class AssertCreditMemoButton extends AbstractConstraint @@ -24,17 +23,17 @@ class AssertCreditMemoButton extends AbstractConstraint /** * Assert that 'Credit Memo' button is present on order's page * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @return void */ - public function processAssert(SalesOrderView $orderView, OrderIndex $orderIndex, OrderInjectable $order) + public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); \PHPUnit_Framework_Assert::assertTrue( - $orderView->getPageActions()->isActionButtonVisible('CreditMemo'), + $salesOrderView->getPageActions()->isActionButtonVisible('CreditMemo'), 'Credit memo button is absent on order view page.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php index b43ff086fcc5c..9108b66f82294 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php @@ -13,7 +13,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertInvoiceInInvoicesTab * Assert that invoice is present in the invoices tab of the order with corresponding amount(Grand Total) */ class AssertInvoiceInInvoicesTab extends AbstractConstraint @@ -25,23 +24,23 @@ class AssertInvoiceInInvoicesTab extends AbstractConstraint /** * Assert that invoice is present in the invoices tab of the order with corresponding amount(Grand Total) * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @param array $ids * @return void */ public function processAssert( - SalesOrderView $orderView, + SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order, array $ids ) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - $orderView->getOrderForm()->openTab('invoices'); + $salesOrderView->getOrderForm()->openTab('invoices'); /** @var Grid $grid */ - $grid = $orderView->getOrderForm()->getTabElement('invoices')->getGridBlock(); + $grid = $salesOrderView->getOrderForm()->getTabElement('invoices')->getGridBlock(); $amount = $order->getPrice(); foreach ($ids['invoiceIds'] as $key => $invoiceId) { $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php index d6ea8ceed5987..f9b04dd6857c7 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertInvoiceSuccessCreateMessage * Assert success invoice create message is displayed on order view page */ class AssertInvoiceSuccessCreateMessage extends AbstractConstraint @@ -27,14 +26,14 @@ class AssertInvoiceSuccessCreateMessage extends AbstractConstraint /** * Assert that success message present after create invoice * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @return void */ - public function processAssert(SalesOrderView $orderView) + public function processAssert(SalesOrderView $salesOrderView) { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_CREATE_MESSAGE, - $orderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessages() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php index f2c4ec3bf358b..ddf7345a9da0f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertInvoiceWithShipmentSuccessMessage * Assert success created the invoice and shipment message presents */ class AssertInvoiceWithShipmentSuccessMessage extends AbstractConstraint @@ -27,14 +26,14 @@ class AssertInvoiceWithShipmentSuccessMessage extends AbstractConstraint /** * Assert success message presents * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @return void */ - public function processAssert(SalesOrderView $orderView) + public function processAssert(SalesOrderView $salesOrderView) { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $orderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessages() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php index e1e109dc14df4..2bfcb1d0ce23b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php @@ -9,7 +9,7 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\InvoiceView; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\CustomerOrderView; /** * Class AssertInvoicedAmountOnFrontend @@ -26,7 +26,7 @@ class AssertInvoicedAmountOnFrontend extends AbstractAssertOrderOnFrontend * * @param OrderHistory $orderHistory * @param OrderInjectable $order - * @param OrderView $orderView + * @param CustomerOrderView $customerOrderView * @param InvoiceView $invoiceView * @param array $ids * @return void @@ -34,13 +34,13 @@ class AssertInvoicedAmountOnFrontend extends AbstractAssertOrderOnFrontend public function processAssert( OrderHistory $orderHistory, OrderInjectable $order, - OrderView $orderView, + CustomerOrderView $customerOrderView, InvoiceView $invoiceView, array $ids ) { $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer()); $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId()); - $orderView->getOrderViewBlock()->openLinkByName('Invoices'); + $customerOrderView->getOrderViewBlock()->openLinkByName('Invoices'); foreach ($ids['invoiceIds'] as $key => $invoiceId) { \PHPUnit_Framework_Assert::assertEquals( number_format($order->getPrice()[$key]['grand_invoice_total'], 2), diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php index aaf2532fe8c19..d5069af6330c4 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertNoCreditMemoButton * Assert that after refunding full amount 'Credit Memo' is not available any more */ class AssertNoCreditMemoButton extends AbstractConstraint @@ -24,17 +23,17 @@ class AssertNoCreditMemoButton extends AbstractConstraint /** * Assert that after refunding full amount 'Credit Memo' is not available any more * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @return void */ - public function processAssert(SalesOrderView $orderView, OrderIndex $orderIndex, OrderInjectable $order) + public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); \PHPUnit_Framework_Assert::assertFalse( - $orderView->getPageActions()->isActionButtonVisible('CreditMemo'), + $salesOrderView->getPageActions()->isActionButtonVisible('CreditMemo'), 'Credit memo button is present on order view page.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php index dea42fd1224fd..fd00c2328b3eb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertNoInvoiceButton * Assert no Invoice button the order grid */ class AssertNoInvoiceButton extends AbstractConstraint @@ -24,17 +23,17 @@ class AssertNoInvoiceButton extends AbstractConstraint /** * Assert no Invoice button the order grid * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @return void */ - public function processAssert(SalesOrderView $orderView, OrderIndex $orderIndex, OrderInjectable $order) + public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); \PHPUnit_Framework_Assert::assertFalse( - $orderView->getPageActions()->isActionButtonVisible('Invoice'), + $salesOrderView->getPageActions()->isActionButtonVisible('Invoice'), 'Invoice button is present on order view page.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php index cf95adc81fb83..46e36758f69aa 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertOrderButtonsUnavailable * Assert that buttons from dataSet are not present on page */ class AssertOrderButtonsUnavailable extends AbstractConstraint @@ -25,14 +24,14 @@ class AssertOrderButtonsUnavailable extends AbstractConstraint * Assert that buttons from dataSet are not present on page * * @param OrderIndex $orderIndex - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderInjectable $order * @param string $orderButtonsUnavailable * @return void */ public function processAssert( OrderIndex $orderIndex, - SalesOrderView $orderView, + SalesOrderView $salesOrderView, OrderInjectable $order, $orderButtonsUnavailable ) { @@ -41,7 +40,7 @@ public function processAssert( $buttons = explode(',', $orderButtonsUnavailable); $matches = []; foreach ($buttons as $button) { - if ($orderView->getPageActions()->isActionButtonVisible(trim($button))) { + if ($salesOrderView->getPageActions()->isActionButtonVisible(trim($button))) { $matches[] = $button; } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php index b8afe0589eb9d..b155b9ffc827a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertOrderCancelSuccessMessage * Assert that after cancel sales order successful message appears */ class AssertOrderCancelSuccessMessage extends AbstractConstraint @@ -27,14 +26,14 @@ class AssertOrderCancelSuccessMessage extends AbstractConstraint /** * Assert that after cancel sales order successful message appears * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @return void */ - public function processAssert(SalesOrderView $orderView) + public function processAssert(SalesOrderView $salesOrderView) { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_CANCEL_MESSAGE, - $orderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessages() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php index 54bbfd640be38..4269bcab32e72 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertOrderGrandTotal * Assert that Order Grand Total is correct on order page in backend */ class AssertOrderGrandTotal extends AbstractConstraint diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php index c598738e28422..16315c537bf0f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertOrderSuccessCreateMessage * Assert that after create sales order successful message appears */ class AssertOrderSuccessCreateMessage extends AbstractConstraint @@ -27,14 +26,14 @@ class AssertOrderSuccessCreateMessage extends AbstractConstraint /** * Assert that after create sales order successful message appears * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @return void */ - public function processAssert(SalesOrderView $orderView) + public function processAssert(SalesOrderView $salesOrderView) { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $orderView->getMessagesBlock()->getSuccessMessages(), + $salesOrderView->getMessagesBlock()->getSuccessMessages(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php index 9faa463dab62c..fd5d6ffc4d561 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php @@ -13,7 +13,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertRefundInCreditMemoTab * Assert that refund is present in the tab with ID and refunded amount(depending on full/partial refund) */ class AssertRefundInCreditMemoTab extends AbstractConstraint @@ -25,23 +24,23 @@ class AssertRefundInCreditMemoTab extends AbstractConstraint /** * Assert that refund is present in the tab with ID and refunded amount(depending on full/partial refund) * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @param array $ids * @return void */ public function processAssert( - SalesOrderView $orderView, + SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order, array $ids ) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - $orderView->getOrderForm()->openTab('creditmemos'); + $salesOrderView->getOrderForm()->openTab('creditmemos'); /** @var Grid $grid */ - $grid = $orderView->getOrderForm()->getTabElement('creditmemos')->getGridBlock(); + $grid = $salesOrderView->getOrderForm()->getTabElement('creditmemos')->getGridBlock(); $amount = $order->getPrice(); foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php index 899ef1f9fcd93..0936d189c6a1c 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertRefundSuccessCreateMessage * Assert that success create credit memo message is present on order view page */ class AssertRefundSuccessCreateMessage extends AbstractConstraint @@ -27,14 +26,14 @@ class AssertRefundSuccessCreateMessage extends AbstractConstraint /** * Assert that success create credit memo message is present on order view page * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @return void */ - public function processAssert(SalesOrderView $orderView) + public function processAssert(SalesOrderView $salesOrderView) { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_CREATE_MESSAGE, - $orderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessages() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php index e0795fe77a3c5..05c8cc3a3a753 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php @@ -9,10 +9,9 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\CreditMemoView; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\CustomerOrderView; /** - * Class AssertRefundedGrandTotalOnFrontend * Assert that refunded grand total is equal to data from fixture on My Account page */ class AssertRefundedGrandTotalOnFrontend extends AbstractAssertOrderOnFrontend @@ -26,7 +25,7 @@ class AssertRefundedGrandTotalOnFrontend extends AbstractAssertOrderOnFrontend * * @param OrderHistory $orderHistory * @param OrderInjectable $order - * @param OrderView $orderView + * @param CustomerOrderView $customerOrderView * @param CreditMemoView $creditMemoView * @param array $ids * @return void @@ -34,13 +33,13 @@ class AssertRefundedGrandTotalOnFrontend extends AbstractAssertOrderOnFrontend public function processAssert( OrderHistory $orderHistory, OrderInjectable $order, - OrderView $orderView, + CustomerOrderView $customerOrderView, CreditMemoView $creditMemoView, array $ids ) { $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer()); $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId()); - $orderView->getOrderViewBlock()->openLinkByName('Refunds'); + $customerOrderView->getOrderViewBlock()->openLinkByName('Refunds'); foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { \PHPUnit_Framework_Assert::assertEquals( number_format($order->getPrice()[$key]['grand_creditmemo_total'], 2), diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php index cc89376e2164f..1f9c3afcbfe8b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertUnholdButton * Assert that 'Unhold' button present on page */ class AssertUnholdButton extends AbstractConstraint @@ -25,16 +24,16 @@ class AssertUnholdButton extends AbstractConstraint * Assert that 'Unhold' button present on order page * * @param OrderIndex $orderIndex - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderInjectable $order * @return void */ - public function processAssert(OrderIndex $orderIndex, SalesOrderView $orderView, OrderInjectable $order) + public function processAssert(OrderIndex $orderIndex, SalesOrderView $salesOrderView, OrderInjectable $order) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); \PHPUnit_Framework_Assert::assertTrue( - $orderView->getPageActions()->isActionButtonVisible('Unhold'), + $salesOrderView->getPageActions()->isActionButtonVisible('Unhold'), 'Button "Unhold" is absent on order page.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/CustomerOrderView.xml similarity index 86% rename from dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderView.xml rename to dev/tests/functional/tests/app/Magento/Sales/Test/Page/CustomerOrderView.xml index 0846befbea55f..b590da18b2c9e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/OrderView.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/CustomerOrderView.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php index 4dac16079bd85..31e9f6471c48d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/ReorderStep.php @@ -20,15 +20,15 @@ class ReorderStep implements TestStepInterface * * @var SalesOrderView */ - protected $orderView; + protected $salesOrderView; /** * @construct - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView */ - public function __construct(SalesOrderView $orderView) + public function __construct(SalesOrderView $salesOrderView) { - $this->orderView = $orderView; + $this->salesOrderView = $salesOrderView; } /** @@ -38,6 +38,6 @@ public function __construct(SalesOrderView $orderView) */ public function run() { - $this->orderView->getPageActions()->reorder(); + $this->salesOrderView->getPageActions()->reorder(); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index 8d0a3568f1816..c08f18f36e279 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -30,7 +30,7 @@ class SubmitOrderStep implements TestStepInterface * * @var SalesOrderView */ - protected $orderView; + protected $salesOrderView; /** * Factory for fixtures. @@ -42,7 +42,7 @@ class SubmitOrderStep implements TestStepInterface /** * @constructor * @param OrderCreateIndex $orderCreateIndex - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param FixtureFactory $fixtureFactory * @param Customer $customer * @param Address $billingAddress @@ -50,14 +50,14 @@ class SubmitOrderStep implements TestStepInterface */ public function __construct( OrderCreateIndex $orderCreateIndex, - SalesOrderView $orderView, + SalesOrderView $salesOrderView, FixtureFactory $fixtureFactory, Customer $customer, Address $billingAddress, array $products ) { $this->orderCreateIndex = $orderCreateIndex; - $this->orderView = $orderView; + $this->salesOrderView = $salesOrderView; $this->fixtureFactory = $fixtureFactory; $this->customer = $customer; $this->billingAddress = $billingAddress; @@ -72,8 +72,8 @@ public function __construct( public function run() { $this->orderCreateIndex->getCreateBlock()->submitOrder(); - $this->orderView->getMessagesBlock()->waitSuccessMessage(); - $orderId = trim($this->orderView->getTitleBlock()->getTitle(), '#'); + $this->salesOrderView->getMessagesBlock()->waitSuccessMessage(); + $orderId = trim($this->salesOrderView->getTitleBlock()->getTitle(), '#'); $order = $this->fixtureFactory->createByCode( 'orderInjectable', [ diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php index 2b82934d63fa4..e4b0888131ccf 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertNoShipButton * Assert no Ship button in the order grid */ class AssertNoShipButton extends AbstractConstraint @@ -24,17 +23,17 @@ class AssertNoShipButton extends AbstractConstraint /** * Assert no Ship button in the order grid * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @return void */ - public function processAssert(SalesOrderView $orderView, OrderIndex $orderIndex, OrderInjectable $order) + public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); \PHPUnit_Framework_Assert::assertFalse( - $orderView->getPageActions()->isActionButtonVisible('Ship'), + $salesOrderView->getPageActions()->isActionButtonVisible('Ship'), 'Ship button is present on order view page.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php index a2f10efbeea68..7d5d35f8b4bb4 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php @@ -9,7 +9,7 @@ use Magento\Sales\Test\Constraint\AbstractAssertOrderOnFrontend; use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Shipping\Test\Page\ShipmentView; /** @@ -27,7 +27,7 @@ class AssertShipTotalQuantity extends AbstractAssertOrderOnFrontend * * @param OrderHistory $orderHistory * @param OrderInjectable $order - * @param OrderView $orderView + * @param CustomerOrderView $customerOrderView * @param ShipmentView $shipmentView * @param array $ids * @return void @@ -35,14 +35,14 @@ class AssertShipTotalQuantity extends AbstractAssertOrderOnFrontend public function processAssert( OrderHistory $orderHistory, OrderInjectable $order, - OrderView $orderView, + CustomerOrderView $customerOrderView, ShipmentView $shipmentView, array $ids ) { $totalQty = $order->getTotalQtyOrdered(); $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer()); $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId()); - $orderView->getOrderViewBlock()->openLinkByName('Order Shipments'); + $customerOrderView->getOrderViewBlock()->openLinkByName('Order Shipments'); foreach ($ids['shipmentIds'] as $key => $shipmentIds) { \PHPUnit_Framework_Assert::assertEquals( $totalQty[$key], diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php index 78727668b0a84..0ad056d9451f9 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php @@ -12,7 +12,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertShipmentInShipmentsTab * Assert that shipment is present in the Shipments tab with correct shipped items quantity */ class AssertShipmentInShipmentsTab extends AbstractConstraint @@ -24,21 +23,21 @@ class AssertShipmentInShipmentsTab extends AbstractConstraint /** * Assert that shipment is present in the Shipments tab with correct shipped items quantity * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param OrderInjectable $order * @param array $ids * @return void */ public function processAssert( - SalesOrderView $orderView, + SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order, array $ids ) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - $orderView->getOrderForm()->openTab('shipments'); + $salesOrderView->getOrderForm()->openTab('shipments'); $totalQty = $order->getTotalQtyOrdered(); $totalQty = is_array($totalQty) ? $totalQty : [$totalQty]; @@ -49,7 +48,7 @@ public function processAssert( 'qty_to' => $totalQty[$key], ]; \PHPUnit_Framework_Assert::assertTrue( - $orderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->isRowVisible($filter), + $salesOrderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->isRowVisible($filter), 'Shipment is absent on shipments tab.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php index 3c00c720ff65f..b73ca9bccabd3 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php @@ -10,7 +10,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertShipmentSuccessCreateMessage * Assert that success message is displayed after shipment has been created */ class AssertShipmentSuccessCreateMessage extends AbstractConstraint @@ -27,14 +26,14 @@ class AssertShipmentSuccessCreateMessage extends AbstractConstraint /** * Assert success message presents * - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @return void */ - public function processAssert(SalesOrderView $orderView) + public function processAssert(SalesOrderView $salesOrderView) { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $orderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessages() ); } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php index c8ac5237c0f8c..f5d516b6f6957 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php @@ -23,7 +23,7 @@ abstract class AbstractAssertOrderTaxOnBackend extends AbstractConstraint * * @var SalesOrderView */ - protected $orderView; + protected $salesOrderView; /** * Order View Page. @@ -76,7 +76,7 @@ abstract protected function getCreditMemoNewTotals($actualPrices); * @param array $prices * @param InjectableFixture $product * @param OrderIndex $orderIndex - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderInvoiceNew $orderInvoiceNew * @param OrderCreditMemoNew $orderCreditMemoNew * @return void @@ -85,11 +85,11 @@ public function processAssert( array $prices, InjectableFixture $product, OrderIndex $orderIndex, - SalesOrderView $orderView, + SalesOrderView $salesOrderView, OrderInvoiceNew $orderInvoiceNew, OrderCreditMemoNew $orderCreditMemoNew ) { - $this->orderView = $orderView; + $this->salesOrderView = $salesOrderView; $this->orderInvoiceNew = $orderInvoiceNew; $this->orderCreditMemoNew = $orderCreditMemoNew; $orderIndex->open(); @@ -101,7 +101,7 @@ public function processAssert( $prices = $this->preparePrices($prices); $message = 'Prices on order view page should be equal to defined in dataset.'; \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); - $orderView->getPageActions()->invoice(); + $salesOrderView->getPageActions()->invoice(); //Check prices on invoice creation page $actualPrices = []; $actualPrices = $this->getInvoiceNewPrices($actualPrices, $product); @@ -115,7 +115,7 @@ public function processAssert( $actualPrices = $this->getOrderTotals($actualPrices); $message = 'Prices on invoice page should be equal to defined in dataset.'; \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); - $orderView->getPageActions()->orderCreditMemo(); + $salesOrderView->getPageActions()->orderCreditMemo(); //Check prices on credit memo creation page $pricesCreditMemo = $this->preparePricesCreditMemo($prices); $actualPrices = []; @@ -177,7 +177,7 @@ protected function preparePricesCreditMemo($prices) */ public function getOrderPrices($actualPrices, InjectableFixture $product) { - $viewBlock = $this->orderView->getItemsOrderedBlock(); + $viewBlock = $this->salesOrderView->getItemsOrderedBlock(); $actualPrices['cart_item_price_excl_tax'] = $viewBlock->getItemPriceExclTax($product->getName()); $actualPrices['cart_item_price_incl_tax'] = $viewBlock->getItemPriceInclTax($product->getName()); $actualPrices['cart_item_subtotal_excl_tax'] = $viewBlock->getItemSubExclTax($product->getName()); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php index f6c2557645ca0..4661c262f9cce 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php @@ -11,7 +11,7 @@ use Magento\Checkout\Test\Page\CheckoutOnepage; use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; use Magento\Customer\Test\Fixture\Customer; -use Magento\Sales\Test\Page\OrderView; +use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Mtf\Fixture\InjectableFixture; /** @@ -29,9 +29,9 @@ abstract class AbstractAssertTaxCalculationAfterCheckout extends AbstractConstra /** * Order view page. * - * @var OrderView + * @var CustomerOrderView */ - protected $orderView; + protected $customerOrderView; /** * Constraint severeness. @@ -64,7 +64,7 @@ abstract protected function getOrderTotals($actualPrices); * @param CheckoutCart $checkoutCart * @param CheckoutOnepage $checkoutOnepage * @param CheckoutOnepageSuccess $checkoutOnepageSuccess - * @param OrderView $orderView + * @param CustomerOrderView $customerOrderView * @return void */ public function processAssert( @@ -73,10 +73,10 @@ public function processAssert( CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, - OrderView $orderView + CustomerOrderView $customerOrderView ) { $this->checkoutOnepage = $checkoutOnepage; - $this->orderView = $orderView; + $this->customerOrderView = $customerOrderView; $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout(); $checkoutOnepage->getBillingBlock()->clickContinue(); @@ -154,7 +154,7 @@ public function getReviewPrices($actualPrices, InjectableFixture $product) */ public function getOrderPrices($actualPrices, InjectableFixture $product) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['cart_item_price_excl_tax'] = $viewBlock->getItemPriceExclTax($product->getName()); $actualPrices['cart_item_price_incl_tax'] = $viewBlock->getItemPriceInclTax($product->getName()); $actualPrices['cart_item_subtotal_excl_tax'] = $viewBlock->getItemSubExclTax($product->getName()); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php index 1851caffdb0c7..db8795a0baa80 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php @@ -26,7 +26,7 @@ class AssertOrderTaxOnBackendExcludingIncludingTax extends AbstractAssertOrderTa */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderTotalsBlock(); + $viewBlock = $this->salesOrderView->getOrderTotalsBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotalExclTax(); $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotalInclTax(); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php index 9b0c4846f2711..961745b5c2124 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php @@ -27,7 +27,7 @@ class AssertOrderTaxOnBackendExcludingTax extends AbstractAssertOrderTaxOnBacken */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderTotalsBlock(); + $viewBlock = $this->salesOrderView->getOrderTotalsBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotal(); $actualPrices['subtotal_incl_tax'] = null; diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendIncludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendIncludingTax.php index 8843f04669a88..17c88bf66fa2b 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertOrderTaxOnBackendIncludingTax.php @@ -26,7 +26,7 @@ class AssertOrderTaxOnBackendIncludingTax extends AbstractAssertOrderTaxOnBacken */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderTotalsBlock(); + $viewBlock = $this->salesOrderView->getOrderTotalsBlock(); $actualPrices['subtotal_excl_tax'] = null; $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotal(); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php index 7d65c80e0aee4..57e9269dd9b79 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php @@ -48,7 +48,7 @@ public function getReviewTotals($actualPrices) */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->salesOrderView->getSalesOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotalExclTax(); $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotalInclTax(); $actualPrices['discount'] = $viewBlock->getDiscount(); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingTax.php index eecf9cc8c8740..1a2cdcc1e76fa 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingTax.php @@ -46,7 +46,7 @@ public function getReviewTotals($actualPrices) */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotal(); $actualPrices['subtotal_incl_tax'] = null; diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutIncludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutIncludingTax.php index 59869e99eaa92..3282110c8a2bb 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutIncludingTax.php @@ -47,7 +47,7 @@ public function getReviewTotals($actualPrices) */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->orderView->getOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = null; $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotal(); $actualPrices['discount'] = $viewBlock->getDiscount(); From 3fcb1080f6bac697884ac91fa94b5ddeb99bf700 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Wed, 18 Feb 2015 09:58:37 +0200 Subject: [PATCH 47/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../Test/Constraint/AssertBundlePriceType.php | 2 ++ .../Constraint/AssertProductAbsentCrossSells.php | 2 ++ .../Test/Constraint/AssertProductCrossSells.php | 2 ++ .../Catalog/Test/Constraint/AssertProductInCart.php | 2 ++ .../TestCase/Product/AddToCartCrossSellTest.php | 7 ++++--- .../Product/NavigateRelatedProductsTest.php | 3 +-- .../TestCase/DeleteProductsFromShoppingCartTest.php | 4 +--- .../Test/TestStep/AddProductsToTheCartStep.php | 2 +- .../Constraint/AssertConfigurableProductInCart.php | 2 ++ .../CreateDownloadableProductEntityTest.php | 4 +--- .../Constraint/AssertGiftMessageInFrontendOrder.php | 13 ++++++------- .../Test/TestCase/ProductsInCartReportEntity.php | 4 ---- .../AbstractAssertTaxWithCrossBorderApplying.php | 2 ++ .../Weee/Test/Constraint/AssertFptApplied.php | 2 ++ ...uctsToCartFromCustomerWishlistOnFrontendTest.php | 1 + 15 files changed, 29 insertions(+), 23 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index 22e4f9c693a30..3498abf26aa24 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -79,6 +79,8 @@ protected function assertPrice( ? $originalProduct->getPriceType() : $product->getPriceType(); $catalogProductView->getViewBlock()->addToCart($product); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCartView->open(); $cartItem = $checkoutCartView->getCartBlock()->getCartItem($product); $specialPrice = 0; if (isset($bundleData['group_price'])) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php index 15ec04a749030..939c3ebbcd04b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php @@ -50,6 +50,8 @@ public function processAssert( $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->addToCart($product); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCart->open(); foreach ($promotedProducts as $promotedProduct) { \PHPUnit_Framework_Assert::assertFalse( $checkoutCart->getCrosssellBlock()->getProductItem($promotedProduct)->isVisible(), diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php index 036d9dabd5f0c..ae7c8849500a7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCrossSells.php @@ -51,6 +51,8 @@ public function processAssert( $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->addToCart($product); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCart->open(); foreach ($promotedProducts as $promotedProduct) { if (!$checkoutCart->getCrosssellBlock()->getProductItem($promotedProduct)->isVisible()) { $errors[] = 'Product \'' . $promotedProduct->getName() . '\' is absent in cross-sell section.'; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php index dd4d70e89fbe7..701e9a6fa02d1 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php @@ -42,6 +42,7 @@ public function processAssert( $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->fillOptions($product); $catalogProductView->getViewBlock()->clickAddToCart(); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); // Check price $this->assertOnShoppingCart($product, $checkoutCart); @@ -56,6 +57,7 @@ public function processAssert( */ protected function assertOnShoppingCart(FixtureInterface $product, CheckoutCart $checkoutCart) { + $checkoutCart->open(); /** @var CatalogProductSimple $product */ $customOptions = $product->getCustomOptions(); $checkoutData = $product->getCheckoutData(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php index 0bc815ba47a5a..a099fb9a4a67c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddToCartCrossSellTest.php @@ -11,8 +11,6 @@ use Magento\Mtf\Fixture\InjectableFixture; /** - * Test Flow: - * * Preconditions: * 1. Create products. * 2. Assign promoted products. @@ -84,6 +82,7 @@ public function test( $this->browser->open($_ENV['app_frontend_url'] . $initialProduct->getUrlKey() . '.html'); $this->catalogProductView->getViewBlock()->addToCart($initialProduct); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); $this->assertCrossSellSection($initialProductToVerify); foreach ($navigateProductsOrder as $productName) { $this->addToCart($this->products[$productName]); @@ -109,7 +108,7 @@ protected function addToCart(InjectableFixture $product) $this->catalogProductView->getViewBlock()->addToCart($product); } - $this->checkoutCart->getMessagesBlock()->waitSuccessMessage(); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); } /** @@ -119,6 +118,7 @@ protected function addToCart(InjectableFixture $product) */ protected function assertAbsentCrossSellSection() { + $this->checkoutCart->open(); \PHPUnit_Framework_Assert::assertFalse( $this->checkoutCart->getCrosssellBlock()->isVisible(), "Cross-sell block is present." @@ -139,6 +139,7 @@ protected function assertCrossSellSection(array $promotedProductNames) foreach ($promotedProductNames as $promotedProductName) { $productNames[] = $this->products[$promotedProductName]->getName(); } + $this->checkoutCart->open(); foreach ($this->checkoutCart->getCrosssellBlock()->getProducts() as $productItem) { $pageProductNames[] = $productItem->getProductName(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php index e5052cab92c2a..83f78502d0560 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php @@ -10,8 +10,6 @@ use Magento\Mtf\Fixture\InjectableFixture; /** - * Test Flow: - * * Preconditions: * 1. Create products. * 2. Assign promoted products. @@ -102,6 +100,7 @@ public function test( $checkoutProducts = $this->selectRelatedProducts($lastProductName); $checkoutProducts[] = $lastProduct; $this->catalogProductView->getViewBlock()->addToCart($lastProduct); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); $this->assertCheckoutCart($checkoutProducts); } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php index 87b1cd5997332..f9a709c226a98 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php @@ -15,9 +15,6 @@ use Magento\Mtf\TestCase\Injectable; /** - * Class DeleteProductsFromShoppingCartTest - * Test delete products from shopping cart - * * Preconditions * 1. Test products are created * @@ -141,6 +138,7 @@ protected function addToCart(array $products) */ protected function removeProducts(array $products) { + $this->cartPage->open(); foreach ($products as $product) { $this->cartPage->getCartBlock()->getCartItem($product)->removeItem(); } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php index bc314698d1fe2..e7d7a3f13564b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php @@ -13,7 +13,6 @@ use Magento\Mtf\TestStep\TestStepInterface; /** - * Class AddProductsToTheCartStep * Adding created products to the cart */ class AddProductsToTheCartStep implements TestStepInterface @@ -88,6 +87,7 @@ public function run() foreach ($this->products as $product) { $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $this->catalogProductView->getViewBlock()->addToCart($product); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); } } } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php index 39a749d3cc341..ea8e3ee73525e 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductInCart.php @@ -36,6 +36,8 @@ public function processAssert( $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->addToCart($product); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCart->open(); $checkoutData = $product->getCheckoutData(); $price = $checkoutCart->getCartBlock()->getCartItem($product)->getPrice(); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php index 6295a6b54cb8d..c27b3e194788f 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php @@ -13,9 +13,7 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for Create DownloadableProductEntity - * - * Test Flow: + * Steps: * 1. Log in to Backend. * 2. Navigate to Products > Catalog. * 3. Start to create new Downloadable product. diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php index 1f63e18a0534b..1179780a8b09c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php @@ -10,12 +10,11 @@ use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\SalesOrderView; +use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertGiftMessageInFrontendOrder - * Assert that message from dataSet is displayed on order(s) view page on frontend + * Assert that message from dataSet is displayed on order(s) view page on frontend. */ class AssertGiftMessageInFrontendOrder extends AbstractConstraint { @@ -24,12 +23,12 @@ class AssertGiftMessageInFrontendOrder extends AbstractConstraint /* end tags */ /** - * Assert that message from dataSet is displayed on order(s) view page on frontend + * Assert that message from dataSet is displayed on order(s) view page on frontend. * * @param GiftMessage $giftMessage * @param Customer $customer * @param OrderHistory $orderHistory - * @param SalesOrderView $salesOrderView + * @param CustomerOrderView $customerOrderView * @param CustomerAccountLogout $customerAccountLogout * @param string $orderId * @return void @@ -38,7 +37,7 @@ public function processAssert( GiftMessage $giftMessage, Customer $customer, OrderHistory $orderHistory, - SalesOrderView $salesOrderView, + CustomerOrderView $customerOrderView, CustomerAccountLogout $customerAccountLogout, $orderId ) { @@ -57,7 +56,7 @@ public function processAssert( \PHPUnit_Framework_Assert::assertEquals( $expectedData, - $salesOrderView->getGiftMessageForOrderBlock()->getGiftMessage(), + $customerOrderView->getGiftMessageForOrderBlock()->getGiftMessage(), 'Wrong gift message is displayed on order.' ); $customerAccountLogout->open(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php index a5af836086932..da35b1fd05a13 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntity.php @@ -16,10 +16,6 @@ use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for ProductsInCartReportEntity - * - * Test Flow: - * * Preconditions: * 1. Create customer * 2. Create product diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php index b249079cbac77..379a0361c5e63 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php @@ -150,6 +150,7 @@ protected function addToCart(CatalogProductSimple $product, $actualPrices) $actualPrices['product_page_price'] = $this->catalogProductView->getViewBlock()->getPriceBlock()->getEffectivePrice(); $this->catalogProductView->getViewBlock()->clickAddToCart(); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); return $actualPrices; } @@ -162,6 +163,7 @@ protected function addToCart(CatalogProductSimple $product, $actualPrices) */ protected function getCartPrice(CatalogProductSimple $product, $actualPrices) { + $this->checkoutCart->open(); $actualPrices['cart_item_price_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax(); $actualPrices['cart_item_subtotal_incl_tax'] = diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php index 579f0972482d3..44d5c620b02d2 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Constraint/AssertFptApplied.php @@ -158,6 +158,7 @@ protected function addToCart(CatalogProductSimple $product, array $actualPrices) $actualPrices['product_page_fpt'] = $viewWeeeBlock->getFptBlock($this->fptLabel)->getFpt(); $actualPrices['product_page_fpt_total'] = $viewWeeeBlock->getFptBlock($this->fptLabel)->getFptTotal(); $viewBlock->clickAddToCart(); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); return $actualPrices; } @@ -171,6 +172,7 @@ protected function addToCart(CatalogProductSimple $product, array $actualPrices) */ protected function getCartPrice(CatalogProductSimple $product, array $actualPrices) { + $this->checkoutCart->open(); $productItem = $this->checkoutCart->getCartBlock()->getCartItem($product); $productWeeeItem = $this->checkoutCart->getWeeeCartBlock()->getCartItem($product); $actualPrices['cart_item_price'] = $productItem->getPrice(); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php index 4ff44919fb99a..b83ca2292615d 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php @@ -76,6 +76,7 @@ protected function addToCart(array $products, $qty) $this->wishlistIndex->getItemsBlock()->getItemProduct($product)->clickAddToCart(); if (!$this->wishlistIndex->getWishlistBlock()->isVisible()) { $this->catalogProductView->getViewBlock()->addToCart($product); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); } } } From 21692645b11c153893b21f7389e7f9798ecceb3a Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Wed, 18 Feb 2015 10:00:34 +0200 Subject: [PATCH 48/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../tests/app/Magento/Customer/Test/etc/constraint.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml index 12f0e8575e9ac..2e21cd2080211 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml @@ -65,4 +65,5 @@ + From 54eda204944b23c7d19a4112c0ac68779aab1b28 Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Wed, 18 Feb 2015 12:30:11 +0200 Subject: [PATCH 49/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../Test/Block/Category/ProductPagination.php | 12 +++++------- .../Sales/Test/Block/Adminhtml/Order/View/Items.php | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php index 6d111afb3183c..5badc1311aa60 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/ProductPagination.php @@ -7,26 +7,24 @@ namespace Magento\Catalog\Test\Block\Category; use Magento\Mtf\Block\Block; +use Magento\Mtf\Client\ElementInterface; /** - * Class ProductPagination - * Pagination page product list - * - * @package Magento\Catalog\Test\Block\Category + * Pagination page product list. */ class ProductPagination extends Block { /** - * Selector next active element + * Selector next active element. * * @var string */ protected $nextPageSelector = '.item.current + .item a'; /** - * Getting the active element to go to the next page + * Getting the active element to go to the next page. * - * @return \Magento\Mtf\Client\ElementInterface|null + * @return ElementInterface|null */ public function getNextPage() { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php index 459ba8a82a9fb..ff6f31a9363bc 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Items.php @@ -78,7 +78,7 @@ public function getPrice(InjectableFixture $product) $valueKey = $checkoutOption['value']; $attributeName = $attributesData[$titleKey]['frontend_label']; $optionLabel = $attributesData[$titleKey]['options'][$valueKey]['label']; - $optionsDetails[] = "{$attributeName} {$optionLabel}"; + $optionsDetails[] = "{$attributeName}{$optionLabel}"; $matrixKey[] = "{$titleKey}:{$valueKey}"; $optionsPrice += $attributesData[$titleKey]['options'][$valueKey]['pricing_value']; @@ -86,7 +86,7 @@ public function getPrice(InjectableFixture $product) $optionsDetails = implode(' ', $optionsDetails); $matrixKey = implode(' ', $matrixKey); - $productDisplay = $productName . ' SKU: ' . $matrix[$matrixKey]['sku'] . ' ' . $optionsDetails; + $productDisplay = $productName . 'SKU: ' . $matrix[$matrixKey]['sku'] . $optionsDetails; } else { $productDisplay = $productName . 'SKU: ' . $product->getSku(); } From 27d5cfa8076b35225159fbcbda9d330fb1da7e3e Mon Sep 17 00:00:00 2001 From: Dmytro Aponasenko Date: Thu, 19 Feb 2015 13:20:24 +0200 Subject: [PATCH 50/50] MTA-1602: Sync qmt repository with mainline - Sprint 6 --- .../Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php | 3 ++- .../Bundle/Test/TestCase/CreateBundleProductEntityTest.xml | 3 ++- .../Test/Block/Adminhtml/Product/Edit/Tab/Options.php | 4 ++++ .../Magento/Catalog/Test/Constraint/AssertProductInCart.php | 2 ++ .../Test/Fixture/CatalogProductSimple/CategoryIds.php | 2 ++ .../Magento/CatalogRule/Test/Handler/CatalogRule/Curl.php | 5 ++--- .../CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php | 1 + .../Magento/Checkout/Test/TestStep/ProceedToCheckoutStep.php | 1 + .../Test/Constraint/AssertTermOnCheckout.php | 2 ++ .../Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php | 4 ++++ .../Test/Fixture/DownloadableProduct/CheckoutData.php | 3 ++- 11 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php index 200d32b0b8f6c..3535ce3d0286b 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php @@ -11,7 +11,6 @@ use Magento\Mtf\Util\Protocol\CurlTransport; /** - * Class FrontendDecorator * Curl transport on frontend */ class FrontendDecorator implements CurlInterface @@ -117,6 +116,8 @@ protected function initCookies() * @param array $headers * @param array $params * @return void + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function write($method, $url, $httpVer = '1.1', $headers = [], $params = []) { diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index 64a23137b0a26..0f42b3c33167c 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -209,7 +209,8 @@ - Create offline fixed bundle + Bug: MAGETWO-33071 + Create fixed bundle which is out of stock bundle-product-%isolation% BundleProduct %isolation% Fixed diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php index 9219f363b747a..abf37ac38b7bc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php @@ -59,6 +59,8 @@ class Options extends Tab * @param array $fields * @param SimpleElement|null $element * @return $this + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function fillFormTab(array $fields, SimpleElement $element = null) { @@ -139,6 +141,8 @@ protected function getSearchGridBlock() * @param array|null $fields * @param SimpleElement|null $element * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getDataFormTab($fields = null, SimpleElement $element = null) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php index 701e9a6fa02d1..2cbabd73cc997 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php @@ -54,6 +54,8 @@ public function processAssert( * @param FixtureInterface $product * @param CheckoutCart $checkoutCart * @return void + * + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function assertOnShoppingCart(FixtureInterface $product, CheckoutCart $checkoutCart) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php index 0e7cd3e00442d..7742361674d6f 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php @@ -35,6 +35,8 @@ class CategoryIds implements FixtureInterface * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function __construct( FixtureFactory $fixtureFactory, diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/Curl.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/Curl.php index 289364dd08294..1c6d9a58f8710 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/Curl.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Handler/CatalogRule/Curl.php @@ -159,11 +159,10 @@ public function getCategoryPriceRuleId(array $data) $response = $curl->read(); $curl->close(); - $pattern = '/class=\" col\-id col\-rule_id\W*>\W+(\d+)\W+<\/td>\W+\W+?' - . $data['name'] . '/siu'; + $pattern = '/col-rule_id\W*(\d+)<.td><[^<>]*?>' . $data['name'] . '/siu'; preg_match($pattern, $response, $matches); if (empty($matches)) { - throw new \Exception('Cannot find Category Price Rule id'); + throw new \Exception('Cannot find Catalog Price Rule id! Response: ' . $response); } return $matches[1]; diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php index 9307dfff97a03..b59e33dc259d2 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php @@ -47,6 +47,7 @@ public function processAssert(CatalogSearchIndex $indexPage, CatalogSearchQuery 'display_in_terms' => strtolower($searchTerm->getDisplayInTerms()), ]; + $filters = array_filter($filters); $grid->search($filters); unset($filters['store_id']); \PHPUnit_Framework_Assert::assertTrue( diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/ProceedToCheckoutStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/ProceedToCheckoutStep.php index 6fdee3ab31755..6ece955692d6e 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/ProceedToCheckoutStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/ProceedToCheckoutStep.php @@ -38,6 +38,7 @@ public function __construct(CheckoutCart $checkoutCart) */ public function run() { + $this->checkoutCart->open(); $this->checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout(); } } diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php index 68bb0c2b6e7ff..04443a98b5b6a 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php @@ -75,6 +75,8 @@ public function processAssert( $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCartButton(); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCart->open(); $checkoutCart->getCartBlock()->getOnepageLinkBlock()->proceedToCheckout(); $checkoutOnepage->getLoginBlock()->guestCheckout(); $checkoutOnepage->getLoginBlock()->clickContinue(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index 710bf66fbae4b..8165f2a35c7b2 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -88,6 +88,8 @@ class Config extends Tab * @param array $fields * @param SimpleElement|null $element * @return $this + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function fillFormTab(array $fields, SimpleElement $element = null) { @@ -182,6 +184,8 @@ public function getTemplateBlock() * @param array|null $fields * @param SimpleElement|null $element * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getDataFormTab($fields = null, SimpleElement $element = null) { diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php index df4a2deaa1625..a68a64dc05794 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php @@ -7,7 +7,6 @@ namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; /** - * Class CheckoutData * Data for fill product form on frontend * * Data keys: @@ -20,6 +19,8 @@ class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\Ch * * @param $name * @return array|null + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function getPreset($name) {