diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index 8ce924bd190d77c558cedd1ff4a7f04b83af3df5..ca4b3bc7f79e43c04109d7162163832f89340ec8 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc26", + "magento/mtf": "1.0.0-rc27", "php": "~5.5.0|~5.6.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php index e1bcbd54580d6daa2bd2eac1a39657b8dd7c8f24..50307147313fa52285d237b6637cb22244f546a6 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php @@ -14,11 +14,6 @@ use Magento\Mtf\Client\ElementInterface; */ class GlobalsearchElement extends SimpleElement { - /** - * "Backspace" key code. - */ - const BACKSPACE = "\xEE\x80\x83"; - /** * Search icon selector. * @@ -63,43 +58,14 @@ class GlobalsearchElement extends SimpleElement public function setValue($value) { $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $this->waitInitElement(); - if (!$this->find($this->searchInput)->isVisible()) { $this->find($this->searchIcon)->click(); } - $this->selectWindow(); - $this->clear(); - $this->find($this->searchInput)->setValue($value); - $this->selectWindow(); - + $this->find($this->searchInput)->keys(str_split($value)); $this->waitResult(); } - /** - * Clear value of element. - * - * @return void - */ - protected function clear() - { - $element = $this->find($this->searchInput); - while ('' != $element->getValue()) { - $element->setValue([self::BACKSPACE]); - } - } - - /** - * Select to last window. - * - * @return void - */ - protected function selectWindow() - { - $this->driver->selectWindow(); - } - /** * Wait init search suggest container. * @@ -130,12 +96,7 @@ class GlobalsearchElement extends SimpleElement $this->driver->waitUntil( function () use ($browser, $selector) { - if ($browser->find($selector)->isVisible()) { - return true; - } else { - $browser->selectWindow(); - return null; - } + return $browser->find($selector)->isVisible() ? true : null; } ); } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php index 0d3244802c70260eedce3ed996df9856c77a3057..09123d09767bf838415192989cd1f5f06732360b 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Form/Group.php @@ -9,7 +9,7 @@ namespace Magento\Backend\Test\Block\System\Config\Form; use Magento\Mtf\Client\Locator; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; /** * Class Group diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Form.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Form.php deleted file mode 100644 index d57bd1aa4d78f8f9829b08857a27611793b1d462..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Form.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php -/** - * @api - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Backend\Test\Block\Widget; - -use Magento\Mtf\Block\Form as FormInstance; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Form - * Is used to represent any form on the page - * - * @SuppressWarnings(PHPMD.NumberOfChildren) - */ -class Form extends FormInstance -{ - /** - * 'Save' button - * - * @var string - */ - protected $saveButton = '#save'; - - /** - * 'Save And Continue Edit' button - * - * @var string - */ - protected $saveAndContinueButton = '#save_and_continue'; - - /** - * 'Save And Continue Edit' button - * - * @var string - */ - protected $saveAndContinueEditButton = '#save_and_continue_edit'; - - /** - * Back button - * - * @var string - */ - protected $backButton = '#back'; - - /** - * Reset button - * - * @var string - */ - protected $resetButton = '#reset'; - - /** - * 'Delete' button - * - * @var string - */ - protected $deleteButton = '#delete-button-button'; - - /** - * Backend abstract block - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Selector of element to wait for. If set by child will wait for element after action - * - * @var string - */ - protected $waitForSelector; - - /** - * Locator type of waitForSelector - * - * @var Locator - */ - protected $waitForSelectorType = Locator::SELECTOR_CSS; - - /** - * Wait for should be for visibility or not? - * - * @var boolean - */ - protected $waitForSelectorVisible = true; - - /** - * Update the root form - * - * @param FixtureInterface $fixture - * @return Form - */ - public function update(FixtureInterface $fixture) - { - $this->fill($fixture); - return $this; - } - - /** - * Get backend abstract block - * - * @return \Magento\Backend\Test\Block\Template - */ - protected function getTemplateBlock() - { - return Factory::getBlockFactory()->getMagentoBackendTemplate( - $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH) - ); - } - - /** - * Save the form - * - * @param FixtureInterface $fixture - * @return Form - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function save(FixtureInterface $fixture = null) - { - $this->_rootElement->find($this->saveButton, Locator::SELECTOR_CSS)->click(); - $this->waitForElement(); - return $this; - } - - /** - * Method that waits for the configured selector using class attributes. - */ - protected function waitForElement() - { - if (!empty($this->waitForSelector)) { - if ($this->waitForSelectorVisible) { - $this->getTemplateBlock()->waitForElementVisible($this->waitForSelector, $this->waitForSelectorType); - } else { - $this->getTemplateBlock()->waitForElementNotVisible($this->waitForSelector, $this->waitForSelectorType); - } - } - } - - /** - * Back action - * - * @return Form - */ - public function back() - { - $this->_rootElement->find($this->backButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Reset the form - * - * @return Form - */ - public function reset() - { - $this->_rootElement->find($this->resetButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Delete current form item - * - * @param FixtureInterface $fixture - * @return Form - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function delete(FixtureInterface $fixture = null) - { - $this->_rootElement->find($this->deleteButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Click save and continue button on form - */ - public function clickSaveAndContinue() - { - $this->_rootElement->find($this->saveAndContinueButton, Locator::SELECTOR_CSS)->click(); - return $this; - } - - /** - * Click save and continue button on form - */ - public function clickSaveAndContinueEdit() - { - $this->_rootElement->find($this->saveAndContinueEditButton, Locator::SELECTOR_CSS)->click(); - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php index b11db4365fa2d253ebf571ea4495200274fc74d6..b104c3230510c08d70f30d1d17d49be50cebd18d 100755 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php @@ -7,6 +7,7 @@ namespace Magento\Backend\Test\Block\Widget; use Magento\Mtf\Block\BlockFactory; +use Magento\Mtf\Block\Form; use Magento\Mtf\Block\Mapper; use Magento\Mtf\Client\Locator; use Magento\Mtf\Client\ElementInterface; @@ -87,8 +88,7 @@ class FormTabs extends Form foreach ($tabs as $tabName => $tabFields) { $tab = $this->getTab($tabName); $this->openTab($tabName); - $tab->fillFormTab(array_merge($tabFields, $this->unassignedFields), $context); - $this->updateUnassignedFields($tab); + $tab->fillFormTab($tabFields, $context); } if (!empty($this->unassignedFields)) { $this->fillMissedFields($tabs); @@ -97,34 +97,25 @@ class FormTabs extends Form return $this; } - /** - * Update array with fields which aren't assigned to any tab - * - * @param Tab $tab - */ - protected function updateUnassignedFields(Tab $tab) - { - $this->unassignedFields = array_diff_key( - $this->unassignedFields, - array_intersect_key($this->unassignedFields, $tab->setFields) - ); - } - /** * Fill fields which weren't found on filled tabs * - * @param array $tabs * @throws \Exception - * * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ - protected function fillMissedFields(array $tabs) + protected function fillMissedFields() { - foreach (array_diff_key($this->tabs, $tabs) as $tabName => $tabData) { + foreach ($this->tabs as $tabName => $tabData) { $tab = $this->getTab($tabName); - if ($this->openTab($tabName)) { - $tab->fillFormTab($this->unassignedFields, $this->_rootElement); - $this->updateUnassignedFields($tab); + if ($this->openTab($tabName) && $this->isTabVisible($tabName)) { + $mapping = $tab->dataMapping($this->unassignedFields); + foreach ($mapping as $fieldName => $data) { + $element = $tab->_rootElement->find($data['selector'], $data['strategy'], $data['input']); + if ($element->isVisible()) { + $element->setValue($data['value']); + unset($this->unassignedFields[$fieldName]); + } + } if (empty($this->unassignedFields)) { break; } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9624a9398b6ac7c7bb2f25f47b49bfde089978f5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Backend\Test\TestCase; + +use Magento\Backend\Test\Fixture\GlobalSearch; +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. Create customer + * 2. Create two simple products + * 3. Create order with one of created simple product + * + * Steps: + * 1. Login to backend + * 2. Click on Search button on the top of page + * 3. Fill in data according dataSet + * 4. Perform assertions + * + * @group Search_Core_(MX) + * @ZephyrId MAGETWO-28457 + */ +class GlobalSearchEntityTest extends Injectable +{ + /* tags */ + const MVP = 'no'; + const DOMAIN = 'MX'; + /* end tags */ + + /** + * Backend Dashboard page. + * + * @var Dashboard + */ + protected $dashboard; + + /** + * Preparing pages for test. + * + * @param Dashboard $dashboard + * @return void + */ + public function __inject(Dashboard $dashboard) + { + $this->dashboard = $dashboard; + } + + /** + * Run Global Search Entity Test. + * + * @param GlobalSearch $search + * @return void + */ + public function test(GlobalSearch $search) + { + //Steps: + $this->dashboard->open(); + $this->dashboard->getAdminPanelHeader()->search($search->getQuery()); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..7adcf2b0241bad21f32708ea1416b7a9afcf5128 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + --> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> + <testCase name="Magento\Backend\Test\TestCase\GlobalSearchEntityTest"> + <variation name="GlobalSearchEntityTestVariation2"> + <data name="description" xsi:type="string">search with 2 sign return no results</data> + <data name="search/data/query" xsi:type="string">:)</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchNoRecordsFound" /> + </variation> + <variation name="GlobalSearchEntityTestVariation3"> + <data name="description" xsi:type="string">search product by sku</data> + <data name="search/data/query" xsi:type="string">orderInjectable::default::product::sku</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchProductName" /> + </variation> + <variation name="GlobalSearchEntityTestVariation4"> + <data name="description" xsi:type="string">search existed customer</data> + <data name="search/data/query" xsi:type="string">customer::johndoe_unique::lastname</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchCustomerName" /> + </variation> + <variation name="GlobalSearchEntityTestVariation5"> + <data name="description" xsi:type="string">search order (by order id)</data> + <data name="search/data/query" xsi:type="string">orderInjectable::default::id</data> + <constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchOrderId" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php index b8d486de23c5b4006f491a3f1fad1532a2a0f928..2e4509a1e66eab3cb43acfd0a9f0407c7bf50ffc 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php @@ -13,7 +13,7 @@ use Magento\Backend\Test\Page\Adminhtml\Dashboard; * Steps: * 1. Log in to backend. * 2. Navigate throught menu to the page. - * 6. Perform asserts. + * 3. Perform asserts. * * @ZephyrId MAGETWO-34874 */ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php index 308ebbe82565e481275b3940ca1f3bece6a11cae..dcb74539acd16a4e77972e99f68f331d328bfc1b 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php @@ -9,8 +9,7 @@ namespace Magento\Bundle\Test\Constraint; use Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage; /** - * Class AssertProductCustomOptionsOnBundleProductPage - * Assertion that commodity options are displayed correctly on bundle product page + * Assertion that commodity options are displayed correctly on bundle product page. */ class AssertProductCustomOptionsOnBundleProductPage extends AssertProductCustomOptionsOnProductPage { diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php index 3c62ea1c4eac77055ad478c6b28de567657631cf..156e24f75aa75a93d7ca1fb19c39fd69c5888508 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php @@ -32,7 +32,7 @@ class AssertTierPriceOnBundleProductPage extends AssertProductTierPriceOnProduct * * @var int */ - protected $priceFormat = 4; + protected $priceFormat = 0; /** * Assertion that tier prices are displayed correctly diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php index a30b316e1e8901d96241ba11f3a7547a5f4b184e..c4f0aee1ebebec8092b22ef6e821825495669879 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php @@ -139,13 +139,13 @@ class Price implements FixtureInterface 'price_to' => '120.00', ], 'fixed-115' => [ - 'price_from' => '115.00', - 'price_to' => '120.00', + 'price_from' => '317.00', + 'price_to' => '362.00', 'cart_price' => '317.00', ], - 'fixed-159' => [ - 'price_from' => '115.00', - 'price_to' => '120.00', + 'fixed-110' => [ + 'price_from' => '159.00', + 'price_to' => '164.00', 'cart_price' => '159.00', ], 'fixed-756' => [ diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml index 2fddc12693d45cf68779b2f75cabcb6b492b47cc..597a6d7f735a93b8a301a9aaff642a95606c0af0 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.xml @@ -6,10 +6,10 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CatalogProductView" area="Product" mca="catalog/product/view"> - <block name="viewBlock"> - <render name="bundle" class="Magento\Bundle\Test\Block\Catalog\Product\View"/> - </block> - <block name="bundleViewBlock" class="Magento\Bundle\Test\Block\Catalog\Product\View" locator="#maincontent" strategy="css selector"/> - </page> + <page name="CatalogProductView" area="Product" mca="catalog/product/view"> + <block name="viewBlock"> + <render name="bundle" class="Magento\Bundle\Test\Block\Catalog\Product\View" /> + </block> + <block name="bundleViewBlock" class="Magento\Bundle\Test\Block\Catalog\Product\View" locator="#maincontent" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index 51d270f4d41e0230b4b54570806b8faa5e0080f3..ad5b9bfa0c055caf84c363a3dcc9067689628cc6 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -228,7 +228,6 @@ <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" /> </variation> <variation name="CreateBundleProductEntityTestVariation10"> - <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create dynamic bundle</data> <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Bundle Dynamic %isolation%</data> @@ -272,7 +271,7 @@ <data name="product/data/sku" xsi:type="string">sku_bundle_fixed_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">110</data> - <data name="product/data/price/preset" xsi:type="string">fixed-159</data> + <data name="product/data/price/preset" xsi:type="string">fixed-110</data> <data name="product/data/bundle_selections/preset" xsi:type="string">second</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> <data name="product/data/checkout_data/preset" xsi:type="string">with_custom_options_2</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml index 887e1983789462f31d40ec9c2846931bb225abd8..ab116cdecc2f5118629b781c8985557529e882a4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main/EditForm.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <fields> <attribute_set_name /> </fields> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php index 39e76e2c98eec4d2d018e8048116199a27c683b7..bd1b633deedd32b670b10b1adf4faae4c2a87e58 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action; use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; /** @@ -25,6 +25,7 @@ class Attribute extends Form public function fill(FixtureInterface $fixture, SimpleElement $element = null) { $data = $fixture->getData(); + $fields = []; foreach ($data as $name => $dataValue) { $fields['toggle_' . $name] = 'Yes'; $fields[$name] = $dataValue; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php index c1baad740ef47f6564c703afddebd6d11d772b35..5c44c611d8da52a7080edabd5699d5b5c0582af2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/NewCategoryIds.php @@ -7,7 +7,7 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; use Magento\Catalog\Test\Fixture\Category; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; /** * Create new category. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php index edc00d8db75fe91c060c124232eadf815fc4c115..bb1e7cc32bbd8dbecc5bdfe2e8764e3c71a071ae 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php @@ -11,7 +11,6 @@ use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class AssertProductInGrid * Assert that product is present in products grid. */ class AssertProductInGrid extends AbstractConstraint @@ -63,7 +62,7 @@ class AssertProductInGrid extends AbstractConstraint } /** - * Get product type + * Get product type. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml index 1e99a0752d4e407a6dfac02c519cf83d9f6ded54..1a38dd8158cd63cd9553ba8cde4daaa7e3c76eed 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml @@ -111,13 +111,13 @@ <field name="is_wysiwyg_enabled" is_required=""> <default_value xsi:type="number">0</default_value> </field> - <field name="is_used_for_promo_rules" is_required=""> + <field name="is_used_for_promo_rules" is_required="" group="frontend-properties"> <default_value xsi:type="number">0</default_value> </field> <field name="search_weight" is_required=""> <default_value xsi:type="string">1</default_value> </field> - <field name="options" is_required="" source="Magento\Catalog\Test\Fixture\CatalogProductAttribute\Options"> + <field name="options" is_required="" group="properties" source="Magento\Catalog\Test\Fixture\CatalogProductAttribute\Options"> <default_value xsi:type="null"/> </field> <field name="default_value_text" group="advanced-properties"/> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index cc82e98b336dbdd13b1088b90762f29d081f212f..2e2903a0cf35267fb62eb27cec89bee8c831baef 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -36,6 +36,23 @@ </field> </dataset> + <dataset name="required_fields"> + <field name="url_key" xsi:type="string">virtual-product%isolation%</field> + <field name="name" xsi:type="string">Virtual product %isolation%</field> + <field name="sku" xsi:type="string">sku_virtual_product_%isolation%</field> + <field name="is_virtual" xsi:type="string">Yes</field> + <field name="price" xsi:type="array"> + <item name="value" xsi:type="string">10</item> + <item name="preset" xsi:type="string">-</item> + </field> + <field name="tax_class_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">taxable_goods</item> + </field> + <field name="website_ids" xsi:type="array"> + <item name="0" xsi:type="string">Main Website</item> + </field> + </dataset> + <dataset name="required_fields_with_category"> <field name="url_key" xsi:type="string">virtual-product%isolation%</field> <field name="name" xsi:type="string">Virtual product %isolation%</field> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml index e84f0409dada6c372eead7ef608a6adb8544f588..364854e6870bbf6a8b9aa15989b7ccececcb7cbc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml @@ -257,7 +257,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> </variation> <variation name="CreateSimpleProductEntityTestVariation15"> - <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create product with tax class and group price</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> @@ -317,7 +316,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" /> </variation> <variation name="CreateSimpleProductEntityTestVariation18"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35342</data> <data name="description" xsi:type="string">Create product wit suite of custom options</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php index 6c297ef596e1f08f89d4d4f578e4945d1a67caa9..1cdff9dbf0ed156e55ea0d5bbc657f7628f7e02d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php @@ -30,7 +30,6 @@ class ProductTypeSwitchingOnCreationTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'MX'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml index af77d4f6fd3d4ea47bad0a0bb3cf512ada4ab3f1..d4850eed96207c39e7d3a43265eab36300c2bcf9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml @@ -27,13 +27,13 @@ </variation> <variation name="ProductTypeSwitchingOnCreationTestVariation3"> <data name="createProduct" xsi:type="string">configurable</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> + <data name="product" xsi:type="string">catalogProductSimple::product_without_category</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnCreationTestVariation4"> <data name="createProduct" xsi:type="string">configurable</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::required_fields</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml index d477c119f14ec5c992f4f9285a47c94bac67effc..8d1fc4b9e09c4fe2d44ffc29021fa079d9a88191 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.xml @@ -8,7 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\Product\ProductTypeSwitchingOnUpdateTest"> <variation name="ProductTypeSwitchingOnUpdateTestVariation1"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">catalogProductSimple::default</data> <data name="product" xsi:type="string">configurableProduct::default</data> <data name="actionName" xsi:type="string">-</data> @@ -28,17 +27,15 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation3"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">configurableProduct::default</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> + <data name="product" xsi:type="string">catalogProductSimple::product_without_category</data> <data name="actionName" xsi:type="string">deleteAttributes</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation4"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">configurableProduct::default</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::required_fields</data> <data name="actionName" xsi:type="string">deleteAttributes</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -51,7 +48,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation6"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">catalogProductVirtual::default</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <data name="actionName" xsi:type="string">-</data> @@ -82,7 +78,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> <variation name="ProductTypeSwitchingOnUpdateTestVariation9"> - <data name="tag" xsi:type="string">stable:no</data> <data name="productOrigin" xsi:type="string">downloadableProduct::default</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <data name="actionName" xsi:type="string">-</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index 73e20318e00350a5fc21cc5089a833cdc7469cd1..4dde51eae09a370f540fa8e3b2e9970d40c19dc6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -70,7 +70,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> </variation> <variation name="UpdateSimpleProductEntityTestVariation5"> <data name="description" xsi:type="string">Update stock to Out of Stock</data> @@ -104,7 +103,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductIsNotDisplayingOnFrontend" /> </variation> <variation name="UpdateSimpleProductEntityTestVariation7"> - <data name="tag" xsi:type="string">stable:no</data> <data name="description" xsi:type="string">Update category</data> <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> <data name="product/data/category_ids/presets" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml index 0346cc1467f5ee7cf386c0d0f304c5bef9625a62..d6607d67fd40b773f4af4c01f0f6dad154b31237 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml @@ -15,11 +15,8 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -38,18 +35,13 @@ <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> <data name="product/data/special_price" xsi:type="string">45</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> @@ -64,17 +56,13 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" /> @@ -86,14 +74,8 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -108,14 +90,8 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">5.00</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -134,10 +110,8 @@ <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -154,14 +128,10 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> <data name="product/data/special_price" xsi:type="string">45</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -176,14 +146,9 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">5.00</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -201,9 +166,6 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> <data name="product/data/visibility" xsi:type="string">Search</data> @@ -221,14 +183,9 @@ <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -247,19 +204,15 @@ <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/special_price" xsi:type="string">-</data> <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml index 93ba98c55dd97d03970e3d0ea2d951f3886c634b..320e99b58a4df53b9a155bad31d53748404b84d5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml @@ -6,14 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest"> - <variation name="CreateAttributeSetEntityTestVariation1"> - <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplate%isolation%</data> - <data name="attributeSet/data/skeleton_set/dataSet" xsi:type="string">default</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest"> + <variation name="CreateAttributeSetEntityTestVariation1"> + <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplate%isolation%</data> + <data name="attributeSet/data/skeleton_set/dataSet" xsi:type="string">default</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml index f569a5dbbd81d73b74ad961f2d3941e5f78b86f8..7597b2416ba022c4ba0a68073835d2af87313ada 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml @@ -6,17 +6,17 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateAttributeSetTest"> - <variation name="UpdateAttributeSetTestVariation1"> - <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplateEdit1%isolation%</data> - <data name="attributeSet/data/group" xsi:type="string">Custom-group%isolation%</data> - <data name="attributeSetOriginal/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateGroupOnProductForm"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateAttributeSetTest"> + <variation name="UpdateAttributeSetTestVariation1"> + <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplateEdit1%isolation%</data> + <data name="attributeSet/data/group" xsi:type="string">Custom-group%isolation%</data> + <data name="attributeSetOriginal/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateGroupOnProductForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml index de42ea1eca4ef4ad387c7315f103b0cb0aa75ff0..0e74dfb542a73f312a319c9aef11e02d330176da 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml @@ -6,58 +6,48 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateProductAttributeEntityTest"> - <variation name="UpdateProductAttributeEntityTestVariation1"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> - <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">-</data> - <data name="attribute/data/options/preset" xsi:type="string">-</data> - <data name="attribute/data/is_required" xsi:type="string">Yes</data> - <data name="attribute/data/attribute_code" xsi:type="string">-</data> - <data name="attribute/data/is_global" xsi:type="string">Global</data> - <data name="attribute/data/default_value_text" xsi:type="string">attribute_edited%isolation%</data> - <data name="attribute/data/is_unique" xsi:type="string">Yes</data> - <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> - <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> - <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> - <data name="attribute/data/is_filterable" xsi:type="string">-</data> - <data name="attribute/data/is_filterable_in_search" xsi:type="string">-</data> - <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">Yes</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> - <data name="isRequired" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm"/> - </variation> - <variation name="UpdateProductAttributeEntityTestVariation2"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_dropdown</data> - <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">-</data> - <data name="attribute/data/options/preset" xsi:type="string">default</data> - <data name="attribute/data/is_required" xsi:type="string">Yes</data> - <data name="attribute/data/attribute_code" xsi:type="string">-</data> - <data name="attribute/data/is_global" xsi:type="string">Global</data> - <data name="attribute/data/default_value_text" xsi:type="string">-</data> - <data name="attribute/data/is_unique" xsi:type="string">Yes</data> - <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> - <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> - <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> - <data name="attribute/data/is_filterable" xsi:type="string">Filterable (with results)</data> - <data name="attribute/data/is_filterable_in_search" xsi:type="string">Yes</data> - <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">No</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> - <data name="isRequired" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateProductAttributeEntityTest"> + <variation name="UpdateProductAttributeEntityTestVariation1"> + <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> + <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_%isolation%</data> + <data name="attribute/data/is_required" xsi:type="string">Yes</data> + <data name="attribute/data/is_global" xsi:type="string">Global</data> + <data name="attribute/data/default_value_text" xsi:type="string">attribute_edited%isolation%</data> + <data name="attribute/data/is_unique" xsi:type="string">Yes</data> + <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> + <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> + <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">Yes</data> + <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> + <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> + </variation> + <variation name="UpdateProductAttributeEntityTestVariation2"> + <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_dropdown</data> + <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_%isolation%</data> + <data name="attribute/data/options/preset" xsi:type="string">default</data> + <data name="attribute/data/is_required" xsi:type="string">Yes</data> + <data name="attribute/data/is_global" xsi:type="string">Global</data> + <data name="attribute/data/is_unique" xsi:type="string">Yes</data> + <data name="attribute/data/is_searchable" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data> + <data name="attribute/data/is_comparable" xsi:type="string">Yes</data> + <data name="attribute/data/is_filterable" xsi:type="string">Filterable (with results)</data> + <data name="attribute/data/is_filterable_in_search" xsi:type="string">Yes</data> + <data name="attribute/data/is_used_for_promo_rules" xsi:type="string">No</data> + <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/is_visible_on_front" xsi:type="string">Yes</data> + <data name="attribute/data/used_in_product_listing" xsi:type="string">Yes</data> + <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php index c3c576a8b7d4cff2100653d3aa4a62b1d7912130..25ca938dde09070eefb4cc191d65d1a75e5d1f79 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Adminhtml/Edit/SearchTermForm.php @@ -6,11 +6,10 @@ namespace Magento\CatalogSearch\Test\Block\Adminhtml\Edit; -use Magento\Backend\Test\Block\Widget\Form as WidgetForm; +use Magento\Mtf\Block\Form as WidgetForm; /** - * Class Form - * Form for search term + * Form for search term. */ class SearchTermForm extends WidgetForm { diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php index 5581bb47ea913a86cb7ba2a4bfaaddffdfe69bb8..c52774c67d3d912b1dd8813e9aacd7a61d89dd57 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php @@ -11,55 +11,61 @@ use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; /** - * Class Shipping - * Cart shipping block + * Cart shipping block. */ class Shipping extends Form { /** - * Form wrapper selector + * Form wrapper selector. * * @var string */ protected $formWrapper = '.content'; /** - * Open shipping form selector + * Open shipping form selector. * * @var string */ protected $openForm = '.title'; /** - * Get quote selector + * Get quote selector. * * @var string */ protected $getQuote = '.action.quote'; /** - * Update total selector + * Update total selector. * * @var string */ protected $updateTotalSelector = '.action.update'; /** - * Selector to access the shipping carrier method + * Selector to access the shipping carrier method. * * @var string */ protected $shippingMethod = '//span[text()="%s"]/following::*//*[contains(text(), "%s")]'; /** - * From with shipping available shipping methods + * From with shipping available shipping methods. * * @var string */ protected $shippingMethodForm = '#co-shipping-method-form'; /** - * Open estimate shipping and tax form + * Fields that are used in estimation shipping form. + * + * @var array + */ + protected $estimationFields = ['country_id', 'region_id', 'region', 'postcode']; + + /** + * Open estimate shipping and tax form. * * @return void */ @@ -71,7 +77,7 @@ class Shipping extends Form } /** - * Click Get quote button + * Click Get quote button. * * @return void */ @@ -81,7 +87,7 @@ class Shipping extends Form } /** - * Select shipping method + * Select shipping method. * * @param array $shipping * @return void @@ -97,7 +103,7 @@ class Shipping extends Form } /** - * Fill shipping and tax form + * Fill shipping and tax form. * * @param Address $address * @return void @@ -105,12 +111,14 @@ class Shipping extends Form public function fillEstimateShippingAndTax(Address $address) { $this->openEstimateShippingAndTax(); - $this->fill($address); + $data = $address->getData(); + $mapping = $this->dataMapping(array_intersect_key($data, array_flip($this->estimationFields))); + $this->_fill($mapping, $this->_rootElement); $this->clickGetQuote(); } /** - * Determines if the specified shipping carrier/method is visible on the cart + * Determines if the specified shipping carrier/method is visible on the cart. * * @param $carrier * @param $method diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php index f4df8ae791b970291e26684656e2199df91d1445..dcc945eaafd750c6d4fcb282c791c3f611e0e8a1 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php @@ -48,8 +48,6 @@ class Billing extends Form $isShippingAddress = false ) { if ($billingAddress) { - //@TODO: MAGETWO-34756 - sleep(5); $this->fill($billingAddress); } if ($isShippingAddress) { diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml index 2e1583ed1df208668de87b8fc5a3e62edd4b4628..a6fb5bb04526031f8a9e828ea496e769bde0590b 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -18,7 +18,6 @@ <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> </variation> <variation name="CreateCmsBlockEntityTestVariation2"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35059</data> <data name="cmsBlock/data/title" xsi:type="string">block_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_%isolation%</data> <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php index 60e0ea23b8526546d7ef2dca4f1d92a7c870c99b..7c1cddceb98ec3c10a9706921d161ae55629fec8 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php @@ -9,6 +9,7 @@ namespace Magento\Cms\Test\TestCase; use Magento\Cms\Test\Fixture\CmsPage as CmsPageFixture; use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; use Magento\Cms\Test\Page\Adminhtml\CmsPageNew; +use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** @@ -29,7 +30,6 @@ class CreateCmsPageEntityTest extends Injectable const MVP = 'yes'; const DOMAIN = 'PS'; const TEST_TYPE = 'acceptance_test'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** @@ -46,33 +46,46 @@ class CreateCmsPageEntityTest extends Injectable */ protected $cmsPageNew; + /** + * Fixture factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + /** * Inject pages. * * @param CmsPageIndex $cmsIndex * @param CmsPageNew $cmsPageNew + * @param FixtureFactory $fixtureFactory * @return void */ - public function __inject(CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew) + public function __inject(CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew, FixtureFactory $fixtureFactory) { $this->cmsIndex = $cmsIndex; $this->cmsPageNew = $cmsPageNew; + $this->fixtureFactory = $fixtureFactory; } /** * Creating Cms page. * - * @param CmsPageFixture $cms - * @return void + * @param array $data + * @param string $fixtureType + * @return array */ - public function test(CmsPageFixture $cms) + public function test(array $data, $fixtureType) { // Steps + $cms = $this->fixtureFactory->createByCode($fixtureType, ['data' => $data]); $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); //TODO: remove cms page new refresh after resolve issue with static js files publication (MAGETWO-37898) $this->cmsPageNew->open(); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); + + return ['cms' => $cms]; } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 21c9773ef8a4518f1ebdd6c466585dd4d2749fd2..a549ca390d66817d3c7a2c64590aaa833bd1ed8a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -9,10 +9,11 @@ <testCase name="Magento\Cms\Test\TestCase\CreateCmsPageEntityTest"> <variation name="CreateCmsPageEntityTestVariation1"> <data name="description" xsi:type="string">MAGETWO-12399: Create CMS Content Page</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/identifier" xsi:type="string">identifier-%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">All Store Views</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/identifier" xsi:type="string">identifier-%isolation%</data> + <data name="data/store_id" xsi:type="string">All Store Views</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> @@ -20,20 +21,21 @@ </variation> <variation name="CreateCmsPageEntityTestVariation2"> <data name="description" xsi:type="string">Create page for default store view</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> </variation> <variation name="CreateCmsPageEntityTestVariation3"> - <data name="issue" xsi:type="string">Bug: MAGETWO-34858</data> <data name="description" xsi:type="string">Create page with widget and system variable</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="cms/data/content/widget/preset" xsi:type="string">default</data> - <data name="cms/data/content/variable" xsi:type="string">General Contact Name</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="data/content/widget/preset" xsi:type="string">default</data> + <data name="data/content/variable" xsi:type="string">General Contact Name</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> @@ -41,10 +43,11 @@ </variation> <variation name="CreateCmsPageEntityTestVariation4"> <data name="description" xsi:type="string">Create disabled page</data> - <data name="cms/data/title" xsi:type="string">NewCmsPage%isolation%</data> - <data name="cms/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="cms/data/is_active" xsi:type="string">Disabled</data> - <data name="cms/data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> + <data name="fixtureType" xsi:type="string">cmsPage</data> + <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> + <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="data/is_active" xsi:type="string">Disabled</data> + <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php index 5023d9a37f2449be13b0c1153842e92014fa779c..5a0511def48fa2e7ac955637e7132367330113b4 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php @@ -75,7 +75,7 @@ class CreateCmsPageRewriteEntityTest extends Injectable //Steps $this->urlRewriteIndex->open(); $this->urlRewriteIndex->getPageActionsBlock()->addNew(); - $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite); + $this->urlRewriteEdit->getUrlRewriteTypeSelectorBlock()->selectType($urlRewrite->getEntityType()); $cmsPage = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity(); $filter = ['title' => $cmsPage->getTitle()]; $this->urlRewriteEdit->getCmsGridBlock()->searchAndOpen($filter); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml index 472e5a6558643e5ba71f676aa4811e555ff98515..048ff19fc06e9c2126be6cf5113afdaaa5349c9a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml @@ -18,7 +18,6 @@ <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> </variation> <variation name="UpdateCmsBlockEntityTestVariation2"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35059</data> <data name="cmsBlock/data/title" xsi:type="string">block_updated_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_updated_%isolation%</data> <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php index 8da0baf1779dbb8f1509e4e74ad68bf8fe31d3ea..4c8f8d1cf29e792b75501b2d16471d83671cb0cc 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php @@ -32,7 +32,6 @@ class UpdateCmsPageEntityTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'PS'; - const STABLE = 'no'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php index 1385164d592ac0608f057730e41b2897938ae55f..c838565a3d1ade69fe36b7cecf324a8bcd7e5402 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/AffectedAttributeSet.php @@ -10,7 +10,7 @@ use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Backend\Test\Block\Widget\Form as ParentForm; +use Magento\Mtf\Block\Form as ParentForm; /** * Class AffectedAttributeSet diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php index 9008800f6dd2ed58aec9821449f7fbd8ac12cd7f..17dc4b9d01f3141652064cfa61f058c34df4b68c 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php @@ -6,7 +6,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config\Attribute\AttributeSelector; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Locator; @@ -247,7 +247,12 @@ class Attribute extends Form $attributeBlock->find($this->addOption)->click(); } $mapping = $this->dataMapping($option); - $this->_fill($mapping, $optionContainer); + foreach ($mapping as $field) { + $element = $this->getElement($optionContainer, $field); + if ($element->isVisible() && !$element->isDisabled()) { + $element->setValue($field['value']); + } + } } } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php index d3c32d608a143ce63212eef08da97c7df4372a93..4d2bf2cb8268168557df928f63a3cb0b8cde12c8 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php @@ -21,14 +21,16 @@ class AttributeSelector extends SuggestElement */ public function waitResult() { - $browser = $this; - $selector = $this->searchResult; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() ? true : null; - } - ); + try { + $this->waitUntil( + function () { + return $this->find($this->searchResult)->isVisible() ? true : null; + } + ); + } catch (\Exception $e) { + // In parallel run on windows change the focus is lost on element + // that causes disappearing of result suggest list. + } } /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index 11db5ed304636b2e2f25019e3c7b08bc5d8ac1f5..8ecdc5aa867ac14b09de37a8dfc480144d468b6f 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -8,7 +8,7 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Supe use Magento\Mtf\Client\Locator; use Magento\Backend\Test\Block\Template; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php index 1fbc66894cebacdfb377b9a2edc64a5e04fa17a1..6b79d3f4378eb68c03306271d9f951fae10259cd 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php @@ -34,6 +34,7 @@ class ProductForm extends \Magento\Catalog\Test\Block\Adminhtml\Product\ProductF } $this->showAdvancedSettings(); + $this->getTab('variations')->showContent(); return $this->fillTabs($tabs, $element); } } diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml index 4ffc8f05740d4454c14ded3bdc171699a7d93c1c..333fd02a273cdf57938df7df7fa4e9e801d26537 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <wrapper>rate</wrapper> <fields> <rate> diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php index 2f758e545f4821b7f8fc3fc271881099d2c70d82..33e1e795ca940f4dc40ade7b565ba87969a0c54f 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/CurrencySymbolForm.php @@ -34,6 +34,10 @@ class CurrencySymbolForm extends Form public function fill(FixtureInterface $fixture, SimpleElement $element = null) { $element = $this->_rootElement->find(sprintf($this->currencyRow, $fixture->getCode()), Locator::SELECTOR_XPATH); - return parent::fill($fixture, $element); + $data = $fixture->getData(); + unset($data['code']); + $mapping = $this->dataMapping($data); + $this->_fill($mapping, $element); + return $this; } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php index b262872d048e724c5c3fc5570cb79e82b6030db4..e840b736e06357961ff3446ab37e661e27d93e58 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Group/Edit/Form.php @@ -6,15 +6,10 @@ namespace Magento\Customer\Test\Block\Adminhtml\Group\Edit; -use Magento\Backend\Test\Block\Widget\Form as AbstractForm; - /** - * Class Form - * Customer group edit form - * - * @package Magento\Customer\Test\Block\Adminhtml\Group\Edit + * Customer group edit form. */ -class Form extends AbstractForm +class Form extends \Magento\Mtf\Block\Form { // } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomer.php deleted file mode 100644 index 744387049f2bc348cc2ea1ad106c6d472e3c885b..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomer.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; - -/** - * Class CreateCustomer. - * Curl handler for creating customer through registration page. - * - */ -class CreateCustomer extends Curl -{ - /** - * Post request for creating customer - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $fixture->getData('fields'); - $fields = []; - foreach ($data as $key => $field) { - $fields[$key] = $field['value']; - } - $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; - $curl = new CurlTransport(); - $curl->write(CurlInterface::POST, $url, '1.0', [], $fields); - $response = $curl->read(); - $curl->close(); - - return $response; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomerBackend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomerBackend.php deleted file mode 100644 index cad3c992efa4681f8bf0851d50fa211c22aad7cc..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/CreateCustomerBackend.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Curl handler for creating customer in admin - * - */ -class CreateCustomerBackend extends Curl -{ - /** - * Prepare POST data for creating customer request - * - * @param FixtureInterface $fixture - * @return array - */ - protected function _prepareData(FixtureInterface $fixture) - { - $data = $fixture->getData('fields'); - foreach ($data as $key => $values) { - $value = $this->_getValue($values); - if (null === $value) { - continue; - } - $data[$key] = $value; - } - - $curlData['account'] = $data; - return $curlData; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function _getValue($values) - { - if (!isset($values['value'])) { - return null; - } - return isset($values['input_value']) ? $values['input_value'] : $values['value']; - } - - /** - * Post request for creating customer in backend - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $params = $this->_prepareData($fixture); - - $url = $_ENV['app_backend_url'] . 'customer/index/save/active_tab/account'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $params); - $response = $curl->read(); - $curl->close(); - - return $response; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php deleted file mode 100644 index 43456cb34eec54dc87dd5f795753e44e06856fd7..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Curl/SaveCustomerWithAddress.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; - -/** - * Curl handler for saving customer address in admin - * - */ -class SaveCustomerWithAddress extends Curl -{ - /** - * Url for saving data - * - * @var string - */ - protected $saveUrl = '/customer/address/formPost/?nocookie=true'; - - /** - * Url for saving customer - * - * @var string - */ - protected $saveCustomer = 'customer/account/createpost/?nocookie=true'; - - /** - * Url of new address form - * - * @var string - */ - protected $addressNew = '/customer/address/new/?nocookie=true'; - - /** - * Form key - * - * @var string - */ - protected $formKey; - - /** - * Prepare POST data for creating customer request - * - * @param array $data - * @return array - */ - protected function prepareData($data) - { - $curlData = []; - foreach ($data as $key => $values) { - $value = $this->getValue($values); - if (null === $value) { - continue; - } - $curlData[$key] = $value; - } - $curlData['success_url'] = ''; - $curlData['error_url'] = ''; - $curlData['default_billing'] = 1; - $curlData['default_shipping'] = 1; - - return $curlData; - } - - /** - * Retrieve field value or return null if value does not exist - * - * @param array $values - * @return null|mixed - */ - protected function getValue($values) - { - if (!isset($values['value'])) { - return null; - } - return isset($values['input_value']) ? $values['input_value'] : $values['value']; - } - - /** - * Execute handler - * - * @param FixtureInterface $fixture - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var \Magento\Customer\Test\Fixture\Customer $fixture */ - $address = $fixture->getDefaultBilling(); - $fields = $this->prepareData($address->getData('fields')); - $url = $_ENV['app_frontend_url'] . $this->saveUrl; - $curl = $this->saveCustomer($fixture); - $fields['form_key'] = $this->formKey; - $curl->write(CurlInterface::POST, $url, '1.0', [], $fields); - $response = $curl->read(); - $curl->close(); - - return $response; - } - - /** - * Get from key from response - * - * @param string $response - * @return string - */ - protected function getFromKey($response) - { - preg_match('/input name="form_key" type="hidden" value="(\w+)"/', $response, $matches); - $formKey = ''; - if (!empty($matches[1])) { - $formKey = $matches[1]; - } - return $formKey; - } - - /** - * Save new customer and get form key - * - * @param \Magento\Customer\Test\Fixture\Customer $fixture - * @return CurlTransport - */ - protected function saveCustomer(\Magento\Customer\Test\Fixture\Customer $fixture) - { - $data = $fixture->getData('fields'); - $fields = []; - foreach ($data as $key => $field) { - $fields[$key] = $field['value']; - } - $url = $_ENV['app_frontend_url'] . $this->saveCustomer; - $curl = new CurlTransport(); - $curl->write(CurlInterface::POST, $url, '1.0', [], $fields); - $curl->read(); - $urlForm = $_ENV['app_frontend_url'] . $this->addressNew; - $curl->write(CurlInterface::GET, $urlForm, '1.0', []); - $response = $curl->read(); - $this->formKey = $this->getFromKey($response); - - return $curl; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php index a13c263aeab7fe4db7e475dc11ee6f668fbfe4a8..2d8f5faf09f8860b6d20b3e5a08bdc2ca5b21c0f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php @@ -195,23 +195,27 @@ class Curl extends AbstractCurl implements CustomerInterface */ protected function prepareAddressData(array $curlData) { + $address = []; foreach (array_keys($curlData['address']) as $key) { - $curlData['address'][$key]['_deleted'] = ''; - $curlData['address'][$key]['region'] = ''; - if (!is_array($curlData['address'][$key]['street'])) { - $street = $curlData['address'][$key]['street']; - $curlData['address'][$key]['street'] = []; - $curlData['address'][$key]['street'][] = $street; + $addressKey = 'new_' . $key; + $address[$addressKey] = $curlData['address'][$key]; + $address[$addressKey]['_deleted'] = ''; + $address[$addressKey]['region'] = ''; + if (!is_array($address[$addressKey]['street'])) { + $street = $address[$addressKey]['street']; + $address[$addressKey]['street'] = []; + $address[$addressKey]['street'][] = $street; } - if (isset($curlData['address'][$key]['default_billing'])) { - $value = $curlData['address'][$key]['default_billing'] === 'Yes' ? 'true' : 'false'; - $curlData['address'][$key]['default_billing'] = $value; + if (isset($address[$addressKey]['default_billing'])) { + $value = $address[$addressKey]['default_billing'] === 'Yes' ? 'true' : 'false'; + $address[$addressKey]['default_billing'] = $value; } - if (isset($curlData['address'][$key]['default_shipping'])) { - $value = $curlData['address'][$key]['default_shipping'] === 'Yes' ? 'true' : 'false'; - $curlData['address'][$key]['default_shipping'] = $value; + if (isset($address[$addressKey]['default_shipping'])) { + $value = $address[$addressKey]['default_shipping'] === 'Yes' ? 'true' : 'false'; + $address[$addressKey]['default_shipping'] = $value; } } + $curlData['address'] = $address; return $curlData; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Ui/CreateAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Ui/CreateAddress.php deleted file mode 100644 index b2e9bdd33d69766478fad90cc5c20634f96f45f6..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Ui/CreateAddress.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Ui; - -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * UI handler for creating customer address. - */ -class CreateAddress extends \Magento\Mtf\Handler\Ui -{ - /** - * Execute handler - * - * @param FixtureInterface $fixture [optional] - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var \Magento\Customer\Test\Fixture\Address $fixture */ - // Pages - $loginPage = Factory::getPageFactory()->getCustomerAccountLogin(); - $addressPage = Factory::getPageFactory()->getCustomerAddressEdit(); - - $loginPage->open(); - if ($loginPage->getLoginBlock()->isVisible()) { - $loginPage->getLoginBlock()->login($fixture->getCustomer()); - } - - $addressPage->open(); - $addressPage->getEditForm()->editCustomerAddress($fixture); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Webapi/CreateCustomer.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Webapi/CreateCustomer.php deleted file mode 100644 index af06e68b03ef85b14d92d27f4044803de10e059b..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Webapi/CreateCustomer.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Test\Handler\Webapi; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Webapi; -use Magento\Mtf\Util\Protocol\SoapTransport; - -/** - * Class CreateCustomer - * - */ -class CreateCustomer extends Webapi -{ - /** - * Create customer through request - * - * @param FixtureInterface $fixture [optional] - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - $configuration = $this->_configuration->get('handler/0/webapi/0/value'); - - $soap = new SoapTransport($configuration['soap']); - return $soap->call('customerCustomerList', $fixture->getData()); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php index 6012db8cdd17d501e64154dfe8892b8c14dcc2f3..ab84bfc693502818ea324506b9ff465771960798 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.php @@ -25,8 +25,8 @@ class Address extends AbstractRepository 'data' => $defaultData, ]; - $this->_data['address_US_1'] = $this->_getUS1(); - $this->_data['address_US_2'] = $this->_getUS2(); + $this->_data['US_address_1'] = $this->_getUS1(); + $this->_data['US_address_2'] = $this->_getUS2(); $this->_data['address_UK'] = $this->getAddressUK(); $this->_data['address_UK_2'] = $this->getAddressUK2(); $this->_data['address_UK_with_VAT'] = $this->getAddressUKWithVAT($this->_data['address_UK']); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml index e379604530bcdc5cbafede7c11370a74e5639b94..b39490b24c48af4d2b10c1ac7e45fdc7d4a367d0 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml @@ -37,21 +37,6 @@ <field name="default_shipping" xsi:type="string">No</field> </dataset> - <dataset name="US_NY_address_billing"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6262 Fifth Avenue</field> - <field name="city" xsi:type="string">New York</field> - <field name="region_id" xsi:type="string">New York</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="default_billing" xsi:type="string">No</field> - <field name="default_shipping" xsi:type="string">No</field> - </dataset> - <dataset name="US_address_default_shipping"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> @@ -67,43 +52,42 @@ <field name="default_shipping" xsi:type="string">No</field> </dataset> - <dataset name="default_US_address"> + <dataset name="US_address_1"> + <field name="firstname" xsi:type="string">John</field> + <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="city" xsi:type="string">Culver City</field> - <field name="region_id" xsi:type="string">California</field> + <field name="street" xsi:type="string">6161 West Centinela Avenue</field> <field name="postcode" xsi:type="string">90230</field> <field name="country_id" xsi:type="string">United States</field> + <field name="region_id" xsi:type="string">California</field> <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="default_billing" xsi:type="string">Yes</field> - <field name="default_shipping" xsi:type="string">Yes</field> </dataset> - <dataset name="US_address_without_email"> + <dataset name="US_address_1_without_email"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> <field name="city" xsi:type="string">Culver City</field> - <field name="region_id" xsi:type="string">California</field> + <field name="street" xsi:type="string">6161 West Centinela Avenue</field> <field name="postcode" xsi:type="string">90230</field> <field name="country_id" xsi:type="string">United States</field> + <field name="region_id" xsi:type="string">California</field> <field name="telephone" xsi:type="string">555-55-555-55</field> </dataset> - <dataset name="US_address_NY"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> + <dataset name="US_address_2"> + <field name="firstname" xsi:type="string">Billy</field> + <field name="lastname" xsi:type="string">Holiday</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">3222 Cliffside Drive</field> - <field name="city" xsi:type="string">Binghamton</field> - <field name="region_id" xsi:type="string">New York</field> - <field name="postcode" xsi:type="string">13901</field> + <field name="email" xsi:type="string">b.holliday@example.net</field> + <field name="city" xsi:type="string">New York</field> + <field name="street" xsi:type="string">727 5th Ave</field> + <field name="postcode" xsi:type="string">10022</field> <field name="country_id" xsi:type="string">United States</field> - <field name="telephone" xsi:type="string">607-481-7802</field> - <field name="default_billing" xsi:type="string">Yes</field> - <field name="default_shipping" xsi:type="string">Yes</field> + <field name="region_id" xsi:type="string">New York</field> + <field name="telephone" xsi:type="string">777-77-77-77</field> </dataset> <dataset name="US_address_TX"> @@ -121,21 +105,37 @@ <field name="default_shipping" xsi:type="string">Yes</field> </dataset> - <dataset name="customer_US"> + <dataset name="US_address_NY"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> + <field name="street" xsi:type="string">3222 Cliffside Drive</field> + <field name="city" xsi:type="string">Binghamton</field> + <field name="region_id" xsi:type="string">New York</field> + <field name="postcode" xsi:type="string">13901</field> + <field name="country_id" xsi:type="string">United States</field> + <field name="telephone" xsi:type="string">607-481-7802</field> + <field name="default_billing" xsi:type="string">Yes</field> + <field name="default_shipping" xsi:type="string">Yes</field> + </dataset> + + <dataset name="US_address_NY_default_no"> + <field name="firstname" xsi:type="string">John</field> + <field name="lastname" xsi:type="string">Doe</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> + <field name="company" xsi:type="string">Magento %isolation%</field> + <field name="street" xsi:type="string">6262 Fifth Avenue</field> + <field name="city" xsi:type="string">New York</field> + <field name="region_id" xsi:type="string">New York</field> <field name="postcode" xsi:type="string">90230</field> <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="fax" xsi:type="string">555-55-555-55</field> + <field name="default_billing" xsi:type="string">No</field> + <field name="default_shipping" xsi:type="string">No</field> </dataset> - <dataset name="customer_UK"> + <dataset name="UK_address_default_billing"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="email" xsi:type="string">JaneDoe_%isolation%@example.com</field> @@ -147,9 +147,11 @@ <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> <field name="fax" xsi:type="string">444-44-444-44</field> + <field name="default_billing" xsi:type="string">Yes</field> + <field name="default_shipping" xsi:type="string">Yes</field> </dataset> - <dataset name="address_UK_default_billing_address"> + <dataset name="UK_address"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="email" xsi:type="string">JaneDoe_%isolation%@example.com</field> @@ -161,61 +163,9 @@ <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> <field name="fax" xsi:type="string">444-44-444-44</field> - <field name="default_billing" xsi:type="string">Yes</field> - <field name="default_shipping" xsi:type="string">Yes</field> - </dataset> - - <dataset name="address_US_1"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - </dataset> - - <dataset name="address_US_2"> - <field name="firstname" xsi:type="string">Billy</field> - <field name="lastname" xsi:type="string">Holiday</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="email" xsi:type="string">b.holliday@example.net</field> - <field name="city" xsi:type="string">New York</field> - <field name="street" xsi:type="string">727 5th Ave</field> - <field name="postcode" xsi:type="string">10022</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">New York</field> - <field name="telephone" xsi:type="string">777-77-77-77</field> - </dataset> - - <dataset name="address_data_US_1"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - </dataset> - - <dataset name="address_DE"> - <field name="firstname" xsi:type="string">Jan</field> - <field name="lastname" xsi:type="string">Jansen</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Berlin</field> - <field name="street" xsi:type="string">Augsburger Strabe 41</field> - <field name="postcode" xsi:type="string">10789</field> - <field name="country_id" xsi:type="string">Germany</field> - <field name="region_id" xsi:type="string">Berlin</field> - <field name="telephone" xsi:type="string">333-33-333-33</field> </dataset> - <dataset name="address_UK"> + <dataset name="UK_address_without_email"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> @@ -223,23 +173,12 @@ <field name="street" xsi:type="string">172, Westminster Bridge Rd</field> <field name="postcode" xsi:type="string">SE1 7RW</field> <field name="country_id" xsi:type="string">United Kingdom</field> - <field name="region_id" xsi:type="string">London</field> - <field name="telephone" xsi:type="string">444-44-444-44</field> - </dataset> - - <dataset name="address_UK_2"> - <field name="firstname" xsi:type="string">Jane</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="city" xsi:type="string">Manchester</field> - <field name="street" xsi:type="string">42 King Street West</field> - <field name="postcode" xsi:type="string">M3 2WY</field> - <field name="country_id" xsi:type="string">United Kingdom</field> - <field name="region_id" xsi:type="string">Manchester</field> + <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> + <field name="fax" xsi:type="string">444-44-444-44</field> </dataset> - <dataset name="address_UK_with_VAT"> + <dataset name="UK_address_with_VAT"> <field name="firstname" xsi:type="string">Jane</field> <field name="lastname" xsi:type="string">Doe</field> <field name="company" xsi:type="string">Magento %isolation%</field> @@ -253,5 +192,17 @@ <field name="default_billing" xsi:type="string">Yes</field> <field name="default_shipping" xsi:type="string">Yes</field> </dataset> + + <dataset name="DE_address"> + <field name="firstname" xsi:type="string">Jan</field> + <field name="lastname" xsi:type="string">Jansen</field> + <field name="company" xsi:type="string">Magento %isolation%</field> + <field name="city" xsi:type="string">Berlin</field> + <field name="street" xsi:type="string">Augsburger Strabe 41</field> + <field name="postcode" xsi:type="string">10789</field> + <field name="country_id" xsi:type="string">Germany</field> + <field name="region_id" xsi:type="string">Berlin</field> + <field name="telephone" xsi:type="string">333-33-333-33</field> + </dataset> </repository> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml index a3eb0e57b62a60790483e504a2f020e7252744b0..2dc95ab415c6d8bebb759f0726e17366ed87a627 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml @@ -76,22 +76,6 @@ </field> </dataset> - <dataset name="customer_US"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - </dataset> - - <dataset name="customer_UK"> - <field name="firstname" xsi:type="string">Jane</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">JaneDoe_%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - </dataset> - <dataset name="johndoe_unique"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> @@ -144,7 +128,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_US_1</item> + <item name="presets" xsi:type="string">US_address_1</item> </field> </dataset> @@ -158,29 +142,18 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_US_1</item> + <item name="presets" xsi:type="string">US_address_1</item> </field> </dataset> - <dataset name="customer_US_1"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe%isolation%</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_US_1</item> - </field> - </dataset> - - <dataset name="customer_UK_1"> + <dataset name="customer_US"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_UK</item> + <item name="presets" xsi:type="string">US_address_1</item> </field> </dataset> @@ -191,7 +164,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_UK_default_billing_address</item> + <item name="presets" xsi:type="string">UK_address_default_billing</item> </field> </dataset> @@ -202,7 +175,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">address_UK_with_VAT</item> + <item name="presets" xsi:type="string">UK_address_with_VAT</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php index 80e7a2eef28ff3be93e1ba8068f640151f00676e..010ed24047c38808b955e7645fccfbcccf858f6e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php @@ -13,11 +13,9 @@ use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for CreateExistingCustomerFrontendEntity - * - * Test Flow: * Preconditions: - * 1.Customer is created + * 1.Customer is created. + * * Steps: * 1. Go to frontend. * 2. Click Register link. @@ -36,14 +34,14 @@ class CreateExistingCustomerFrontendEntity extends Injectable /* end tags */ /** - * Page CustomerAccountCreate + * Page CustomerAccountCreate. * * @var CustomerAccountCreate */ protected $customerAccountCreate; /** - * Page CustomerAccountLogout + * Page CustomerAccountLogout. * * @var CustomerAccountLogout */ @@ -57,51 +55,48 @@ class CreateExistingCustomerFrontendEntity extends Injectable protected $cmsIndex; /** - * Injection data + * Inject pages. * * @param CustomerAccountCreate $customerAccountCreate * @param CustomerAccountLogout $customerAccountLogout * @param CmsIndex $cmsIndex - * @param Customer $customer * @return array */ public function __inject( CustomerAccountCreate $customerAccountCreate, CustomerAccountLogout $customerAccountLogout, - CmsIndex $cmsIndex, - Customer $customer + CmsIndex $cmsIndex ) { $this->customerAccountLogout = $customerAccountLogout; $this->customerAccountCreate = $customerAccountCreate; $this->cmsIndex = $cmsIndex; - //Precondition - $customer->persist(); - return [ - 'customer' => $customer, - ]; } /** - * Create Existing Customer account on frontend + * Create Existing Customer account on frontend. * * @param Customer $customer * @return void */ public function testCreateExistingCustomer(Customer $customer) { - //Steps + // Precondition + $existingCustomer = clone $customer; + $customer->persist(); + + // Steps $this->cmsIndex->open(); $this->cmsIndex->getLinksBlock()->openLink('Register'); - $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer); + $this->customerAccountCreate->getRegisterForm()->registerCustomer($existingCustomer); } /** - * Logout customer from frontend account + * Logout customer from frontend account. * * @return void */ public function tearDown() { - $this->customerAccountLogout->open(); + $this->objectManager->create('Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep')->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml index 7c8b8ff68e45d059212dd8b1403f175a098f7b02..3fbdcf50f62d855f3aba5c3566609a72e0b34c8e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml @@ -6,9 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerFrontendEntity"> - <variation name="CreateExistingCustomerFrontendEntityVariation1"> - <constraint name="Magento\Customer\Test\Constraint\AssertCustomerFailRegisterMessage"/> - </variation> - </testCase> + <testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerFrontendEntity"> + <variation name="CreateExistingCustomerFrontendEntityVariation1"> + <data name="customer/data/firstname" xsi:type="string">john</data> + <data name="customer/data/lastname" xsi:type="string">doe</data> + <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data> + <data name="customer/data/password" xsi:type="string">123123q</data> + <data name="customer/data/password_confirmation" xsi:type="string">123123q</data> + <constraint name="Magento\Customer\Test\Constraint\AssertCustomerFailRegisterMessage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml index f998fde69cd1802f9eb05e63c6ae26622301b614..d4c96eef41e1caf37de7b2357dbfba0dec7e7350 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Customer\Test\TestCase\DeleteCustomerAddressTest"> <variation name="DeleteCustomerAddressTestVariation1"> <data name="customer/dataSet" xsi:type="string">default</data> - <data name="customer/data/address/presets" xsi:type="string">US_address_default_billing,US_NY_address_billing</data> + <data name="customer/data/address/presets" xsi:type="string">US_address_default_billing,US_address_NY_default_no</data> <constraint name="Magento\Customer\Test\Constraint\AssertAddressDeletedFrontend"/> <constraint name="Magento\Customer\Test\Constraint\AssertAddressDeletedBackend"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml index 28a5aa51e2f9bfb87966e81d9f6e77129c2f070a..42e10059a897b80bc35e7c0bccffb34f56469c75 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\ForgotPasswordOnFrontendTest"> <variation name="ForgotPasswordOnFrontendTestVariation1"> - <data name="customer/dataSet" xsi:type="string">customer_US_1</data> + <data name="customer/dataSet" xsi:type="string">customer_US</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForgotPasswordSuccessMessage" /> </variation> </testCase> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php index 2892af943fdd10dde6a8f51e40fa4580fe885047..63308bbea50d1103e598c31a2d40558952ce77d6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php @@ -135,14 +135,4 @@ class UpdateCustomerFrontendEntityTest extends Injectable $this->customerAddressEdit->getEditForm()->fill($address); $this->customerAddressEdit->getEditForm()->saveAddress(); } - - /** - * Customer logout from account - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep')->run(); - } } diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php index 04aa6c4ca73d61e4ef01e61ac9929d9a225d2b59..22b8d54518de92625349f1aa55fdf5cc7044695b 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php @@ -25,7 +25,7 @@ use Magento\CurrencySymbol\Test\Page\Adminhtml\SystemCurrencyIndex; * 5. Perform assertions. * * @group Localization_(PS) - * @ZephyrId MAGETWO-12427, MAGETWO-36824 + * @ZephyrId MAGETWO-36824 */ class CreateCurrencyRateTest extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml index 69a8cb56138fc5d25a46a3eb72ac00e5dd66be17..10ba00e4d5db1f8c1791e7c96b82c0ddde64d343 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml @@ -114,7 +114,6 @@ <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/weight" xsi:type="string">10</data> <data name="product/data/special_price" xsi:type="string">40</data> <data name="isRequired" xsi:type="string">No</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml index 2c81ac17aeccd868843f2979155eaebd647408d8..add7f2519646396f0697621f74646ce4986d46bb 100644 --- a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml @@ -11,9 +11,9 @@ <data name="description" xsi:type="string">Checkout as guest using FedEx with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="address/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="address/dataSet" xsi:type="string">UK_address</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">Federal Express</data> <data name="shipping/shipping_method" xsi:type="string">International Economy</data> <data name="cart/data/shipping_method" xsi:type="string">International Economy</data> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml index 18f90c0f3157a1fc6295e3647311913f2fcf3f84..b6433e7ad8ed1e3a5d3715920b9e4f7cc85f4e47 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\GiftMessage\Test\TestCase\CheckoutWithGiftMessagesTest"> <variation name="CheckoutWithGiftMessagesTestVariation1"> <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">login</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -26,8 +26,8 @@ </variation> <variation name="CheckoutWithGiftMessagesTestVariation2"> <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">login</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml index 01f5463b5f052fac98c49d795f3ac38e4979139f..ac1253f96a0c0d1486389a3bf354b1842e4df1ac 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml @@ -6,22 +6,22 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="importExport" module="Magento_ImportExport" type="flat" entity_type="importexport_importdata" class="Magento\ImportExport\Test\Fixture\ImportExport"> - <dataset name="default"> - <field name="entity" xsi:type="string">Products</field> - <field name="behavior" xsi:type="string">CSV</field> - </dataset> - <field name="id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="entity" is_required=""> - <default_value xsi:type="string">Products</default_value> - </field> - <field name="behavior" is_required=""> - <default_value xsi:type="string">CSV</default_value> - </field> - <field name="data_export" is_required=""> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="importExport" module="Magento_ImportExport" type="flat" entity_type="importexport_importdata" class="Magento\ImportExport\Test\Fixture\ImportExport"> + <dataset name="default"> + <field name="entity" xsi:type="string">Products</field> + <field name="behavior" xsi:type="string">CSV</field> + </dataset> + <field name="id" is_required="1"> + <default_value xsi:type="null" /> + </field> + <field name="entity" is_required=""> + <default_value xsi:type="string">Products</default_value> + </field> + <field name="file_format" is_required=""> + <default_value xsi:type="string">CSV</default_value> + </field> + <field name="data_export" is_required=""> + <default_value xsi:type="null" /> + </field> + </fixture> </config> 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 index 3f1616de3dbd0340573923778b6036b34776df03..b21f140454da51bf0b7428fd6d515c84b52534b6 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <fields> <username> <selector>[name='adminUsername']</selector> 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 index e9e81483fa4943a59bb69b5f31ca0bb2552d954e..efe02fa2148c8c0108b0324d6790ab31df0c78c2 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php @@ -24,11 +24,11 @@ class CustomizeStore extends Form protected $next = "[ng-click*='checkModuleConstraints']"; /** - * First field selector + * Module configuration section. * * @var string */ - protected $firstField = '[ng-model*="language"]'; + protected $moduleConfiguration = '.customize-your-store-advanced'; /** * Click on 'Next' button. @@ -49,7 +49,17 @@ class CustomizeStore extends Form */ public function fill(FixtureInterface $fixture, SimpleElement $element = null) { - $this->waitForElementVisible($this->firstField); - return parent::fill($fixture, $element); + $this->waitForElementVisible($this->moduleConfiguration); + $data = $fixture->getData(); + $storeData = []; + foreach ($data as $key => $value) { + if (strpos($key, 'store') === 0) { + $storeData[$key] = $value; + } + } + $mapping = $this->dataMapping($storeData); + $this->_fill($mapping, $element); + + return $this; } } 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 index 24eaf10fa6a1ae9b5c06b4b06d41736b6e36f93d..8c99894d4e76836ccdd88c30f6498f6fbaba0c00 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml @@ -7,13 +7,13 @@ --> <mapping strict="0"> <fields> - <currency> - <selector>[ng-model*='currency']</selector> + <storeCurrency> + <selector>#storeCurrency</selector> <input>select</input> - </currency> - <language> - <selector>[ng-model*='language']</selector> + </storeCurrency> + <storeLanguage> + <selector>#storeLanguage</selector> <input>select</input> - </language> + </storeLanguage> </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 index e1efe0955d55b1affbec3bd5ecce0045617dad7a..b532f1d1070a6439e06709987196760716415b75 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php @@ -8,6 +8,8 @@ namespace Magento\Install\Test\Block; use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Database form. @@ -28,6 +30,28 @@ class Database extends Form */ protected $next = "[ng-click*='testConnection']"; + /** + * Fill database form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + $dbData = []; + foreach ($data as $key => $value) { + if (strpos($key, 'db') === 0) { + $dbData[$key] = $value; + } + } + $mapping = $this->dataMapping($dbData); + $this->_fill($mapping, $element); + + return $this; + } + /** * Get 'Test connection successful.' message. * 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 index 654dd1ffc8fe3ad117cf1db3a7bb24ee7da00594..64a90917c4c0245490565f507e3def561752cd70 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php @@ -7,6 +7,8 @@ namespace Magento\Install\Test\Block; use Magento\Mtf\Block\Form; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Web configuration block. @@ -27,6 +29,28 @@ class WebConfiguration extends Form */ protected $advancedOptions = "[ng-click*='advanced']"; + /** + * Fill web configuration form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + $webConfiguration = []; + foreach ($data as $key => $value) { + if (strpos($key, 'db') !== 0 && strpos($key, 'store') !== 0) { + $webConfiguration[$key] = $value; + } + } + $mapping = $this->dataMapping($webConfiguration); + $this->_fill($mapping, $element); + + return $this; + } + /** * Click on 'Next' button. * 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 index f88d760c4c9cbd9a7c8d3b81bdb73f12338a9b79..a4b04f205eebf5c1305bda785977155d6449f569 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml @@ -7,7 +7,9 @@ --> <mapping strict="0"> <fields> - <web /> + <baseUrl> + <selector>[name="base_url"]</selector> + </baseUrl> <admin /> <keyOwn> <selector>[value="user"]</selector> 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 index 07ce519b594d395e17adffc2cc6af1ab0f0f2ffb..dec19f621eda153301cce67d640609aa1bc406d2 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php @@ -24,7 +24,7 @@ class AssertSuccessInstall extends AbstractConstraint protected $adminFieldsList = [ ['pageData' => 'username', 'fixture' => 'username'], ['pageData' => 'e-mail', 'fixture' => 'email'], - ['pageData' => 'your_store_address', 'fixture' => 'web'], + ['pageData' => 'your_store_address', 'fixture' => 'baseUrl'], ['pageData' => 'magento_admin_address', 'fixture' => 'admin'] ]; @@ -57,8 +57,8 @@ class AssertSuccessInstall extends AbstractConstraint $allData[$key] = isset($value['value']) ? $value['value'] : $value; } - $allData['web'] = (isset($allData['https']) ? $allData['https'] : $allData['web']); - $allData['admin'] = $allData['web'] . $allData['admin'] . '/'; + $allData['baseUrl'] = (isset($allData['https']) ? $allData['https'] : $allData['baseUrl']); + $allData['admin'] = $allData['baseUrl'] . $allData['admin'] . '/'; foreach ($this->adminFieldsList as $field) { \PHPUnit_Framework_Assert::assertEquals( 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 index d846de8f0bd45b0ed71068f8146e171994d682f6..2d83153459204f88755791b178917c92d4c01c79 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml @@ -6,25 +6,25 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="install" module="Magento_Install" type="virtual" entity_type="install" repository_class="Magento\Install\Test\Repository\Install" handler_interface="Magento\Install\Test\Handler\Install\InstallInterface" class="Magento\Install\Test\Fixture\Install"> - <field name="dbHost"/> - <field name="dbUser"/> - <field name="dbPassword"/> - <field name="dbName"/> - <field name="web"/> - <field name="admin"/> - <field name="adminUsername"/> - <field name="adminEmail"/> - <field name="adminPassword"/> - <field name="adminConfirm"/> - <field name="apacheRewrites"/> - <field name="dbTablePrefix"/> - <field name="keyOwn"/> - <field name="httpsAdmin"/> - <field name="https"/> - <field name="httpsFront"/> - <field name="keyValue"/> - <field name="language"/> - <field name="currency"/> - </fixture> + <fixture name="install" module="Magento_Install" type="virtual" entity_type="install" repository_class="Magento\Install\Test\Repository\Install" handler_interface="Magento\Install\Test\Handler\Install\InstallInterface" class="Magento\Install\Test\Fixture\Install"> + <field name="dbHost" /> + <field name="dbUser" /> + <field name="dbPassword" /> + <field name="dbName" /> + <field name="dbTablePrefix" /> + <field name="baseUrl" /> + <field name="admin" /> + <field name="adminUsername" /> + <field name="adminEmail" /> + <field name="adminPassword" /> + <field name="adminConfirm" /> + <field name="apacheRewrites" /> + <field name="keyOwn" /> + <field name="httpsAdmin" /> + <field name="https" /> + <field name="httpsFront" /> + <field name="keyValue" /> + <field name="storeLanguage" /> + <field name="storeCurrency" /> + </fixture> </config> 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 index fbfb262f1206d798a750dcfede4c913b96eed3c5..ccf21709a84ab2f1d5f59eaf62cb5444a49df765 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php @@ -12,17 +12,13 @@ use Magento\Install\Test\Fixture\Install as InstallConfig; use Magento\User\Test\Fixture\User; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; -use Magento\Mtf\Config\DataInterface; use Magento\Install\Test\Constraint\AssertAgreementTextPresent; use Magento\Install\Test\Constraint\AssertSuccessfulReadinessCheck; -use Magento\Mtf\ObjectManagerFactory; /** * PLEASE ADD NECESSARY INFO BEFORE RUNNING TEST TO * ../dev/tests/functional/config/config.xml * - * Test Flow: - * * Preconditions: * 1. Uninstall Magento. * @@ -67,20 +63,20 @@ class InstallTest extends Injectable */ public function __prepare() { - $config = ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\DataInterface'); + $config = $this->objectManager->get('Magento\Mtf\Config\DataInterface'); // Prepare config data $configData['dbHost'] = $config->get('install/0/host/0'); $configData['dbUser'] = $config->get('install/0/user/0'); $configData['dbPassword'] = $config->get('install/0/password/0'); $configData['dbName'] = $config->get('install/0/dbName/0'); - $configData['web'] = $config->get('install/0/baseUrl/0'); + $configData['baseUrl'] = $config->get('install/0/baseUrl/0'); $configData['admin'] = $config->get('install/0/backendName/0'); return ['configData' => $configData]; } /** - * Injection data. + * Uninstall Magento. * * @param CmsIndex $homePage * @param Install $installPage @@ -99,24 +95,24 @@ class InstallTest extends Injectable * Install Magento via web interface. * * @param User $user - * @param array $install * @param array $configData * @param FixtureFactory $fixtureFactory * @param AssertAgreementTextPresent $assertLicense * @param AssertSuccessfulReadinessCheck $assertReadiness + * @param array $install [optional] * @return array */ public function test( User $user, - array $install, array $configData, FixtureFactory $fixtureFactory, AssertAgreementTextPresent $assertLicense, - AssertSuccessfulReadinessCheck $assertReadiness + AssertSuccessfulReadinessCheck $assertReadiness, + array $install = [] ) { $dataConfig = array_merge($install, $configData); - if ($dataConfig['httpsFront'] != "-") { - $dataConfig['https'] = str_replace('http', 'https', $dataConfig['web']); + if (isset($dataConfig['httpsFront'])) { + $dataConfig['https'] = str_replace('http', 'https', $dataConfig['baseUrl']); } /** @var InstallConfig $installConfig */ $installConfig = $fixtureFactory->create('Magento\Install\Test\Fixture\Install', ['data' => $dataConfig]); diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml index a527c8538f6140ecff520b4f49e72bf3731d49ca..ff6ba2d1f1d7c44aa00109c83150752118a34b5b 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml @@ -6,113 +6,59 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Install\Test\TestCase\InstallTest"> - <variation name="InstallTestVariation1"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with default values</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="InstallTestVariation2"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">custom</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with custom admin path</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="InstallTestVariation3"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">Yes</data> - <data name="install/keyValue" xsi:type="string">123123qa</data> - <data name="install/language" xsi:type="string">German (Germany)</data> - <data name="install/currency" xsi:type="string">Euro (EUR)</data> - <data name="currencySymbol" xsi:type="string">€</data> - <data name="languageTemplate" xsi:type="string">Suchbegriffe</data> - <data name="description" xsi:type="string">install with custom encryption key and changed currency and locale</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\Install\Test\Constraint\AssertKeyCreated"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\Install\Test\Constraint\AssertCurrencySelected"/> - <constraint name="Magento\Install\Test\Constraint\AssertLanguageSelected"/> - </variation> - <variation name="InstallTestVariation4"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">prefix1_</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">Chinese (China)</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with table prefix</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="InstallTestVariation5"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">-</data> - <data name="install/httpsAdmin" xsi:type="string">-</data> - <data name="install/apacheRewrites" xsi:type="string">Yes</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with enabled url rewrites</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\Install\Test\Constraint\AssertRewritesEnabled"/> - </variation> - <variation name="InstallTestVariation6"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="install/dbTablePrefix" xsi:type="string">-</data> - <data name="install/admin" xsi:type="string">-</data> - <data name="install/httpsFront" xsi:type="string">Yes</data> - <data name="install/httpsAdmin" xsi:type="string">Yes</data> - <data name="install/apacheRewrites" xsi:type="string">-</data> - <data name="install/keyOwn" xsi:type="string">-</data> - <data name="install/keyValue" xsi:type="string">-</data> - <data name="install/language" xsi:type="string">-</data> - <data name="install/currency" xsi:type="string">-</data> - <data name="currencySymbol" xsi:type="string">-</data> - <data name="languageTemplate" xsi:type="string">-</data> - <data name="description" xsi:type="string">install with enabled secure urls</data> - <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\Install\Test\Constraint\AssertSecureUrlEnabled"/> - </variation> - </testCase> + <testCase name="Magento\Install\Test\TestCase\InstallTest"> + <variation name="InstallTestVariation1"> + <data name="description" xsi:type="string">Install with default values.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="InstallTestVariation2"> + <data name="description" xsi:type="string">Install with custom admin path.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/admin" xsi:type="string">custom</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="InstallTestVariation3"> + <data name="description" xsi:type="string">Install with custom encryption key and changed currency and locale.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/keyOwn" xsi:type="string">Yes</data> + <data name="install/keyValue" xsi:type="string">123123qa</data> + <data name="install/storeLanguage" xsi:type="string">German (Germany)</data> + <data name="install/storeCurrency" xsi:type="string">Euro (EUR)</data> + <data name="currencySymbol" xsi:type="string">€</data> + <data name="languageTemplate" xsi:type="string">Suchbegriffe</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\Install\Test\Constraint\AssertKeyCreated" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\Install\Test\Constraint\AssertCurrencySelected" /> + <constraint name="Magento\Install\Test\Constraint\AssertLanguageSelected" /> + </variation> + <variation name="InstallTestVariation4"> + <data name="description" xsi:type="string">Install with table prefix.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/dbTablePrefix" xsi:type="string">prefix1_</data> + <data name="install/storeLanguage" xsi:type="string">Chinese (China)</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="InstallTestVariation5"> + <data name="description" xsi:type="string">Install with enabled url rewrites.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/apacheRewrites" xsi:type="string">Yes</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\Install\Test\Constraint\AssertRewritesEnabled" /> + </variation> + <variation name="InstallTestVariation6"> + <data name="description" xsi:type="string">Install with enabled secure urls.</data> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="install/httpsFront" xsi:type="string">Yes</data> + <data name="install/httpsAdmin" xsi:type="string">Yes</data> + <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\Install\Test\Constraint\AssertSecureUrlEnabled" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml index c17dbfb6ada9f96177f87d9d17223643041df640..56ee9f7302d96e787e64d4e0cf408d768f65cfab 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateEdit.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="TemplateEdit" area="Adminhtml" mca="newsletter/template/edit" module="Magento_Newsletter"> - <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="editForm" class="Magento\Backend\Test\Block\Widget\Form" locator="[id='page:main-container']" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="TemplateEdit" area="Adminhtml" mca="newsletter/template/edit" module="Magento_Newsletter"> + <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="editForm" class="Magento\Mtf\Block\Form" locator="[id='page:main-container']" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml index 968920909e50d99c93a0f21dcc54c7f645a07ddf..b2744b0902e2c80329f8a345cbf953555ca6554c 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateNewIndex.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="TemplateNewIndex" area="Adminhtml" mca="newsletter/template/new/index" module="Magento_Newsletter"> - <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="editForm" class="Magento\Backend\Test\Block\Widget\Form" locator="[id='page:main-container']" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="TemplateNewIndex" area="Adminhtml" mca="newsletter/template/new/index" module="Magento_Newsletter"> + <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="editForm" class="Magento\Mtf\Block\Form" locator="[id='page:main-container']" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml index 8e17bfc6814b8ab37822b55279cb9dbffaaba742..c4840bceae2123bf11213311c8756b1707b48ba7 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="TemplateQueue" area="Adminhtml" mca="newsletter/queue/edit" module="Magento_Newsletter"> - <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="editForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#queue_edit_form" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="TemplateQueue" area="Adminhtml" mca="newsletter/queue/edit" module="Magento_Newsletter"> + <block name="formPageActions" class="Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="editForm" class="Magento\Mtf\Block\Form" locator="#queue_edit_form" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml index e996602cc41fc49ed5c141addcfd07d71325b91f..26430b8ea9c7233e8734019c057493a2435bbbf3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml @@ -6,36 +6,38 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\CustomerReviewReportEntityTest"> - <variation name="CustomerReviewReportEntityTestVariation1"> - <data name="customerLogin" xsi:type="string">Yes</data> - <data name="product/dataSet" xsi:type="string">default</data> - <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> - <data name="reviewsCount" xsi:type="string">1</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid"/> - </variation> - <variation name="CustomerReviewReportEntityTestVariation2"> - <data name="customerLogin" xsi:type="string">Yes</data> - <data name="product/dataSet" xsi:type="string">default</data> - <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> - <data name="reviewsCount" xsi:type="string">2</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid"/> - </variation> - <variation name="CustomerReviewReportEntityTestVariation3"> - <data name="customerLogin" xsi:type="string">No</data> - <data name="product/dataSet" xsi:type="string">default</data> - <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> - <data name="reviewsCount" xsi:type="string">2</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerNotInGrid"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\CustomerReviewReportEntityTest"> + <variation name="CustomerReviewReportEntityTestVariation1"> + <data name="customerLogin" xsi:type="string">Yes</data> + <data name="product/dataSet" xsi:type="string">default</data> + <data name="review/data/type" xsi:type="string">Customer</data> + <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> + <data name="reviewsCount" xsi:type="string">1</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid" /> + </variation> + <variation name="CustomerReviewReportEntityTestVariation2"> + <data name="customerLogin" xsi:type="string">Yes</data> + <data name="product/dataSet" xsi:type="string">default</data> + <data name="review/data/type" xsi:type="string">Customer</data> + <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> + <data name="reviewsCount" xsi:type="string">2</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerInGrid" /> + </variation> + <variation name="CustomerReviewReportEntityTestVariation3"> + <data name="customerLogin" xsi:type="string">No</data> + <data name="product/dataSet" xsi:type="string">default</data> + <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> + <data name="reviewsCount" xsi:type="string">2</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewsQtyByCustomer" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReportByCustomerNotInGrid" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php index a9499d608da3f1844151c1b9c81a70f4dcbf9c9a..c3ad0a3ef2d2f631d160e7da69b7de4629296d9f 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewForm.php @@ -6,38 +6,58 @@ namespace Magento\Review\Test\Block\Adminhtml; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** - * Class Edit - * Review edit form + * Review edit form. */ class ReviewForm extends Form { /** - * Posted by field + * Posted by field. * * @var string */ protected $customer = '#customer'; /** - * Rating status + * Rating status. * * @var string */ protected $status = '[name=status_id]'; /** - * 'Save Review' button + * 'Save Review' button. * * @var string */ protected $saveButton = '[data-ui-id$=save-button-button]'; /** - * Get data from 'Posted By' field + * Fill the review form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + if (isset($data['entity_id'])) { + unset($data['entity_id']); + } + $mapping = $this->dataMapping($data); + $this->_fill($mapping, $element); + + return $this; + } + + /** + * Get data from 'Posted By' field. * * @return string */ @@ -47,7 +67,7 @@ class ReviewForm extends Form } /** - * Get data from Status field + * Get data from Status field. * * @return string */ @@ -57,7 +77,7 @@ class ReviewForm extends Form } /** - * Set approve review + * Set approve review. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php index eb6cb92c40c0f270b3fab671135d6f00bcc364a2..edf5cb90995549c5ddd0537fbf335002d8304fc3 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewForm.php @@ -48,8 +48,8 @@ class AssertProductReviewForm extends AbstractAssertForm $fixtureData = $review->getData(); $formData = $reviewEdit->getReviewForm()->getData(); - if (isset($fixtureData['customer'])) { - $formData['customer'] = $reviewEdit->getReviewForm()->getPostedBy(); + if (isset($fixtureData['type'])) { + $formData['type'] = $reviewEdit->getReviewForm()->getPostedBy(); } $error = $this->verifyData($fixtureData, $formData); diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php index b448f3ac837a261457216b46465dc4ce9e719ec6..93e28f758b9eb2408328058ca50d4d93a585b18d 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php @@ -12,13 +12,12 @@ use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class AssertProductReviewInGrid - * Check that review is displayed in grid + * Check that review is displayed in grid. */ class AssertProductReviewInGrid extends AbstractConstraint { /** - * Filter params + * Filter params. * * @var array */ @@ -35,10 +34,10 @@ class AssertProductReviewInGrid extends AbstractConstraint ]; /** - * Assert that review is displayed in grid + * Assert that review is displayed in grid. * * @param ReviewIndex $reviewIndex - * @param Review $review , + * @param Review $review * @param FixtureInterface $product * @param string $gridStatus * @return void @@ -61,7 +60,7 @@ class AssertProductReviewInGrid extends AbstractConstraint } /** - * Prepare filter for assert + * Prepare filter for assert. * * @param FixtureInterface $product * @param array $review @@ -89,6 +88,9 @@ class AssertProductReviewInGrid extends AbstractConstraint case 'status_id': $value = $gridStatus != '' ? $gridStatus : (isset($review[$param]) ? $review[$param] : null); break; + case 'type': + $value = isset($review[$param]) ? $review[$param] : 'Administrator'; + break; default: $value = isset($review[$param]) ? $review[$param] : null; break; @@ -101,7 +103,7 @@ class AssertProductReviewInGrid extends AbstractConstraint } /** - * Text success exist review in grid on product reviews tab + * Text success exist review in grid on product reviews tab. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml index bf97a39b60e0ab692798889c9c0d22d36a1fbd27..ee97d7bb2149563e0583afbb7328d09cf1189a3b 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml @@ -6,48 +6,45 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Review\Test\TestCase\CreateProductReviewBackendEntityTest"> - <variation name="CreateProductReviewBackendEntityTestVariation1"> - <data name="review/data/type" xsi:type="string">Administrator</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="review/data/status_id" xsi:type="string">Approved</data> - <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/rating_0/rating" xsi:type="string">3</data> - <data name="review/data/nickname" xsi:type="string">John</data> - <data name="review/data/title" xsi:type="string">title %isolation%</data> - <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - <variation name="CreateProductReviewBackendEntityTestVariation2"> - <data name="review/data/type" xsi:type="string">Administrator</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="review/data/status_id" xsi:type="string">Pending</data> - <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/rating_0/rating" xsi:type="string">4</data> - <data name="review/data/nickname" xsi:type="string">Britney</data> - <data name="review/data/title" xsi:type="string">title %isolation%</data> - <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - <variation name="CreateProductReviewBackendEntityTestVariation3"> - <data name="review/data/type" xsi:type="string">Administrator</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="review/data/status_id" xsi:type="string">Not Approved</data> - <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/rating_0/rating" xsi:type="string">5</data> - <data name="review/data/nickname" xsi:type="string">Michael</data> - <data name="review/data/title" xsi:type="string">title %isolation%</data> - <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - </testCase> + <testCase name="Magento\Review\Test\TestCase\CreateProductReviewBackendEntityTest"> + <variation name="CreateProductReviewBackendEntityTestVariation1"> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/status_id" xsi:type="string">Approved</data> + <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/rating" xsi:type="string">3</data> + <data name="review/data/nickname" xsi:type="string">John</data> + <data name="review/data/title" xsi:type="string">title %isolation%</data> + <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + <variation name="CreateProductReviewBackendEntityTestVariation2"> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/status_id" xsi:type="string">Pending</data> + <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/rating" xsi:type="string">4</data> + <data name="review/data/nickname" xsi:type="string">Britney</data> + <data name="review/data/title" xsi:type="string">title %isolation%</data> + <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + <variation name="CreateProductReviewBackendEntityTestVariation3"> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/status_id" xsi:type="string">Not Approved</data> + <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/rating" xsi:type="string">5</data> + <data name="review/data/nickname" xsi:type="string">Michael</data> + <data name="review/data/title" xsi:type="string">title %isolation%</data> + <data name="review/data/detail" xsi:type="string">review detail %isolation%</data> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewBackendSuccessSaveMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml index 747044f00e030859b162598332c766a74b5c283c..ee9096bce936c26452574d0d8362293f90933c68 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml @@ -6,37 +6,35 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Review\Test\TestCase\CreateProductReviewFrontendEntityTest"> - <variation name="CreateProductReviewFrontendEntityTestVariation1"> - <data name="description" xsi:type="string">Create product review with rating</data> - <data name="review/data/customer" xsi:type="string">-</data> - <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_%isolation%</data> - <data name="review/data/ratings/1/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> - <data name="review/data/ratings/1/rating" xsi:type="string">4</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingOnReviewPage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage"/> - </variation> - <variation name="CreateProductReviewFrontendEntityTestVariation2"> - <data name="description" xsi:type="string">MAGETWO-12403 - Add Product Review from Customer's Prospective</data> - <data name="review/data/customer" xsi:type="string">Guest</data> - <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> - <data name="review/data/title" xsi:type="string">title_%isolation%</data> - <data name="review/data/detail" xsi:type="string">review_%isolation%</data> - <data name="review/data/ratings/1/dataSet" xsi:type="string">-</data> - <data name="review/data/ratings/1/rating" xsi:type="string">-</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> - <data name="tag" xsi:type="string">test_type:acceptance_test</data> - <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewIsAbsentOnProductPage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewForm"/> - <constraint name="Magento\Review\Test\Constraint\AssertSetApprovedProductReview"/> - <constraint name="Magento\Review\Test\Constraint\AssertReviewLinksIsPresentOnProductPage"/> - <constraint name="Magento\Review\Test\Constraint\AssertProductReviewOnProductPage"/> - </variation> - </testCase> + <testCase name="Magento\Review\Test\TestCase\CreateProductReviewFrontendEntityTest"> + <variation name="CreateProductReviewFrontendEntityTestVariation1"> + <data name="description" xsi:type="string">Create product review with rating</data> + <data name="review/data/type" xsi:type="string">Guest</data> + <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_%isolation%</data> + <data name="review/data/ratings/1/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/1/rating" xsi:type="string">4</data> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingOnReviewPage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> + </variation> + <variation name="CreateProductReviewFrontendEntityTestVariation2"> + <data name="description" xsi:type="string">MAGETWO-12403 - Add Product Review from Customer's Prospective</data> + <data name="review/data/type" xsi:type="string">Guest</data> + <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> + <data name="review/data/title" xsi:type="string">title_%isolation%</data> + <data name="review/data/detail" xsi:type="string">review_%isolation%</data> + <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewIsAbsentOnProductPage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewForm" /> + <constraint name="Magento\Review\Test\Constraint\AssertSetApprovedProductReview" /> + <constraint name="Magento\Review\Test\Constraint\AssertReviewLinksIsPresentOnProductPage" /> + <constraint name="Magento\Review\Test\Constraint\AssertProductReviewOnProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml index 369d359cf8a55a41421c7228d0b91c6a924e7ac6..2439e6aeac763956de84b836bf817642a915135b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Address.xml @@ -23,8 +23,5 @@ </region_id> <postcode /> <telephone /> - <save_in_address_book> - <input>checkbox</input> - </save_in_address_book> </fields> </mapping> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php index 0a350725839b9e8833b90dda8003c051b0c7293c..14ec5f4336b64d6429c6c04caa8bf5501666ac09 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Coupons.php @@ -6,7 +6,7 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\Create; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\SalesRule\Test\Fixture\SalesRule; use Magento\Mtf\Client\Locator; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml index 768fef18f37797e49cb835efa48e80e45b746f6a..ece7a7be14cf2e6234031368e4bb83310b869e49 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Form/Account.xml @@ -5,12 +5,12 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <wrapper>order[account]</wrapper> <fields> - <group> + <group_id> <input>select</input>> - </group> + </group_id> <email /> </fields> </mapping> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php index 03ec6f8187c16a1a697a93f64e6a8d861a0130fe..efcf05d2a42144b7ed72c3b2e0a9b0fd5243d911 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php @@ -8,6 +8,8 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\Create\Items; use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Client\Element\SimpleElement; /** * Class ItemProduct @@ -76,6 +78,28 @@ class ItemProduct extends Form return $result; } + /** + * Fill the root form. + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $data = $fixture->getData(); + if (isset($data['cartItem'])) { + unset($data['cartItem']); + } + if (isset($data['options'])) { + unset($data['options']); + } + $mapping = $this->dataMapping($data); + $this->_fill($mapping, $element); + + return $this; + } + /** * Click Configure button. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml index c1d712de6a2d0f33e4545ce3a3983a101dd96e11..298289698a18295d355e73f5f66f515e040b2620 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusEdit.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="OrderStatusEdit" area="Adminhtml" mca="sales/order_status/edit" module="Magento_Sales"> - <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="orderStatusForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#edit_form" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="OrderStatusEdit" area="Adminhtml" mca="sales/order_status/edit" module="Magento_Sales"> + <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="orderStatusForm" class="Magento\Mtf\Block\Form" locator="#edit_form" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml index 856880560d3ed1eaa69d6746666788ce166ce286..0457f3a4b1899a46bd3b850b7c6349733cd3d515 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderStatusNew.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="OrderStatusNew" area="Adminhtml" mca="sales/order_status/new" module="Magento_Sales"> - <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="orderStatusForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#edit_form" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="OrderStatusNew" area="Adminhtml" mca="sales/order_status/new" module="Magento_Sales"> + <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="orderStatusForm" class="Magento\Mtf\Block\Form" locator="#edit_form" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml index 6371ae09b9981d48b42be0a1e9fd1c54897e91cd..ce5a4f0d95671ebaf4caf9ff4a8984b6c0853b57 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml @@ -10,8 +10,8 @@ <variation name="CreateOrderBackendTestVariation1"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Cash on Delivery payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -31,8 +31,8 @@ <variation name="CreateOrderBackendTestVariation2"> <data name="description" xsi:type="string">Create order with virtual product for registered UK customer using Check/Money Order payment method</data> <data name="products" xsi:type="string">catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address_without_email</data> <data name="prices" xsi:type="array"> <item name="grandTotal" xsi:type="string">10.00</item> </data> @@ -49,8 +49,8 @@ <variation name="CreateOrderBackendTestVariation3"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Bank Transfer payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -71,8 +71,8 @@ <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create order with virtual product for registered UK customer using Bank Transfer payment method</data> <data name="products" xsi:type="string">catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="prices" xsi:type="array"> <item name="grandTotal" xsi:type="string">10.00</item> @@ -91,9 +91,9 @@ <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Purchase Order payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">No</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> @@ -114,10 +114,10 @@ <data name="description" xsi:type="string">MAGETWO-12395 - Create Offline Order for Registered Customer in Admin</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">No</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> @@ -132,10 +132,10 @@ <data name="description" xsi:type="string">MAGETWO-12520 - Create Order for New Customer in Admin with Offline Payment Method</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">Yes</data> <data name="checkoutMethod" xsi:type="string">register</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml index 200b45de0adb16a93d2c5343434e3038d064973d..20b862a735ee7e9977599fd0c8f82598384d6637 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">Reorder placed order (update products, billing address).</data> <data name="order/dataSet" xsi:type="string">two_simple_product</data> <data name="salesRule" xsi:type="string">active_sales_rule_with_fixed_price_discount_coupon</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml index 7e75ac518b8e7a2e66c38e5d9798c220d281e39f..bacb199390c0d3982e726b71db8c8adc51e9e9bd 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml @@ -6,7 +6,7 @@ */ --> <mapping strict="0"> - <wrapper>creditmemo</wrapper> + <wrapper>shipment</wrapper> <fields> <comment_text /> <shipping_amount /> diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml index 4f33714bfae86e6ab15c88cb3b5c500ad429e4ad..6852866408294adf0b9516a3013a41855534e24e 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Page/Adminhtml/SitemapNew.xml @@ -6,8 +6,8 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SitemapNew" area="Adminhtml" mca="sitemap/new/index" module="Magento_Sitemap"> - <block name="sitemapForm" class="Magento\Backend\Test\Block\Widget\Form" locator="#add_sitemap_form" strategy="css selector"/> - <block name="sitemapPageActions" class="Magento\Sitemap\Test\Block\Adminhtml\SitemapPageActions" locator=".page-main-actions" strategy="css selector"/> - </page> + <page name="SitemapNew" area="Adminhtml" mca="sitemap/new/index" module="Magento_Sitemap"> + <block name="sitemapForm" class="Magento\Mtf\Block\Form" locator="#add_sitemap_form" strategy="css selector" /> + <block name="sitemapPageActions" class="Magento\Sitemap\Test\Block\Adminhtml\SitemapPageActions" locator=".page-main-actions" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php index 970bede06def9787026240f7fd543488d39ed4a7..43e431fbbea44d9a0d3f6964961747b69f1cb104 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php @@ -31,10 +31,7 @@ class AssertTaxRateForm extends AbstractConstraint TaxRate $taxRate, TaxRate $initialTaxRate = null ) { - $data = ($initialTaxRate !== null) - ? array_merge($initialTaxRate->getData(), $taxRate->getData()) - : $taxRate->getData(); - $data = $this->prepareData($data); + $data = $this->prepareData($taxRate, $initialTaxRate); $filter = [ 'code' => $data['code'], ]; @@ -53,11 +50,20 @@ class AssertTaxRateForm extends AbstractConstraint /** * Preparing data for verification * - * @param array $data + * @param TaxRate $taxRate + * @param TaxRate $initialTaxRate * @return array */ - protected function prepareData(array $data) + protected function prepareData(TaxRate $taxRate, TaxRate $initialTaxRate = null) { + if ($initialTaxRate !== null) { + $data = array_merge($initialTaxRate->getData(), $taxRate->getData()); + if ($taxRate->hasData('tax_country_id') && !$taxRate->hasData('tax_region_id')) { + unset($data['tax_region_id']); + } + } else { + $data = $taxRate->getData(); + } if ($data['zip_is_range'] === 'Yes') { unset($data['tax_postcode']); } else { diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml index ae3c83014c7f0169da523f9e15c065671c69f167..d5407ecf878f38d62433a282d67c5b7e2f7f942a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml @@ -11,11 +11,11 @@ <data name="description" xsi:type="string">MAGETWO-13436: Automatic Apply Tax Based on VAT ID.</data> <data name="vatConfig/dataSet" xsi:type="string">enable_VAT_on_frontend</data> <data name="configData" xsi:type="string">default_tax_configuration, flatrate, checkmo, store_information_DE_with_VAT, enable_VAT_on_frontend</data> - <data name="customer/dataSet" xsi:type="string">address_UK_with_VAT</data> + <data name="customer/dataSet" xsi:type="string">customer_UK_address_with_VAT</data> <data name="order/dataSet" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::product_10_dollar</data> <data name="order/data/customer_id/dataSet" xsi:type="string">customer_UK_address_with_VAT</data> - <data name="order/data/billing_address_id/dataSet" xsi:type="string">address_UK_with_VAT</data> + <data name="order/data/billing_address_id/dataSet" xsi:type="string">UK_address_with_VAT</data> <data name="taxRule/dataSet" xsi:type="string">retailer_uk_full_tax_rule</data> <data name="customerGroup" xsi:type="string">valid_intra_union_group</data> <data name="cart/data/subtotal" xsi:type="string">10</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml index bee3fb886b6f598dd767fe1706a967247ea05736..9602d171bf546587b59734b79042e4b42d6618fc 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml @@ -14,7 +14,6 @@ <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> <data name="taxRate/data/tax_country_id" xsi:type="string">Australia</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">20</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInGrid" /> @@ -55,7 +54,6 @@ <data name="taxRate/data/zip_to" xsi:type="string">7800935</data> <data name="taxRate/data/tax_postcode" xsi:type="string">-</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United Kingdom</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">7.75</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml index 5f3a3e5fba76bad0aa9afb2fa85624cddb1e4beb..c8205ff306c4f0a543f0ab0cea2d619a6df8004a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml @@ -11,8 +11,6 @@ <data name="initialTaxRate/dataSet" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">90001</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United States</data> <data name="taxRate/data/tax_region_id" xsi:type="string">California</data> @@ -27,7 +25,6 @@ <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">90001</data> <data name="taxRate/data/zip_to" xsi:type="string">96162</data> - <data name="taxRate/data/tax_postcode" xsi:type="string">-</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United States</data> <data name="taxRate/data/tax_region_id" xsi:type="string">California</data> <data name="taxRate/data/rate" xsi:type="string">15.05</data> @@ -39,11 +36,8 @@ <data name="initialTaxRate/dataSet" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United Kingdom</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">777</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInGrid" /> @@ -53,8 +47,6 @@ <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">180</data> <data name="taxRate/data/tax_country_id" xsi:type="string">Canada</data> <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> @@ -69,9 +61,7 @@ <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">1</data> <data name="taxRate/data/zip_to" xsi:type="string">7800935</data> - <data name="taxRate/data/tax_postcode" xsi:type="string">-</data> <data name="taxRate/data/tax_country_id" xsi:type="string">United Kingdom</data> - <data name="taxRate/data/tax_region_id" xsi:type="string">*</data> <data name="taxRate/data/rate" xsi:type="string">12.99</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> @@ -80,8 +70,6 @@ <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> - <data name="taxRate/data/zip_from" xsi:type="string">-</data> - <data name="taxRate/data/zip_to" xsi:type="string">-</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> <data name="taxRate/data/tax_country_id" xsi:type="string">France</data> <data name="taxRate/data/tax_region_id" xsi:type="string">Val-d'Oise</data> diff --git a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml index 850c839e08fd3a5e50591d5c9912922b4467803e..fcb92ddb6be2a91c3c689bd686687517c4c6ef16 100644 --- a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12848 – Use UPS Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data> <data name="shipping/shipping_method" xsi:type="string">UPS Ground</data> <data name="cart/data/shipping_method" xsi:type="string">UPS Ground</data> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">Checkout as guest using UPS with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="address/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="address/dataSet" xsi:type="string">UK_address</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data> <data name="shipping/shipping_method" xsi:type="string">UPS Worldwide Expedited</data> <data name="cart/data/shipping_method" xsi:type="string">UPS Worldwide Expedited</data> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php index 373c6c4cabd7c90d4920667f958868594b4b3946..5fb3fc21d02d69cd99399f7af6741da752448522 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php @@ -6,7 +6,7 @@ namespace Magento\UrlRewrite\Test\Block\Adminhtml\Catalog\Edit; -use Magento\Backend\Test\Block\Widget\Form; +use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Element; use Magento\Mtf\Fixture\FixtureInterface; @@ -16,6 +16,42 @@ use Magento\Mtf\Fixture\FixtureInterface; */ class UrlRewriteForm extends Form { + /** + * Prepare data for url rewrite fixture. + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareData(FixtureInterface $fixture) + { + $data = $fixture->getData(); + if (empty($data['entity_type']) && empty($this->getData()['target_path']) && !isset($data['target_path'])) { + $entity = $fixture->getDataFieldConfig('target_path')['source']->getEntity(); + $data['target_path'] = $entity->hasData('identifier') + ? $entity->getIdentifier() + : $entity->getUrlKey() . '.html'; + } + return $data; + } + + /** + * Fill visible fields on the form. + * + * @param array $data + * @param SimpleElement $context + * @retun void + */ + protected function fillFields(array $data, SimpleElement $context) + { + $mapping = $this->dataMapping($data); + foreach ($mapping as $field) { + $element = $this->getElement($context, $field); + if ($element->isVisible() && !$element->isDisabled()) { + $element->setValue($field['value']); + } + } + } + /** * Fill the root form. * @@ -29,13 +65,8 @@ class UrlRewriteForm extends Form SimpleElement $element = null, array $replace = [] ) { - $data = $fixture->getData(); - if (empty($data['entity_type']) && empty($this->getData()['target_path']) && !isset($data['target_path'])) { - $entity = $fixture->getDataFieldConfig('target_path')['source']->getEntity(); - $data['target_path'] = $entity->hasData('identifier') - ? $entity->getIdentifier() - : $entity->getUrlKey() . '.html'; - } + $context = ($element === null) ? $this->_rootElement : $element; + $data = $this->prepareData($fixture); foreach ($replace as $key => $value) { if (isset($data[$key])) { @@ -43,8 +74,7 @@ class UrlRewriteForm extends Form } } - $mapping = $this->dataMapping($data); - $this->_fill($mapping, $element); + $this->fillFields($data, $context); return $this; } diff --git a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml index db8db09e418ca18c1adee18b65fbc9391a1a303e..25c488a697e577f4589ef24fd679ae5e52ed3f89 100644 --- a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12444 – Use USPS Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">customer_US</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data> <data name="shipping/shipping_method" xsi:type="string">Priority Mail 1-Day</data> <data name="cart/data/shipping_method" xsi:type="string">Priority Mail 1-Day</data> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">Checkout as guest using USPS with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">customer_UK</data> - <data name="address/dataSet" xsi:type="string">customer_UK</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_UK</data> + <data name="customer/dataSet" xsi:type="string">default</data> + <data name="address/dataSet" xsi:type="string">UK_address</data> + <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data> <data name="shipping/shipping_method" xsi:type="string">Priority Mail International</data> <data name="cart/data/shipping_method" xsi:type="string">Priority Mail International</data> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php index 736d2e0e8136600a99ebc424ef73e57fbfdb2a00..b3102c9d7f960e4205fd633bfb10c18008fd10f5 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AbstractWishlistTest.php @@ -119,11 +119,9 @@ abstract class AbstractWishlistTest extends Injectable */ protected function addToWishlist(array $products, $configure = false) { - $addProductsToWishlistStep = $this->objectManager->create( + $this->objectManager->create( 'Magento\Wishlist\Test\TestStep\AddProductsToWishlistStep', ['products' => $products, 'configure' => $configure] - ); - - $addProductsToWishlistStep->run(); + )->run(); } } diff --git a/dev/tests/functional/utils/generate/constraint.php b/dev/tests/functional/utils/generate/constraint.php deleted file mode 100644 index 5dfd019f6c17046591a153cb136e0245dac581a3..0000000000000000000000000000000000000000 --- a/dev/tests/functional/utils/generate/constraint.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Constraint')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults();