diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index ab4bd87728a6789a1b2ec6f575ccb1cf1ce8b45c..e2e3d4ad289ce347e9c3fade95d09f606d490ea5 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc10", + "magento/mtf": "1.0.0-rc11", "php": ">=5.4.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", diff --git a/dev/tests/functional/lib/Mtf/Util/Generate/Factory/AbstractFactory.php b/dev/tests/functional/lib/Mtf/Util/Generate/Factory/AbstractFactory.php index 9ff3fa478573038c63a8a31642916c41a5be6fbc..dae63661d8efb2c7033ca187d45a8ff820a72e41 100644 --- a/dev/tests/functional/lib/Mtf/Util/Generate/Factory/AbstractFactory.php +++ b/dev/tests/functional/lib/Mtf/Util/Generate/Factory/AbstractFactory.php @@ -161,7 +161,10 @@ abstract class AbstractFactory } else { $dirIterator = new \RegexIterator( new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($filePath, \FilesystemIterator::SKIP_DOTS) + new \RecursiveDirectoryIterator( + $filePath, + \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS + ) ), '/.php$/i' ); @@ -190,9 +193,10 @@ abstract class AbstractFactory { $filename = str_replace('\\', '/', $filename); - $classPath = str_replace(MTF_BP . '/' . $path . '/', '', $filename); - $classPath = str_replace('.php', '', $classPath); - $className = str_replace('/', '\\', $classPath); + $posTestsPath = strpos($filename, $path); + $posClassName = $posTestsPath + strlen($path); + $classPath = str_replace('.php', '', $filename); + $className = str_replace('/', '\\', substr($classPath, $posClassName)); $reflectionClass = new \ReflectionClass($className); if ($reflectionClass->isAbstract()) { diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index 3cfdfc5ccbdfebf2f355e672551726654d3dd077..e480294de2aa43cb4ab824f02de2f6a712a434a4 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -25,6 +25,7 @@ </arguments> </listener> <listener class="Mtf\System\Event\StateListener" /> + <listener class="Mtf\System\JUnit"/> </listeners> <php> @@ -38,6 +39,7 @@ <env name="log_directory" value="var/log" /> <env name="events_preset" value="base" /> <env name="module_whitelist" value="Magento_Install" /> + <env name="report_file_name" value="test-cases-report.xml"/> </php> </phpunit> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Tree.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Tree.php index 6402bd1873a0d6a36a0f1656cc9d0fecb43cba11..851892347af536d4c1759d6d59f8d8439582257e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Tree.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Tree.php @@ -121,9 +121,11 @@ class Tree extends Block protected function prepareFullCategoryPath(CatalogCategory $category) { $path = []; - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); + $parentCategory = $category->hasData('parent_id') + ? $category->getDataFieldConfig('parent_id')['source']->getParentCategory() + : null; - if ($parentCategory != null) { + if ($parentCategory !== null) { $path = $this->prepareFullCategoryPath($parentCategory); } return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogCategory/ParentId.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogCategory/ParentId.php index c8f66313c0802837d2b002f799b170fddd9effe8..01ba2f41397c821367660a6b5597057f9de876d0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogCategory/ParentId.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogCategory/ParentId.php @@ -38,7 +38,7 @@ class ParentId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data = []) { $this->params = $params; - if ($data['dataSet']) { + if (isset($data['dataSet']) && $data['dataSet'] !== '-') { $this->parentCategory = $fixtureFactory->createByCode('catalogCategory', ['dataSet' => $data['dataSet']]); if (!$this->parentCategory->hasData('id')) { $this->parentCategory->persist(); 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 6252e2454054cb0c40d640a3aa9bcd27449976cf..f3e9d14a6db51510344e73b3d79516ab33165a1f 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 @@ -1,6 +1,6 @@ "addCategory";"category/data/parent_id/dataSet";"category/data/name";"category/data/url_key";"category/data/is_active";"category/data/description";"category/data/meta_title";"category/data/include_in_menu";"category/data/display_mode";"category/data/landing_page";"category/data/is_anchor";"category/data/available_product_listing_config";"category/data/available_sort_by/sort_0";"category/data/available_sort_by/sort_1";"category/data/available_sort_by/sort_2";"category/data/default_product_listing_config";"category/data/default_sort_by";"category/data/use_config_price_range";"category/data/layered_navigation_price_step";"category/data/category_products_data/preset";"category/data/category_products/dataSet";"constraint" -"addRootCategory";"1";"RootCategory%isolation%";"RootCategory%isolation%";"Yes";"RootCategory Required ";"-";"-";"-";"-";"-";"No";"Position";"Name";"Price";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm" -"addRootCategory";"1";"RootCategory%isolation%";"RootCategory%isolation%";"Yes";"RootCategory All Fields ";"RootCategory Page Title";"Yes";"Static block and products";"Catalog Events Lister";"Yes";"No";"Position";"Name";"Price";"No";"Name";"No";"50";"-";"-";"assertCategorySaveMessage, assertCategoryForm" +"addRootCategory";"-";"RootCategory%isolation%";"RootCategory%isolation%";"Yes";"RootCategory Required ";"-";"-";"-";"-";"-";"No";"Position";"Name";"Price";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm" +"addRootCategory";"-";"RootCategory%isolation%";"RootCategory%isolation%";"Yes";"RootCategory All Fields ";"RootCategory Page Title";"Yes";"Static block and products";"Catalog Events Lister";"Yes";"No";"Position";"Name";"Price";"No";"Name";"No";"50";"-";"-";"assertCategorySaveMessage, assertCategoryForm" "addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Subcategory Required";"-";"-";"-";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage" "addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Subcategory For Anchor Subcategory";"-";"Yes";"-";"-";"No";"Yes";"-";"-";"-";"Yes";"-";"Yes";"-";"default";"catalogProductSimple::default,catalogProductSimple::default";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage, assertCategoryForAssignedProducts" "addSubcategory";"default_category";"Subcategory%isolation%";"Subcategory%isolation%";"Yes";"Anchor Subcategory All Fields";"Subcategory Page Title";"Yes";"Products only";"Catalog Events Lister";"Yes";"No";"Position";"Name";"Price";"No";"Price";"No";"50";"default";"catalogProductSimple::default,catalogProductSimple::default";"assertCategorySaveMessage, assertCategoryForm, assertCategoryPage, assertCategoryForAssignedProducts" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php index 03035ce728f1346e59ee891e27993f1f7782d0cc..bc0d8f4c5c5c02405076d41c8cbae89d131e6004 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php @@ -5,11 +5,12 @@ namespace Magento\CatalogSearch\Test\Constraint; +use Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery; use Magento\CatalogSearch\Test\Page\AdvancedResult; use Mtf\Constraint\AbstractConstraint; /** - * Class AssertCatalogSearchResult + * Assert search results. */ class AssertCatalogSearchResult extends AbstractConstraint { @@ -18,40 +19,31 @@ class AssertCatalogSearchResult extends AbstractConstraint /* end tags */ /** - * Assert that result page contains all products, according to search request, from fixture + * Assert that result page contains product, according to search request from fixture. * - * @param array $products + * @param CatalogSearchQuery $catalogSearch * @param AdvancedResult $resultPage * @return void */ - public function processAssert(array $products, AdvancedResult $resultPage) + public function processAssert(CatalogSearchQuery $catalogSearch, AdvancedResult $resultPage) { - $errors = []; - foreach ($products as $product) { - $name = $product->getName(); + $product = $catalogSearch->getDataFieldConfig('query_text')['source']->getProduct(); + $name = $product->getName(); + $isProductVisible = $resultPage->getListProductBlock()->isProductVisible($name); + while (!$isProductVisible && $resultPage->getBottomToolbar()->nextPage()) { $isProductVisible = $resultPage->getListProductBlock()->isProductVisible($name); - while (!$isProductVisible && $resultPage->getBottomToolbar()->nextPage()) { - $isProductVisible = $resultPage->getListProductBlock()->isProductVisible($name); - } - - if ($isProductVisible === false) { - $errors[] = '- ' . $name; - } } - \PHPUnit_Framework_Assert::assertTrue( - empty($errors), - 'Were not found the following products:' . implode("\n", $errors) - ); + \PHPUnit_Framework_Assert::assertTrue($isProductVisible, "A product with name '$name' was not found."); } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ public function toString() { - return 'All products have been successfully found.'; + return 'Searched product has been successfully found.'; } } diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertProductCanBeOpenedFromSearchResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertProductCanBeOpenedFromSearchResult.php new file mode 100644 index 0000000000000000000000000000000000000000..8363237b6ac44281e6e1c17427a45d7bd559e9b4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertProductCanBeOpenedFromSearchResult.php @@ -0,0 +1,60 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\CatalogSearch\Test\Constraint; + +use Mtf\Constraint\AbstractConstraint; +use Magento\CatalogSearch\Test\Page\AdvancedResult; +use Magento\Catalog\Test\Page\Product\CatalogProductView; +use Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery; + +/** + * Assert product can be opened from search results page. + */ +class AssertProductCanBeOpenedFromSearchResult extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + + /** + * Assert product can be opened from search results page. + * + * @param CatalogSearchQuery $catalogSearch + * @param AdvancedResult $resultPage + * @param CatalogProductView $catalogProductViewPage + * @return void + */ + public function processAssert( + CatalogSearchQuery $catalogSearch, + AdvancedResult $resultPage, + CatalogProductView $catalogProductViewPage + ) { + $product = $catalogSearch->getDataFieldConfig('query_text')['source']->getProduct(); + $productName = $product->getName(); + $isProductVisible = $resultPage->getListProductBlock()->isProductVisible($productName); + while (!$isProductVisible && $resultPage->getBottomToolbar()->nextPage()) { + $isProductVisible = $resultPage->getListProductBlock()->isProductVisible($productName); + } + \PHPUnit_Framework_Assert::assertTrue($isProductVisible, "A product with name $productName was not found."); + + $resultPage->getListProductBlock()->openProductViewPage($productName); + \PHPUnit_Framework_Assert::assertEquals( + $productName, + $catalogProductViewPage->getViewBlock()->getProductName(), + 'Wrong product page has been opened.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Product can be opened from search results page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.php index 6fa48c95845542276e6580055fbd968241ff6a94..a7cf9414dd9d514a2c8d0b08dd32a992871f70d9 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.php @@ -42,7 +42,7 @@ class CatalogSearchQuery extends InjectableFixture 'is_required' => '', 'default_value' => '', 'input' => '', - 'source' => 'Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery\SearchData', + 'source' => 'Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery\QueryText', ]; protected $num_results = [ diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php new file mode 100644 index 0000000000000000000000000000000000000000..e570c33fa10207b205a325dff1d4ca9dddb5744c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php @@ -0,0 +1,106 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery; + +use Mtf\Fixture\FixtureFactory; +use Mtf\Fixture\FixtureInterface; +use Mtf\Fixture\InjectableFixture; + +/** + * Data to search for. + * Possible templates: + * - {value} + * - {product}::{product_property_to_search} + * - {product}::{product_dataSet}::{product_property_to_search} + */ +class QueryText implements FixtureInterface +{ + /** + * Entity to search. + * + * @var InjectableFixture + */ + protected $product; + + /** + * Resource data. + * + * @var string + */ + protected $data; + + /** + * @constructor + * @param FixtureFactory $fixtureFactory + * @param array $params + * @param array $data + */ + public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) + { + $this->params = $params; + $explodeValue = explode('::', $data['value']); + if (!empty($explodeValue) && count($explodeValue) > 1) { + $fixtureCode = $explodeValue[0]; + $dataSet = isset($explodeValue[2]) ? $explodeValue[1] : ''; + $searchValue = isset($explodeValue[2]) ? $explodeValue[2] : $explodeValue[1]; + $this->product = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + if (!$this->product->hasData('id')) { + $this->product->persist(); + } + if ($this->product->hasData($searchValue)) { + $getProperty = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $searchValue))); + $this->data = $this->product->$getProperty(); + } else { + $this->data = $searchValue; + } + } else { + $this->data = strval($data['value']); + } + } + + /** + * Persist custom selections products. + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data. + * + * @param string|null $key + * @return string + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings. + * + * @return array + */ + public function getDataConfig() + { + return $this->params; + } + + /** + * Get product fixture to search. + * + * @return InjectableFixture + */ + public function getProduct() + { + return $this->product; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/SearchData.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/SearchData.php deleted file mode 100644 index ca125d27cd216060ade515298607425a4407246b..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/SearchData.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ - -namespace Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery; - -use Mtf\Fixture\FixtureFactory; -use Mtf\Fixture\FixtureInterface; - -/** - * Class SearchData - * Data to search for - */ -class SearchData implements FixtureInterface -{ - /** - * Resource data - * - * @var string - */ - protected $data; - - /** - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data - */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - $explodeValue = explode('::', $data['value']); - if (!empty($explodeValue) && count($explodeValue) > 1) { - /** @var FixtureInterface $fixture */ - $fixture = $fixtureFactory->createByCode($explodeValue[0]); - $fixture->persist(); - $this->data = $fixture->$explodeValue[1](); - } else { - $this->data = strval($data['value']); - } - } - - /** - * Persist custom selections products - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data - * - * @param string|null $key - * @return string - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php index ac620bd1c9ebc42d3a896fd652efc728c89a2418..c3f21df8d2fff9cdae48dd9fa3fa4167a76881a6 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php @@ -12,7 +12,6 @@ use Mtf\Fixture\FixtureFactory; use Mtf\TestCase\Injectable; /** - * Test Flow: * Preconditions: * 1. Two specific simple product is created(unique sku,name,short/full description, tax class) * @@ -29,7 +28,7 @@ use Mtf\TestCase\Injectable; class AdvancedSearchEntityTest extends Injectable { /** - * Prepare data + * Prepare data. * * @param FixtureFactory $fixtureFactory * @return array @@ -59,18 +58,14 @@ class AdvancedSearchEntityTest extends Injectable } /** - * Run test creation for advanced search entity + * Run test creation for advanced search entity. * - * @param array $products * @param CatalogProductSimple $productSearch * @param CmsIndex $cmsIndex * @param AdvancedSearch $searchPage * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function test( - array $products, CatalogProductSimple $productSearch, CmsIndex $cmsIndex, AdvancedSearch $searchPage 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 687344b622bc901679dd91d607507442b506046e..76eb2b4ead571fac5a047371e29598bc85b9240e 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,13 +1,14 @@ -"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" -"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;500;"assertAdvancedSearchProductsResult" -"Yes";"-";"abc";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" -"-";"Yes";"adc_123";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" -"Yes";"-";"-";"abc";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" -"Yes";"-";"-";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" -"Yes";"-";"-";"abc";"adc_full";"-";"-";"-";"assertAdvancedSearchProductsResult" -"-";"Yes";"-";"-";"dfj_full";"-";"-";"-";"assertAdvancedSearchProductsResult" -"Yes";"-";"-";"-";"-";"abc_short";"-";"-";"assertAdvancedSearchProductsResult" -"-";"-";"-";"-";"-";"dfj_short";"-";"-";"assertAdvancedSearchProductsResult" -"Yes";"-";"-";"-";"-";"-";50;50;"assertAdvancedSearchProductsResult" -"Yes";"Yes";"-";"-";"-";"-";"-";100;"assertAdvancedSearchProductsResult" -"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;50;"assertAdvancedSearchProductsResult" +"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" +"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";"" +"Search product in advanced search by partial sku";"Yes";"-";"-";"abc";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by partial sku and description";"Yes";"-";"-";"abc";"adc_full";"-";"-";"-";"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by description";"-";"Yes";"-";"-";"dfj_full";"-";"-";"-";"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by short description";"-";"-";"-";"-";"-";"dfj_short";"-";"-";"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by partial short description";"Yes";"-";"-";"-";"-";"abc_short";"-";"-";"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by price to";"Yes";"Yes";"-";"-";"-";"-";"-";100;"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by price from and price to";"Yes";"-";"-";"-";"-";"-";50;50;"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by name, sku, description, short description, price from and price to";"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;500;"assertAdvancedSearchProductsResult";"" +"Search product in advanced search by name, sku, description, short description, price from and price to";"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;50;"assertAdvancedSearchProductsResult";"" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchTest.php deleted file mode 100644 index fe1a12168297ba1b85be61a2ba5d073714769c03..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ - -namespace Magento\CatalogSearch\Test\TestCase; - -use Mtf\Factory\Factory; -use Mtf\TestCase\Functional; - -/** - * Class AdvancedSearchTest - * Searching product in the Frontend via advanced search - */ -class AdvancedSearchTest extends Functional -{ - /** - * Advanced search product on frontend by product name - * - * @ZephyrId MAGETWO-12421 - */ - public function testProductSearch() - { - //Data - $productFixture = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); - $productFixture->switchData('simple'); - $productFixture->persist(); - - //Pages - $homePage = Factory::getPageFactory()->getCmsIndexIndex(); - $advancedSearchPage = Factory::getPageFactory()->getCatalogsearchAdvanced(); - $advancedSearchResultPage = Factory::getPageFactory()->getCatalogsearchResult(); - - //Steps - $homePage->open(); - $homePage->getSearchBlock()->clickAdvancedSearchButton(); - $searchForm = $advancedSearchPage->getForm(); - $this->assertTrue($searchForm->isVisible(), '"Advanced Search" form is not opened'); - $searchForm->fillCustom($productFixture, ['name', 'sku']); - $searchForm->submit(); - - //Verifying - $productName = $productFixture->getName(); - $this->assertTrue( - $advancedSearchResultPage->getListProductBlock()->isProductVisible($productName), - sprintf('Product "%s" is not displayed on the "Catalog Advanced Search" results page."', $productName) - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c04b3e6d309f0c400a3bc1b4759bcd74c1a87cc6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.php @@ -0,0 +1,55 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\CatalogSearch\Test\TestCase; + +use Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery; +use Magento\Cms\Test\Page\CmsIndex; +use Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. All product types are created. + * + * Steps: + * 1. Navigate to frontend on index page. + * 2. Input test data into "search field" and press Enter key. + * 3. Perform all assertions. + * + * @group Search_Frontend_(MX) + * @ZephyrId MAGETWO-25095 + */ +class SearchEntityResultsTest extends Injectable +{ + /** + * CMS index page. + * + * @var CmsIndex + */ + protected $cmsIndex; + + /** + * Inject data. + * + * @param CmsIndex $cmsIndex + * @return void + */ + public function __inject(CmsIndex $cmsIndex) + { + $this->cmsIndex = $cmsIndex; + } + + /** + * Run searching result test. + * + * @param CatalogSearchQuery $catalogSearch + * @return void + */ + public function test(CatalogSearchQuery $catalogSearch) + { + $this->cmsIndex->open(); + $this->cmsIndex->getSearchBlock()->search($catalogSearch->getQueryText()); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..f6082080c2e9390765b784f9c8a79b38d93702ec --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest/test.csv @@ -0,0 +1,9 @@ +"description";"catalogSearch/data/query_text/value";"constraint";"tag" +"MAGETWO-12420: Use Quick Search to Find the Product";"catalogProductSimple::default::sku";"assertProductCanBeOpenedFromSearchResult";"bamboo_plan:BAT" +"Search simple product";"catalogProductSimple::default::simple";"assertCatalogSearchResult";"" +"Search virtual product";"catalogProductVirtual::default::virtual";"assertCatalogSearchResult";"" +"Search configurable product";"configurableProductInjectable::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";"" +"Search fixed product";"bundleProduct::bundle_fixed_product::bundle";"assertCatalogSearchResult";"" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest/testSearch.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest/testSearch.csv index 2843f836b276b7fea1c7f38e2c123f88dc6e690c..73e196ce0a25fdd302e0da27117a2a477cb3dde8 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest/testSearch.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest/testSearch.csv @@ -1,3 +1,3 @@ "catalogSearch/data/query_text/value";"catalogSearch/data/num_results";"constraint" -"catalogProductSimple::getName";"-";"assertSuggestSearchingResult" -"catalogProductSimple::getSku";"1";"assertSuggestSearchingResult" +"catalogProductSimple::name";"-";"assertSuggestSearchingResult" +"catalogProductSimple::sku";"1";"assertSuggestSearchingResult" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml index 5cb45afd90ea77991357b5d953997be6fa4135c3..f55277251d871dd12404a13139f51ecaed466029 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml @@ -119,4 +119,12 @@ <browser class="Mtf\Client\Browser" /> </require> </assertSearchSynonymMassActionNotOnFrontend> + <assertProductCanBeOpenedFromSearchResult module="Magento_CatalogSearch"> + <severity>high</severity> + <require> + <catalogSearch class="Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery" /> + <resultPage class="Magento\CatalogSearch\Test\Page\AdvancedResult" /> + <catalogProductViewPage class="Magento\Catalog\Test\Page\Product\CatalogProductView" /> + </require> + </assertProductCanBeOpenedFromSearchResult> </constraint> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php index 4c6ea9e268ee9db9a0d18ffbe8a111a259016406..daea7ea002c6e50fa49508da10e1e9626053674b 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php @@ -39,6 +39,10 @@ class AssertConfigurableProductDuplicateForm extends AssertConfigurableProductFo $productData = $product->getData(); $productData['sku'] = $duplicateProductSku; $productData['status'] = 'Product offline'; + if (isset($compareData['quantity_and_stock_status']['qty'])) { + $compareData['quantity_and_stock_status']['qty'] = ''; + $compareData['quantity_and_stock_status']['is_in_stock'] = 'Out of Stock'; + } $fixtureData = $this->prepareFixtureData($productData, $this->sortFields); $formData = $this->prepareFormData($productPage->getProductForm()->getData($product), $this->sortFields); $error = $this->verifyData($fixtureData, $formData); 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 index 47b35a7511a615f8810f922c99bd89bd59a39832..3474c0f0765579785c96ca5c4230a936514b227e 100644 --- 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 @@ -1,6 +1,6 @@ "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" "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";"3/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" "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/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv index 649c9f7842c9fb4907ab8250ac9f4dc6f7e9d388..457306867243d367f992b907b83d97a5868739ee 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";1/8/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";1/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";"" +"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/Install/Test/Block/CreateAdmin.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php new file mode 100644 index 0000000000000000000000000000000000000000..cd025b734f794d319f7c80df777057c6890d16bf --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php @@ -0,0 +1,32 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Form; +use Mtf\Client\Element\Locator; + +/** + * Create Admin Account block. + */ +class CreateAdmin extends Form +{ + /** + * 'Next' button. + * + * @var string + */ + protected $next = "[ng-click*='next']"; + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml new file mode 100644 index 0000000000000000000000000000000000000000..87f9389c51434d6bcb9462412788f45ed2f7f6c0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<mapping strict="0"> + <fields> + <username> + <selector>[name='adminUsername']</selector> + </username> + <email> + <selector>[name='adminEmail']</selector> + </email> + <password> + <selector>[name='adminPassword']</selector> + </password> + <password_confirmation> + <selector>[name='adminConfirm']</selector> + </password_confirmation> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php new file mode 100644 index 0000000000000000000000000000000000000000..af5707450b52e1cd068fc331b09a49ba9364a6ea --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php @@ -0,0 +1,32 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Form; +use Mtf\Client\Element\Locator; + +/** + * Customize Your Store block. + */ +class CustomizeStore extends Form +{ + /** + * 'Next' button. + * + * @var string + */ + protected $next = "[ng-click*='next']"; + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml new file mode 100644 index 0000000000000000000000000000000000000000..afca361627a82e77d04da2a9c2c9102eadb5688b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<mapping strict="0"> + <fields> + <currency> + <selector>[ng-model*='currency']</selector> + <input>select</input> + </currency> + <language> + <selector>[ng-model*='language']</selector> + <input>select</input> + </language> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php new file mode 100644 index 0000000000000000000000000000000000000000..8d5919a7ec93110c43152846098ac179c9353606 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php @@ -0,0 +1,49 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Form; +use Mtf\Client\Element\Locator; + +/** + * Database form. + */ +class Database extends Form +{ + /** + * 'Test connection successful.' message. + * + * @var string + */ + protected $successConnectionMessage = ".text-success"; + + /** + * 'Next' button. + * + * @var string + */ + protected $next = "[ng-click*='testConnection']"; + + /** + * Get 'Test connection successful.' message. + * + * @return string + */ + public function getSuccessConnectionMessage() + { + return $this->_rootElement->find($this->successConnectionMessage, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.xml new file mode 100644 index 0000000000000000000000000000000000000000..c09b95b5d282e8b04a12137f7c2921ebd7cb7e11 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<mapping strict="0"> + <fields> + <dbHost /> + <dbUser /> + <dbPassword /> + <dbName> + <selector>[name="dbname"]</selector> + </dbName> + <dbTablePrefix /> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php new file mode 100644 index 0000000000000000000000000000000000000000..8df7ca8d6c0c288cfd25b9e7d84a843d82207a3e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php @@ -0,0 +1,100 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Block; +use Mtf\Client\Element\Locator; + +/** + * Install block. + */ +class Install extends Block +{ + /** + * 'Install Now' button. + * + * @var string + */ + protected $installNow = "//*[@ng-show='!isStarted']/button"; + + /** + * Admin info block. + * + * @var string + */ + protected $adminInfo = "//*[@id='admin-info']"; + + /** + * Database info block. + * + * @var string + */ + protected $dbInfo = "//*[@id='db-info']"; + + /** + * 'Launch Magento Admin' button. + * + * @var string + */ + protected $launchAdmin = "//*[@type='button']"; + + /** + * Click on 'Install Now' button. + * + * @return void + */ + public function clickInstallNow() + { + $this->_rootElement->find($this->installNow, Locator::SELECTOR_XPATH)->click(); + $this->waitForElementVisible($this->launchAdmin, Locator::SELECTOR_XPATH); + } + + /** + * Get admin info. + * + * @return string + */ + public function getAdminInfo() + { + $adminData = []; + $rows = $this->_rootElement->find('#admin-info .row')->getElements(); + foreach ($rows as $row) { + $dataRow = $row->find('div')->getElements(); + $key = strtolower(str_replace(' ', '_', str_replace(':', '', $dataRow[0]->getText()))); + $adminData[$key] = $dataRow[1]->getText(); + } + + return $adminData; + } + + /** + * Get database info. + * + * @return string + */ + public function getDbInfo() + { + $dbData = []; + $rows = $this->_rootElement->find('#db-info .row')->getElements(); + foreach ($rows as $row) { + $dataRow = $row->find('div')->getElements(); + $key = strtolower(str_replace(' ', '_', str_replace(':', '', $dataRow[0]->getText()))); + $dbData[$key] = $dataRow[1]->getText(); + } + + return $dbData; + } + + /** + * Click on 'Launch Magento Admin' button. + * + * @return void + */ + public function clickLaunchAdmin() + { + $this->_rootElement->find($this->launchAdmin, Locator::SELECTOR_XPATH)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Landing.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Landing.php new file mode 100644 index 0000000000000000000000000000000000000000..75085d53c750703e95145647ba1298777a539730 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Landing.php @@ -0,0 +1,49 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Block; +use Mtf\Client\Element\Locator; + +/** + * Landing block. + */ +class Landing extends Block +{ + /** + * 'Agree and Set up Magento' button. + * + * @var string + */ + protected $agreeAndSetup = '.btn-lg.btn-primary'; + + /** + * 'Terms & Agreement' link. + * + * @var string + */ + protected $termsAndAgreement = "[ng-click*='previous']"; + + /** + * Click on 'Agree and Set up Magento' button. + * + * @return void + */ + public function clickAgreeAndSetup() + { + $this->_rootElement->find($this->agreeAndSetup, Locator::SELECTOR_CSS)->click(); + } + + /** + * Click on 'Terms & Agreement' link. + * + * @return void + */ + public function clickTermsAndAgreement() + { + $this->_rootElement->find($this->termsAndAgreement, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/License.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/License.php new file mode 100644 index 0000000000000000000000000000000000000000..83f59f7159d4d81dd0c891877268ed9bbd52ad77 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/License.php @@ -0,0 +1,49 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Block; +use Mtf\Client\Element\Locator; + +/** + * License block. + */ +class License extends Block +{ + /** + * 'Back' button. + * + * @var string + */ + protected $back = '.btn.btn-primary'; + + /** + * License text. + * + * @var string + */ + protected $license = '.container.ng-scope'; + + /** + * Click on 'Back' button. + * + * @return void + */ + public function clickBack() + { + $this->_rootElement->find($this->back, Locator::SELECTOR_CSS)->click(); + } + + /** + * Get license text. + * + * @return string + */ + public function getLicense() + { + return $this->_rootElement->find($this->license, Locator::SELECTOR_CSS)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Readiness.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Readiness.php new file mode 100644 index 0000000000000000000000000000000000000000..72fcfcb1aa26ae7139e77972307a9f5373642201 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Readiness.php @@ -0,0 +1,108 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Block; +use Mtf\Client\Element\Locator; + +/** + * Readiness block. + */ +class Readiness extends Block +{ + /** + * 'Start Readiness Check' button. + * + * @var string + */ + protected $readinessCheck = "[ng-click*='state.go']"; + + /** + * 'Next' button. + * + * @var string + */ + protected $next = "[ng-click*='next']"; + + /** + * 'Completed!' message. + * [ng-switch-when="true"] + * @var string + */ + protected $completedMessage = '[ng-switch-when="true"]'; + + /** + * PHP Version successful check. + * + * @var string + */ + protected $phpVersionCheck = '#php-version'; + + /** + * PHP Extensions successful check. + * + * @var string + */ + protected $phpExtensionCheck = '#php-extensions'; + + /** + * File Permission check. + * + * @var string + */ + protected $filePermissionCheck = '#php-permissions'; + + /** + * Click on 'Start Readiness Check' button. + * + * @return void + */ + public function clickReadinessCheck() + { + $this->_rootElement->find($this->readinessCheck, Locator::SELECTOR_CSS)->click(); + $this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS); + } + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } + + /** + * Get File Permissions check result. + * + * @return string + */ + public function getFilePermissionCheck() + { + return $this->_rootElement->find($this->filePermissionCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get PHP Version check result. + * + * @return string + */ + public function getPhpVersionCheck() + { + return $this->_rootElement->find($this->phpVersionCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get PHP Extensions check result. + * + * @return string + */ + public function getPhpExtensionsCheck() + { + return $this->_rootElement->find($this->phpExtensionCheck, Locator::SELECTOR_CSS)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php new file mode 100644 index 0000000000000000000000000000000000000000..08ca27d4d6f98ef8bfc77dd58c810a0162281454 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php @@ -0,0 +1,48 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Block; + +use Mtf\Block\Form; + +/** + * Web configuration block. + */ +class WebConfiguration extends Form +{ + /** + * 'Next' button. + * + * @var string + */ + protected $next = "[ng-click*='next']"; + + /** + * 'Advanced Options' locator. + * + * @var string + */ + protected $advancedOptions = "[ng-click*='advanced']"; + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next)->click(); + } + + /** + * Click on 'Advanced Options' button. + * + * @return void + */ + public function clickAdvancedOptions() + { + $this->_rootElement->find($this->advancedOptions)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml new file mode 100644 index 0000000000000000000000000000000000000000..06cdb68f1bc0a0660c2075b23acc1045f03baca8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<mapping strict="0"> + <fields> + <web /> + <admin /> + <keyOwn> + <selector>[value="user"]</selector> + <input>checkbox</input> + </keyOwn> + <keyValue> + <selector>[name="key"]</selector> + </keyValue> + <apacheRewrites> + <selector>[ng-model*="rewrites"]</selector> + <input>checkbox</input> + </apacheRewrites> + <httpsFront> + <selector>[ng-model*="front"]</selector> + <input>checkbox</input> + </httpsFront> + <https /> + <httpsAdmin> + <selector>[type="checkbox"][ng-model*="admin"]</selector> + <input>checkbox</input> + </httpsAdmin> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php new file mode 100644 index 0000000000000000000000000000000000000000..673956def75bf25d20720abe50d65336081fcf04 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php @@ -0,0 +1,49 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Magento\Install\Test\Page\Install; +use Mtf\Constraint\AbstractConstraint; + +/** + * Check that agreement text present on Terms & Agreement page during install. + */ +class AssertAgreementTextPresent extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Part of license agreement text. + */ + const LICENSE_AGREEMENT_TEXT = 'Open Software License ("OSL") v. 3.0'; + + /** + * Assert that part of license agreement text is present on Terms & Agreement page. + * + * @param Install $installPage + * @return void + */ + public function processAssert(Install $installPage) + { + \PHPUnit_Framework_Assert::assertContains( + self::LICENSE_AGREEMENT_TEXT, + $installPage->getLicenseBlock()->getLicense(), + 'License agreement text is absent.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "License agreement text is present on Terms & Agreement page."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertCurrencySelected.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertCurrencySelected.php new file mode 100644 index 0000000000000000000000000000000000000000..b2da3668ba26f38effa9ffca1691caee2b0a359a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertCurrencySelected.php @@ -0,0 +1,44 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Mtf\Constraint\AbstractConstraint; + +/** + * Assert that selected currency symbol displays in admin. + */ +class AssertCurrencySelected extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Assert that selected currency symbol displays on dashboard. + * + * @param string $currencySymbol + * @param Dashboard $dashboardPage + * @return void + */ + public function processAssert($currencySymbol, Dashboard $dashboardPage) + { + \PHPUnit_Framework_Assert::assertTrue( + strpos($dashboardPage->getMainBlock()->getRevenuePrice(), $currencySymbol) !== false, + 'Selected currency symbol not displays on dashboard.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Selected currency displays in admin.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertKeyCreated.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertKeyCreated.php new file mode 100644 index 0000000000000000000000000000000000000000..13cd5642be416b2d691d019eb7ef1bbfeca64929 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertKeyCreated.php @@ -0,0 +1,46 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Mtf\Constraint\AbstractConstraint; +use Magento\Install\Test\Page\Install; +use Magento\Install\Test\Fixture\Install as InstallConfig; + +/** + * Assert that selected encryption key displays on success full install page. + */ +class AssertKeyCreated extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Assert that selected encryption key displays on success full install page. + * + * @param Install $installPage + * @param InstallConfig $installConfig + * @return void + */ + public function processAssert(Install $installPage, InstallConfig $installConfig) + { + \PHPUnit_Framework_Assert::assertEquals( + $installConfig->getKeyValue(), + $installPage->getInstallBlock()->getAdminInfo()['encryption_key'], + 'Selected encryption key on install page not equals to data from fixture.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Selected encryption key displays on success full install page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertLanguageSelected.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertLanguageSelected.php new file mode 100644 index 0000000000000000000000000000000000000000..177673c0adb935bba5311d02521377b7d1f28f64 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertLanguageSelected.php @@ -0,0 +1,45 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Magento\Cms\Test\Page\CmsIndex; +use Mtf\Constraint\AbstractConstraint; + +/** + * Assert that selected language currently displays on frontend. + */ +class AssertLanguageSelected extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Assert that selected language currently displays on frontend. + * + * @param string $languageTemplate + * @param CmsIndex $indexPage + * @return void + */ + public function processAssert($languageTemplate, CmsIndex $indexPage) + { + $indexPage->open(); + \PHPUnit_Framework_Assert::assertTrue( + $indexPage->getLinksBlock()->isLinkVisible($languageTemplate), + 'Selected language not displays on frontend.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Selected language currently displays on frontend.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertRewritesEnabled.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertRewritesEnabled.php new file mode 100644 index 0000000000000000000000000000000000000000..c9db0e7d4a2874f9366368c6762e6ecf76db2e3f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertRewritesEnabled.php @@ -0,0 +1,50 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Magento\Cms\Test\Page\CmsIndex; +use Mtf\Constraint\AbstractConstraint; +use Mtf\Client\Driver\Selenium\Browser; +use Magento\Catalog\Test\Fixture\CatalogCategory; + +/** + * Assert that apache redirect correct works. + */ +class AssertRewritesEnabled extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Assert that apache redirect works by opening category page and asserting index.php in its url + * + * @param CatalogCategory $category + * @param CmsIndex $homePage + * @param Browser $browser + */ + public function processAssert(CatalogCategory $category, CmsIndex $homePage, Browser $browser) + { + $category->persist(); + $homePage->open(); + $homePage->getTopmenu()->selectCategoryByName($category->getName()); + + \PHPUnit_Framework_Assert::assertTrue( + strpos($browser->getUrl(), 'index.php') === false, + 'Apache redirect for category does not work.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Apache redirect works correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSecureUrlEnabled.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSecureUrlEnabled.php new file mode 100644 index 0000000000000000000000000000000000000000..2397ad0103ecd8689a7cb7f74f21b6149eb93313 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSecureUrlEnabled.php @@ -0,0 +1,57 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Mtf\Client\Browser; +use Mtf\Constraint\AbstractConstraint; +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Magento\Customer\Test\Page\CustomerAccountLogin; + +/** + * Assert that Secure Urls Enabled. + */ +class AssertSecureUrlEnabled extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Assert that Secure Urls Enabled. + * + * @param Browser $browser + * @param Dashboard $dashboard + * @param CustomerAccountLogin $customerAccountLogin + * @return void + */ + public function processAssert( + Browser $browser, + Dashboard $dashboard, + CustomerAccountLogin $customerAccountLogin + ) { + $dashboard->open(); + \PHPUnit_Framework_Assert::assertTrue( + strpos($browser->getUrl(), 'https://') !== false, + 'Secure Url is not displayed on backend.' + ); + + $customerAccountLogin->open(); + \PHPUnit_Framework_Assert::assertTrue( + strpos($browser->getUrl(), 'https://') !== false, + 'Secure Url is not displayed on frontend.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Secure Urls are displayed successful.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php new file mode 100644 index 0000000000000000000000000000000000000000..47df11f0aaceae2a9cce48658aaa04eb68390c3f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php @@ -0,0 +1,85 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Magento\User\Test\Fixture\User; +use Magento\Install\Test\Page\Install; +use Mtf\Constraint\AbstractConstraint; +use Magento\Install\Test\Fixture\Install as InstallConfig; + +/** + * Check that Magento successfully installed. + */ +class AssertSuccessInstall extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + + /** + * Admin info fields mapping. + * + * @var array + */ + protected $adminFieldsList = [ + ['pageData' => 'username', 'fixture' => 'username'], + ['pageData' => 'e-mail', 'fixture' => 'email'], + ['pageData' => 'your_store_address', 'fixture' => 'web'], + ['pageData' => 'magento_admin_address', 'fixture' => 'admin'] + ]; + + /** + * Database info fields mapping. + * + * @var array + */ + protected $dbFieldsList = [ + ['pageData' => 'database_name', 'fixture' => 'dbName'], + ['pageData' => 'username', 'fixture' => 'dbUser'] + ]; + + /** + * Assert that Magento successfully installed. + * + * @param InstallConfig $installConfig + * @param User $user + * @param Install $installPage + * @return void + */ + public function processAssert(Install $installPage, InstallConfig $installConfig, User $user) + { + $adminData = $installPage->getInstallBlock()->getAdminInfo(); + $dbData = $installPage->getInstallBlock()->getDbInfo(); + + $allData = array_merge($user->getData(), $installConfig->getData()); + $allData['admin'] = $allData['web'] . $allData['admin'] . '/'; + + foreach ($this->adminFieldsList as $field) { + \PHPUnit_Framework_Assert::assertEquals( + $allData[$field['fixture']], + $adminData[$field['pageData']], + 'Wrong admin information is displayed.' + ); + } + foreach ($this->dbFieldsList as $field) { + \PHPUnit_Framework_Assert::assertEquals( + $allData[$field['fixture']], + $dbData[$field['pageData']], + 'Wrong database information is displayed.' + ); + } + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Install successfully finished."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessfulReadinessCheck.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessfulReadinessCheck.php new file mode 100644 index 0000000000000000000000000000000000000000..de613def6e2c97c098a038eca938a8c16e527d90 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessfulReadinessCheck.php @@ -0,0 +1,69 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Constraint; + +use Magento\Install\Test\Page\Install; +use Mtf\Constraint\AbstractConstraint; + +/** + * Check that PHP Version, PHP Extensions and File Permission are ok. + */ +class AssertSuccessfulReadinessCheck extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + + /** + * PHP version message. + */ + const PHP_VERSION_MESSAGE = 'Your PHP version is correct'; + + /** + * PHP extensions message. + */ + const PHP_EXTENSIONS_MESSAGE = 'You meet 9 out of 9 PHP extensions requirements.'; + + /** + * File permission message. + */ + const FILE_PERMISSION_MESSAGE = 'You meet 4 out of 4 writable file permission requirements.'; + + /** + * Assert that PHP Version, PHP Extensions and File Permission are ok. + * + * @param Install $installPage + * @return void + */ + public function processAssert(Install $installPage) + { + \PHPUnit_Framework_Assert::assertContains( + self::PHP_VERSION_MESSAGE, + $installPage->getReadinessBlock()->getPhpVersionCheck(), + 'PHP version is incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::PHP_EXTENSIONS_MESSAGE, + $installPage->getReadinessBlock()->getPhpExtensionsCheck(), + 'PHP extensions missed.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::FILE_PERMISSION_MESSAGE, + $installPage->getReadinessBlock()->getFilePermissionCheck(), + 'File permissions does not meet requirements.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "PHP Version, PHP Extensions and File Permission are ok."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.php b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.php new file mode 100644 index 0000000000000000000000000000000000000000..deec331975f74321f5298d7f51ba341041074981 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.php @@ -0,0 +1,219 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\Fixture; + +use Mtf\Fixture\InjectableFixture; + +/** + * Class Install + * + * @SuppressWarnings(PHPMD.TooManyFields) + */ +class Install extends InjectableFixture +{ + /** + * @var string + */ + protected $repositoryClass = 'Magento\Install\Test\Repository\Install'; + + /** + * @var string + */ + protected $handlerInterface = 'Magento\Install\Test\Handler\Install\InstallInterface'; + + protected $defaultDataSet = [ + ]; + + protected $dbHost = [ + 'attribute_code' => 'dbHost', + 'backend_type' => 'virtual', + ]; + + protected $dbUser = [ + 'attribute_code' => 'dbUser', + 'backend_type' => 'virtual', + ]; + + protected $dbPassword = [ + 'attribute_code' => 'dbPassword', + 'backend_type' => 'virtual', + ]; + + protected $dbName = [ + 'attribute_code' => 'dbName', + 'backend_type' => 'virtual', + ]; + + protected $web = [ + 'attribute_code' => 'web', + 'backend_type' => 'virtual', + ]; + + protected $admin = [ + 'attribute_code' => 'admin', + 'backend_type' => 'virtual', + ]; + + protected $adminUsername = [ + 'attribute_code' => 'adminUsername', + 'backend_type' => 'virtual', + ]; + + protected $adminEmail = [ + 'attribute_code' => 'adminEmail', + 'backend_type' => 'virtual', + ]; + + protected $adminPassword = [ + 'attribute_code' => 'adminPassword', + 'backend_type' => 'virtual', + ]; + + protected $adminConfirm = [ + 'attribute_code' => 'adminConfirm', + 'backend_type' => 'virtual', + ]; + + protected $apacheRewrites = [ + 'attribute_code' => 'apacheRewrites', + 'backend_type' => 'virtual', + ]; + + protected $dbTablePrefix = [ + 'attribute_code' => 'dbTablePrefix', + 'backend_type' => 'virtual', + ]; + + protected $keyOwn = [ + 'attribute_code' => 'keyOwn', + 'backend_type' => 'virtual', + ]; + + protected $httpsAdmin = [ + 'attribute_code' => 'httpsAdmin', + 'backend_type' => 'virtual', + ]; + + protected $https = [ + 'attribute_code' => 'https', + 'backend_type' => 'virtual', + ]; + + protected $httpsFront = [ + 'attribute_code' => 'httpsFront', + 'backend_type' => 'virtual', + ]; + + protected $keyValue = [ + 'attribute_code' => 'keyValue', + 'backend_type' => 'virtual', + ]; + + protected $language = [ + 'attribute_code' => 'language', + 'backend_type' => 'virtual', + ]; + + protected $currency = [ + 'attribute_code' => 'language', + 'backend_type' => 'virtual', + ]; + + public function getDbHost() + { + return $this->getData('dbHost'); + } + + public function getDbUser() + { + return $this->getData('dbUser'); + } + + public function getDbPassword() + { + return $this->getData('dbPassword'); + } + + public function getDbName() + { + return $this->getData('dbName'); + } + + public function getWeb() + { + return $this->getData('web'); + } + + public function getAdmin() + { + return $this->getData('admin'); + } + + public function getAdminUsername() + { + return $this->getData('adminUsername'); + } + + public function getAdminEmail() + { + return $this->getData('adminEmail'); + } + + public function getAdminPassword() + { + return $this->getData('adminPassword'); + } + + public function getAdminConfirm() + { + return $this->getData('adminConfirm'); + } + + public function getCurrency() + { + return $this->getData('currency'); + } + + public function getApacheRewrites() + { + return $this->getData('apacheRewrites'); + } + + public function getKeyOwn() + { + return $this->getData('keyOwn'); + } + + public function getKeyValue() + { + return $this->getData('keyValue'); + } + + public function getLanguage() + { + return $this->getData('language'); + } + + public function getHttpsAdmin() + { + return $this->getData('httpsAdmin'); + } + + public function getHttps() + { + return $this->getData('https'); + } + + public function getHttpsFront() + { + return $this->getData('httpsFront'); + } + + public function getDbTablePrefix() + { + return $this->getData('dbTablePrefix'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml new file mode 100644 index 0000000000000000000000000000000000000000..fffac95c703866547a075593e603d4f506fd3ae1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<fixture class="Magento\Install\Test\Fixture\Install"> + <module>Magento_Install</module> + <type>virtual</type> + <entity_type>install</entity_type> + <fields> + <dbHost> + <attribute_code>dbHost</attribute_code> + <backend_type>virtual</backend_type> + </dbHost> + <dbUser> + <attribute_code>dbUser</attribute_code> + <backend_type>virtual</backend_type> + </dbUser> + <dbTablePrefix> + <attribute_code>dbTablePrefix</attribute_code> + <backend_type>virtual</backend_type> + </dbTablePrefix> + <dbPassword> + <attribute_code>dbPassword</attribute_code> + <backend_type>virtual</backend_type> + </dbPassword> + <dbName> + <attribute_code>dbname</attribute_code> + <backend_type>virtual</backend_type> + </dbName> + <web> + <attribute_code>web</attribute_code> + <backend_type>virtual</backend_type> + </web> + <dbTablePrefix> + <attribute_code>dbTablePrefix</attribute_code> + <backend_type>virtual</backend_type> + </dbTablePrefix> + <admin> + <attribute_code>admin</attribute_code> + <backend_type>virtual</backend_type> + </admin> + <httpsFront> + <attribute_code>httpsFront</attribute_code> + <backend_type>virtual</backend_type> + </httpsFront> + <https> + <attribute_code>https</attribute_code> + <backend_type>virtual</backend_type> + </https> + <httpsAdmin> + <attribute_code>httpsAdmin</attribute_code> + <backend_type>virtual</backend_type> + </httpsAdmin> + <apacheRewrites> + <attribute_code>apacheRewrites</attribute_code> + <backend_type>virtual</backend_type> + </apacheRewrites> + <keyOwn> + <attribute_code>keyOwn</attribute_code> + <backend_type>virtual</backend_type> + </keyOwn> + <keyValue> + <attribute_code>keyValue</attribute_code> + <backend_type>virtual</backend_type> + </keyValue> + <language> + <attribute_code>language</attribute_code> + <backend_type>virtual</backend_type> + </language> + <currency> + <attribute_code>currency</attribute_code> + <backend_type>virtual</backend_type> + </currency> + </fields> + <repository_class>Magento\Install\Test\Repository\Install</repository_class> + <handler_interface>Magento\Install\Test\Handler\Install\InstallInterface</handler_interface> +</fixture> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Page/Install.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Page/Install.xml new file mode 100644 index 0000000000000000000000000000000000000000..06f3b3a33b408c248a9865b82450d367765eeee3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Page/Install.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<page mca="setup/" module="Magento_Install"> + <blocks> + <landingBlock> + <class>Magento\Install\Test\Block\Landing</class> + <locator>body</locator> + <strategy>css selector</strategy> + </landingBlock> + <licenseBlock> + <class>Magento\Install\Test\Block\License</class> + <locator>body</locator> + <strategy>css selector</strategy> + </licenseBlock> + <readinessBlock> + <class>Magento\Install\Test\Block\Readiness</class> + <locator>body</locator> + <strategy>css selector</strategy> + </readinessBlock> + <databaseBlock> + <class>Magento\Install\Test\Block\Database</class> + <locator>body</locator> + <strategy>css selector</strategy> + </databaseBlock> + <webConfigBlock> + <class>Magento\Install\Test\Block\WebConfiguration</class> + <locator>body</locator> + <strategy>css selector</strategy> + </webConfigBlock> + <customizeStoreBlock> + <class>Magento\Install\Test\Block\CustomizeStore</class> + <locator>body</locator> + <strategy>css selector</strategy> + </customizeStoreBlock> + <createAdminBlock> + <class>Magento\Install\Test\Block\CreateAdmin</class> + <locator>body</locator> + <strategy>css selector</strategy> + </createAdminBlock> + <installBlock> + <class>Magento\Install\Test\Block\Install</class> + <locator>body</locator> + <strategy>css selector</strategy> + </installBlock> + </blocks> +</page> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php new file mode 100644 index 0000000000000000000000000000000000000000..2aa869b7750465d27fec6a260e88256f2e320a8a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php @@ -0,0 +1,148 @@ +<?php +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ + +namespace Magento\Install\Test\TestCase; + +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Install\Test\Page\Install; +use Magento\Install\Test\Fixture\Install as InstallConfig; +use Magento\User\Test\Fixture\User; +use Mtf\Fixture\FixtureFactory; +use Mtf\TestCase\Injectable; +use Mtf\System\Config; +use Magento\Install\Test\Constraint\AssertAgreementTextPresent; +use Magento\Install\Test\Constraint\AssertSuccessfulReadinessCheck; + +/** + * PLEASE ADD NECESSARY INFO BEFORE RUNNING TEST TO + * ../dev/tests/functional/config/install_data.yml.dist + * + * Test Flow: + * + * Preconditions: + * 1. Uninstall Magento. + * + * Steps: + * 1. Go setup landing page. + * 2. Click on "Terms and agreements" button. + * 3. Check license agreement text. + * 4. Return back to landing page and click "Agree and Setup" button. + * 5. Click "Start Readiness Check" button. + * 6. Make sure PHP Version, PHP Extensions and File Permission are ok. + * 7. Click "Next" and fill DB credentials. + * 8. Click "Test Connection and Authentication" and make sure connection successful. + * 9. Click "Next" and fill store address and admin path. + * 10. Click "Next" and leave all default values. + * 11. Click "Next" and fill admin user info. + * 12. Click "Next" and on the "Step 6: Install" page click "Install Now" button. + * 13. Perform assertions. + * + * @group Installer_and_Upgrade/Downgrade_(PS) + * @ZephyrId MAGETWO-31431 + */ +class InstallTest extends Injectable +{ + /** + * Install page. + * + * @var Install + */ + protected $installPage; + + /** + * Cms index page. + * + * @var CmsIndex + */ + protected $homePage; + + /** + * Uninstall Magento before test. + * + * @param Config $systemConfig + * @return array + */ + public function __prepare(Config $systemConfig) + { + // Prepare config data + $configData = $systemConfig->getConfigParam('install_data/db_credentials'); + $urlConfig = $systemConfig->getConfigParam('install_data/url'); + $configData['web'] = $urlConfig['base_url']; + $configData['admin'] = $urlConfig['backend_frontname']; + + return ['configData' => $configData]; + } + + /** + * Injection data. + * + * @param CmsIndex $homePage + * @param Install $installPage + * @return void + */ + public function __inject(Install $installPage, CmsIndex $homePage) + { + $magentoBaseDir = dirname(dirname(dirname(MTF_BP))); + // Uninstall Magento. + shell_exec("php -f $magentoBaseDir/setup/index.php uninstall"); + $this->installPage = $installPage; + $this->homePage = $homePage; + } + + /** + * Install Magento via web interface. + * + * @param User $user + * @param array $install + * @param array $configData + * @param FixtureFactory $fixtureFactory + * @param AssertAgreementTextPresent $assertLicense + * @param AssertSuccessfulReadinessCheck $assertReadiness + * @return array + */ + public function test( + User $user, + array $install, + array $configData, + FixtureFactory $fixtureFactory, + AssertAgreementTextPresent $assertLicense, + AssertSuccessfulReadinessCheck $assertReadiness + ) { + $dataConfig = array_merge($install, $configData); + if ($dataConfig['httpsFront'] != "-") { + $dataConfig['https'] = str_replace('http', 'https', $dataConfig['web']); + } + /** @var InstallConfig $installConfig */ + $installConfig = $fixtureFactory->create('Magento\Install\Test\Fixture\Install', ['data' => $dataConfig]); + // Steps + $this->homePage->open(); + // Verify license agreement. + $this->installPage->getLandingBlock()->clickTermsAndAgreement(); + $assertLicense->processAssert($this->installPage); + $this->installPage->getLicenseBlock()->clickBack(); + $this->installPage->getLandingBlock()->clickAgreeAndSetup(); + // Step 1: Readiness Check. + $this->installPage->getReadinessBlock()->clickReadinessCheck(); + $assertReadiness->processAssert($this->installPage); + $this->installPage->getReadinessBlock()->clickNext(); + // Step 2: Add a Database. + $this->installPage->getDatabaseBlock()->fill($installConfig); + $this->installPage->getDatabaseBlock()->clickNext(); + // Step 3: Web Configuration. + $this->installPage->getWebConfigBlock()->clickAdvancedOptions(); + $this->installPage->getWebConfigBlock()->fill($installConfig); + $this->installPage->getWebConfigBlock()->clickNext(); + // Step 4: Customize Your Store + $this->installPage->getCustomizeStoreBlock()->fill($installConfig); + $this->installPage->getCustomizeStoreBlock()->clickNext(); + // Step 5: Create Admin Account. + $this->installPage->getCreateAdminBlock()->fill($user); + $this->installPage->getCreateAdminBlock()->clickNext(); + // Step 6: Install. + $this->installPage->getInstallBlock()->clickInstallNow(); + + return ['installConfig' => $installConfig]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest/test.csv b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..63ad72c17f75117c18631cb09658b51a3b0c76a8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest/test.csv @@ -0,0 +1,7 @@ +"user/dataSet";"install/dbTablePrefix";"install/admin";"install/httpsFront";"install/httpsAdmin";"install/apacheRewrites";"install/keyOwn";"install/keyValue";"install/language";"install/currency";"currencySymbol";"languageTemplate";"constraint";"description" +"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin";"install with default values" +"default";"-";"custom";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin";"install with custom admin path" +"default";"-";"-";"-";"-";"-";"Yes";"123123qa";"German (Germany)";"Euro (EUR)";"€";"Suchbegriffe";"assertSuccessInstall, assertKeyCreated, assertUserSuccessLogin, assertCurrencySelected, assertLanguageSelected";"install with custom encryption key and changed currency and locale" +"default";"prefix1_";"-";"-";"-";"-";"-";"-";"Chinese (China)";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin";"install with table prefix" +"default";"-";"-";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin, assertRewritesEnabled";"install with enabled url rewrites" +"default";"-";"-";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin, assertSecureUrlEnabled";"install with enabled secure urls" diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Install/Test/etc/constraint.xml new file mode 100644 index 0000000000000000000000000000000000000000..921f167e82432e0ce4a17c484f7b4aa30e2a9b8d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/etc/constraint.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<constraint> + <assertAgreementTextPresent module="Magento_Install"> + <severity>low</severity> + </assertAgreementTextPresent> + <assertSuccessDbConnection module="Magento_Install"> + <severity>low</severity> + </assertSuccessDbConnection> + <assertSuccessfulReadinessCheck module="Magento_Install"> + <severity>low</severity> + </assertSuccessfulReadinessCheck> + <assertSuccessInstall module="Magento_Install"> + <severity>low</severity> + </assertSuccessInstall> + <assertKeyCreated module="Magento_Install"> + <severity>low</severity> + </assertKeyCreated> + <assertLanguageSelected module="Magento_Install"> + <severity>low</severity> + </assertLanguageSelected> + <assertCurrencySelected module="Magento_Install"> + <severity>low</severity> + </assertCurrencySelected> + <assertRewritesEnabled module="Magento_Install"> + <severity>low</severity> + </assertRewritesEnabled> + <assertSecureUrlEnabled module="Magento_Install"> + <severity>low</severity> + </assertSecureUrlEnabled> +</constraint> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Install/Test/etc/fixture.xml new file mode 100644 index 0000000000000000000000000000000000000000..c5c091aad3d47305937ab785117e74916c18141b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/etc/fixture.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> + +<fixture> + <install module="Magento_Install"> + <type>virtual</type> + <entity_type>install</entity_type> + <fields> + <dbHost> + <attribute_code>dbHost</attribute_code> + <backend_type>virtual</backend_type> + </dbHost> + <dbUser> + <attribute_code>dbUser</attribute_code> + <backend_type>virtual</backend_type> + </dbUser> + <dbPassword> + <attribute_code>dbPassword</attribute_code> + <backend_type>virtual</backend_type> + </dbPassword> + <dbname> + <attribute_code>dbname</attribute_code> + <backend_type>virtual</backend_type> + </dbname> + <web> + <attribute_code>web</attribute_code> + <backend_type>virtual</backend_type> + </web> + </fields> + </install> +</fixture> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/Install/Test/etc/page.xml new file mode 100644 index 0000000000000000000000000000000000000000..523ecd7d0672c81742917b4c4c78c102276db6f4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/etc/page.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" ?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<page module="Magento_Install"> + <install> + <mca>setup/</mca> + <class>Magento\Install\Test\Page\Install</class> + </install> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml index a8287d2ce082ba5ff51e7afb3a30e52f1e921c18..bbc913577f0f87c00ca91d7318ce15a3d0809e39 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml @@ -4,7 +4,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ --> -<page mca="reports/index/search" module="Magento_Reports"> +<page mca="search/term/report/" module="Magento_Reports"> <blocks> <searchGrid> <class>Magento\Reports\Test\Block\Adminhtml\SearchTermsGrid</class> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php index a1701cccd3a60d094527d8ffd3ac6b55bce955ea..dca52650288cc7fc6d00fba8e2c721df6d16fca6 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php @@ -72,7 +72,6 @@ class SearchTermsReportEntityTest extends Injectable */ public function test($product, $countProducts, $countSearch) { - $this->markTestIncomplete('MAGETWO-30246'); // Preconditions $productName = $this->createProducts($product, $countProducts); diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/BatCETests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/BatCETests.php deleted file mode 100644 index d5d16fc2cb8e37dc18aaefd17ccc4a5402ef747f..0000000000000000000000000000000000000000 --- a/dev/tests/functional/testsuites/Mtf/TestSuite/BatCETests.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * BAT CE - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ - -namespace Mtf\TestSuite; - -class BatCETests -{ - public static function suite() - { - $suite = new TestSuite('BAT CE'); - - // Product - $suite->addTestSuite('Magento\Bundle\Test\TestCase\BundleFixedTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateTest'); - $suite->addTestSuite('Magento\ConfigurableProduct\Test\TestCase\CreateConfigurableTest'); - $suite->addTestSuite('Magento\ConfigurableProduct\Test\TestCase\CreateWithAttributeTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCustomOptionsAndCategoryTest'); - - // Category - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Category\CreateTest'); - - // Stores - $suite->addTestSuite('Magento\Store\Test\TestCase\StoreTest'); - - return $suite; - } -} diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/EndToEndCETests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/EndToEndCETests.php deleted file mode 100755 index 42243f0d1d7845c348035beebab2a79e6eddf1da..0000000000000000000000000000000000000000 --- a/dev/tests/functional/testsuites/Mtf/TestSuite/EndToEndCETests.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * End-to-end scenarios without 3-rd party solutions for CE - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - */ - -namespace Mtf\TestSuite; - -class EndToEndCETests -{ - public static function suite() - { - $suite = new TestSuite('End-to-end Scenarios without 3-rd Party Solutions for CE'); - - // Products - // Simple - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateProductTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\EditSimpleProductTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCategoryTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\UnassignCategoryTest'); - // Grouped - $suite->addTestSuite('Magento\GroupedProduct\Test\TestCase\CreateGroupedTest'); - // Virtual - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CreateVirtualTest'); - // Configurable - $suite->addTestSuite('Magento\ConfigurableProduct\Test\TestCase\EditConfigurableTest'); - // Downloadable - $suite->addTestSuite('Magento\Downloadable\Test\TestCase\Create\LinksPurchasedSeparatelyTest'); - // Bundle - $suite->addTestSuite('Magento\Bundle\Test\TestCase\BundleDynamicTest'); - $suite->addTestSuite('Magento\Bundle\Test\TestCase\EditBundleTest'); - - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\UpsellTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\CrosssellTest'); - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Product\RelatedProductTest'); - - // Product search - $suite->addTestSuite('Magento\CatalogSearch\Test\TestCase\AdvancedSearchTest'); - - // Url rewrites - $suite->addTestSuite('Magento\UrlRewrite\Test\TestCase\ProductTest'); - $suite->addTestSuite('Magento\UrlRewrite\Test\TestCase\CategoryTest'); - - // Customer - $suite->addTestSuite('Magento\Customer\Test\TestCase\BackendCustomerCreateTest'); - $suite->addTestSuite('Magento\Customer\Test\TestCase\CreateOnFrontendTest'); - - // Review - $suite->addTestSuite('Magento\Review\Test\TestCase\ReviewTest'); - - // Tax - $suite->addTestSuite('Magento\Tax\Test\TestCase\TaxRuleTest'); - - // Assign products to a category - $suite->addTestSuite('Magento\Catalog\Test\TestCase\Category\AssignProductTest'); - - return $suite; - } -} diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/bat_ce.xml b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/bat_ce.xml new file mode 100644 index 0000000000000000000000000000000000000000..78345d2193aced1262f65a08c81cf78aac6b581e --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/bat_ce.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../vendor/magento/mtf/Mtf/TestRunner/etc/testRunner.xsd"> + <rule scope="testsuite"> + <allow> + <!--Products--> + <class value="Magento\Bundle\Test\TestCase\BundleFixedTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\CreateTest" /> + <class value="Magento\ConfigurableProduct\Test\TestCase\CreateConfigurableTest" /> + <class value="Magento\ConfigurableProduct\Test\TestCase\CreateWithAttributeTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCustomOptionsAndCategoryTest" /> + <!--Category--> + <class value="Magento\Catalog\Test\TestCase\Category\CreateTest" /> + <!--Stores--> + <class value="Magento\Store\Test\TestCase\StoreTest" /> + <!--Quick Search--> + <class value="Magento\CatalogSearch\Test\TestCase\SearchEntityResultsTest" /> + </allow> + </rule> + <rule scope="variation"> + <allow> + <tag group="bamboo_plan" value="BAT" /> + </allow> + </rule> +</config> diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml new file mode 100644 index 0000000000000000000000000000000000000000..bd0624be9d69e32e6b9141dd63eddc713da92f9b --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/end_to_end_ce.xml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<!-- +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../vendor/magento/mtf/Mtf/TestRunner/etc/testRunner.xsd"> + <rule scope="testsuite"> + <allow> + <!--Product search--> + <class value="Magento\CatalogSearch\Test\TestCase\AdvancedSearchEntityTest" /> + <!--Products--> + <!--Simple--> + <class value="Magento\Catalog\Test\TestCase\Product\CreateProductTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\EditSimpleProductTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\CreateSimpleWithCategoryTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\UnassignCategoryTest" /> + <!--Grouped--> + <class value="Magento\GroupedProduct\Test\TestCase\CreateGroupedTest" /> + <!--Virtual--> + <class value="Magento\Catalog\Test\TestCase\Product\CreateVirtualTest" /> + <!--Configurable--> + <class value="Magento\ConfigurableProduct\Test\TestCase\EditConfigurableTest" /> + <!--Downloadable--> + <class value="Magento\Downloadable\Test\TestCase\Create\LinksPurchasedSeparatelyTest" /> + <!--Bundle--> + <class value="Magento\Bundle\Test\TestCase\BundleDynamicTest" /> + <class value="Magento\Bundle\Test\TestCase\EditBundleTest" /> + <!--Related Products--> + <class value="Magento\Catalog\Test\TestCase\Product\UpsellTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\CrosssellTest" /> + <class value="Magento\Catalog\Test\TestCase\Product\RelatedProductTest" /> + <!--Url rewrites--> + <class value="Magento\UrlRewrite\Test\TestCase\ProductTest" /> + <class value="Magento\UrlRewrite\Test\TestCase\CategoryTest" /> + <!--Customer--> + <class value="Magento\Customer\Test\TestCase\BackendCustomerCreateTest" /> + <class value="Magento\Customer\Test\TestCase\CreateOnFrontendTest" /> + <!--Review--> + <class value="Magento\Review\Test\TestCase\ReviewTest" /> + <!--Tax--> + <class value="Magento\Tax\Test\TestCase\TaxRuleTest" /> + <!--Assign products to a category--> + <class value="Magento\Catalog\Test\TestCase\Category\AssignProductTest" /> + </allow> + </rule> + <rule scope="variation"> + <allow> + <tag group="bamboo_plan" value="end_to_end" /> + </allow> + </rule> +</config>