diff --git a/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php b/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php new file mode 100644 index 0000000000000000000000000000000000000000..abd0c0b1627fce7353acf00d1133dcd8d1263dc6 --- /dev/null +++ b/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Mtf\Fixture; + +use Magento\Mtf\Fixture\FixtureInterface; + +/** + * Parent fixture data source class. + */ +class DataSource implements FixtureInterface +{ + /** + * Data set configuration settings. + * + * @var array + */ + protected $params; + + /** + * Value data. + * + * @var array + */ + protected $data; + + /** + * Persist entity. + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data set. + * + * @param string $key [optional] + * @return mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings. + * + * @return array + */ + public function getDataConfig() + { + return $this->params; + } +} diff --git a/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e5e1e6e6137a144c8005f43b615be3521147b49 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest1"> + <data name="menuItem" xsi:type="string">System > Notifications</data> + <data name="pageTitle" xsi:type="string">Notifications</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Admin/Login.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Admin/Login.php index 735b24eed10dde13fb1f69e750751b562d87b1fe..bd99359490b6c79dce1bd5f0562cd409f899e22b 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Admin/Login.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Admin/Login.php @@ -10,24 +10,37 @@ use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; /** - * Class Login - * Login form for backend user - * + * Login form for backend user. */ class Login extends Form { /** - * 'Log in' button + * 'Log in' button. * * @var string */ protected $submit = '.action-login'; /** - * Submit login form + * Submit login form. */ public function submit() { $this->_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click(); } + + /** + * Wait for Login form is not visible in the page. + * + * @return void + */ + public function waitFormNotVisible() + { + $form = $this->_rootElement; + $this->browser->waitUntil( + function () use ($form) { + return $form->isVisible() ? null : true; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Menu.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Menu.php index c1a645760bb36b1d9a192d9d31715b7f199dfde1..1d683f1ef9034e74cf2a979ee795bce1186b2232 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Menu.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Menu.php @@ -6,15 +6,43 @@ namespace Magento\Backend\Test\Block; use Magento\Mtf\Block\Block; +use Magento\Mtf\Client\Locator; /** - * Class Menu - * Class top menu navigation block + * Top menu navigation block. */ class Menu extends Block { /** - * Returns array of parent menu items present on dashboard menu + * Main menu selector. + * + * @var string + */ + protected $mainMenu = './/li/a[span="%s"]'; + + /** + * Submenu selector. + * + * @var string + */ + protected $subMenu = './/li[a[span="%s"]]/div[@class="submenu" and @style="display: block;"]'; + + /** + * Submenu item selector. + * + * @var string + */ + protected $subMenuItem = './/a[span="%s"]'; + + /** + * Parent menu item. + * + * @var string + */ + protected $parentMenuLevel = 'li.parent.level-0:nth-of-type(%s)'; + + /** + * Returns array of parent menu items present on dashboard menu. * * @return array */ @@ -24,9 +52,9 @@ class Menu extends Block $menuItems = []; $counter = 1; $textSelector = 'a span'; - while ($navigationMenu->find('li.parent.level-0:nth-of-type(' . $counter . ')')->isVisible()) { + while ($navigationMenu->find(sprintf($this->parentMenuLevel, $counter))->isVisible()) { $menuItems[] = strtolower( - $navigationMenu->find('li.parent.level-0:nth-of-type(' . $counter . ')') + $navigationMenu->find(sprintf($this->parentMenuLevel, $counter)) ->find($textSelector) ->getText() ); @@ -34,4 +62,39 @@ class Menu extends Block } return $menuItems; } + + /** + * Open backend page via menu. + * + * @param string $menuItem + * @return void + * @throws \Exception + */ + public function navigate($menuItem) + { + $menuChain = array_map('trim', explode('>', $menuItem)); + $mainMenu = $menuChain[0]; + $subMenu = isset($menuChain[1]) ? $menuChain[1] : null; + + // Click on element in main menu + $mainMenuElement = $this->_rootElement->find(sprintf($this->mainMenu, $mainMenu), Locator::SELECTOR_XPATH); + if (!$mainMenuElement->isVisible()) { + throw new \Exception('Main menu item "' . $mainMenu . '" is not visible.'); + } + $mainMenuElement->click(); + + // Click on element in submenu + if ($subMenu === null) { + return; + } + $subMenuSelector = sprintf($this->subMenu, $mainMenu); + $this->waitForElementVisible($subMenuSelector, Locator::SELECTOR_XPATH); + $subMenuItem = $this->_rootElement->find($subMenuSelector, Locator::SELECTOR_XPATH) + ->find(sprintf($this->subMenuItem, $subMenu), Locator::SELECTOR_XPATH); + if (!$subMenuItem->isVisible()) { + throw new \Exception('Submenu item "' . $subMenu . '" is not visible in "' . $mainMenu . '"'); + } + $subMenuItem->click(); + $this->waitForElementNotVisible($subMenuSelector, Locator::SELECTOR_XPATH); + } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Error.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Error.php new file mode 100644 index 0000000000000000000000000000000000000000..b74ea513d578e1a1b9eb73d574c40e91c2eed809 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Error.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Backend\Test\Block\Page; + +use Magento\Mtf\Block\Block; + +/** + * 404 error backend block. + */ +class Error extends Block +{ + /** + * Get block text content. + * + * @return string + */ + public function getContent() + { + return $this->_rootElement->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php index 9de2cdc43498326ae52a79eb41ebbf373ec6b4f6..3971b6e5d5b969cf768cbb0e57106a7a6ad6b655 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php @@ -9,7 +9,7 @@ namespace Magento\Backend\Test\Block\Page; use Magento\Mtf\Block\Block; /** - * Main block. + * Main dashboard block. */ class Main extends Block { diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBackendPageIsAvailable.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBackendPageIsAvailable.php new file mode 100644 index 0000000000000000000000000000000000000000..0a72723984994fe451b21974be51d94844873136 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBackendPageIsAvailable.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Backend\Test\Constraint; + +use Magento\Backend\Test\Fixture\GlobalSearch; +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert backend page title and it's availability. + */ +class AssertBackendPageIsAvailable extends AbstractConstraint +{ + const ERROR_TEXT = '404 Error'; + + /** + * Assert that backend page has correct title and 404 Error is absent on the page. + * + * @param Dashboard $dashboard + * @param string $pageTitle + * @return void + */ + public function processAssert(Dashboard $dashboard, $pageTitle) + { + \PHPUnit_Framework_Assert::assertEquals( + $pageTitle, + $dashboard->getTitleBlock()->getTitle(), + 'Invalid page title is displayed.' + ); + \PHPUnit_Framework_Assert::assertNotContains( + self::ERROR_TEXT, + $dashboard->getErrorBlock()->getContent(), + "404 Error is displayed on '$pageTitle' page." + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Backend has correct title and 404 page content is absent.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertStoreCanBeLocalized.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertStoreCanBeLocalized.php new file mode 100644 index 0000000000000000000000000000000000000000..754278899b0b42a8e7b1ba59858910351031a8b0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertStoreCanBeLocalized.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Backend\Test\Constraint; + +use Magento\Store\Test\Fixture\Store; +use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Backend\Test\Page\Adminhtml\SystemConfig; +use Magento\Cms\Test\Page\CmsIndex; + +/** + * Assert that store can be localized. + */ +class AssertStoreCanBeLocalized extends AbstractConstraint +{ + /** + * Assert that locale options can be changed and checks new text on index page. + * + * @param SystemConfig $systemConfig + * @param Store $store + * @param CmsIndex $cmsIndex + * @param string $locale + * @param string $welcomeText + * @return void + */ + public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex $cmsIndex, $locale, $welcomeText) + { + // Set locale options + $systemConfig->open(); + $systemConfig->getPageActions()->selectStore($store->getGroupId() . "/" . $store->getName()); + $configGroup = $systemConfig->getForm()->getGroup('Locale Options'); + $configGroup->open(); + $configGroup->setValue('select-groups-locale-fields-code-value', $locale); + $systemConfig->getPageActions()->save(); + $systemConfig->getMessagesBlock()->waitSuccessMessage(); + + // Check presents income text on index page + $cmsIndex->open(); + $cmsIndex->getStoreSwitcherBlock()->selectStoreView($store->getName()); + + \PHPUnit_Framework_Assert::assertTrue( + $cmsIndex->getSearchBlock()->isPlaceholderContains($welcomeText), + "Locale not applied." + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Store locale has changed successfully.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php index c53ef25e6dc0a4a7dc930ed96849953f74d038a5..02f5655d35fa05611ada2a097718106a14bda254 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php @@ -10,40 +10,39 @@ use Magento\Mtf\Factory\Factory; use Magento\Mtf\Page\Page; /** - * Class AdminAuthLogin - * Login page for backend + * Login page for backend. * */ class AdminAuthLogin extends Page { /** - * URL part for backend authorization + * URL part for backend authorization. */ const MCA = 'admin/auth/login'; /** - * Form for login + * Form for login. * * @var string */ protected $loginBlock = '#login-form'; /** - * Header panel of admin dashboard + * Header panel of admin dashboard. * * @var string */ protected $headerBlock = '.page-header .admin-user'; /** - * Global messages block + * Global messages block. * * @var string */ protected $messagesBlock = '#messages .messages'; /** - * Constructor + * Constructor. */ protected function _init() { @@ -51,7 +50,7 @@ class AdminAuthLogin extends Page } /** - * Get the login form block + * Get the login form block. * * @return \Magento\Backend\Test\Block\Admin\Login */ @@ -63,7 +62,7 @@ class AdminAuthLogin extends Page } /** - * Get the header panel block of admin dashboard + * Get the header panel block of admin dashboard. * * @return \Magento\Backend\Test\Block\Page\Header */ @@ -75,7 +74,7 @@ class AdminAuthLogin extends Page } /** - * Get global messages block + * Get global messages block. * * @return \Magento\Core\Test\Block\Messages */ @@ -84,6 +83,11 @@ class AdminAuthLogin extends Page return Factory::getBlockFactory()->getMagentoCoreMessages($this->_browser->find($this->messagesBlock)); } + /** + * Wait for Header block is visible in the page. + * + * @return void + */ public function waitForHeaderBlock() { $browser = $this->_browser; diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml index 77f4285338fc45ff1aebb9247c3156e9523b2688..b7f64e34db13d794af6e7c689ccb905178cf1741 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml @@ -6,11 +6,13 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="Dashboard" area="Adminhtml" mca="admin/dashboard" module="Magento_Backend"> - <block name="adminPanelHeader" class="Magento\Backend\Test\Block\Page\Header" locator=".page-header" strategy="css selector"/> - <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper" strategy="css selector"/> - <block name="mainBlock" class="Magento\Backend\Test\Block\Page\Main" locator=".dashboard-main" strategy="css selector"/> - <block name="menuBlock" class="Magento\Backend\Test\Block\Menu" locator=".admin__menu" strategy="css selector"/> - <block name="storeStatsBlock" class="Magento\Backend\Test\Block\Dashboard\StoreStats" locator=".dashboard-store-stats" strategy="css selector"/> - </page> + <page name="Dashboard" area="Adminhtml" mca="admin/dashboard" module="Magento_Backend"> + <block name="adminPanelHeader" class="Magento\Backend\Test\Block\Page\Header" locator=".page-header" strategy="css selector" /> + <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper" strategy="css selector" /> + <block name="mainBlock" class="Magento\Backend\Test\Block\Page\Main" locator=".dashboard-main" strategy="css selector" /> + <block name="menuBlock" class="Magento\Backend\Test\Block\Menu" locator=".admin__menu" strategy="css selector" /> + <block name="storeStatsBlock" class="Magento\Backend\Test\Block\Dashboard\StoreStats" locator=".dashboard-store-stats" strategy="css selector" /> + <block name="errorBlock" class="Magento\Backend\Test\Block\Page\Error" locator="[id='page:main-container']" strategy="css selector" /> + <block name="accessDeniedBlock" class="Magento\Backend\Test\Block\Denied" locator="#anchor-content" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/SystemConfig.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/SystemConfig.xml index 6f486d22e4276c990f69c55abc142ebc34f39da8..be9dea93665872a526fa05dc2f139f4a29e75c84 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/SystemConfig.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/SystemConfig.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SystemConfig" area="Adminhtml" mca="admin/system_config" module="Magento_Config"> + <page name="SystemConfig" area="Adminhtml" mca="admin/system_config" module="Magento_Backend"> <block name="pageActions" class="Magento\Backend\Test\Block\System\Config\PageActions" locator=".page-main-actions" strategy="css selector"/> <block name="form" class="Magento\Backend\Test\Block\System\Config\Form" locator="#config-edit-form" strategy="css selector"/> <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> 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 new file mode 100644 index 0000000000000000000000000000000000000000..5ddeae663986fb131b8da386365384173c9dc35a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Backend\Test\TestCase; + +use Magento\Mtf\TestCase\Injectable; +use Magento\Backend\Test\Page\Adminhtml\Dashboard; + +/** + * Steps: + * 1. Log in to backend. + * 2. Navigate throught menu to the page. + * 6. Perform asserts. + * + * @ZephyrId MAGETWO-34874 + */ +class NavigateMenuTest extends Injectable +{ + /* tags */ + const MVP = 'no'; + const DOMAIN = 'CS, MX, PS'; + /* end tags */ + + /** + * Run menu navigation test. + * + * @param Dashboard $dashboard + * @param string $menuItem + * @return void + */ + public function test(Dashboard $dashboard, $menuItem) + { + $dashboard->open(); + $dashboard->getMenuBlock()->navigate($menuItem); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..2cc5603938057e0d3b7d7bd8363b1ccf16d7fa0c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,36 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest2"> + <data name="menuItem" xsi:type="string">Dashboard</data> + <data name="pageTitle" xsi:type="string">Dashboard</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest3"> + <data name="menuItem" xsi:type="string">Content > Schedule</data> + <data name="pageTitle" xsi:type="string">Store Design Schedule</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest4"> + <data name="menuItem" xsi:type="string">Stores > All Stores</data> + <data name="pageTitle" xsi:type="string">Stores</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest5"> + <data name="menuItem" xsi:type="string">Stores > Configuration</data> + <data name="pageTitle" xsi:type="string">Configuration</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest6"> + <data name="menuItem" xsi:type="string">System > Cache Management</data> + <data name="pageTitle" xsi:type="string">Cache Management</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba16bc1f7220b03ccf0a2efacf445d9ff9dab6bc --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml @@ -0,0 +1,19 @@ +<?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="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <type name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"> + <arguments> + <argument name="severity" xsi:type="string">high</argument> + </arguments> + </type> + <type name="Magento\Backend\Test\Constraint\AssertStoreCanBeLocalized"> + <arguments> + <argument name="severity" xsi:type="string">high</argument> + </arguments> + </type> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Backup/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Backup/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..e9ac9e52ca3db010cebacea976aba3530ff9e05c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backup/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest7"> + <data name="menuItem" xsi:type="string">System > Backups</data> + <data name="pageTitle" xsi:type="string">Backups</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php index d457d3fae63ea11ac4c9d94a544f5a39c9918455..0423a2e4a409107c6569bc3ec1fd8767049f0ba3 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php @@ -64,6 +64,14 @@ class AttributeForm extends FormTabs $this->browser->switchToFrame(new Locator($this->iFrame)); } + /** + * @destructor + */ + public function __destruct() + { + $this->browser->switchToFrame(); + } + /** * Fill the attribute form. * @@ -112,6 +120,5 @@ class AttributeForm extends FormTabs public function saveAttributeForm() { $this->browser->find($this->saveButton)->click(); - $this->browser->selectWindow(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index b1091273427d381a749fb588bb47b4dd7883cac8..8a6c5bc78830d8fd334ba89304cb078305b736f3 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -11,27 +11,26 @@ use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Element; /** - * Class AdvancedPropertiesTab - * Tab "Advanced Attribute Properties" + * Tab "Advanced Attribute Properties". */ class Advanced extends Tab { /** - * "Advanced Attribute Properties" tab-button + * "Advanced Attribute Properties" tab-button. * * @var string */ protected $propertiesTab = '[data-target="#advanced_fieldset-content"][data-toggle="collapse"]'; /** - * "Advanced Attribute Properties" tab-button active + * "Advanced Attribute Properties" content. * * @var string */ - protected $propertiesTabActive = '.title.active'; + protected $propertiesTabContent = '#advanced_fieldset-content'; /** - * Fill 'Advanced Attribute Properties' tab + * Fill 'Advanced Attribute Properties' tab. * * @param array $fields * @param SimpleElement|null $element @@ -39,10 +38,10 @@ class Advanced extends Tab */ public function fillFormTab(array $fields, SimpleElement $element = null) { - if (!$this->_rootElement->find($this->propertiesTabActive)->isVisible()) { + if (!$this->_rootElement->find($this->propertiesTabContent)->isVisible()) { $this->_rootElement->find($this->propertiesTab)->click(); } - return parent::fillFormTab($fields); + return parent::fillFormTab($fields, $element); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 68a4971aba92afce46910ac1a89c9d952cbbac2a..699bc721e7d1ea84b21ebb145d548ad0e8eee2aa 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -113,11 +113,6 @@ class ProductForm extends FormTabs } else { $tabs = $this->getFieldsByTabs($product); - //TODO: Remove after old product fixture will be deleted - if (null === $category && $product instanceof DataFixture) { - $categories = $product->getCategories(); - $category = reset($categories); - } if ($category) { $tabs['product-details']['category_ids']['value'] = $category->getName(); } @@ -147,7 +142,7 @@ class ProductForm extends FormTabs /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails $tab */ $tab = $this->openTab($tabName); $tab->addNewAttribute($tabName); - $this->fillAttributeForm($attribute); + $this->getAttributeForm()->fill($attribute); } } @@ -286,18 +281,6 @@ class ProductForm extends FormTabs return $data; } - /** - * Fill product attribute form. - * - * @param CatalogProductAttribute $productAttribute - * @return void - */ - public function fillAttributeForm(CatalogProductAttribute $productAttribute) - { - $attributeForm = $this->getAttributeForm(); - $attributeForm->fill($productAttribute); - } - /** * Click "Save" button on attribute form. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php index b8c85e290dd14f129545de8f05f50bd98352f79d..9c9e9dd1f19e92723750b360081d474888baa44a 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php @@ -11,34 +11,33 @@ use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; /** - * Class View - * Category view block on the category page + * Category view block on the category page. */ class View extends Block { /** - * Recently Viewed Products selectors + * Recently Viewed Products selectors. * * @var string */ protected $recentlyViewedProducts = './/*[contains(@class,"widget")]//strong[@class="product-item-name"]'; /** - * Description CSS selector + * Description CSS selector. * * @var string */ protected $description = '.category-description'; /** - * Locator for category content + * Locator for category content. * * @var string */ protected $content = '.category-cms'; /** - * Get description + * Get description. * * @return string */ @@ -48,17 +47,18 @@ class View extends Block } /** - * Get Category Content + * Get Category Content. * * @return string */ public function getContent() { - return $this->_rootElement->find($this->content)->getText(); + $categoryContent = $this->_rootElement->find($this->content); + return $categoryContent->isVisible() ? $categoryContent->getText() : ''; } /** - * Get products from Recently Viewed block + * Get products from Recently Viewed block. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php index 34b3fc49ec2a02ab967e466728256fcb1213fdb8..dd2265411c098a6e4998c25ffde26a82e069e61e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php @@ -20,7 +20,7 @@ class Search extends Block * * @var string */ - protected $searchAutocomplete = './/div[@id="search_autocomplete"]//li[span[text()="%s"]]'; + protected $searchAutocomplete = './/div[@id="search_autocomplete"]//li[span[text()[normalize-space()="%s"]]]'; /** * Selector number of matches for a given row diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml index 636a0e12ebdacc88ee55e08997c68943fc8c6bc6..663a249b5da66e367bd8b0a953e622653aaa065e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml @@ -78,7 +78,7 @@ <field name="include_in_menu" group="general_information"> <default_value xsi:type="string">Yes</default_value> </field> - <field name="landing_page" group="display_setting" source="\Magento\Catalog\Test\Fixture\Category\LandingPage"/> + <field name="landing_page" group="display_setting" source="Magento\Catalog\Test\Fixture\Category\LandingPage"/> <field name="display_mode" group="display_setting"/> <field name="category_products" group="category_products" source="Magento\Catalog\Test\Fixture\Category\CategoryProducts"/> </fixture> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php index add0a7c40e1bcae69191eeeab91173c2d8e497f2..22ac44c8c5e55700a322e6a1359a6dc4dcb241b7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php @@ -45,6 +45,7 @@ class LandingPage implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data = []) { $this->params = $params; + $this->data = $data; if (isset($data['preset'])) { /** @var CmsBlock $cmsBlock */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Category/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Category/Curl.php index 66ae5c3e9048d4043b850092dcbde3ed7120562d..9770e6726048c6139631ba6022d8801484e1c108 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Category/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Category/Curl.php @@ -14,13 +14,12 @@ use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; /** - * Class Curl - * Create new category via curl + * Create new category via curl. */ class Curl extends AbstractCurl implements CategoryInterface { /** - * Data use config for category + * Data use config for category. * * @var array */ @@ -56,25 +55,16 @@ class Curl extends AbstractCurl implements CategoryInterface ]; /** - * Post request for creating Subcategory + * Post request for creating Subcategory. * * @param FixtureInterface|null $fixture [optional] * @return array */ public function persist(FixtureInterface $fixture = null) { - $data['general'] = $this->replaceMappingData($fixture->getData()); - if ($fixture->hasData('landing_page')) { - $data['general']['landing_page'] = $this->getBlockId($fixture->getLandingPage()); - } + $data = $this->prepareData($fixture); - $diff = array_diff($this->dataUseConfig, array_keys($data['general'])); - if (!empty($diff)) { - $data['use_config'] = $diff; - } - $parentCategoryId = $data['general']['parent_id']; - - $url = $_ENV['app_backend_url'] . 'catalog/category/save/store/0/parent/' . $parentCategoryId . '/'; + $url = $_ENV['app_backend_url'] . 'catalog/category/save/store/0/parent/' . $data['general']['parent_id'] . '/'; $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); $curl->write(CurlInterface::POST, $url, '1.0', [], $data); $response = $curl->read(); @@ -87,12 +77,34 @@ class Curl extends AbstractCurl implements CategoryInterface } /** - * Getting block id by name + * Prepare category data for curl. + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareData(FixtureInterface $fixture) + { + $data['general'] = $this->replaceMappingData($fixture->getData()); + $data['is_anchor'] = isset($data['is_anchor']) ? $data['is_anchor'] : 0; + if ($fixture->hasData('landing_page')) { + $data['general']['landing_page'] = $this->getBlockId($fixture->getLandingPage()); + } + + $diff = array_diff($this->dataUseConfig, array_keys($data['general'])); + if (!empty($diff)) { + $data['use_config'] = $diff; + } + + return $data; + } + + /** + * Getting block id by name. * * @param string $landingName * @return int|null */ - public function getBlockId($landingName) + protected function getBlockId($landingName) { $url = $_ENV['app_backend_url'] . 'catalog/category'; $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductIndex.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductIndex.xml index 5872271e30c50db4a9f20d1051ae479ed9574afe..df6bf92efaf4d81667d63552871f5b21a4611a72 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductIndex.xml @@ -6,10 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CatalogProductIndex" area="Adminhtml" mca="catalog/product/index" module="Magento_Catalog"> - <block name="productGrid" class="Magento\Catalog\Test\Block\Adminhtml\Product\Grid" locator="#productGrid" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> - <block name="gridPageActionBlock" class="Magento\Catalog\Test\Block\Adminhtml\Product\GridPageAction" locator="#add_new_product" strategy="css selector"/> - <block name="accessDeniedBlock" class="Magento\Backend\Test\Block\Denied" locator="[id='page:main-container']" strategy="css selector"/> - </page> + <page name="CatalogProductIndex" area="Adminhtml" mca="catalog/product/index" module="Magento_Catalog"> + <block name="productGrid" class="Magento\Catalog\Test\Block\Adminhtml\Product\Grid" locator="#productGrid" strategy="css selector"/> + <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> + <block name="gridPageActionBlock" class="Magento\Catalog\Test\Block\Adminhtml\Product\GridPageAction" locator="#add_new_product" strategy="css selector"/> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index b7060994fbd5073da14ad9663b246769eea86f48..4998c9d9604744c84511a07a10c321a6cc29bd02 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -277,7 +277,7 @@ </field> <field name="weight" xsi:type="string">100</field> <field name="website_ids" xsi:type="array"> - <item name="0" xsi:type="string">Main W"e</item> + <item name="0" xsi:type="string">Main Website</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="category_ids" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml index 395dc632a4049d8006c6e3432fbe19e39335ca1c..590204f0d4d3b5ba1a99653f4642524428cbb5b7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml @@ -18,7 +18,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">-</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">-</data> <data name="category/data/available_product_listing_config" xsi:type="string">No</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">Position</data> @@ -44,7 +43,6 @@ <data name="category/data/meta_title" xsi:type="string">RootCategory Page Title</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">Static block and products</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">Yes</data> <data name="category/data/available_product_listing_config" xsi:type="string">No</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">Position</data> @@ -70,7 +68,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">-</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">-</data> <data name="category/data/available_product_listing_config" xsi:type="string">Yes</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">-</data> @@ -97,7 +94,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">No</data> <data name="category/data/available_product_listing_config" xsi:type="string">Yes</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">-</data> @@ -125,7 +121,7 @@ <data name="category/data/meta_title" xsi:type="string">Subcategory Page Title</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">Static block and products</data> - <data name="category/data/landing_page" xsi:type="string">default</data> + <data name="category/data/landing_page/preset" xsi:type="string">default</data> <data name="category/data/is_anchor" xsi:type="string">Yes</data> <data name="category/data/available_product_listing_config" xsi:type="string">No</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">Position</data> @@ -153,7 +149,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">-</data> <data name="category/data/available_product_listing_config" xsi:type="string">Yes</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">-</data> @@ -179,7 +174,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">No</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">-</data> <data name="category/data/available_product_listing_config" xsi:type="string">-</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">-</data> @@ -205,7 +199,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">-</data> <data name="category/data/available_product_listing_config" xsi:type="string">-</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">-</data> @@ -233,7 +226,6 @@ <data name="category/data/meta_title" xsi:type="string">-</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">-</data> - <data name="category/data/landing_page" xsi:type="string">-</data> <data name="category/data/is_anchor" xsi:type="string">-</data> <data name="category/data/available_product_listing_config" xsi:type="string">-</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">-</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..a42733b3587f1f71c694a7dd569a96a387d5b0e5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.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\NavigateMenuTest"> + <variation name="NavigateMenuTest9"> + <data name="menuItem" xsi:type="string">Products > Catalog</data> + <data name="pageTitle" xsi:type="string">Inventory</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest10"> + <data name="menuItem" xsi:type="string">Products > Categories</data> + <data name="pageTitle" xsi:type="string">Categories</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest11"> + <data name="menuItem" xsi:type="string">Stores > Product</data> + <data name="pageTitle" xsi:type="string">Product Attributes</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest12"> + <data name="menuItem" xsi:type="string">Stores > Product Template</data> + <data name="pageTitle" xsi:type="string">Product Templates</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> 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 dcbe8113bdd361d397c7a9f820fd3c28584564ba..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 @@ -6,856 +6,457 @@ */ --> <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\CreateSimpleProductEntityTest"> - <variation name="CreateSimpleProductEntityTestVariation1" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with custom options(fixed price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10000</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">50</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">657</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation2" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with custom options(percent price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10001</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">51</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">658</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with special price and custom options(fixed price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10002</data> - <data name="product/data/special_price" xsi:type="string">90</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">52</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">659</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation4" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with special price and custom options(percent price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10003</data> - <data name="product/data/special_price" xsi:type="string">90</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">53</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">660</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation5" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with group price and custom options(percent price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10004</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">54</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">661</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation6" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with group price and custom options(fixed price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10005</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">55</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">662</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation7" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with tier price and custom options(percent price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10006</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">56</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">663</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation8" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with tier price and custom options(fixed price)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10007</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">57</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">664</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation9" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product without custom options</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10008</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">58</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">665</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation10" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product that is in stock</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10009</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">59</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation11" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product that is out stock</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10010</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">60</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">0</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductOutOfStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation12" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product that visible only in search</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10011</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">61</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">138</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">Search</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductOutOfStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation13" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create simple product and check search by sku</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10012</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">62</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">139</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" next="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation14" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create simple product and check visibility in category</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10013</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">63</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">140</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation15" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with tax class and group price</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/price/value" xsi:type="string">10014</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">64</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">141</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">default</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" next="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation16" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with tax class and check absent special price</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/price/value" xsi:type="string">10015</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">65</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">142</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" next="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation17" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product without tax class and tier price</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> - <data name="product/data/price/value" xsi:type="string">10016</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">66</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">143</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">default</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" next="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation18" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product wit suite of custom options</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10017</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">67</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">144</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> - <data name="product/data/checkout_data/preset" xsi:type="string">options-suite</data> - <data name="product/data/custom_options/import_products" xsi:type="string">catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInStock" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" next="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation19" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with cross-sell products</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10018</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">59</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductCrossSells" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductCrossSells" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation20" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with up-sell products</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10019</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">59</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductUpSells" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductUpSells" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation21" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with related products</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10020</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> - <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">59</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductForm" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" next="Magento\Catalog\Test\Constraint\AssertProductRelatedProducts" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductRelatedProducts" prev="Magento\Catalog\Test\Constraint\AssertProductForm"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation22" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart</data> - <data name="configData" xsi:type="string">display_out_of_stock</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10021</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">68</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">0</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <data name="tag" xsi:type="string">test_type:acceptance_test</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertAddToCartButtonAbsent"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAddToCartButtonAbsent" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation23" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)</data> - <data name="product/data/category_ids/new_category" xsi:type="string">yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/url_key" xsi:type="string">simple%isolation%</data> - <data name="product/data/name" xsi:type="string">simple%isolation%</data> - <data name="product/data/sku" xsi:type="string">simple%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation24" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12514: Create Simple Product and Assigning It to Category</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">1</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1000</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation25" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12703: Create Simple Product with Custom Options and Assign it to the Category</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> - <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">1</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1000</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/qty" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <data name="tag" xsi:type="string">test_type:acceptance_test</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" next="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateSimpleProductEntityTestVariation26" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12914: Create Simple Product with Advanced Inventory and Assign It to the Category</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</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> - <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/stock_data/manage_stock" xsi:type="string">Yes</data> - <data name="product/data/stock_data/qty" xsi:type="string">1</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">-</data> - <data name="product/data/related_products/presets" xsi:type="string">-</data> - <data name="tag" xsi:type="string">test_type:acceptance_test</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\Product\CreateSimpleProductEntityTest"> + <variation name="CreateSimpleProductEntityTestVariation1"> + <data name="description" xsi:type="string">Create product with custom options(fixed 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10000</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">50</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">657</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation2"> + <data name="description" xsi:type="string">Create product with custom options(percent 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10001</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">51</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">658</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/price/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation3"> + <data name="description" xsi:type="string">Create product with special price and custom options(fixed 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10002</data> + <data name="product/data/special_price" xsi:type="string">90</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">52</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">659</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation4"> + <data name="description" xsi:type="string">Create product with special price and custom options(percent 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10003</data> + <data name="product/data/special_price" xsi:type="string">90</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">53</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">660</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation5"> + <data name="description" xsi:type="string">Create product with group price and custom options(percent 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10004</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">54</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">661</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> + <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation6"> + <data name="description" xsi:type="string">Create product with group price and custom options(fixed 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10005</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">55</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">662</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> + <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation7"> + <data name="description" xsi:type="string">Create product with tier price and custom options(percent 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10006</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">56</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">663</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> + <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation8"> + <data name="description" xsi:type="string">Create product with tier price and custom options(fixed 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10007</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">57</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">664</data> + <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> + <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation9"> + <data name="description" xsi:type="string">Create product without 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10008</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">58</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">665</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation10"> + <data name="description" xsi:type="string">Create product that is in stock</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10009</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">59</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation11"> + <data name="description" xsi:type="string">Create product that is out stock</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10010</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">60</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">0</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation12"> + <data name="description" xsi:type="string">Create product that visible only in search</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10011</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">61</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">138</data> + <data name="product/data/visibility" xsi:type="string">Search</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation13"> + <data name="description" xsi:type="string">Create simple product and check search by sku</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10012</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">62</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">139</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\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation14"> + <data name="description" xsi:type="string">Create simple product and check visibility in category</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10013</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">63</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">140</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\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation15"> + <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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/value" xsi:type="string">10014</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">64</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">141</data> + <data name="product/data/group_price/preset" xsi:type="string">default</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\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductGroupedPriceOnProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation16"> + <data name="description" xsi:type="string">Create product with tax class and check absent special 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/value" xsi:type="string">10015</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">65</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">142</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\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation17"> + <data name="description" xsi:type="string">Create product without tax class and tier 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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/price/value" xsi:type="string">10016</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">66</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">143</data> + <data name="product/data/tier_price/preset" xsi:type="string">default</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\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation18"> + <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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10017</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">67</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">144</data> + <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> + <data name="product/data/checkout_data/preset" xsi:type="string">options-suite</data> + <data name="product/data/custom_options/import_products" xsi:type="string">catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option</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\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation19"> + <data name="description" xsi:type="string">Create product with cross-sell products</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10018</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">59</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/cross_sell_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</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\AssertProductCrossSells" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation20"> + <data name="description" xsi:type="string">Create product with up-sell products</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10019</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">59</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/up_sell_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</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\AssertProductUpSells" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation21"> + <data name="description" xsi:type="string">Create product with related products</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10020</data> + <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> + <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">59</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/related_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</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\AssertProductRelatedProducts" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation22"> + <data name="description" xsi:type="string">MAGETWO-12423: Can't Add Out of Stock Products to Shopping Cart</data> + <data name="configData" xsi:type="string">display_out_of_stock</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10021</data> + <data name="product/data/weight" xsi:type="string">68</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">0</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAddToCartButtonAbsent" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation23"> + <data name="description" xsi:type="string">MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)</data> + <data name="product/data/category_ids/new_category" xsi:type="string">yes</data> + <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/url_key" xsi:type="string">simple%isolation%</data> + <data name="product/data/name" xsi:type="string">simple%isolation%</data> + <data name="product/data/sku" xsi:type="string">simple%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation24"> + <data name="description" xsi:type="string">MAGETWO-12514: Create Simple Product and Assigning It to Category</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/value" xsi:type="string">10</data> + <data name="product/data/weight" xsi:type="string">1</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1000</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation25"> + <data name="description" xsi:type="string">MAGETWO-12703: Create Simple Product with Custom Options and Assign it to the Category</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/value" xsi:type="string">10</data> + <data name="product/data/weight" xsi:type="string">1</data> + <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1000</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">drop_down_with_one_option_fixed_price</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" /> + </variation> + <variation name="CreateSimpleProductEntityTestVariation26"> + <data name="description" xsi:type="string">MAGETWO-12914: Create Simple Product with Advanced Inventory and Assign It to the Category</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> + <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">10</data> + <data name="product/data/stock_data/manage_stock" xsi:type="string">Yes</data> + <data name="product/data/stock_data/qty" xsi:type="string">1</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d9e73e456e61868ca16699ab0d4f2d15de01c324 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Catalog\Test\TestCase\Product; + +use Magento\Catalog\Test\Fixture\Category; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\TestCase\Injectable; + +/** + * Precondition: + * 1. Product is created. + * + * Steps: + * 1. Login to backend. + * 2. Navigate to PRODUCTS > Catalog. + * 3. Click Product from grid. + * 4. Click "Save & Duplicate". + * 5. Perform asserts. + * + * @group Products_(MX) + * @ZephyrId MAGETWO-23294 + */ +class DuplicateProductEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'MX'; + /* end tags */ + + /** + * Category fixture. + * + * @var Category + */ + protected $category; + + /** + * Product page with a grid. + * + * @var CatalogProductIndex + */ + protected $productGrid; + + /** + * Page to update a product. + * + * @var CatalogProductEdit + */ + protected $editProductPage; + + /** + * Fixture factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + + /** + * Prepare data. + * + * @param Category $category + * @param CatalogProductIndex $productGrid + * @param CatalogProductEdit $editProductPage + * @param FixtureFactory $fixtureFactory + * @return void + */ + public function __prepare( + Category $category, + CatalogProductIndex $productGrid, + CatalogProductEdit $editProductPage, + FixtureFactory $fixtureFactory + ) { + $this->category = $category; + $this->category->persist(); + $this->productGrid = $productGrid; + $this->editProductPage = $editProductPage; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Run test duplicate product entity. + * + * @param string $productType + * @return array + */ + public function test($productType) + { + // Precondition + $product = $this->createProduct($productType); + + // Steps + $filter = ['sku' => $product->getSku()]; + $this->productGrid->open(); + $this->productGrid->getProductGrid()->searchAndOpen($filter); + $this->editProductPage->getFormPageActions()->saveAndDuplicate(); + + return ['product' => $product]; + } + + /** + * Creating a product according to the type of. + * + * @param string $productType + * @return array + */ + protected function createProduct($productType) + { + list($fixture, $dataSet) = explode('::', $productType); + $product = $this->fixtureFactory->createByCode( + $fixture, + [ + 'dataSet' => $dataSet, + 'data' => [ + 'category_ids' => [ + 'category' => $this->category, + ], + ] + ] + ); + $product->persist(); + + return $product; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f2950f6efc1b2360dc1f0d091ff27e47565822a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml @@ -0,0 +1,19 @@ +<?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\Catalog\Test\TestCase\Product\DuplicateProductEntityTest"> + <variation name="DuplicateProductEntityTestVariation1"> + <data name="productType" xsi:type="string">catalogProductSimple::default</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicatedInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateIsNotDisplayingOnFrontend" /> + </variation> + </testCase> +</config> 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 34bbab86b588337d2aa3f3a9aeaa8d8591ce5070..d0bd1c40c54cbaa745d4f50caaed7c5f86542b6b 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 @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\Product\ProductTypeSwitchingOnCreationTest"> <variation name="ProductTypeSwitchingOnCreationTestVariation1"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34630</data> <data name="createProduct" xsi:type="string">simple</data> <data name="product" xsi:type="string">configurableProduct::default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> @@ -44,6 +45,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> </variation> <variation name="ProductTypeSwitchingOnCreationTestVariation6"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34630</data> <data name="createProduct" xsi:type="string">virtual</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> @@ -71,6 +73,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> </variation> <variation name="ProductTypeSwitchingOnCreationTestVariation9"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34630</data> <data name="createProduct" xsi:type="string">downloadable</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> 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 d82f009bac2d5df148d3f4aae04c40e3b1f93fe6..b862b94987c5d39d5a27a2ae6d0a609c6eb0c38c 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 @@ -6,106 +6,107 @@ */ --> <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="productOrigin" xsi:type="string">catalogProductSimple::default</data> - <data name="product" xsi:type="string">configurableProduct::default</data> - <data name="actionName" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation2"> - <data name="productOrigin" xsi:type="string">catalogProductSimple::default</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</data> - <data name="actionName" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="productOrigin" xsi:type="string">configurableProduct::default</data> - <data name="product" xsi:type="string">catalogProductSimple::default</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" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="productOrigin" xsi:type="string">configurableProduct::default</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</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="ProductTypeSwitchingOnUpdateTestVariation5"> - <data name="productOrigin" xsi:type="string">catalogProductVirtual::default</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="actionName" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation6"> - <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> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation7"> - <data name="productOrigin" xsi:type="string">catalogProductVirtual::default</data> - <data name="product" xsi:type="string">downloadableProduct::default</data> - <data name="actionName" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableLinksData"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation8" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="productOrigin" xsi:type="string">downloadableProduct::default</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="actionName" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation9" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <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> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation10" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="productOrigin" xsi:type="string">downloadableProduct::default</data> - <data name="product" xsi:type="string">catalogProductVirtual::default</data> - <data name="actionName" xsi:type="string">clearDownloadableData</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - </variation> - <variation name="ProductTypeSwitchingOnUpdateTestVariation11"> - <data name="productOrigin" xsi:type="string">catalogProductSimple::default</data> - <data name="product" xsi:type="string">downloadableProduct::default</data> - <data name="actionName" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableLinksData"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\Product\ProductTypeSwitchingOnUpdateTest"> + <variation name="ProductTypeSwitchingOnUpdateTestVariation1"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34630</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> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation2"> + <data name="productOrigin" xsi:type="string">catalogProductSimple::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::default</data> + <data name="actionName" xsi:type="string">-</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation3"> + <data name="productOrigin" xsi:type="string">configurableProduct::default</data> + <data name="product" xsi:type="string">catalogProductSimple::default</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="productOrigin" xsi:type="string">configurableProduct::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::default</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="ProductTypeSwitchingOnUpdateTestVariation5"> + <data name="productOrigin" xsi:type="string">catalogProductVirtual::default</data> + <data name="product" xsi:type="string">catalogProductSimple::default</data> + <data name="actionName" xsi:type="string">-</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation6"> + <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> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation7"> + <data name="productOrigin" xsi:type="string">catalogProductVirtual::default</data> + <data name="product" xsi:type="string">downloadableProduct::default</data> + <data name="actionName" xsi:type="string">-</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableLinksData" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation8"> + <data name="productOrigin" xsi:type="string">downloadableProduct::default</data> + <data name="product" xsi:type="string">catalogProductSimple::default</data> + <data name="actionName" xsi:type="string">-</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation9"> + <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> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation10"> + <data name="productOrigin" xsi:type="string">downloadableProduct::default</data> + <data name="product" xsi:type="string">catalogProductVirtual::default</data> + <data name="actionName" xsi:type="string">clearDownloadableData</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + </variation> + <variation name="ProductTypeSwitchingOnUpdateTestVariation11"> + <data name="productOrigin" xsi:type="string">catalogProductSimple::default</data> + <data name="product" xsi:type="string">downloadableProduct::default</data> + <data name="actionName" xsi:type="string">-</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableLinksData" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php index 897c4eb57180a2f3b541ef65941b190daec4411f..d17441b09b1fce6815ac4fa4f70771fa8918b335 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php @@ -54,7 +54,6 @@ class CreateProductAttributeEntityFromProductPageTest extends Scenario */ public function __prepare(FixtureFactory $fixtureFactory) { - $this->markTestIncomplete('Bug: MTA-1616'); $product = $fixtureFactory->createByCode( 'catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor'] diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml index f88391d8938b591dd39a54c9ade2683bbd54f07c..2a0d3215e00f39556df7101785673ee781987133 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml @@ -6,109 +6,67 @@ */ --> <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\CreateProductAttributeEntityFromProductPageTest"> - <variation name="CreateProductAttributeEntityFromProductPageTestVariation1"> - <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">Text Field</data> - <data name="attribute/data/options/preset" xsi:type="string">-</data> - <data name="attribute/data/is_required" xsi:type="string">No</data> - <data name="attribute/data/attribute_code" xsi:type="string">attr_text_%isolation%</data> - <data name="attribute/data/is_global" xsi:type="string">Global</data> - <data name="attribute/data/default_value_text" xsi:type="string"><b><i>default_value_text%isolation%</i></b></data> - <data name="attribute/data/default_value_textarea" 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">-</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">-</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">-</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnSearchForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsGlobal"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnFrontend"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnSearchForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsComparable"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsHtmlAllowed"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUsedInSortOnFrontend"/> - </variation> - <variation name="CreateProductAttributeEntityFromProductPageTestVariation2"> - <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_Admin_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">Dropdown</data> - <data name="attribute/data/options/preset" xsi:type="string">two_options</data> - <data name="attribute/data/is_required" xsi:type="string">No</data> - <data name="attribute/data/attribute_code" xsi:type="string">attr_dropdown_%isolation%</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/default_value_textarea" xsi:type="string">-</data> - <data name="attribute/data/is_unique" xsi:type="string">-</data> - <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> - <data name="attribute/data/is_searchable" xsi:type="string">-</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">-</data> - <data name="attribute/data/is_comparable" xsi:type="string">-</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">-</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">-</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">-</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">-</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterable"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterableInSearch"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertProductAttributeIsConfigurable"/> - </variation> - <variation name="CreateProductAttributeEntityFromProductPageTestVariation3"> - <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">Text Field</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">attr_text_%isolation%</data> - <data name="attribute/data/is_global" xsi:type="string">-</data> - <data name="attribute/data/default_value_text" xsi:type="string">default_value_text%isolation%</data> - <data name="attribute/data/default_value_textarea" xsi:type="string">-</data> - <data name="attribute/data/is_unique" xsi:type="string">-</data> - <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> - <data name="attribute/data/is_searchable" xsi:type="string">-</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">-</data> - <data name="attribute/data/is_comparable" xsi:type="string">-</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">-</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">-</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">-</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">-</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsRequired"/> - </variation> - <variation name="CreateProductAttributeEntityFromProductPageTestVariation4"> - <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> - <data name="attribute/data/frontend_input" xsi:type="string">Text Field</data> - <data name="attribute/data/options/preset" xsi:type="string">-</data> - <data name="attribute/data/is_required" xsi:type="string">No</data> - <data name="attribute/data/attribute_code" xsi:type="string">attr_text_%isolation%</data> - <data name="attribute/data/is_global" xsi:type="string">-</data> - <data name="attribute/data/default_value_text" xsi:type="string">default_value_text%isolation%</data> - <data name="attribute/data/default_value_textarea" 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">-</data> - <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">-</data> - <data name="attribute/data/is_comparable" xsi:type="string">-</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">-</data> - <data name="attribute/data/is_html_allowed_on_front" xsi:type="string">-</data> - <data name="attribute/data/is_visible_on_front" xsi:type="string">-</data> - <data name="attribute/data/used_in_product_listing" xsi:type="string">-</data> - <data name="attribute/data/used_for_sort_by" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUnique"/> - </variation> - </testCase> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityFromProductPageTest"> + <variation name="CreateProductAttributeEntityFromProductPageTestVariation1"> + <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> + <data name="attribute/data/frontend_input" xsi:type="string">Text Field</data> + <data name="attribute/data/is_required" xsi:type="string">No</data> + <data name="attribute/data/attribute_code" xsi:type="string">attr_text_%isolation%</data> + <data name="attribute/data/is_global" xsi:type="string">Global</data> + <data name="attribute/data/default_value_text" xsi:type="string"><b><i>default_value_text%isolation%</i></b></data> + <data name="attribute/data/default_value_textarea" xsi:type="string">-</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_in_search" xsi:type="string">-</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_for_sort_by" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnSearchForm"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsGlobal"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnFrontend"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnSearchForm"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsComparable"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsHtmlAllowed"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUsedInSortOnFrontend"/> + </variation> + <variation name="CreateProductAttributeEntityFromProductPageTestVariation2"> + <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_Admin_%isolation%</data> + <data name="attribute/data/frontend_input" xsi:type="string">Dropdown</data> + <data name="attribute/data/options/preset" xsi:type="string">two_options</data> + <data name="attribute/data/is_required" xsi:type="string">No</data> + <data name="attribute/data/attribute_code" xsi:type="string">attr_dropdown_%isolation%</data> + <data name="attribute/data/is_global" xsi:type="string">Global</data> + <data name="attribute/data/is_unique" xsi:type="string">-</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> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterable"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterableInSearch"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertProductAttributeIsConfigurable"/> + </variation> + <variation name="CreateProductAttributeEntityFromProductPageTestVariation3"> + <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> + <data name="attribute/data/frontend_input" xsi:type="string">Text Field</data> + <data name="attribute/data/is_required" xsi:type="string">Yes</data> + <data name="attribute/data/attribute_code" xsi:type="string">attr_text_%isolation%</data> + <data name="attribute/data/default_value_text" xsi:type="string">default_value_text%isolation%</data> + <data name="attribute/data/default_value_textarea" xsi:type="string">-</data> + <data name="attribute/data/manage_frontend_label" xsi:type="string">-</data> + <data name="attribute/data/is_visible_in_advanced_search" xsi:type="string">-</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsRequired"/> + </variation> + <variation name="CreateProductAttributeEntityFromProductPageTestVariation4"> + <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> + <data name="attribute/data/frontend_input" xsi:type="string">Text Field</data> + <data name="attribute/data/is_required" xsi:type="string">No</data> + <data name="attribute/data/attribute_code" xsi:type="string">attr_text_%isolation%</data> + <data name="attribute/data/default_value_text" xsi:type="string">default_value_text%isolation%</data> + <data name="attribute/data/is_unique" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUnique"/> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/FillAttributeFormOnProductPageStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/FillAttributeFormOnProductPageStep.php index 2d867c8aaa5d114d958081f59ec7e5808dd7ad73..620475dbb388249cb8167120aeacdf279aeafeea 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/FillAttributeFormOnProductPageStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/FillAttributeFormOnProductPageStep.php @@ -47,7 +47,7 @@ class FillAttributeFormOnProductPageStep implements TestStepInterface */ public function run() { - $this->catalogProductEdit->getProductForm()->fillAttributeForm($this->attribute); + $this->catalogProductEdit->getProductForm()->getAttributeForm()->fill($this->attribute); return ['attribute' => $this->attribute]; } } diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php index f982dafef13783f8f7ab440e0c5bff091be6cbed..1eab3289e6597aa4939e1168848babfcdef38e6c 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php @@ -6,49 +6,60 @@ namespace Magento\CatalogRule\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Page\Category\CatalogCategoryView; use Magento\Cms\Test\Page\CmsIndex; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; /** - * Class AssertCatalogPriceRuleAppliedCatalogPage + * Assert that Catalog Price Rule is applied for product(s) in Catalog. */ class AssertCatalogPriceRuleAppliedCatalogPage extends AbstractConstraint { /** * Assert that Catalog Price Rule is applied for product(s) in Catalog - * according to Priority(Priority/Stop Further Rules Processing) + * according to Priority(Priority/Stop Further Rules Processing). * - * @param CatalogProductSimple $product - * @param CmsIndex $cmsIndex - * @param CatalogCategoryView $catalogCategoryView - * @param array $price + * @param CmsIndex $cmsIndexPage + * @param CatalogCategoryView $catalogCategoryViewPage + * @param array $products + * @param array $productPrice + * @param Customer $customer * @return void */ public function processAssert( - CatalogProductSimple $product, - CmsIndex $cmsIndex, - CatalogCategoryView $catalogCategoryView, - array $price + CmsIndex $cmsIndexPage, + CatalogCategoryView $catalogCategoryViewPage, + array $products, + array $productPrice, + Customer $customer = null ) { - $cmsIndex->open(); - $categoryName = $product->getCategoryIds()[0]; - $productName = $product->getName(); - $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); - $productPriceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($productName); - $actualPrice['regular'] = $productPriceBlock->getRegularPrice(); - $actualPrice['special'] = $productPriceBlock->getSpecialPrice(); - $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; - $diff = $this->verifyData($actualPrice, $price); - \PHPUnit_Framework_Assert::assertTrue( - empty($diff), - implode(' ', $diff) - ); + if ($customer !== null) { + $this->objectManager->create( + '\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); + } + $cmsIndexPage->open(); + foreach ($products as $key => $product) { + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndexPage->getTopmenu()->selectCategoryByName($categoryName); + $productPriceBlock = $catalogCategoryViewPage->getListProductBlock()->getProductPriceBlock($productName); + $actualPrice['regular'] = $productPriceBlock->getRegularPrice(); + $actualPrice['special'] = $productPriceBlock->getSpecialPrice(); + $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; + $diff = $this->verifyData($actualPrice, $productPrice[$key]); + \PHPUnit_Framework_Assert::assertTrue( + empty($diff), + implode(' ', $diff) + ); + } } /** - * Check if arrays have equal values + * Check if arrays have equal values. * * @param array $formData * @param array $fixtureData @@ -59,16 +70,16 @@ class AssertCatalogPriceRuleAppliedCatalogPage extends AbstractConstraint $errorMessage = []; foreach ($formData as $key => $value) { if ($value != $fixtureData[$key]) { - $errorMessage[] = "Data not equal." + $errorMessage[] = "Value " . $key . " is not equal." . "\nExpected: " . $fixtureData[$key] - . "\nActual: " . $value; + . "\nActual: " . $value . "\n"; } } return $errorMessage; } /** - * Text of catalog price rule visibility on catalog page (frontend) + * Text of catalog price rule visibility on catalog page (frontend). * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedOnepageCheckout.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedOnepageCheckout.php new file mode 100644 index 0000000000000000000000000000000000000000..a68f7719e18624b36103955d1c3a78ed22cc6c63 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedOnepageCheckout.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\CatalogRule\Test\Constraint; + +use Magento\Checkout\Test\Page\CheckoutOnepage; +use Magento\Customer\Test\Fixture\Customer; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that Catalog Price Rule is applied on OnePage Checkout page. + */ +class AssertCatalogPriceRuleAppliedOnepageCheckout extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + + /** + * Assert that Catalog Price Rule is applied & it impacts on product's discount price on OnePage Checkout page. + * + * @param CheckoutOnepage $checkoutOnepage + * @param Customer $customer + * @param array $products + * @param array $cartPrice + * @param array $shipping + * @param array $payment + * @return void + */ + public function processAssert( + CheckoutOnepage $checkoutOnepage, + Customer $customer, + array $products, + array $cartPrice, + array $shipping, + array $payment + ) { + $this->objectManager->create( + '\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); + $this->objectManager->create( + '\Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => $products] + )->run(); + $this->objectManager->create('\Magento\Checkout\Test\TestStep\ProceedToCheckoutStep')->run(); + $this->objectManager->create( + '\Magento\Checkout\Test\TestStep\FillBillingInformationStep', + ['customer' => $customer, 'checkoutMethod' => 'register'] + )->run(); + $this->objectManager->create( + '\Magento\Checkout\Test\TestStep\FillShippingMethodStep', + ['shipping' => $shipping] + )->run(); + $this->objectManager->create( + '\Magento\Checkout\Test\TestStep\SelectPaymentMethodStep', + ['payment' => $payment] + )->run(); + $actualPrices['grand_total'] = $checkoutOnepage->getReviewBlock()->getGrandTotal(); + $actualPrices['sub_total'] = $checkoutOnepage->getReviewBlock()->getSubtotal(); + $expectedPrices['grand_total'] = $cartPrice['grand_total'] + $cartPrice['shipping_price']; + $expectedPrices['sub_total'] = $cartPrice['sub_total']; + \PHPUnit_Framework_Assert::assertEquals( + $expectedPrices, + $actualPrices, + 'Wrong total cart prices are displayed.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Displayed catalog price rule data on OnePage Checkout equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php index 3dc3d40203234831a391b7a1cc8dec93647408bf..821f48e27730094befa699fd13199996e866defb 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php @@ -6,52 +6,62 @@ namespace Magento\CatalogRule\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Page\Category\CatalogCategoryView; -use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Catalog\Test\Page\Product\CatalogProductView; +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; /** - * Class AssertCatalogPriceRuleAppliedProductPage + * Assert that Catalog Price Rule is applied on Product page. */ class AssertCatalogPriceRuleAppliedProductPage extends AbstractConstraint { /** - * Assert that Catalog Price Rule is applied & it impacts on product's discount price on Product page + * Assert that Catalog Price Rule is applied & it impacts on product's discount price on Product page. * - * @param CatalogProductSimple $product - * @param CatalogProductView $pageCatalogProductView - * @param CmsIndex $cmsIndex - * @param CatalogCategoryView $catalogCategoryView - * @param array $price + * @param CatalogProductView $catalogProductViewPage + * @param CmsIndex $cmsIndexPage + * @param CatalogCategoryView $catalogCategoryViewPage + * @param array $products + * @param array $productPrice + * @param Customer $customer * @return void */ public function processAssert( - CatalogProductSimple $product, - CatalogProductView $pageCatalogProductView, - CmsIndex $cmsIndex, - CatalogCategoryView $catalogCategoryView, - array $price + CatalogProductView $catalogProductViewPage, + CmsIndex $cmsIndexPage, + CatalogCategoryView $catalogCategoryViewPage, + array $products, + array $productPrice, + Customer $customer = null ) { - $cmsIndex->open(); - $categoryName = $product->getCategoryIds()[0]; - $productName = $product->getName(); - $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); - $catalogCategoryView->getListProductBlock()->openProductViewPage($productName); - $productPriceBlock = $pageCatalogProductView->getViewBlock()->getPriceBlock(); - $actualPrice['regular'] = $productPriceBlock->getRegularPrice(); - $actualPrice['special'] = $productPriceBlock->getSpecialPrice(); - $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; - $diff = $this->verifyData($actualPrice, $price); - \PHPUnit_Framework_Assert::assertTrue( - empty($diff), - implode(' ', $diff) - ); + if ($customer !== null) { + $this->objectManager->create( + '\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); + } + $cmsIndexPage->open(); + foreach ($products as $key => $product) { + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndexPage->getTopmenu()->selectCategoryByName($categoryName); + $catalogCategoryViewPage->getListProductBlock()->openProductViewPage($productName); + $productPriceBlock = $catalogProductViewPage->getViewBlock()->getPriceBlock(); + $actualPrice['regular'] = $productPriceBlock->getRegularPrice(); + $actualPrice['special'] = $productPriceBlock->getSpecialPrice(); + $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; + $diff = $this->verifyData($actualPrice, $productPrice[$key]); + \PHPUnit_Framework_Assert::assertTrue( + empty($diff), + implode(' ', $diff) + ); + } } /** - * Check if arrays have equal values + * Check if arrays have equal values. * * @param array $formData * @param array $fixtureData @@ -71,7 +81,7 @@ class AssertCatalogPriceRuleAppliedProductPage extends AbstractConstraint } /** - * Text of catalog price rule visibility on product page (frontend) + * Text of catalog price rule visibility on product page (frontend). * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php index 783eba7bfa8fdbea306cba538bffbe9e0e22aa5d..e3b15f78366b04ad70e2e0d10c46518d0ae46a50 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php @@ -6,56 +6,68 @@ namespace Magento\CatalogRule\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Page\Category\CatalogCategoryView; -use Magento\Catalog\Test\Page\Product\CatalogProductView; +use Magento\Customer\Test\Fixture\Customer; use Magento\Checkout\Test\Page\CheckoutCart; -use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; /** - * Class AssertCatalogPriceRuleAppliedShoppingCart + * Assert that Catalog Price Rule is applied in Shopping Cart. */ class AssertCatalogPriceRuleAppliedShoppingCart extends AbstractConstraint { /** * Assert that Catalog Price Rule is applied for product(s) in Shopping Cart - * according to Priority(Priority/Stop Further Rules Processing) + * according to Priority(Priority/Stop Further Rules Processing). * - * @param CatalogProductSimple $product - * @param CatalogProductView $pageCatalogProductView - * @param CmsIndex $cmsIndex - * @param CatalogCategoryView $catalogCategoryView - * @param CheckoutCart $pageCheckoutCart - * @param array $price + * @param CheckoutCart $checkoutCartPage + * @param array $products + * @param array $cartPrice + * @param array $productPrice + * @param Customer $customer * @return void */ public function processAssert( - CatalogProductSimple $product, - CatalogProductView $pageCatalogProductView, - CmsIndex $cmsIndex, - CatalogCategoryView $catalogCategoryView, - CheckoutCart $pageCheckoutCart, - array $price + CheckoutCart $checkoutCartPage, + array $products, + array $cartPrice, + array $productPrice, + Customer $customer = null ) { - $cmsIndex->open(); - $categoryName = $product->getCategoryIds()[0]; - $productName = $product->getName(); - $cmsIndex->getTopmenu()->selectCategoryByName($categoryName); - $catalogCategoryView->getListProductBlock()->openProductViewPage($productName); - $pageCatalogProductView->getViewBlock()->clickAddToCartButton(); - $actualGrandTotal = $pageCheckoutCart->getCartBlock()->getCartItem($product)->getPrice(); + if ($customer !== null) { + $this->objectManager->create( + '\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); + } + $this->objectManager->create( + '\Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => $products] + )->run(); + $checkoutCartPage->open(); + foreach ($products as $key => $product) { + $actualPrice = $checkoutCartPage->getCartBlock()->getCartItem($product)->getSubtotalPrice(); + \PHPUnit_Framework_Assert::assertEquals( + $productPrice[$key]['sub_total'], + $actualPrice, + 'Wrong product price is displayed.' + . "\nExpected: " . $productPrice[$key]['sub_total'] + . "\nActual: " . $actualPrice . "\n" + ); + } + $actualPrices['sub_total'] = $checkoutCartPage->getTotalsBlock()->getSubtotal(); + $actualPrices['grand_total'] = $checkoutCartPage->getTotalsBlock()->getGrandTotal(); + $expectedPrices['sub_total'] = $cartPrice['sub_total']; + $expectedPrices['grand_total'] = $cartPrice['grand_total']; \PHPUnit_Framework_Assert::assertEquals( - $price['grand_total'], - $actualGrandTotal, - 'Wrong grand total price is displayed.' - . "\nExpected: " . $price['grand_total'] - . "\nActual: " . $actualGrandTotal + $expectedPrices, + $actualPrices, + 'Wrong total cart prices are displayed.' ); } /** - * Text of catalog price rule visibility in Shopping Cart (frontend) + * Text of catalog price rule visibility in Shopping Cart (frontend). * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedCatalogPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedCatalogPage.php new file mode 100644 index 0000000000000000000000000000000000000000..4b6b244d48f3dffae669ea84dc296f1066f110be --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedCatalogPage.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\CatalogRule\Test\Constraint; + +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; + +/** + * Assert that Catalog Price Rule is not applied for product(s) in Catalog. + */ +class AssertCatalogPriceRuleNotAppliedCatalogPage extends AbstractConstraint +{ + /** + * Assert that Catalog Price Rule is not applied for product(s) in Catalog. + * + * @param CmsIndex $cmsIndexPage + * @param CatalogCategoryView $catalogCategoryViewPage + * @param array $products + * @return void + */ + public function processAssert( + CmsIndex $cmsIndexPage, + CatalogCategoryView $catalogCategoryViewPage, + array $products + ) { + $cmsIndexPage->open(); + foreach ($products as $product) { + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndexPage->getTopmenu()->selectCategoryByName($categoryName); + $productPriceBlock = $catalogCategoryViewPage->getListProductBlock()->getProductPriceBlock($productName); + \PHPUnit_Framework_Assert::assertFalse( + $productPriceBlock->isSpecialPriceVisible(), + "Catalog price rule is applied!\n" + ); + } + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Catalog price rule was not applied to products on catalog page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedProductPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedProductPage.php new file mode 100644 index 0000000000000000000000000000000000000000..8b5dc40eb97bf34e92138a7a8d98ddce649d3e7e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedProductPage.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\CatalogRule\Test\Constraint; + +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Catalog\Test\Page\Product\CatalogProductView; +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; + +/** + * Assert that Catalog Price Rule is not applied on Product page. + */ +class AssertCatalogPriceRuleNotAppliedProductPage extends AbstractConstraint +{ + /** + * Assert that Catalog Price Rule is not applied on Product page. + * + * @param CatalogProductView $catalogProductViewPage + * @param CmsIndex $cmsIndexPage + * @param CatalogCategoryView $catalogCategoryViewPage + * @param array $products + * @return void + */ + public function processAssert( + CatalogProductView $catalogProductViewPage, + CmsIndex $cmsIndexPage, + CatalogCategoryView $catalogCategoryViewPage, + array $products + ) { + $cmsIndexPage->open(); + foreach ($products as $product) { + $categoryName = $product->getCategoryIds()[0]; + $productName = $product->getName(); + $cmsIndexPage->getTopmenu()->selectCategoryByName($categoryName); + $catalogCategoryViewPage->getListProductBlock()->openProductViewPage($productName); + $productPriceBlock = $catalogProductViewPage->getViewBlock()->getPriceBlock(); + \PHPUnit_Framework_Assert::assertFalse( + $productPriceBlock->isSpecialPriceVisible(), + "Catalog price rule is applied!\n" + ); + } + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Catalog price rule was not applied to products on product page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedShoppingCart.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedShoppingCart.php new file mode 100644 index 0000000000000000000000000000000000000000..bea638692dc20b74acc96ca4734a3bbef47791ed --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotAppliedShoppingCart.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\CatalogRule\Test\Constraint; + +use Magento\Checkout\Test\Page\CheckoutCart; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that Catalog Price Rule is not applied in Shopping Cart. + */ +class AssertCatalogPriceRuleNotAppliedShoppingCart extends AbstractConstraint +{ + /** + * Assert that Catalog Price Rule is not applied for product(s) in Shopping Cart. + * + * @param CheckoutCart $checkoutCartPage + * @param array $products + * @param array $productPrice + * @return void + */ + public function processAssert( + CheckoutCart $checkoutCartPage, + array $products, + array $productPrice + ) { + $this->objectManager->create( + '\Magento\Checkout\Test\TestStep\AddProductsToTheCartStep', + ['products' => $products] + )->run(); + $checkoutCartPage->open(); + foreach ($products as $key => $product) { + $actualPrice = $checkoutCartPage->getCartBlock()->getCartItem($product)->getSubtotalPrice(); + \PHPUnit_Framework_Assert::assertEquals( + $productPrice[$key]['regular'], + $actualPrice, + 'Wrong product price is displayed.' + . "\nExpected: " . $productPrice[$key]['regular'] + . "\nActual: " . $actualPrice . "\n" + ); + } + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Displayed catalog price rule data in shopping cart(frontend) equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogPriceRule.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogPriceRule.php deleted file mode 100644 index ff33ac103f3b04906254cafb8c32cc7ba888897d..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogPriceRule.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogRule\Test\Fixture; - -use Magento\CatalogRule\Test\Repository\CatalogPriceRule as Repository; -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\DataFixture; - -/** - * Class CatalogPriceRule - * - */ -class CatalogPriceRule extends DataFixture -{ - /** - * {@inheritdoc} - */ - protected function _initData() - { - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCatalogRuleCatalogPriceRule($this->_dataConfig, $this->_data); - - //Default data set - $this->switchData(Repository::CATALOG_PRICE_RULE); - } - - /** - * Get the rule name value - */ - public function getRuleName() - { - return $this->getData('fields/name/value'); - } - - /** - * Get the discount amount value - */ - public function getDiscountAmount() - { - return $this->getData('fields/discount_amount/value'); - } -} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule/Conditions.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule/Conditions.php deleted file mode 100644 index 548477e346f9a2c75ac305ce9a912ef7c8409cd5..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule/Conditions.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogRule\Test\Fixture\CatalogRule; - -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Conditions - * - * Data keys: - * - dataSet - */ -class Conditions implements FixtureInterface -{ - /** - * @var array - */ - protected $data = []; - - /** - * @var \Magento\Mtf\Fixture\FixtureFactory - */ - protected $fixtureFactory; - - /** - * @var array - */ - protected $params; - - /** - * Constructor for preparing conditions data from repository - * - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param string $data - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function __construct(FixtureFactory $fixtureFactory, array $params, $data) - { - preg_match('/\[(.*)\]/', $data, $matches); - $conditionsArray = explode(",", $matches[1]); - $value = array_shift($conditionsArray); - $parts = explode('|', $value); - - foreach ($parts as $key => $value) { - $parts[$key] = trim($value); - } - - if ($parts[0] == 'Category') { - $this->data['conditions']['1--1']['attribute'] = 'category_ids'; - } elseif ($parts[1] == 'AttributeSet') { - $this->data['conditions']['1--1']['attribute'] = 'attribute_set_id'; - } - - if ($parts[1] == 'is') { - $this->data['conditions']['1--1']['operator'] = '=='; - } else { - $this->data['conditions']['1--1']['operator'] = '!='; - } - - $this->data['conditions']['1--1']['type'] = 'Magento\CatalogRule\Model\Rule\Condition\Product'; - - if (!empty($parts[2])) { - $this->data['conditions']['1--1']['value'] = $parts[2]; - } - } - - /** - * Persist custom selections conditions - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param string|null $key - * @return array|mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Product/Category.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Product/Category.php deleted file mode 100644 index ed8f775509728edac53ffaf3b3fd68fbea7a0c01..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/Product/Category.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogRule\Test\Fixture\Product; - -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Category - * - * Data keys: - * - preset (Product options preset name) - */ -class Category implements FixtureInterface -{ - /** - * @var \Magento\Mtf\Fixture\FixtureFactory - */ - protected $fixtureFactory; - - /** - * @param FixtureFactory $fixtureFactory - * @param mixed $data - * @param array $params - * @param bool $persist - */ - public function __construct( - FixtureFactory $fixtureFactory, - $data, - array $params = [], - $persist = false - ) { - $this->fixtureFactory = $fixtureFactory; - - $this->data = $data; - - if (isset($this->data['products'])) { - $products = explode(',', $this->data['products']); - $this->data['products'] = []; - foreach ($products as $key => $product) { - list($fixture, $dataSet) = explode('::', $product); - $this->data['products'][$key] = $this->fixtureFactory - ->createByCode($fixture, ['dataSet' => $dataSet]); - } - } - - $this->data['preset'] = $this->getPreset($this->data['preset']); - - $this->params = $params; - if ($persist) { - $this->persist(); - } - } - - /** - * Persist bundle selections products - * - * @return void - */ - public function persist() - { - if (isset($this->data['products'])) { - foreach ($this->data['products'] as $product) { - /** @var $product FixtureInterface */ - $product->persist(); - } - } - } - - /** - * Return prepared data set - * - * @param $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * @param $name - * @return mixed - * @throws \InvalidArgumentException - */ - protected function getPreset($name) - { - $presets = [ - 'simple_category' => [ - 'name' => 'Simple With Category', - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogPriceRule.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogPriceRule.php deleted file mode 100755 index 1a9b4268b9ffb8271c56725944d648ff7894a5c6..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogPriceRule.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogRule\Test\Repository; - -use Magento\Mtf\Repository\AbstractRepository; - -/** - * Class CatalogPriceRule Repository - * - */ -class CatalogPriceRule extends AbstractRepository -{ - const CATALOG_PRICE_RULE = 'catalog_price_rule'; - - const CATALOG_PRICE_RULE_ALL_GROUPS = 'catalog_price_rule_all_groups'; - - const CUSTOMER_GROUP_GENERAL_RULE = 'customer_group_general_rule'; - - const GROUP_RULE_INFORMATION = 'rule_information'; - - const GROUP_CONDITIONS = 'conditions'; - - const GROUP_ACTIONS = 'actions'; - - public function __construct(array $defaultConfig = [], array $defaultData = []) - { - $this->_data['default'] = ['config' => $defaultConfig, 'data' => $defaultData]; - $this->_data[self::CATALOG_PRICE_RULE] = $this->_getCatalogPriceRule(); - $this->_data[self::CATALOG_PRICE_RULE_ALL_GROUPS] = array_replace_recursive( - $this->_getCatalogPriceRule(), - $this->_getCatalogPriceRuleAllGroups() - ); - } - - protected function _getCatalogPriceRule() - { - return [ - 'data' => [ - 'fields' => [ - 'name' => ['value' => 'Rule %isolation%', 'group' => static::GROUP_RULE_INFORMATION], - 'is_active' => [ - 'value' => 'Active', - 'group' => static::GROUP_RULE_INFORMATION, - 'input' => 'select', - ], - 'website_ids' => [ - 'value' => ['Main Website'], - 'group' => static::GROUP_RULE_INFORMATION, - 'input' => 'multiselect', - 'input_value' => ['1'], - ], - 'customer_group_ids' => [ - 'value' => ['%group_value%'], - 'group' => static::GROUP_RULE_INFORMATION, - 'input' => 'multiselect', - 'input_value' => ['%group_id%'], - ], - 'simple_action' => [ - 'value' => 'By Percentage of the Original Price', - 'group' => static::GROUP_ACTIONS, - 'input' => 'select', - ], - 'discount_amount' => ['value' => '50.0000', 'group' => static::GROUP_ACTIONS], - 'conditions' => [ - 'value' => '[Category|is|%category_id%]', - 'group' => static::GROUP_CONDITIONS, - 'input' => 'conditions', - 'input_value' => 'Magento\CatalogRule\Model\Rule\Condition\Product|category_ids', - ], - ], - ] - ]; - } - - protected function _getCatalogPriceRuleAllGroups() - { - return [ - 'data' => [ - 'fields' => [ - 'customer_group_ids' => [ - 'value' => ['NOT LOGGED IN', 'General', 'Wholesale', 'Retailer'], - 'group' => static::GROUP_RULE_INFORMATION, - 'input' => 'multiselect', - 'input_value' => ['0', '1', '2', '3'], - ], - ], - ] - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php index c9e412c975af762365d454996adadaab76908b22..84f9cd923b6ef87fa44b77d82c0874529f0362fa 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php @@ -58,12 +58,14 @@ class ApplySeveralCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTe $this->catalogRuleNew->getFormPageActions()->saveAndApply(); } // Create product - $productSimple = $this->fixtureFactory->createByCode( - 'catalogProductSimple', - ['dataSet' => 'simple_for_salesrule_1'] - ); - $productSimple->persist(); + $products = $this->objectManager->create( + '\Magento\Catalog\Test\TestStep\CreateProductsStep', + ['products' => 'catalogProductSimple::simple_for_salesrule_1'] + )->run(); - return ['product' => $productSimple]; + return [ + 'products' => $products['products'], + 'category' => $products['products'][0]->getDataFieldConfig('category_ids')['source']->getCategories()[0], + ]; } } diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml index 59418b9161ce48d8b265fd49b56f5380fa6e5092..6f335c06d63aff7113f1b349726ca4cc597fbb30 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml @@ -11,11 +11,12 @@ <data name="catalogRulesOriginal/priority_0" xsi:type="string">catalog_price_rule_priority_0</data> <data name="catalogRulesOriginal/priority_1" xsi:type="string">-</data> <data name="catalogRulesOriginal/priority_2" xsi:type="string">catalog_price_rule_priority_2</data> - <data name="price/sub_total" xsi:type="string">100</data> - <data name="price/grand_total" xsi:type="string">40</data> - <data name="price/discount_amount" xsi:type="string">60</data> - <data name="price/special" xsi:type="string">40</data> - <data name="price/regular" xsi:type="string">100</data> + <data name="cartPrice/sub_total" xsi:type="string">40</data> + <data name="cartPrice/grand_total" xsi:type="string">40</data> + <data name="productPrice/0/discount_amount" xsi:type="string">60</data> + <data name="productPrice/0/special" xsi:type="string">40</data> + <data name="productPrice/0/sub_total" xsi:type="string">40</data> + <data name="productPrice/0/regular" xsi:type="string">100</data> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedCatalogPage"/> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedProductPage"/> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedShoppingCart"/> @@ -24,11 +25,12 @@ <data name="catalogRulesOriginal/priority_0" xsi:type="string">catalog_price_rule_priority_0</data> <data name="catalogRulesOriginal/priority_1" xsi:type="string">catalog_price_rule_priority_1_stop_further_rules</data> <data name="catalogRulesOriginal/priority_2" xsi:type="string">catalog_price_rule_priority_2</data> - <data name="price/sub_total" xsi:type="string">100</data> - <data name="price/grand_total" xsi:type="string">45</data> - <data name="price/discount_amount" xsi:type="string">55</data> - <data name="price/special" xsi:type="string">45</data> - <data name="price/regular" xsi:type="string">100</data> + <data name="cartPrice/sub_total" xsi:type="string">45</data> + <data name="cartPrice/grand_total" xsi:type="string">45</data> + <data name="productPrice/0/discount_amount" xsi:type="string">55</data> + <data name="productPrice/0/special" xsi:type="string">45</data> + <data name="productPrice/0/sub_total" xsi:type="string">45</data> + <data name="productPrice/0/regular" xsi:type="string">100</data> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedCatalogPage"/> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedProductPage"/> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedShoppingCart"/> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php index b16659bb3aa2d8243e52552d72e8d61f7b086193..cff1f6ac7037a57dbf52be7545d425491f292b37 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php @@ -6,8 +6,10 @@ namespace Magento\CatalogRule\Test\TestCase; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Customer\Test\Fixture\Customer; use Magento\CatalogRule\Test\Fixture\CatalogRule; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Customer\Test\Fixture\CustomerGroupInjectable; /** * Test Coverage for Create Catalog Rule @@ -28,20 +30,28 @@ use Magento\CatalogRule\Test\Fixture\CatalogRule; class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest { /* tags */ + const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; + const STABLE = 'no'; /* end tags */ /** * Create Catalog Price Rule * * @param CatalogRule $catalogPriceRule + * @param Customer $customer + * @param string $product * @return array */ - public function testCreate(CatalogRule $catalogPriceRule) - { - $productSimple = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'MAGETWO-23036']); + public function testCreate( + CatalogRule $catalogPriceRule, + $product, + Customer $customer = null + ) { + $productSimple = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => $product]); // Prepare data + $catalogPriceRule = $this->applyCustomerGroup($catalogPriceRule, $customer); $replace = [ 'conditions' => [ 'conditions' => [ @@ -60,6 +70,9 @@ class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest $this->catalogRuleNew->getEditForm()->fill($catalogPriceRule, null, $replace); $this->catalogRuleNew->getFormPageActions()->save(); + // Prepare data for tear down + $this->catalogRules[] = $catalogPriceRule; + // Apply Catalog Price Rule $this->catalogRuleIndex->getGridPageActions()->applyRules(); @@ -71,9 +84,36 @@ class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest $this->adminCache->getActionsBlock()->flushMagentoCache(); $this->adminCache->getMessagesBlock()->waitSuccessMessage(); - // Prepare data for tear down - $this->catalogRules[] = $catalogPriceRule; + return [ + 'products' => [$productSimple], + 'category' => $productSimple->getDataFieldConfig('category_ids')['source']->getCategories()[0], + ]; + } + + /** + * Create customer with customer group and apply customer group to catalog price rule. + * + * @param CatalogRule $catalogPriceRule + * @param Customer|null $customer + * @return CustomerGroupInjectable + */ + public function applyCustomerGroup(CatalogRule $catalogPriceRule, Customer $customer = null) + { + if ($customer !== null) { + $customer->persist(); + /** @var \Magento\Customer\Test\Fixture\CustomerGroupInjectable $customerGroup */ + $customerGroup = $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup(); + $catalogPriceRule = $this->fixtureFactory->createByCode( + 'catalogRule', + [ + 'data' => array_merge( + $catalogPriceRule->getData(), + ['customer_group_ids' => $customerGroup->getCustomerGroupCode()] + ) + ] + ); + } - return ['product' => $productSimple]; + return $catalogPriceRule; } } diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml index 676f80d505035e93ccc3a0da4c24de03015c2023..91556d40fba7f2d537452532882bb22c75ca265a 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml @@ -6,24 +6,51 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\CatalogRule\Test\TestCase\CreateCatalogRuleTest"> - <variation name="CreateCatalogRuleTestVariation1"> - <data name="catalogPriceRule/data/name" xsi:type="string">rule_name%isolation%</data> - <data name="catalogPriceRule/data/is_active" xsi:type="string">Active</data> - <data name="catalogPriceRule/data/website_ids" xsi:type="string">Main Website</data> - <data name="catalogPriceRule/data/customer_group_ids" xsi:type="string">NOT LOGGED IN</data> - <data name="catalogPriceRule/data/conditions" xsi:type="string">[Category|is|%category_1%]</data> - <data name="catalogPriceRule/data/simple_action" xsi:type="string">To Percentage of the Original Price</data> - <data name="catalogPriceRule/data/discount_amount" xsi:type="string">90</data> - <data name="price/sub_total" xsi:type="string">100</data> - <data name="price/grand_total" xsi:type="string">90</data> - <data name="price/discount_amount" xsi:type="string">10</data> - <data name="price/special" xsi:type="string">90</data> - <data name="price/regular" xsi:type="string">100</data> - <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleInGrid"/> - <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedCatalogPage"/> - <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedProductPage"/> - <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedShoppingCart"/> - </variation> - </testCase> + <testCase name="Magento\CatalogRule\Test\TestCase\CreateCatalogRuleTest"> + <variation name="CreateCatalogRuleTestVariation1"> + <data name="product" xsi:type="string">MAGETWO-23036</data> + <data name="catalogPriceRule/data/name" xsi:type="string">rule_name%isolation%</data> + <data name="catalogPriceRule/data/is_active" xsi:type="string">Active</data> + <data name="catalogPriceRule/data/website_ids" xsi:type="string">Main Website</data> + <data name="catalogPriceRule/data/customer_group_ids" xsi:type="string">NOT LOGGED IN</data> + <data name="catalogPriceRule/data/conditions" xsi:type="string">[Category|is|%category_1%]</data> + <data name="catalogPriceRule/data/simple_action" xsi:type="string">To Percentage of the Original Price</data> + <data name="catalogPriceRule/data/discount_amount" xsi:type="string">90</data> + <data name="cartPrice/sub_total" xsi:type="string">90</data> + <data name="cartPrice/grand_total" xsi:type="string">90</data> + <data name="productPrice/0/discount_amount" xsi:type="string">10</data> + <data name="productPrice/0/special" xsi:type="string">90</data> + <data name="productPrice/0/sub_total" xsi:type="string">90</data> + <data name="productPrice/0/regular" xsi:type="string">100</data> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleInGrid"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedCatalogPage"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedProductPage"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedShoppingCart"/> + </variation> + <variation name="CreateCatalogRuleTestVariation2"> + <data name="description" xsi:type="string">MAGETWO-12908: Apply Catalog Price Rules to Specific Customer Group.</data> + <data name="customer/dataSet" xsi:type="string">customer_with_new_customer_group</data> + <data name="product" xsi:type="string">simple_10_dollar</data> + <data name="catalogPriceRule/data/name" xsi:type="string">rule_name%isolation%</data> + <data name="catalogPriceRule/data/is_active" xsi:type="string">Active</data> + <data name="catalogPriceRule/data/website_ids" xsi:type="string">Main Website</data> + <data name="catalogPriceRule/data/conditions" xsi:type="string">[Category|is|%category_1%]</data> + <data name="catalogPriceRule/data/simple_action" xsi:type="string">By Percentage of the Original Price</data> + <data name="catalogPriceRule/data/discount_amount" xsi:type="string">50</data> + <data name="cartPrice/sub_total" xsi:type="string">5</data> + <data name="cartPrice/grand_total" xsi:type="string">5</data> + <data name="productPrice/0/discount_amount" xsi:type="string">5</data> + <data name="productPrice/0/special" xsi:type="string">5</data> + <data name="productPrice/0/sub_total" xsi:type="string">5</data> + <data name="productPrice/0/regular" xsi:type="string">10</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleInGrid"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleNotAppliedCatalogPage"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleNotAppliedProductPage"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleNotAppliedShoppingCart"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedCatalogPage"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedProductPage"/> + <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedShoppingCart"/> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..b3ba80fd8108654f103cdcad5f7d57353754acf3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest14"> + <data name="menuItem" xsi:type="string">Marketing > Catalog Price Rules</data> + <data name="pageTitle" xsi:type="string">Catalog Price Rules</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php index 189ebcaaca3f02d532258f236cbe7c0a34fe7fe4..8178bd9dbbf3870367a3d7cc742ca6055ae8a31e 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php @@ -80,12 +80,12 @@ class UpdateCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTest $this->catalogRuleNew->getEditForm()->fill($catalogPriceRule, null, $replace); $this->catalogRuleNew->getFormPageActions()->$saveAction(); - // Create simple product with category - $productSimple->persist(); - // Prepare data for tear down $this->catalogRules[] = $catalogPriceRule; - return ['product' => $productSimple]; + // Create simple product with category + $productSimple->persist(); + + return ['products' => [$productSimple]]; } } diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php index 106070b62ec4e474126a1966f8461f0cd96a80b0..aa4f63f5cd9776905ca7c21b28a39f5dc5525eb3 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php @@ -12,20 +12,16 @@ use Magento\CatalogSearch\Test\Page\Adminhtml\CatalogSearchIndex; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for CreateSearchTermEntity - * - * Test Flow: - * * Preconditions: - * 1. Product is created + * 1. Product is created. * * Steps: - * 1. Go to backend as admin user - * 4. Navigate to Marketing->SEO&Search->Search Terms - * 5. Click "Add New Search Term" button - * 6. Fill out all data according to dataset - * 7. Save the Search Term - * 8. Perform all assertions + * 1. Go to backend as admin user. + * 4. Navigate to Marketing > SEO&Search > Search Terms. + * 5. Click "Add New Search Term" button. + * 6. Fill out all data according to dataset. + * 7. Save the Search Term. + * 8. Perform all assertions. * * @group Search_Terms_(MX) * @ZephyrId MAGETWO-26165 @@ -38,21 +34,21 @@ class CreateSearchTermEntityTest extends Injectable /* end tags */ /** - * Search term page + * Search term page. * * @var CatalogSearchIndex */ protected $indexPage; /** - * Search term edit page + * Search term edit page. * * @var CatalogSearchEdit */ protected $editPage; /** - * Inject pages + * Inject pages. * * @param CatalogSearchIndex $indexPage * @param CatalogSearchEdit $editPage @@ -65,7 +61,7 @@ class CreateSearchTermEntityTest extends Injectable } /** - * Run create search term test + * Run create search term test. * * @param CatalogSearchQuery $searchTerm * @return void diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml index cc92653c73f77698153ec84deadb1da0b3e4742a..02a7b1b0d410e9b80f4d1a97e1a816836390ddb4 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml @@ -6,18 +6,18 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\CatalogSearch\Test\TestCase\CreateSearchTermEntityTest"> - <variation name="CreateSearchTermEntityTestVariation1"> - <data name="searchTerm/data/query_text/value" xsi:type="string">catalogProductSimple::getSku</data> - <data name="searchTerm/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="searchTerm/data/synonym_for" xsi:type="string">Search Term Synonym %isolation%</data> - <data name="searchTerm/data/redirect" xsi:type="string">http://example.com/</data> - <data name="searchTerm/data/display_in_terms" xsi:type="string">No</data> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSuccessSaveMessage"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermInGrid"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermForm"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermOnFrontend"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSynonymOnFrontend"/> - </variation> - </testCase> + <testCase name="Magento\CatalogSearch\Test\TestCase\CreateSearchTermEntityTest"> + <variation name="CreateSearchTermEntityTestVariation1"> + <data name="searchTerm/data/query_text/value" xsi:type="string">catalogProductSimple::sku</data> + <data name="searchTerm/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="searchTerm/data/synonym_for" xsi:type="string">Search Term Synonym %isolation%</data> + <data name="searchTerm/data/redirect" xsi:type="string">http://example.com/</data> + <data name="searchTerm/data/display_in_terms" xsi:type="string">No</data> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSuccessSaveMessage" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermInGrid" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermForm" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermOnFrontend" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSynonymOnFrontend" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/EditSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/EditSearchTermEntityTest.xml deleted file mode 100644 index 113e7c222fcbc013f92f863b97acd13acbfb30e5..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/EditSearchTermEntityTest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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\CatalogSearch\Test\TestCase\EditSearchTermEntityTest"> - <variation name="EditSearchTermEntityTestVariation1"> - <data name="searchTerm/data/query_text/value" xsi:type="string">catalogProductSimple::getSku</data> - <data name="searchTerm/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="searchTerm/data/num_results" xsi:type="string">1</data> - <data name="searchTerm/data/popularity" xsi:type="string">20</data> - <data name="searchTerm/data/synonym_for" xsi:type="string">simple%isolation%</data> - <data name="searchTerm/data/redirect" xsi:type="string">http://example.com/</data> - <data name="searchTerm/data/display_in_terms" xsi:type="string">No</data> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSuccessSaveMessage"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermForm"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermInGrid"/> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermOnFrontend"/> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..51a39239a23c7ec23f757377156c78993be86a62 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,21 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest15"> + <data name="menuItem" xsi:type="string">Marketing > Search Terms</data> + <data name="pageTitle" xsi:type="string">Search Terms</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest16"> + <data name="menuItem" xsi:type="string">Reports > Search Terms</data> + <data name="pageTitle" xsi:type="string">Search Terms Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php index d4ce912e61386c4a79a50b99f4c6c64b24510f45..146f33e1212fb847eca8302e8b0d7d6467046d46 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php @@ -11,10 +11,6 @@ use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\TestCase\Injectable; /** - * Cover Suggest Searching Result (SearchEntity) - * - * Test Flow: - * * Preconditions: * 1. Two "default" test simple products is created. * 2. Navigate to frontend. @@ -36,7 +32,7 @@ class SuggestSearchingResultEntityTest extends Injectable /* end tags */ /** - * Run suggest searching result test + * Run suggest searching result test. * * @param CmsIndex $cmsIndex * @param CatalogSearchQuery $catalogSearch diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/EditSearchTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.php similarity index 77% rename from dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/EditSearchTermEntityTest.php rename to dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.php index a2b143d4786f03bd5e0b64f381c0c01231d5ae3b..e81e138f19279e4c4ebcbe4b79b87aeb55eac7ba 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/EditSearchTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.php @@ -13,27 +13,23 @@ use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for EditSearchTermEntity - * - * Test Flow: - * * Preconditions: - * 1. Product is created + * 1. Product is created. * * Steps: - * 1. Go to frontend - * 2. Test word into the Search field at the top of the page and click Go - * 3. Go to backend as admin user - * 4. Navigate to Marketing->SEO&Search->Search Terms - * 5. Click "Edit" link of just added test word search term - * 6. Fill out all data according to dataset - * 7. Save the Search Term - * 8. Perform all assertions + * 1. Go to frontend. + * 2. Test word into the Search field at the top of the page and click Go. + * 3. Go to backend as admin user. + * 4. Navigate to Marketing > SEO&Search > Search Terms. + * 5. Click "Edit" link of just added test word search term. + * 6. Fill out all data according to dataset. + * 7. Save the Search Term. + * 8. Perform all assertions. * * @group Search_Terms_(MX) * @ZephyrId MAGETWO-26100 */ -class EditSearchTermEntityTest extends Injectable +class UpdateSearchTermEntityTest extends Injectable { /* tags */ const MVP = 'yes'; @@ -41,28 +37,28 @@ class EditSearchTermEntityTest extends Injectable /* end tags */ /** - * CMS index page + * CMS index page. * * @var CmsIndex */ protected $cmsIndex; /** - * Search term page + * Search term page. * * @var CatalogSearchIndex */ protected $indexPage; /** - * Search term edit page + * Search term edit page. * * @var CatalogSearchEdit */ protected $editPage; /** - * Inject pages + * Inject pages. * * @param CmsIndex $cmsIndex * @param CatalogSearchIndex $indexPage @@ -80,7 +76,7 @@ class EditSearchTermEntityTest extends Injectable } /** - * Run edit search term test + * Run update search term test. * * @param CatalogSearchQuery $searchTerm * @return void diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..af1eb669e1f62f9a4036f0f3eba43701526a96d1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/UpdateSearchTermEntityTest.xml @@ -0,0 +1,24 @@ +<?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\CatalogSearch\Test\TestCase\UpdateSearchTermEntityTest"> + <variation name="UpdateSearchTermEntityTestVariation1"> + <data name="searchTerm/data/query_text/value" xsi:type="string">catalogProductSimple::sku</data> + <data name="searchTerm/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="searchTerm/data/num_results" xsi:type="string">1</data> + <data name="searchTerm/data/popularity" xsi:type="string">20</data> + <data name="searchTerm/data/synonym_for" xsi:type="string">simple%isolation%</data> + <data name="searchTerm/data/redirect" xsi:type="string">http://example.com/</data> + <data name="searchTerm/data/display_in_terms" xsi:type="string">No</data> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSuccessSaveMessage" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermForm" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermInGrid" /> + <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermOnFrontend" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart.php index 2802929c1069c518f00fbb12bee0d8715daa0a96..dcd021475a053f48137961d472a5dd119be6fa3b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart.php @@ -48,7 +48,7 @@ class Cart extends Block * * @var string */ - protected $updateShoppingCart = '[name="update_cart_action"]'; + protected $updateShoppingCart = '.update[name="update_cart_action"]'; /** * Cart empty block selector diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml index ebe516f24fa44cb7ecf4dee001a7d7151b93371b..165315f753cb3809ccb097bb3dccbd8b69631312 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml @@ -19,6 +19,6 @@ <data name="products" xsi:type="string">catalogProductSimple::default</data> <data name="deletedProductIndex" xsi:type="string">0</data> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/> - </variation> + </variation> </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php index f5d30d2f9bdc2f376563ee8964537b6758553fb2..b99ac46a7261d7d25c83f283e7aabbe389f06b4d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php @@ -85,6 +85,7 @@ class UpdateProductFromMiniShoppingCartEntityTest extends Injectable */ public function test($originalProduct, $checkoutData) { + $this->markTestIncomplete('Bug: MAGETWO-34259'); // Preconditions: $product = $this->createProduct($originalProduct); $this->addToCart($product); diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php index bd3f7381fb4ad87b90eb55fec967c9dccef684ee..f30e937e0ace3a196c18a27a556aaf5888e8a1f4 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.php @@ -15,9 +15,6 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for Update ShoppingCart - * - * Test Flow: * Precondition: * 1. Simple product is created * 2. Clear shopping cart @@ -113,6 +110,7 @@ class UpdateShoppingCartTest extends Injectable $productView->fillOptions($product); $productView->setQty(1); $productView->clickAddToCart(); + $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); $qty = $product->getCheckoutData()['qty']; $this->checkoutCart->open(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php index 9bcca39ddd4b577fc37dce6e3df5d24270e98a69..f14298e28858eef9b5c5818b1f116ba3619f9fe6 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php @@ -16,7 +16,6 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\ObjectManager; /** - * Class AssertTermAbsentOnCheckout * Check that Checkout Agreement is absent in the Place order tab. */ class AssertTermAbsentOnCheckout extends AbstractConstraint @@ -60,6 +59,8 @@ class AssertTermAbsentOnCheckout extends AbstractConstraint $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCartButton(); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCart->open(); $checkoutCart->getCartBlock()->getOnepageLinkBlock()->proceedToCheckout(); $checkoutOnepage->getLoginBlock()->guestCheckout(); $checkoutOnepage->getLoginBlock()->clickContinue(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml index e6462a16bf8d73148e74ac21a1a906bde8dbf7d7..4a9a438e8460ae93d277273787204e0d78bfd333 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml @@ -6,44 +6,48 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="checkoutAgreement" module="Magento_CheckoutAgreements" type="flat" entity_type="checkout_agreement" collection="Magento\CheckoutAgreements\Model\Resource\Agreement\Collection" repository_class="Magento\CheckoutAgreements\Test\Repository\CheckoutAgreement" handler_interface="Magento\CheckoutAgreements\Test\Handler\CheckoutAgreement\CheckoutAgreementInterface" class="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement"> - <dataset name="default"> - <field name="name" xsi:type="string">DefaultName%isolation%</field> - <field name="is_active" xsi:type="string">Enabled</field> - <field name="is_html" xsi:type="string">Text</field> - <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - <field name="checkbox_text" xsi:type="string">test_checkbox%isolation%</field> - <field name="content" xsi:type="string">TestMessage%isolation%</field> - </dataset> - <field name="agreement_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="name" is_required=""> - <default_value xsi:type="string">DefaultName%isolation%</default_value> - </field> - <field name="content" is_required=""> - <default_value xsi:type="string">TestMessage%isolation%</default_value> - </field> - <field name="content_height" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="checkbox_text" is_required=""> - <default_value xsi:type="string">test_checkbox%isolation%</default_value> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="string">Enabled</default_value> - </field> - <field name="is_html" is_required=""> - <default_value xsi:type="string">Text</default_value> - </field> - <field name="store_ids" source="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement\Stores"> - <default_value xsi:type="array"> + <fixture name="checkoutAgreement" module="Magento_CheckoutAgreements" + type="flat" entity_type="checkout_agreement" collection="Magento\CheckoutAgreements\Model\Resource\Agreement\Collection" + repository_class="Magento\CheckoutAgreements\Test\Repository\CheckoutAgreement" + handler_interface="Magento\CheckoutAgreements\Test\Handler\CheckoutAgreement\CheckoutAgreementInterface" + class="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement"> + <dataset name="default"> + <field name="name" xsi:type="string">DefaultName%isolation%</field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="is_html" xsi:type="string">Text</field> + <field name="stores" xsi:type="array"> + <item name="dataSet" xsi:type="string">default</item> + </field> + <field name="checkbox_text" xsi:type="string">test_checkbox%isolation%</field> + <field name="content" xsi:type="string">TestMessage%isolation%</field> + </dataset> + <field name="agreement_id" is_required="1"> + <default_value xsi:type="null" /> + </field> + <field name="name" is_required=""> + <default_value xsi:type="string">DefaultName%isolation%</default_value> + </field> + <field name="content" is_required=""> + <default_value xsi:type="string">TestMessage%isolation%</default_value> + </field> + <field name="content_height" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="checkbox_text" is_required=""> + <default_value xsi:type="string">test_checkbox%isolation%</default_value> + </field> + <field name="is_active" is_required=""> + <default_value xsi:type="string">Enabled</default_value> + </field> + <field name="is_html" is_required=""> + <default_value xsi:type="string">Text</default_value> + </field> + <field name="stores" source="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement\Stores"> + <default_value xsi:type="array"> <item name="dataSet" xsi:type="array"> <item name="0" xsi:type="string">default</item> </item> </default_value> - </field> - </fixture> + </field> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php index 54db2bc5d210582beb5800c2e8dc3d916a1b88da..ca9dbfda8de6e1691095841d3bdacccff1a0b7b7 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php @@ -13,19 +13,15 @@ use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Test creation for DeleteTermEntityTest. - * - * Test Flow: - * * Preconditions: - * 1. Enable "Terms and Conditions": Stores > Configuration > Sales > Checkout > Checkout Options - * 2. Create term according to dataSet + * 1. Enable "Terms and Conditions": Stores > Configuration > Sales > Checkout > Checkout Options. + * 2. Create term according to dataSet. * * Steps: - * 1. Open Backend Stores > Terms and Conditions - * 2. Open created Term from preconditions - * 3. Click on 'Delete' button - * 4. Perform all assertions + * 1. Open Backend Stores > Terms and Conditions. + * 2. Open created Term from preconditions. + * 3. Click on 'Delete' button. + * 4. Perform all assertions. * * @group Terms_and_Conditions_(CS) * @ZephyrId MAGETWO-29687 @@ -96,7 +92,7 @@ class DeleteTermEntityTest extends Injectable */ public function tearDown() { - ObjectManager::getInstance()->create( + $this->objectManager->create( 'Magento\Core\Test\TestStep\SetupConfigurationStep', ['configData' => 'checkout_term_condition', 'rollback' => true] )->run(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..0c231f25d3f3fb674d3a1524cf354b5fa87a4a65 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest17"> + <data name="menuItem" xsi:type="string">Stores > Terms and Conditions</data> + <data name="pageTitle" xsi:type="string">Terms and Conditions</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/CmsGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/CmsGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..df52dfb3a70cb31a819d4cb0aa9f95248b82536e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/CmsGrid.php @@ -0,0 +1,66 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Block; + +use Magento\Backend\Test\Block\Widget\Grid; + +/** + * Adminhtml Cms Block management grid. + */ +class CmsGrid extends Grid +{ + /** + * Filters array mapping. + * + * @var array + */ + protected $filters = [ + 'title' => [ + 'selector' => '#title', + ], + 'identifier' => [ + 'selector' => '#identifier', + ], + 'is_active' => [ + 'selector' => '#is_active', + 'input' => 'select', + ], + 'creation_time_from' => [ + 'selector' => '(//span[.="Created"]/following::input[contains(@placeholder,"From")])[1]', + 'strategy' => 'xpath', + ], + 'update_time_from' => [ + 'selector' => '(//span[.="Created"]/following::input[contains(@placeholder,"From")])[2]', + 'strategy' => 'xpath', + ], + 'store_id' => [ + 'selector' => 'label[for="store_id"] + div > select', + 'input' => 'selectstore' + ], + ]; + + /** + * Locator value for 'Search' button. + * + * @var string + */ + protected $searchButton = '.action-apply'; + + /** + * Locator value for 'Reset' button. + * + * @var string + */ + protected $resetButton = '.action-reset'; + + /** + * Locator value for link in action column. + * + * @var string + */ + protected $editLink = 'td[data-part="body.row.cell"]'; +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/BlockForm.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/BlockForm.php new file mode 100644 index 0000000000000000000000000000000000000000..4a09e7545f775a262511d50e4ec82bb908264bce --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/BlockForm.php @@ -0,0 +1,85 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Block\Edit; + +use Magento\Mtf\Block\Form; +use Magento\Mtf\Client\Locator; +use Magento\Cms\Test\Block\Adminhtml\Wysiwyg\Config; + +/** + * Block adminhtml form. + */ +class BlockForm extends Form +{ + /** + * Content Editor toggle button id. + * + * @var string + */ + protected $toggleButton = "#toggleblock_content"; + + /** + * Content Editor form. + * + * @var string + */ + protected $contentForm = "#page_content"; + + /** + * Custom Variable block selector. + * + * @var string + */ + protected $customVariableBlock = "./ancestor::body//div[div[@id='variables-chooser']]"; + + /** + * Insert Variable button selector. + * + * @var string + */ + protected $addVariableButton = ".add-variable"; + + /** + * Clicking in content tab 'Insert Variable' button. + * + * @return void + */ + public function clickInsertVariable() + { + $addVariableButton = $this->_rootElement->find($this->addVariableButton); + if ($addVariableButton->isVisible()) { + $addVariableButton->click(); + } + } + + /** + * Get for wysiwyg config block. + * + * @return Config + */ + public function getWysiwygConfig() + { + return $this->blockFactory->create( + 'Magento\Cms\Test\Block\Adminhtml\Wysiwyg\Config', + ['element' => $this->_rootElement->find($this->customVariableBlock, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Page Content Show/Hide Editor toggle button. + * + * @return void + */ + public function toggleEditor() + { + $content = $this->_rootElement->find($this->contentForm, Locator::SELECTOR_CSS); + $toggleButton = $this->_rootElement->find($this->toggleButton, Locator::SELECTOR_CSS); + if (!$content->isVisible() && $toggleButton->isVisible()) { + $toggleButton->click(); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.php new file mode 100644 index 0000000000000000000000000000000000000000..2f8d8f341a9b518d5ccb654849ae8769dbbbfc45 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Block\Edit; + +use Magento\Mtf\Block\Form; +use Magento\Mtf\Client\Element\SimpleElement; +use Magento\Mtf\Fixture\FixtureInterface; + +/** + * Form for Cms Block creation. + */ +class CmsForm extends Form +{ + /** + * Content Editor toggle button id. + * + * @var string + */ + protected $toggleButton = "#toggleblock_content"; + + /** + * CMS Block Content area. + * + * @var string + */ + protected $contentForm = '[name="content"]'; + + /** + * Fill the page form. + * + * @param FixtureInterface $fixture + * @param SimpleElement $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $this->hideEditor(); + return parent::fill($fixture, $element); + } + + /** + * Hide WYSIWYG editor. + * + * @return void + */ + protected function hideEditor() + { + $content = $this->_rootElement->find($this->contentForm); + $toggleButton = $this->_rootElement->find($this->toggleButton); + if (!$content->isVisible() && $toggleButton->isVisible()) { + $toggleButton->click(); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.xml new file mode 100644 index 0000000000000000000000000000000000000000..8fc957726181e63e455fe61ab2583d8335f2743d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<mapping strict="0"> + <fields> + <stores> + <selector>[name="stores[]"]</selector> + <input>multiselectgrouplist</input> + </stores> + <is_active> + <input>select</input> + </is_active> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.php new file mode 100644 index 0000000000000000000000000000000000000000..5338aaaead06883ad68c7b8855d962ceff004772 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Page\Edit; + +use Magento\Backend\Test\Block\Widget\FormTabs; +use Magento\Mtf\Client\Locator; + +/** + * Backend Cms Page edit page. + */ +class PageForm extends FormTabs +{ + /** + * Content Editor toggle button id. + * + * @var string + */ + protected $toggleButton = "#togglepage_content"; + + /** + * Content Editor form. + * + * @var string + */ + protected $contentForm = "#page_content"; + + /** + * Page Content Show/Hide Editor toggle button. + * + * @return void + */ + protected function toggleEditor() + { + $content = $this->_rootElement->find($this->contentForm, Locator::SELECTOR_CSS); + $toggleButton = $this->_rootElement->find($this->toggleButton, Locator::SELECTOR_CSS); + if (!$content->isVisible() && $toggleButton->isVisible()) { + $toggleButton->click(); + } + } + + /** + * Returns array with System Variables. + * + * @return array + */ + public function getSystemVariables() + { + $this->openTab('content'); + /** @var \Magento\Cms\Test\Block\Adminhtml\Page\Edit\Tab\Content $contentTab */ + $contentTab = $this->getTabElement('content'); + /** @var \Magento\Cms\Test\Block\Adminhtml\Wysiwyg\Config $config */ + $contentTab->clickInsertVariable(); + $config = $contentTab->getWysiwygConfig(); + + return $config->getAllVariables(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml new file mode 100644 index 0000000000000000000000000000000000000000..454cd9e0f50c670138b2b32e5dfcc1a2b7478723 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tabs> + <page_information> + <class>\Magento\Backend\Test\Block\Widget\Tab</class> + <selector>#page_tabs_main_section</selector> + <strategy>css selector</strategy> + <fields> + <title /> + <identifier /> + <store_id> + <selector>[name='stores[]']</selector> + <input>multiselectgrouplist</input> + </store_id> + <is_active> + <input>select</input> + </is_active> + </fields> + </page_information> + <content> + <class>\Magento\Cms\Test\Block\Adminhtml\Page\Edit\Tab\Content</class> + <selector>#page_tabs_content_section</selector> + <strategy>css selector</strategy> + <fields> + <content_heading /> + <content /> + </fields> + </content> + <design> + <class>\Magento\Backend\Test\Block\Widget\Tab</class> + <selector>#page_tabs_design_section</selector> + <strategy>css selector</strategy> + <fields> + <page_layout> + <input>select</input> + </page_layout> + <layout_update_xml> + <selector>#page_layout_update_xml</selector> + <input>textarea</input> + </layout_update_xml> + <custom_theme_from /> + <custom_theme_to /> + <custom_theme> + <input>select</input> + </custom_theme> + <custom_page_layout> + <input>select</input> + </custom_page_layout> + <custom_layout_update_xml> + <selector>#page_custom_layout_update_xml</selector> + <input>textarea</input> + </custom_layout_update_xml> + </fields> + </design> + <meta_data> + <class>\Magento\Backend\Test\Block\Widget\Tab</class> + <selector>#page_tabs_meta_section</selector> + <strategy>css selector</strategy> + <fields> + <meta_keywords> + <selector>#page_meta_keywords</selector> + <input>textarea</input> + </meta_keywords> + <meta_description> + <selector>#page_meta_description</selector> + <input>textarea</input> + </meta_description> + </fields> + </meta_data> +</tabs> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php new file mode 100644 index 0000000000000000000000000000000000000000..5ac929cb9377036ea3900924081e2b996d95f44f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php @@ -0,0 +1,157 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Page\Edit\Tab; + +use Magento\Mtf\Client\Locator; +use Magento\Backend\Test\Block\Widget\Tab; +use Magento\Mtf\Client\Element\SimpleElement; +use Magento\Widget\Test\Block\Adminhtml\WidgetForm; +use Magento\Cms\Test\Block\Adminhtml\Wysiwyg\Config; + +/** + * Backend cms page content tab. + */ +class Content extends Tab +{ + /** + * System Variable block selector. + * + * @var string + */ + protected $systemVariableBlock = "./ancestor::body//div[div[@id='variables-chooser']]"; + + /** + * Widget block selector. + * + * @var string + */ + protected $widgetBlock = "./ancestor::body/div[div/div/*[@id='widget_options_form']]"; + + /** + * Insert Variable button selector. + * + * @var string + */ + protected $addVariableButton = ".add-variable"; + + /** + * Insert Widget button selector. + * + * @var string + */ + protected $addWidgetButton = '.action-add-widget'; + + /** + * Content input locator. + * + * @var string + */ + protected $content = '#page_content'; + + /** + * Content Heading input locator. + * + * @var string + */ + protected $contentHeading = '#page_content_heading'; + + /** + * Clicking in content tab 'Insert Variable' button. + * + * @return void + */ + public function clickInsertVariable() + { + $addVariableButton = $this->_rootElement->find($this->addVariableButton); + if ($addVariableButton->isVisible()) { + $addVariableButton->click(); + } + } + + /** + * Clicking in content tab 'Insert Widget' button. + * + * @return void + */ + public function clickInsertWidget() + { + $addWidgetButton = $this->_rootElement->find($this->addWidgetButton); + if ($addWidgetButton->isVisible()) { + $addWidgetButton->click(); + } + } + + /** + * Get for wysiwyg config block. + * + * @return Config + */ + public function getWysiwygConfig() + { + return $this->blockFactory->create( + 'Magento\Cms\Test\Block\Adminhtml\Wysiwyg\Config', + ['element' => $this->_rootElement->find($this->systemVariableBlock, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Get widget block. + * + * @return WidgetForm + */ + public function getWidgetBlock() + { + return $this->blockFactory->create( + 'Magento\Widget\Test\Block\Adminhtml\WidgetForm', + ['element' => $this->_rootElement->find($this->widgetBlock, Locator::SELECTOR_XPATH)] + ); + } + + /** + * Fill data to content fields on content tab. + * + * @param array $fields + * @param SimpleElement|null $element + * @return $this + */ + public function fillFormTab(array $fields, SimpleElement $element = null) + { + $element->find($this->content)->setValue($fields['content']['value']['content']); + if (isset($fields['content_heading']['value'])) { + $element->find($this->contentHeading)->setValue($fields['content_heading']['value']); + } + if (isset($fields['content']['value']['widget']['preset'])) { + foreach ($fields['content']['value']['widget']['preset'] as $widget) { + $this->clickInsertWidget(); + $this->getWidgetBlock()->addWidget($widget); + } + } + if (isset($fields['content']['value']['variable'])) { + $this->clickInsertVariable(); + $config = $this->getWysiwygConfig(); + $config->selectVariableByName($fields['content']['value']['variable']); + } + + return $this; + } + + /** + * Get data of content tab. + * + * @param array|null $fields + * @param SimpleElement|null $element + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getDataFormTab($fields = null, SimpleElement $element = null) + { + return [ + 'content' => [], + 'content_heading' => '' + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php new file mode 100644 index 0000000000000000000000000000000000000000..b58dfde4c16cb99902cfcb46a600a58cb00436b3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Grid.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Page; + +use Magento\Backend\Test\Block\Widget\Grid as ParentGrid; +use Magento\Mtf\Client\Locator; + +/** + * Backend Cms Page grid. + */ +class Grid extends ParentGrid +{ + /** + * Locator value for 'Search' button. + * + * @var string + */ + protected $searchButton = '.action.primary.action-apply'; + + /** + * Locator value for 'Reset' button. + * + * @var string + */ + protected $resetButton = '.action.secondary.action-reset'; + + /** + * Locator value for link in action column. + * + * @var string + */ + protected $editLink = 'td[data-part="body.row.cell"]'; + + /** + * 'Preview' cms page link. + * + * @var string + */ + protected $previewCmsPage = "//a[contains(text(),'Preview')]"; + + /** + * Filters array mapping. + * + * @var array + */ + protected $filters = [ + 'title' => [ + 'selector' => '#title', + ], + ]; + + /** + * Search item and open it on front. + * + * @param array $filter + * @throws \Exception + * @return void + */ + public function searchAndPreview(array $filter) + { + $this->search($filter); + $rowItem = $this->_rootElement->find($this->rowItem); + if ($rowItem->isVisible()) { + $rowItem->find($this->previewCmsPage, Locator::SELECTOR_XPATH)->click(); + $this->waitForElement(); + } else { + throw new \Exception('Searched item was not found.'); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Widget/Chooser.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Widget/Chooser.php new file mode 100644 index 0000000000000000000000000000000000000000..a71f9e953f8572ab4656a9933b02645c8d94a046 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Widget/Chooser.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Page\Widget; + +use Magento\Backend\Test\Block\Widget\Grid; + +/** + * Backend select page, block grid. + */ +class Chooser extends Grid +{ + /** + * Filters array mapping. + * + * @var array + */ + protected $filters = [ + 'chooser_identifier' => [ + 'selector' => 'input[name="chooser_identifier"]', + ], + ]; + + /** + * Locator value for link in action column. + * + * @var string + */ + protected $editLink = 'tbody tr .col-chooser_title'; +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Wysiwyg/Config.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Wysiwyg/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..8b73955af229821883991699a89f06402d75c51c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Wysiwyg/Config.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Block\Adminhtml\Wysiwyg; + +use Magento\Mtf\Block\Block; +use Magento\Mtf\Client\Locator; + +/** + * System variable management block. + */ +class Config extends Block +{ + /** + * Selector for getting all variables in list. + * + * @var string + */ + protected $variablesSelector = '.insert-variable > li > a'; + + /** + * Variable link selector. + * + * @var string + */ + protected $variableSelector = '//*[@class="insert-variable"]//a[contains(text(),"%s")]'; + + /** + * Returns array with all variables. + * + * @return array + */ + public function getAllVariables() + { + $values = []; + + $variableElements = $this->_rootElement->getElements($this->variablesSelector); + foreach ($variableElements as $variableElement) { + if ($variableElement->isVisible()) { + $values[] = $variableElement->getText(); + } + } + + return $values; + } + + /** + * Select variable by name. + * + * @param string $variableName + * @return void + */ + public function selectVariableByName($variableName) + { + $this->_rootElement->find(sprintf($this->variableSelector, $variableName), Locator::SELECTOR_XPATH)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Page.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Page.php index 7589ec398662e55982db8ce5be48bcccf0bf4d00..69b0d9aa409c6dc333e8a919980f37aefa86831c 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Page.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Page.php @@ -14,6 +14,13 @@ use Magento\Mtf\Client\Locator; */ class Page extends Block { + /** + * Selector for uninitialized page. + * + * @var string + */ + protected $uninitialized = '//body[(@data-mage-init) or (@aria-busy="true")]'; + /** * Cms page content class. * @@ -107,4 +114,21 @@ class Page extends Block throw new \Exception('Determine how to find the widget on the page.'); } } + + /** + * Waiting page initialization. + * + * @return void + */ + public function waitPageInit() + { + $browser = $this->browser; + $uninitialized = $this->uninitialized; + + $this->_rootElement->waitUntil( + function () use ($browser, $uninitialized) { + return $browser->find($uninitialized, Locator::SELECTOR_XPATH)->isVisible() == false ? true : null; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..36d25d1c49f55d3c81f424354a9fd9ea31804cfe --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that after delete CMS block successful message appears. + */ +class AssertCmsBlockDeleteMessage extends AbstractConstraint +{ + const SUCCESS_DELETE_MESSAGE = 'The block has been deleted.'; + + /** + * Assert that after delete CMS block successful message appears. + * + * @param CmsBlockIndex $cmsBlockIndex + * @return void + */ + public function processAssert(CmsBlockIndex $cmsBlockIndex) + { + $actualMessage = $cmsBlockIndex->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_DELETE_MESSAGE, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_DELETE_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS Block success delete message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..539882b47a497c8e633534324b0cc4c646d6e366 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that created CMS block can be found in grid. + */ +class AssertCmsBlockInGrid extends AbstractConstraint +{ + /** + * Assert that created CMS block can be found in grid via: + * title, identifier, store view, status, created and modified date. + * + * @param CmsBlock $cmsBlock + * @param CmsBlockIndex $cmsBlockIndex + * @return void + * + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + public function processAssert(CmsBlock $cmsBlock, CmsBlockIndex $cmsBlockIndex) + { + $cmsBlockIndex->open(); + $data = $cmsBlock->getData(); + $filter = [ + 'title' => $data['title'], + 'identifier' => $data['identifier'], + 'is_active' => $data['is_active'], + ]; + + if (isset($data['stores'])) { + $filter['store_id'] = is_array($data['stores']) ? reset($data['stores']) : $data['stores']; + } + // add creation_time & update_time to filter if there are ones + if (isset($data['creation_time'])) { + $filter['creation_time_from'] = date("M j, Y", strtotime($cmsBlock->getCreationTime())); + } + if (isset($data['update_time'])) { + $filter['update_time_from'] = date("M j, Y", strtotime($cmsBlock->getUpdateTime())); + } + + $cmsBlockIndex->getCmsBlockGrid()->search($filter); + + if (isset($filter['store_id'])) { + $pieces = explode('/', $filter['store_id']); + $filter['store_id'] = end($pieces); + } + \PHPUnit_Framework_Assert::assertTrue( + $cmsBlockIndex->getCmsBlockGrid()->isRowVisible($filter, false, false), + 'CMS Block with ' + . 'title \'' . $filter['title'] . '\', ' + . 'identifier \'' . $filter['identifier'] . '\', ' + . 'store view \'' . $filter['store_id'] . '\', ' + . 'status \'' . $filter['is_active'] . '\', ' + . (isset($filter['creation_time_from']) + ? ('creation_time \'' . $filter['creation_time_from'] . '\', ') + : '') + . (isset($filter['update_time_from']) ? ('update_time \'' . $filter['update_time_from'] . '\'') : '') + . 'is absent in CMS Block grid.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS Block is present in grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..ad3ce5daef521523e6e439da296394955d995c81 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that created CMS block can't be found in grid. + */ +class AssertCmsBlockNotInGrid extends AbstractConstraint +{ + /** + * Assert that created CMS block can't be found in grid via: + * title, identifier, store view, status, created and modified date + * + * @param CmsBlock $cmsBlock + * @param CmsBlockIndex $cmsBlockIndex + * @return void + * + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + public function processAssert(CmsBlock $cmsBlock, CmsBlockIndex $cmsBlockIndex) + { + $cmsBlockIndex->open(); + $data = $cmsBlock->getData(); + if (isset($data['stores'])) { + $storeId = is_array($data['stores']) ? reset($data['stores']) : $data['stores']; + $parts = explode("/", $storeId); + } + + $filter = [ + 'title' => $data['title'], + 'identifier' => $data['identifier'], + 'is_active' => $data['is_active'], + 'store_id' => end($parts), + ]; + + // add creation_time & update_time to filter if there are ones + if (isset($data['creation_time'])) { + $filter['creation_time_from'] = date("M j, Y", strtotime($cmsBlock->getCreationTime())); + } + if (isset($data['update_time'])) { + $filter['update_time_from'] = date("M j, Y", strtotime($cmsBlock->getUpdateTime())); + } + + \PHPUnit_Framework_Assert::assertFalse( + $cmsBlockIndex->getCmsBlockGrid()->isRowVisible($filter, true, false), + 'CMS Block with ' + . 'title \'' . $filter['title'] . '\', ' + . 'identifier \'' . $filter['identifier'] . '\', ' + . 'store view \'' . $filter['store_id'] . '\', ' + . 'status \'' . $filter['is_active'] . '\', ' + . (isset($filter['creation_time_from']) + ? ('creation_time \'' . $filter['creation_time_from'] . '\', ') + : '') + . (isset($filter['update_time_from']) ? ('update_time \'' . $filter['update_time_from'] . '\'') : '') + . 'exists in CMS Block grid.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS Block is not present in grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php new file mode 100644 index 0000000000000000000000000000000000000000..96eeb2aa0d04f542ba991d9161180911681b7cd6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Mtf\Fixture\FixtureFactory; + +/** + * Assert that created CMS block non visible on frontend category page. + */ +class AssertCmsBlockNotOnCategoryPage extends AbstractConstraint +{ + /** + * Assert that created CMS block non visible on frontend category page + * (in order to assign block to category: go to category page> Display settings> CMS Block) + * + * @param CmsIndex $cmsIndex + * @param CmsBlock $cmsBlock + * @param CatalogCategoryView $catalogCategoryView + * @param FixtureFactory $fixtureFactory + * @return void + */ + public function processAssert( + CmsIndex $cmsIndex, + CmsBlock $cmsBlock, + CatalogCategoryView $catalogCategoryView, + FixtureFactory $fixtureFactory + ) { + $category = $fixtureFactory->createByCode( + 'category', + [ + 'dataSet' => 'default_subcategory', + 'data' => [ + 'display_mode' => 'Static block and products', + 'landing_page' => $cmsBlock->getTitle(), + ] + ] + ); + $category->persist(); + + $cmsIndex->open(); + $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); + $categoryViewContent = $catalogCategoryView->getViewBlock()->getContent(); + + \PHPUnit_Framework_Assert::assertNotEquals( + $cmsBlock->getContent(), + $categoryViewContent, + 'Wrong block content on category is displayed.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS block description is absent on Category page (frontend).'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php new file mode 100644 index 0000000000000000000000000000000000000000..2cc8650a1f924523c0c5c22dd4966f2bad642ccc --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\Mtf\Fixture\FixtureFactory; + +/** + * Assert that created CMS block displayed on frontend category page. + */ +class AssertCmsBlockOnCategoryPage extends AbstractConstraint +{ + /** + * Assert that created CMS block displayed on frontend category page (in order to assign block to category: + * go to category page> Display settings> CMS Block). + * + * @param CmsIndex $cmsIndex + * @param CmsBlock $cmsBlock + * @param CatalogCategoryView $catalogCategoryView + * @param FixtureFactory $fixtureFactory + * @return void + */ + public function processAssert( + CmsIndex $cmsIndex, + CmsBlock $cmsBlock, + CatalogCategoryView $catalogCategoryView, + FixtureFactory $fixtureFactory + ) { + $category = $fixtureFactory->createByCode( + 'category', + [ + 'dataSet' => 'default_subcategory', + 'data' => [ + 'display_mode' => 'Static block and products', + 'landing_page' => $cmsBlock->getTitle(), + ] + ] + ); + $category->persist(); + + $cmsIndex->open(); + $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); + $categoryViewContent = $catalogCategoryView->getViewBlock()->getContent(); + + \PHPUnit_Framework_Assert::assertEquals( + $cmsBlock->getContent(), + $categoryViewContent, + 'Wrong block content on category is displayed.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS block description is present on Category page (frontend).'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..615c4b06fb44ada65c869600fe41a1136dac543a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that after save block successful message appears. + */ +class AssertCmsBlockSuccessSaveMessage extends AbstractConstraint +{ + const SUCCESS_SAVE_MESSAGE = 'The block has been saved.'; + + /** + * Assert that after save block successful message appears. + * + * @param CmsBlockIndex $cmsBlockIndex + * @return void + */ + public function processAssert(CmsBlockIndex $cmsBlockIndex) + { + $actualMessage = $cmsBlockIndex->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_SAVE_MESSAGE, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_SAVE_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS Block success create message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..ff01fa41f99e1990308af033ed5ba5b4c94d5ae9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert success delete message. + */ +class AssertCmsPageDeleteMessage extends AbstractConstraint +{ + const SUCCESS_DELETE_MESSAGE = 'The page has been deleted.'; + + /** + * Assert that success message is displayed after Cms page delete. + * + * @param CmsPageIndex $cmsIndex + * @return void + */ + public function processAssert(CmsPageIndex $cmsIndex) + { + $actualMessage = $cmsIndex->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_DELETE_MESSAGE, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_DELETE_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Cms page success delete message is present.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php new file mode 100644 index 0000000000000000000000000000000000000000..98d8fbaecd074c6f2d05e82556dcc9185d97b16f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Cms\Test\Page\CmsIndex as FrontCmsIndex; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that created CMS page with 'Status' - Disabled displays with '404 Not Found' message on Frontend. + */ +class AssertCmsPageDisabledOnFrontend extends AbstractConstraint +{ + const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; + + /** + * Assert that created CMS page with 'Status' - Disabled displays with '404 Not Found' message on Frontend. + * + * @param CmsPage $cms + * @param FrontCmsIndex $frontCmsIndex + * @param CmsPageIndex $cmsIndex + * @param BrowserInterface $browser + * @return void + */ + public function processAssert( + CmsPage $cms, + FrontCmsIndex $frontCmsIndex, + CmsPageIndex $cmsIndex, + BrowserInterface $browser + ) { + $cmsIndex->open(); + $filter = ['title' => $cms->getTitle()]; + $cmsIndex->getCmsPageGridBlock()->searchAndPreview($filter); + $browser->selectWindow(); + \PHPUnit_Framework_Assert::assertEquals( + self::NOT_FOUND_MESSAGE, + $frontCmsIndex->getTitleBlock()->getTitle(), + 'Wrong page is displayed.' + ); + } + + /** + * Not found page is display. + * + * @return string + */ + public function toString() + { + return 'Not found page is display.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..97e5247f658a8ce1d47dd5fdd62aaffb5b14ad9c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Verify that page has not been created. + */ +class AssertCmsPageDuplicateErrorMessage extends AbstractConstraint +{ + const ERROR_SAVE_MESSAGE = 'A page URL key for specified store already exists.'; + + /** + * Verify that page has not been created. + * + * @param CmsPageIndex $cmsIndex + * @return void + */ + public function processAssert(CmsPageIndex $cmsIndex) + { + $message = $cmsIndex->getMessagesBlock()->getErrorMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::ERROR_SAVE_MESSAGE, + $message, + 'Wrong error message is displayed.' + . "\nExpected: " . self::ERROR_SAVE_MESSAGE + . "\nActual: " . $message + ); + } + + /** + * Page with duplicated identifier has not been created. + * + * @return string + */ + public function toString() + { + return 'Assert that page with duplicated identifier has not been created.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php new file mode 100644 index 0000000000000000000000000000000000000000..7edf213e1d2081acfa7511f8ad3cce5ceebff006 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Cms\Test\Page\Adminhtml\CmsPageNew; +use Magento\Mtf\Constraint\AbstractAssertForm; + +/** + * Assert that displayed CMS page data on edit page equals passed from fixture. + */ +class AssertCmsPageForm extends AbstractAssertForm +{ + /** + * Skipped fields for verify data. + * + * @var array + */ + protected $skippedFields = [ + 'page_id', + 'content', + 'content_heading', + 'custom_theme_from', + 'custom_theme_to', + ]; + + /** + * Assert that displayed CMS page data on edit page equals passed from fixture. + * + * @param CmsPage $cms + * @param CmsPageIndex $cmsIndex + * @param CmsPageNew $cmsPageNew + * @return void + */ + public function processAssert( + CmsPage $cms, + CmsPageIndex $cmsIndex, + CmsPageNew $cmsPageNew + ) { + $cmsIndex->open(); + $filter = ['title' => $cms->getTitle()]; + $cmsIndex->getCmsPageGridBlock()->searchAndOpen($filter); + + $cmsFormData = $cmsPageNew->getPageForm()->getData($cms); + $cmsFormData['store_id'] = implode('/', $cmsFormData['store_id']); + $errors = $this->verifyData($cms->getData(), $cmsFormData); + \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); + } + + /** + * CMS page data on edit page equals data from fixture. + * + * @return string + */ + public function toString() + { + return 'CMS page data on edit page equals data from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..650151b1db998f61fb49134db73d85aca69668d0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that CMS page present in grid and can be found by title. + */ +class AssertCmsPageInGrid extends AbstractConstraint +{ + /** + * Assert that cms page is present in pages grid. + * + * @param CmsPageIndex $cmsIndex + * @param CmsPage $cms + * @return void + */ + public function processAssert(CmsPageIndex $cmsIndex, CmsPage $cms) + { + $filter = [ + 'title' => $cms->getTitle(), + ]; + $cmsIndex->open(); + \PHPUnit_Framework_Assert::assertTrue( + $cmsIndex->getCmsPageGridBlock()->isRowVisible($filter, true, false), + 'Cms page \'' . $cms->getTitle() . '\' is not present in pages grid.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Cms page is present in pages grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..f781faec06d96c468e064ad12fa0326850093565 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert Cms page is absent in grid. + */ +class AssertCmsPageNotInGrid extends AbstractConstraint +{ + /** + * Assert that Cms page is not present in pages grid. + * + * @param CmsPageIndex $cmsIndex + * @param CmsPage $cmsPage + * @return void + */ + public function processAssert(CmsPageIndex $cmsIndex, CmsPage $cmsPage) + { + $filter = [ + 'title' => $cmsPage->getTitle(), + ]; + \PHPUnit_Framework_Assert::assertFalse( + $cmsIndex->getCmsPageGridBlock()->isRowVisible($filter), + 'Cms page \'' . $cmsPage->getTitle() . '\' is present in pages grid.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Cms page is not present in pages grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php new file mode 100644 index 0000000000000000000000000000000000000000..2f8203b640e6c883490f3391b79593e4d5dfcfe6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Cms\Test\Page\CmsIndex as FrontCmsIndex; +use Magento\Cms\Test\Page\CmsPage as FrontCmsPage; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that content of created cms page displayed in section 'maincontent' and equals passed from fixture. + */ +class AssertCmsPagePreview extends AbstractConstraint +{ + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + + /** + * Assert that content of created cms page displayed in section 'maincontent' and equals passed from fixture. + * + * @param CmsPageIndex $cmsIndex + * @param FrontCmsIndex $frontCmsIndex + * @param FrontCmsPage $frontCmsPage + * @param CmsPage $cms + * @param BrowserInterface $browser + * @return void + */ + public function processAssert( + CmsPageIndex $cmsIndex, + FrontCmsIndex $frontCmsIndex, + FrontCmsPage $frontCmsPage, + CmsPage $cms, + BrowserInterface $browser + ) { + $cmsIndex->open(); + $filter = ['title' => $cms->getTitle()]; + $cmsIndex->getCmsPageGridBlock()->searchAndPreview($filter); + $browser->selectWindow(); + + $fixtureContent = $cms->getContent(); + \PHPUnit_Framework_Assert::assertContains( + $fixtureContent['content'], + $frontCmsPage->getCmsPageBlock()->getPageContent(), + 'Wrong content is displayed.' + ); + if (isset($fixtureContent['widget'])) { + foreach ($fixtureContent['widget']['preset'] as $widget) { + \PHPUnit_Framework_Assert::assertTrue( + $frontCmsPage->getCmsPageBlock()->isWidgetVisible($widget['widget_type'], $widget['anchor_text']), + 'Widget \'' . $widget['widget_type'] . '\' is not displayed.' + ); + } + } + if ($cms->getContentHeading()) { + \PHPUnit_Framework_Assert::assertEquals( + $cms->getContentHeading(), + $frontCmsIndex->getTitleBlock()->getTitle(), + 'Wrong title is displayed.' + ); + } + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'CMS Page content equals to data from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..e047e5de15ac053c5bf948526f1ac2b317c7e729 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that after save a CMS page "The page has been saved." successful message appears. + */ +class AssertCmsPageSuccessSaveMessage extends AbstractConstraint +{ + const SUCCESS_SAVE_MESSAGE = 'The page has been saved.'; + + /** + * Assert that after save a CMS page "The page has been saved." successful message appears. + * + * @param CmsPageIndex $cmsIndex + * @return void + */ + public function processAssert(CmsPageIndex $cmsIndex) + { + $actualMessage = $cmsIndex->getMessagesBlock()->getSuccessMessages(); + \PHPUnit_Framework_Assert::assertEquals( + self::SUCCESS_SAVE_MESSAGE, + $actualMessage, + 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_SAVE_MESSAGE + . "\nActual: " . $actualMessage + ); + } + + /** + * Success message is displayed. + * + * @return string + */ + public function toString() + { + return 'Success message is displayed.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php new file mode 100644 index 0000000000000000000000000000000000000000..b237391de42379212caacd1d1a051be9faa0541f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Constraint; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\UrlRewrite\Test\Fixture\UrlRewrite; +use Magento\Core\Test\Page\Adminhtml\SystemVariableNew; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert that created CMS Page URL Rewrite lead to appropriate page in frontend. + */ +class AssertUrlRewriteCmsPageRedirect extends AbstractConstraint +{ + /** + * Assert that created CMS Page URL Rewrite lead to appropriate page in frontend. + * + * @param UrlRewrite $urlRewrite + * @param CmsPage $cmsPage + * @param SystemVariableNew $systemVariableNew + * @param BrowserInterface $browser + * @return void + */ + public function processAssert( + UrlRewrite $urlRewrite, + CmsPage $cmsPage, + SystemVariableNew $systemVariableNew, + BrowserInterface $browser + ) { + $browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath()); + if ($urlRewrite->hasData('store_id')) { + $store = explode('/', $urlRewrite->getStoreId()); + $systemVariableNew->getFormPageActions()->selectStoreView($store[2]); + } + $url = $urlRewrite->getRedirectType() == 'No' + ? $urlRewrite->getRequestPath() + : $cmsPage->getTitle(); + + \PHPUnit_Framework_Assert::assertEquals( + $_ENV['app_frontend_url'] . $url, + $browser->getUrl(), + 'URL rewrite CMS Page redirect false.' + ); + } + + /** + * URL Rewrite lead to appropriate page in frontend. + * + * @return string + */ + public function toString() + { + return 'URL Rewrite lead to appropriate page in frontend.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml new file mode 100644 index 0000000000000000000000000000000000000000..36bb9cf39af0421b3a0bc9e6e25115cb312ad55e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml @@ -0,0 +1,49 @@ +<?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:schemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> + <fixture name="cmsBlock" module="Magento_Cms" type="flat" entity_type="cms_block" collection="Magento\Cms\Model\Resource\Block\Grid\Collection" identifier="identifier" + handler_interface="Magento\Cms\Test\Handler\CmsBlock\CmsBlockInterface" class="Magento\Cms\Test\Fixture\CmsBlock"> + <dataset name="default"> + <field name="title" xsi:type="string">block_%isolation%</field> + <field name="identifier" xsi:type="string">identifier_%isolation%</field> + <field name="stores" xsi:type="array"> + <item name="dataSet" xsi:type="string">All Store Views</item> + </field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="content" xsi:type="string">description_%isolation%</field> + </dataset> + <field name="block_id" is_required="1"> + <default_value xsi:type="null" /> + </field> + <field name="title" is_required=""> + <default_value xsi:type="string">block_%isolation%</default_value> + </field> + <field name="identifier" is_required=""> + <default_value xsi:type="string">identifier_%isolation%</default_value> + </field> + <field name="content" is_required=""> + <default_value xsi:type="string">description_%isolation%</default_value> + </field> + <field name="creation_time" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="update_time" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="is_active" is_required=""> + <default_value xsi:type="string">Enabled</default_value> + </field> + <field name="stores" is_required="1" source="Magento\Cms\Test\Fixture\CmsBlock\Stores"> + <default_value xsi:type="array"> + <item name="dataSet" xsi:type="array"> + <item name="0" xsi:type="string">All Store Views</item> + </item> + </default_value> + </field> + </fixture> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php new file mode 100644 index 0000000000000000000000000000000000000000..4622537127e7ff531f67dbe09b1a06a5f4a59669 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php @@ -0,0 +1,110 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Fixture\CmsBlock; + +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\Fixture\FixtureInterface; + +/** + * Data source for 'stores' field. + * + * Data keys: + * - dataSet + */ +class Stores implements FixtureInterface +{ + /** + * Array with store names. + * + * @var array + */ + protected $data = []; + + /** + * Array with store fixtures. + * + * @var array + */ + protected $stores; + + /** + * Data set configuration settings. + * + * @var array + */ + protected $params; + + /** + * Create custom Store if we have block with custom store view. + * + * @constructor + * @param FixtureFactory $fixtureFactory + * @param array $params + * @param array $data [optional] + */ + public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) + { + $this->params = $params; + if (isset($data['dataSet'])) { + $dataSets = is_array($data['dataSet']) ? $data['dataSet'] : [$data['dataSet']]; + foreach ($dataSets as $dataSet) { + /** @var \Magento\Store\Test\Fixture\Store $store */ + $store = $fixtureFactory->createByCode('store', ['dataSet' => $dataSet]); + if (!$store->hasData('store_id')) { + $store->persist(); + } + $this->stores[] = $store; + $this->data[] = $store->getName() == 'All Store Views' + ? $store->getName() + : $store->getGroupId() . '/' . $store->getName(); + } + } + } + + /** + * Persist custom selections store view. + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data set. + * + * @param string|null $key [optional] + * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return stores. + * + * @return array + */ + public function getStores() + { + return $this->stores; + } + + /** + * Return data set configuration settings. + * + * @return array + */ + public function getDataConfig() + { + return $this->params; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml new file mode 100644 index 0000000000000000000000000000000000000000..149bef091c83163e09710dbaa2cd7f4bc6930058 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml @@ -0,0 +1,79 @@ +<?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:schemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> + <fixture name="cmsPage" module="Magento_Cms" type="flat" entity_type="cms_page" collection="Magento\Cms\Model\Resource\Page\Grid\Collection" identifier="identifier" + repository_class="Magento\Cms\Test\Repository\CmsPage" handler_interface="Magento\Cms\Test\Handler\CmsPage\CmsPageInterface" class="Magento\Cms\Test\Fixture\CmsPage"> + <dataset name="default"> + <field name="title" xsi:type="string">CMS Page%isolation%</field> + <field name="identifier" xsi:type="string">identifier%isolation%</field> + <field name="store_id" xsi:type="string">All Store Views</field> + <field name="is_actice" xsi:type="string">Enabled</field> + <field name="content" xsi:type="array"> + <item name="content" xsi:type="string">description_%isolation%</item> + </field> + </dataset> + <field name="page_id" is_required="1"> + <default_value xsi:type="null" /> + </field> + <field name="title" is_required="" group="page_information"> + <default_value xsi:type="null" /> + </field> + <field name="is_active" is_required="" group="page_information"> + <default_value xsi:type="string">Enabled</default_value> + </field> + <field name="page_layout" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="meta_keywords" is_required="" group="meta_data"> + <default_value xsi:type="null" /> + </field> + <field name="meta_description" is_required="" group="meta_data"> + <default_value xsi:type="null" /> + </field> + <field name="identifier" group="page_information" is_required=""> + <default_value xsi:type="string">identifier%isolation%</default_value> + </field> + <field name="content_heading" is_required="" group="content"> + <default_value xsi:type="null" /> + </field> + <field name="content" is_required="" group="content" source="Magento\Cms\Test\Fixture\CmsPage\Content"> + <default_value xsi:type="array"> + <item name="content" xsi:type="string">Text %isolation%</item> + </default_value> + </field> + <field name="creation_time" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="update_time" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="sort_order" is_required=""> + <default_value xsi:type="number">0</default_value> + </field> + <field name="layout_update_xml" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="custom_theme" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="custom_page_layout" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="custom_layout_update_xml" is_required=""> + <default_value xsi:type="null" /> + </field> + <field name="custom_theme_from" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="custom_theme_to" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="website_root" is_required=""> + <default_value xsi:type="string">1</default_value> + </field> + <field name="store_id" is_required="1" group="page_information"> + <default_value xsi:type="string">All Store Views</default_value> + </field> + </fixture> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php new file mode 100644 index 0000000000000000000000000000000000000000..fc3d5f72bf9c2dfe34c7b78f9524223d8eb59698 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php @@ -0,0 +1,250 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\Fixture\CmsPage; + +use Magento\Catalog\Test\Fixture\Category; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\Fixture\FixtureInterface; + +/** + * Prepare content for cms page. + */ +class Content implements FixtureInterface +{ + /** + * Content data. + * + * @var array + */ + protected $data = []; + + /** + * Fixture params. + * + * @var array + */ + protected $params; + + /** + * Fixture factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + + /** + * @constructor + * @param array $params + * @param array $data + * @param FixtureFactory $fixtureFactory + */ + public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) + { + $this->fixtureFactory = $fixtureFactory; + $this->params = $params; + $this->data = $data; + if (isset($data['widget']['preset'])) { + $this->data['widget']['preset'] = $this->getPreset($data['widget']['preset']); + foreach ($this->data['widget']['preset'] as $key => $widget) { + if (isset($widget['chosen_option']['category_path']) + && !isset($widget['chosen_option']['filter_sku']) + ) { + $category = $this->createCategory($widget); + $categoryName = $category->getData('name'); + $this->data['widget']['preset'][$key]['chosen_option']['category_path'] = $categoryName; + } + if (isset($widget['chosen_option']['category_path']) && isset($widget['chosen_option']['filter_sku'])) { + $product = $this->createProduct($widget); + $categoryName = $product->getCategoryIds()[0]['name']; + $productSku = $product->getData('sku'); + $this->data['widget']['preset'][$key]['chosen_option']['category_path'] = $categoryName; + $this->data['widget']['preset'][$key]['chosen_option']['filter_sku'] = $productSku; + } + if ($widget['widget_type'] == 'Catalog New Products List') { + $this->createProduct(); + } + if ($widget['widget_type'] == 'CMS Static Block') { + $block = $this->createBlock($widget); + $blockIdentifier = $block->getIdentifier(); + $this->data['widget']['preset'][$key]['chosen_option']['filter_identifier'] = $blockIdentifier; + } + } + } + } + + /** + * Create category. + * + * @param array $widget + * @return Category + */ + protected function createCategory($widget) + { + /** @var Category $category */ + $category = $this->fixtureFactory->createByCode( + 'category', + ['dataSet' => $widget['chosen_option']['category_path']] + ); + if (!$category->hasData('id')) { + $category->persist(); + } + + return $category; + } + + /** + * Create product. + * + * @param array|null $widget [optional] + * @return CatalogProductSimple + */ + protected function createProduct($widget = null) + { + $dataSet = $widget === null ? 'default' : $widget['chosen_option']['category_path']; + /** @var CatalogProductSimple $product */ + $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => $dataSet]); + if (!$product->hasData('id')) { + $product->persist(); + } + + return $product; + } + + /** + * Create block. + * + * @param array $widget + * @return CmsBlock + */ + protected function createBlock($widget) + { + /** @var CmsBlock $block */ + $block = $this->fixtureFactory->createByCode($widget['chosen_option']['filter_identifier']); + if (!$block->hasData('block_id')) { + $block->persist(); + } + + return $block; + } + + /** + * Persist attribute options. + * + * @return void + */ + public function persist() + { + // + } + + /** + * Return prepared data set. + * + * @param string|null $key + * @return mixed + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData($key = null) + { + return $this->data; + } + + /** + * Return data set configuration settings. + * + * @return array + */ + public function getDataConfig() + { + return $this->params; + } + + /** + * Preset for Widgets. + * + * @param string $name + * @return array|null + */ + protected function getPreset($name) + { + $presets = [ + 'default' => [ + 'widget_1' => [ + 'widget_type' => 'CMS Page Link', + 'anchor_text' => 'CMS Page Link anchor_text_%isolation%', + 'title' => 'CMS Page Link anchor_title_%isolation%', + 'template' => 'CMS Page Link Block Template', + 'chosen_option' => [ + 'filter_url_key' => 'home', + ], + ], + ], + 'all_widgets' => [ + 'widget_1' => [ + 'widget_type' => 'CMS Page Link', + 'anchor_text' => 'CMS Page Link anchor_text_%isolation%', + 'title' => 'CMS Page Link anchor_title_%isolation%', + 'template' => 'CMS Page Link Block Template', + 'chosen_option' => [ + 'filter_url_key' => 'home', + ], + ], + 'widget_2' => [ + 'widget_type' => 'CMS Static Block', + 'template' => 'CMS Static Block Default Template', + 'chosen_option' => [ + 'filter_identifier' => 'cmsBlock', + ], + ], + 'widget_3' => [ + 'widget_type' => 'Catalog Category Link', + 'anchor_text' => 'Catalog Category Link anchor_text_%isolation%', + 'title' => 'Catalog Category Link anchor_title_%isolation%', + 'template' => 'Category Link Block Template', + 'chosen_option' => [ + 'category_path' => 'default_subcategory', + ], + ], + 'widget_4' => [ + 'widget_type' => 'Catalog New Products List', + 'display_type' => 'All products', + 'show_pager' => 'Yes', + 'products_count' => 10, + 'template' => 'New Products Grid Template', + 'cache_lifetime' => 86400, + ], + 'widget_5' => [ + 'widget_type' => 'Catalog Product Link', + 'anchor_text' => 'Catalog Product Link anchor_text_%isolation%', + 'title' => 'Catalog Product Link anchor_title_%isolation%', + 'template' => 'Product Link Block Template', + 'chosen_option' => [ + 'category_path' => 'product_with_category', + 'filter_sku' => 'product_with_category', + ], + ], + 'widget_6' => [ + 'widget_type' => 'Recently Compared Products', + 'page_size' => 10, + 'template' => 'Compared Products Grid Template', + ], + 'widget_7' => [ + 'widget_type' => 'Recently Viewed Products', + 'page_size' => 10, + 'template' => 'Viewed Products Grid Template', + ], + ], + ]; + if (!isset($presets[$name])) { + return null; + } + return $presets[$name]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsBlock/Curl.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsBlock/Curl.php index 7e76b450a61a2bca890ce5efad101e2478f3f4b0..c3aefd941fc29abf6f5b823497131213d235f6ed 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsBlock/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsBlock/Curl.php @@ -14,20 +14,19 @@ use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; /** - * Class Curl - * Curl handler for creating CMS Block + * Curl handler for creating CMS Block. */ class Curl extends AbstractCurl implements CmsBlockInterface { /** - * Url for saving data + * Url for saving data. * * @var string */ protected $saveUrl = 'cms/block/save/back/edit'; /** - * Mapping values for data + * Mapping values for data. * * @var array */ @@ -39,7 +38,7 @@ class Curl extends AbstractCurl implements CmsBlockInterface ]; /** - * Mapping values for Stores + * Mapping values for Stores. * * @var array */ @@ -48,7 +47,7 @@ class Curl extends AbstractCurl implements CmsBlockInterface ]; /** - * POST request for creating CMS Block + * POST request for creating CMS Block. * * @param FixtureInterface|null $fixture [optional] * @return array @@ -73,7 +72,7 @@ class Curl extends AbstractCurl implements CmsBlockInterface } /** - * Prepare data from text to values + * Prepare data from text to values. * * @param FixtureInterface $fixture * @return array diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php index 6e1f9504703022c968d3736dd421841f90881c3f..4187350d28d7aead4044c949f745be6968cf1a17 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Handler/CmsPage/Curl.php @@ -14,8 +14,7 @@ use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; /** - * Class Curl - * Curl handler for creating Cms page + * Curl handler for creating Cms page. */ class Curl extends Conditions implements CmsPageInterface { @@ -26,7 +25,7 @@ class Curl extends Conditions implements CmsPageInterface */ protected $mappingData = [ 'is_active' => [ - 'Published' => 1, + 'Enabled' => 1, 'Disabled' => 0, ], 'store_id' => [ @@ -37,22 +36,35 @@ class Curl extends Conditions implements CmsPageInterface '2 columns with left bar' => '2columns-left', '2 columns with right bar' => '2columns-right', '3 columns' => '3columns', - ], - 'under_version_control' => [ - 'Yes' => 1, - 'No' => 0, - ], + ] ]; /** - * Url for save cms page + * Url for save cms page. * * @var string */ - protected $url = 'admin/cms_page/save/back/edit/active_tab/main_section/'; + protected $url = 'cms/page/save/back/edit/active_tab/main_section/'; + + /** + * Mapping values for data. + * + * @var array + */ + protected $additionalMappingData = []; + + /** + * @constructor + * @param Config $configuration + */ + public function __construct(Config $configuration) + { + $this->mappingData = array_merge($this->mappingData, $this->additionalMappingData); + parent::__construct($configuration); + } /** - * Post request for creating a cms page + * Post request for creating a cms page. * * @param FixtureInterface $fixture * @return array @@ -77,7 +89,7 @@ class Curl extends Conditions implements CmsPageInterface } /** - * Prepare data + * Prepare data. * * @param array $data * @return array diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml new file mode 100644 index 0000000000000000000000000000000000000000..2aa384eef89c8f62dc734f7c2f3702a0561994ed --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml @@ -0,0 +1,13 @@ +<?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/pages.xsd"> + <page name="CmsBlockEdit" area="Adminhtml" mca="cms/block/edit" module="Magento_Cms"> + <block name="blockForm" class="Magento\Cms\Test\Block\Adminhtml\Block\Edit\BlockForm" locator="[id='page:main-container']" strategy="css selector" /> + <block name="pageMainActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + </page> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml new file mode 100644 index 0000000000000000000000000000000000000000..f9b2d8c51e95c647f45a1c9b18557e7632ad4c1b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml @@ -0,0 +1,14 @@ +<?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/pages.xsd"> + <page name="CmsBlockIndex" area="Adminhtml" mca="cms/block" module="Magento_Cms"> + <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector" /> + <block name="gridPageActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="cmsBlockGrid" class="Magento\Cms\Test\Block\Adminhtml\Block\CmsGrid" locator=".grid" strategy="css selector" /> + </page> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockNew.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockNew.xml new file mode 100644 index 0000000000000000000000000000000000000000..65693e9a94246600741fc5658bd4cd09413d72b6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsBlockNew.xml @@ -0,0 +1,14 @@ +<?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/pages.xsd"> + <page name="CmsBlockNew" area="Adminhtml" mca="cms/block/new" module="Magento_Cms"> + <block name="formPageActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="cmsForm" class="Magento\Cms\Test\Block\Adminhtml\Block\Edit\CmsForm" locator="[id='page:main-container']" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector" /> + </page> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsPageIndex.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsPageIndex.xml new file mode 100644 index 0000000000000000000000000000000000000000..d622c917217dc1b6609fd65efddd157cda24da84 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsPageIndex.xml @@ -0,0 +1,14 @@ +<?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/pages.xsd"> + <page name="CmsPageIndex" area="Adminhtml" mca="cms/page/index" module="Magento_Cms"> + <block name="pageActionsBlock" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="cmsPageGridBlock" class="Magento\Cms\Test\Block\Adminhtml\Page\Grid" locator=".grid" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator=".messages .message" strategy="css selector" /> + </page> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsPageNew.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsPageNew.xml new file mode 100644 index 0000000000000000000000000000000000000000..252dc039121b9ae55c6b30b063170fee9114c9a6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/Adminhtml/CmsPageNew.xml @@ -0,0 +1,13 @@ +<?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/pages.xsd"> + <page name="CmsPageNew" area="Adminhtml" mca="cms/page/new" module="Magento_Cms"> + <block name="pageForm" class="Magento\Cms\Test\Block\Adminhtml\Page\Edit\PageForm" locator="[id='page:main-container']" strategy="css selector" /> + <block name="pageMainActions" class="Magento\Backend\Test\Block\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + </page> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsIndex.xml index 661f784c0a33d2d427b3d1760a0752b9cc8be624..066779eb08b95a54465eacda89d3be298cd40e5d 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsIndex.xml @@ -6,17 +6,17 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CmsIndex" mca="cms/index/index" module="Magento_Cms"> - <block name="searchBlock" class="Magento\Catalog\Test\Block\Search" locator="#search_mini_form" strategy="css selector"/> - <block name="topmenu" class="Magento\Theme\Test\Block\Html\Topmenu" locator="[role='navigation']" strategy="css selector"/> - <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper" strategy="css selector"/> - <block name="footerBlock" class="Magento\Theme\Test\Block\Html\Footer" locator="footer.page-footer" strategy="css selector"/> - <block name="linksBlock" class="Magento\Theme\Test\Block\Links" locator=".header .links" strategy="css selector"/> - <block name="storeSwitcherBlock" class="Magento\Store\Test\Block\Switcher" locator="[data-ui-id='language-switcher']" strategy="css selector"/> - <block name="cartSidebarBlock" class="Magento\Checkout\Test\Block\Cart\Sidebar" locator="[data-block='minicart']" strategy="css selector"/> - <block name="compareProductsBlock" class="Magento\Catalog\Test\Block\Product\Compare\Sidebar" locator=".sidebar.sidebar-additional" strategy="css selector"/> - <block name="currencyBlock" class="Magento\Directory\Test\Block\Currency\Switcher" locator=".switcher.currency" strategy="css selector"/> - <block name="cmsPageBlock" class="Magento\Cms\Test\Block\Page" locator=".page-main" strategy="css selector"/> - <block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector"/> - </page> + <page name="CmsIndex" mca="cms/index/index" module="Magento_Cms"> + <block name="searchBlock" class="Magento\Catalog\Test\Block\Search" locator="#search_mini_form" strategy="css selector" /> + <block name="topmenu" class="Magento\Theme\Test\Block\Html\Topmenu" locator="[role='navigation']" strategy="css selector" /> + <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper" strategy="css selector" /> + <block name="footerBlock" class="Magento\Theme\Test\Block\Html\Footer" locator="footer.page-footer" strategy="css selector" /> + <block name="linksBlock" class="Magento\Theme\Test\Block\Links" locator=".header .links" strategy="css selector" /> + <block name="storeSwitcherBlock" class="Magento\Store\Test\Block\Switcher" locator="[data-ui-id='language-switcher']" strategy="css selector" /> + <block name="cartSidebarBlock" class="Magento\Checkout\Test\Block\Cart\Sidebar" locator="[data-block='minicart']" strategy="css selector" /> + <block name="compareProductsBlock" class="Magento\Catalog\Test\Block\Product\Compare\Sidebar" locator=".sidebar.sidebar-additional" strategy="css selector" /> + <block name="currencyBlock" class="Magento\Directory\Test\Block\Currency\Switcher" locator=".switcher.currency" strategy="css selector" /> + <block name="cmsPageBlock" class="Magento\Cms\Test\Block\Page" locator=".page-main" strategy="css selector" /> + <block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsPage.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsPage.xml index 1bbb59d71184e0a86d7956e9ef570b93dbc1ba42..f251d89bdbbfd3a6d0dc0761000bbac929d30468 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsPage.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsPage.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CmsPage" mca="cms/page" module="Magento_Cms"> - <block name="cmsPageBlock" class="Magento\Cms\Test\Block\Page" locator=".page-main" strategy="css selector"/> - </page> + <page name="CmsPage" mca="cms/page" module="Magento_Cms"> + <block name="cmsPageBlock" class="Magento\Cms\Test\Block\Page" locator=".page-main" strategy="css selector" /> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml new file mode 100644 index 0000000000000000000000000000000000000000..81f9f676fe986eabfdcf044a7eabfe490f176142 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" ?> +<!-- +/** + * 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/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Cms\Test\Repository\CmsBlock"> + <dataset name="default"> + <field name="title" xsi:type="string">block_%isolation%</field> + <field name="identifier" xsi:type="string">identifier_%isolation%</field> + <field name="stores" xsi:type="array"> + <item name="dataSet" xsi:type="array"> + <item name="0" xsi:type="string">All Store Views</item> + </item> + </field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="content" xsi:type="string">description_%isolation%</field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage.xml new file mode 100644 index 0000000000000000000000000000000000000000..46f5e119b6e77145e2c580b3d6da0cff673249a3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" ?> +<!-- +/** + * 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/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Cms\Test\Repository\CmsPage"> + <dataset name="default"> + <field name="title" xsi:type="string">page-%isolation%</field> + <field name="identifier" xsi:type="string">page-%isolation%</field> + <field name="store_id" xsi:type="string">All Store Views</field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="content" xsi:type="array"> + <item name="content" xsi:type="string">Test Content</item> + </field> + <field name="content_heading" xsi:type="string">Heading-%isolation%</field> + <field name="page_layout" xsi:type="string">1 column</field> + </dataset> + + <dataset name="cms-page-duplicated"> + <field name="title" xsi:type="string">404 Not Found 1 Test%isolation%</field> + <field name="identifier" xsi:type="string">home</field> + <field name="store_id" xsi:type="string">All Store Views</field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="content" xsi:type="array"> + <item name="content" xsi:type="string">Test Content</item> + </field> + <field name="meta_keywords" xsi:type="string">Page keywords</field> + <field name="meta_description" xsi:type="string">Page description</field> + </dataset> + + <dataset name="3_column_template"> + <field name="title" xsi:type="string">page-compare-%isolation%</field> + <field name="identifier" xsi:type="string">page-compare-%isolation%</field> + <field name="store_id" xsi:type="string">All Store Views</field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="content" xsi:type="array"> + <item name="content" xsi:type="string">Test Content</item> + </field> + <field name="page_layout" xsi:type="string">3 columns</field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/UrlRewrite.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/UrlRewrite.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c562348e4fa2b621ebd6d9d942ff9a9ca4bd824 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/UrlRewrite.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" ?> +<!-- +/** + * 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/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\UrlRewrite\Test\Repository\UrlRewrite"> + <dataset name="cms_default_no_redirect"> + <field name="request_path" xsi:type="string">test_request%isolation%</field> + <field name="target_path" xsi:type="array"> + <item name="entity" xsi:type="string">cms_page/%cmsPage::default%</item> + </field> + <field name="description" xsi:type="string">test description</field> + <field name="redirect_type" xsi:type="string">No</field> + <field name="store_id" xsi:type="string">Default Store View</field> + </dataset> + + <dataset name="cms_default_temporary_redirect"> + <field name="request_path" xsi:type="string">test_request%isolation%</field> + <field name="redirect_type" xsi:type="string">Temporary (302)</field> + <field name="store_id" xsi:type="string">Default Store View</field> + <field name="target_path" xsi:type="array"> + <item name="entity" xsi:type="string">cms_page/%cmsPage::default%</item> + </field> + <field name="description" xsi:type="string">test description</field> + </dataset> + + <dataset name="cms_default_permanent_redirect"> + <field name="request_path" xsi:type="string">test_request%isolation%</field> + <field name="redirect_type" xsi:type="string">Permanent (301)</field> + <field name="store_id" xsi:type="string">Default Store View</field> + <field name="target_path" xsi:type="array"> + <item name="entity" xsi:type="string">cms_page/%cmsPage::default%</item> + </field> + <field name="description" xsi:type="string">test description</field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4d0aa70db985a4cf4efce25ff4a2c1a9a208a02d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php @@ -0,0 +1,117 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Backend\Test\Page\Adminhtml\StoreDelete; +use Magento\Backend\Test\Page\Adminhtml\StoreIndex; +use Magento\Backend\Test\Page\Adminhtml\StoreNew; +use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex; +use Magento\Cms\Test\Page\Adminhtml\CmsBlockNew; +use Magento\Mtf\TestCase\Injectable; + +/** + * Parent class for CMS Block tests. + */ +abstract class AbstractCmsBlockEntityTest extends Injectable +{ + /** + * Page CmsBlockIndex. + * + * @var CmsBlockIndex + */ + protected $cmsBlockIndex; + + /** + * Page CmsBlockNew. + * + * @var CmsBlockNew + */ + protected $cmsBlockNew; + + /** + * Page StoreIndex. + * + * @var StoreIndex + */ + protected $storeIndex; + + /** + * Page StoreNew. + * + * @var StoreNew + */ + protected $storeNew; + + /** + * Page StoreDelete. + * + * @var StoreDelete + */ + protected $storeDelete; + + /** + * Store Name. + * + * @var array + */ + protected $storeName; + + /** + * Skipped stores for tearDown. + * + * @var array + */ + protected $skippedStores = [ + 'All Store Views', + 'Main Website/Main Website Store/Default Store View', + ]; + + /** + * Injection data. + * + * @param CmsBlockIndex $cmsBlockIndex + * @param CmsBlockNew $cmsBlockNew + * @param StoreIndex $storeIndex + * @param StoreNew $storeNew + * @param StoreDelete $storeDelete + * @return void + */ + public function __inject( + CmsBlockIndex $cmsBlockIndex, + CmsBlockNew $cmsBlockNew, + StoreIndex $storeIndex, + StoreNew $storeNew, + StoreDelete $storeDelete + ) { + $this->cmsBlockIndex = $cmsBlockIndex; + $this->cmsBlockNew = $cmsBlockNew; + $this->storeIndex = $storeIndex; + $this->storeNew = $storeNew; + $this->storeDelete = $storeDelete; + } + + /** + * Delete Store after test. + * + * @return void + */ + public function tearDown() + { + foreach ($this->storeName as $store) { + if (in_array($store, $this->skippedStores)) { + continue; + } + $tmp = explode("/", $store); + $filter['store_title'] = end($tmp); + $this->storeIndex->open(); + $this->storeIndex->getStoreGrid()->searchAndOpen($filter); + $this->storeNew->getFormPageActions()->delete(); + $this->storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']); + $this->storeDelete->getFormPageActions()->delete(); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..bc0c24a28b5d0d24c7464dd668676353d5a3e7ca --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Cms\Test\Fixture\CmsBlock; + +/** + * Preconditions: + * 1. Create store view. + * + * Steps: + * 1. Open Backend. + * 2. Go to Content > Blocks. + * 3. Click "Add New Block" button. + * 4. Fill data according to dataset. + * 5. Perform all assertions. + * + * @group CMS_Content_(PS) + * @ZephyrId MAGETWO-25578 + */ +class CreateCmsBlockEntityTest extends AbstractCmsBlockEntityTest +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * Create CMS Block. + * + * @param CmsBlock $cmsBlock + * @return void + */ + public function test(CmsBlock $cmsBlock) + { + // Prepare data for tearDown + $this->storeName = $cmsBlock->getStores(); + + // Steps + $this->cmsBlockIndex->open(); + $this->cmsBlockIndex->getGridPageActions()->addNew(); + $this->cmsBlockNew->getCmsForm()->fill($cmsBlock); + $this->cmsBlockNew->getFormPageActions()->save(); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..05164514a1335b65b11c83edf68d391b646fcebf --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -0,0 +1,33 @@ +<?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\Cms\Test\TestCase\CreateCmsBlockEntityTest"> + <variation name="CreateCmsBlockEntityTestVariation1"> + <data name="issue" xsi:type="string">Bug: MAGETWO-32125</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">All Store Views</data> + <data name="cmsBlock/data/is_active" xsi:type="string">Enabled</data> + <data name="cmsBlock/data/content" xsi:type="string">description_%isolation%</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> + </variation> + <variation name="CreateCmsBlockEntityTestVariation2"> + <data name="issue" xsi:type="string">Bug: MAGETWO-32125</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> + <data name="cmsBlock/data/is_active" xsi:type="string">Disabled</data> + <data name="cmsBlock/data/content" xsi:type="string">description_%isolation%</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage" /> + </variation> + </testCase> +</config> 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 new file mode 100644 index 0000000000000000000000000000000000000000..35580f33bd3e58b8fb6a6ab68d0a911b7ccfd2fd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +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\TestCase\Injectable; + +/** + * Steps: + * 1. Log in to Backend. + * 2. Navigate to Content > Elements > Pages. + * 3. Start to create new CMS Page. + * 4. Fill out fields data according to data set. + * 5. Save CMS Page. + * 6. Verify created CMS Page. + * + * @group CMS_Content_(PS) + * @ZephyrId MAGETWO-25580 + */ +class CreateCmsPageEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + const TEST_TYPE = 'acceptance_test'; + const STABLE = 'no'; + /* end tags */ + + /** + * CmsIndex page. + * + * @var CmsPageIndex + */ + protected $cmsIndex; + + /** + * CmsPageNew page. + * + * @var CmsPageNew + */ + protected $cmsPageNew; + + /** + * Inject pages. + * + * @param CmsPageIndex $cmsIndex + * @param CmsPageNew $cmsPageNew + * @return void + */ + public function __inject(CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew) + { + $this->cmsIndex = $cmsIndex; + $this->cmsPageNew = $cmsPageNew; + } + + /** + * Creating Cms page. + * + * @param CmsPageFixture $cms + * @return void + */ + public function test(CmsPageFixture $cms) + { + // Steps + $this->cmsIndex->open(); + $this->cmsIndex->getPageActionsBlock()->addNew(); + $this->cmsPageNew->getPageForm()->fill($cms); + $this->cmsPageNew->getPageMainActions()->save(); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..21c9773ef8a4518f1ebdd6c466585dd4d2749fd2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -0,0 +1,54 @@ +<?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\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="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> + </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> + <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> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> + </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> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDisabledOnFrontend" /> + </variation> + </testCase> +</config> 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 new file mode 100644 index 0000000000000000000000000000000000000000..5023d9a37f2449be13b0c1153842e92014fa779c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\UrlRewrite\Test\Fixture\UrlRewrite; +use Magento\UrlRewrite\Test\Page\Adminhtml\UrlRewriteEdit; +use Magento\UrlRewrite\Test\Page\Adminhtml\UrlRewriteIndex; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions + * 1. Create CMS Page. + * + * Steps + * 1. Login to backend as Admin. + * 2. Go to the Marketing > SEO & Search > URL Rewrites. + * 3. Click "Add Url Rewrite" button. + * 4. Select "For CMS Page" in Create URL Rewrite dropdown. + * 5. Select CMS page from preconditions in grid. + * 6. Fill data according to data set. + * 7. Save Rewrite. + * 8. Perform all assertions. + * + * @group URL_Rewrites_(PS) + * @ZephyrId MAGETWO-24847 + */ +class CreateCmsPageRewriteEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * Url rewrite index page. + * + * @var UrlRewriteIndex + */ + protected $urlRewriteIndex; + + /** + * Url rewrite edit page. + * + * @var UrlRewriteEdit + */ + protected $urlRewriteEdit; + + /** + * Inject pages. + * + * @param UrlRewriteIndex $urlRewriteIndex + * @param UrlRewriteEdit $urlRewriteEdit + * @return void + */ + public function __inject( + UrlRewriteIndex $urlRewriteIndex, + UrlRewriteEdit $urlRewriteEdit + ) { + $this->urlRewriteIndex = $urlRewriteIndex; + $this->urlRewriteEdit = $urlRewriteEdit; + } + + /** + * Create CMS page rewrites. + * + * @param UrlRewrite $urlRewrite + * @return array + */ + public function test(UrlRewrite $urlRewrite) + { + //Steps + $this->urlRewriteIndex->open(); + $this->urlRewriteIndex->getPageActionsBlock()->addNew(); + $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite); + $cmsPage = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity(); + $filter = ['title' => $cmsPage->getTitle()]; + $this->urlRewriteEdit->getCmsGridBlock()->searchAndOpen($filter); + $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite); + $this->urlRewriteEdit->getPageMainActions()->save(); + + return ['cmsPage' => $cmsPage]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..518a013681fd4bb237eb92ed50d3ef31084e71ce --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml @@ -0,0 +1,51 @@ +<?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\Cms\Test\TestCase\CreateCmsPageRewriteEntityTest"> + <variation name="CreateCmsPageRewriteEntityTestVariation1"> + <data name="urlRewrite/data/entity_type" xsi:type="string">For CMS page</data> + <data name="urlRewrite/data/target_path/entity" xsi:type="string">cms/page/view/page_id/%cmsPage::default%</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> + <data name="urlRewrite/data/description" xsi:type="string">test_description_default</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + <variation name="CreateCmsPageRewriteEntityTestVariation2"> + <data name="urlRewrite/data/entity_type" xsi:type="string">For CMS page</data> + <data name="urlRewrite/data/target_path/entity" xsi:type="string">cms/page/view/page_id/%cmsPage::default%</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.html</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> + <data name="urlRewrite/data/description" xsi:type="string">test description_302</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + <variation name="CreateCmsPageRewriteEntityTestVariation3"> + <data name="urlRewrite/data/entity_type" xsi:type="string">For CMS page</data> + <data name="urlRewrite/data/target_path/entity" xsi:type="string">cms/page/view/page_id/%cmsPage::default%</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.htm</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">Permanent (301)</data> + <data name="urlRewrite/data/description" xsi:type="string">test description_301</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + <variation name="CreateCmsPageRewriteEntityTestVariation4"> + <data name="urlRewrite/data/entity_type" xsi:type="string">For CMS page</data> + <data name="urlRewrite/data/target_path/entity" xsi:type="string">cms/page/view/page_id/%cmsPage::default%</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.aspx</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">Permanent (301)</data> + <data name="urlRewrite/data/description" xsi:type="string">test description_%isolation%</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..07f8d2dea4488bc90f697262bbaadf250022dde9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Cms\Test\Page\Adminhtml\CmsBlockIndex; +use Magento\Cms\Test\Page\Adminhtml\CmsBlockNew; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. Create CMS Block. + * + * Steps: + * 1. Open Backend. + * 2. Go to Content > Blocks. + * 3. Open created CMS block. + * 4. Click "Delete Block". + * 5. Perform all assertions. + * + * @group CMS_Content_(PS) + * @ZephyrId MAGETWO-25698 + */ +class DeleteCmsBlockEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * Page CmsBlockIndex. + * + * @var CmsBlockIndex + */ + protected $cmsBlockIndex; + + /** + * Page CmsBlockNew. + * + * @var CmsBlockNew + */ + protected $cmsBlockNew; + + /** + * Injection data. + * + * @param CmsBlockIndex $cmsBlockIndex + * @param CmsBlockNew $cmsBlockNew + * @return void + */ + public function __inject( + CmsBlockIndex $cmsBlockIndex, + CmsBlockNew $cmsBlockNew + ) { + $this->cmsBlockIndex = $cmsBlockIndex; + $this->cmsBlockNew = $cmsBlockNew; + } + + /** + * Delete CMS Block. + * + * @param CmsBlock $cmsBlock + * @return void + */ + public function test(CmsBlock $cmsBlock) + { + // Precondition + $cmsBlock->persist(); + $filter = ['identifier' => $cmsBlock->getIdentifier()]; + + // Steps + $this->cmsBlockIndex->open(); + $this->cmsBlockIndex->getCmsBlockGrid()->searchAndOpen($filter, true, false); + $this->cmsBlockNew->getFormPageActions()->delete(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..622b867cab4007ef1cbb9deb279df76f4aa686e7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml @@ -0,0 +1,17 @@ +<?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\Cms\Test\TestCase\DeleteCmsBlockEntityTest"> + <variation name="DeleteCmsBlockEntityTestVariation1"> + <data name="issue" xsi:type="string">Bug: MAGETWO-32125</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockDeleteMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockNotInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5801ba85ea504bfeab0d880713bb50a51780d201 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php @@ -0,0 +1,78 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Cms\Test\Page\Adminhtml\CmsPageNew; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. CMS Page is created. + * + * Steps: + * 1. Log in to Backend. + * 2. Navigate to CONTENT > Pages. + * 3. Click on CMS Page from grid. + * 4. Click "Delete Page" button. + * 5. Perform all assertions. + * + * @group CMS_Content_(PS) + * @ZephyrId MAGETWO-23291 + */ +class DeleteCmsPageEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * CMS Index page. + * + * @var CmsPageIndex + */ + protected $cmsPageIndex; + + /** + * Edit CMS page. + * + * @var CmsPageNew + */ + protected $cmsPageNew; + + /** + * Inject pages. + * + * @param CmsPageIndex $cmsPageIndex + * @param CmsPageNew $cmsPageNew + * @return void + */ + public function __inject(CmsPageIndex $cmsPageIndex, CmsPageNew $cmsPageNew) + { + $this->cmsPageIndex = $cmsPageIndex; + $this->cmsPageNew = $cmsPageNew; + } + + /** + * Delete CMS Page. + * + * @param CmsPage $cmsPage + * @return void + */ + public function test(CmsPage $cmsPage) + { + // Preconditions + $cmsPage->persist(); + + // Steps + $this->cmsPageIndex->open(); + $this->cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cmsPage->getTitle()]); + $this->cmsPageNew->getPageMainActions()->delete(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..78dd465ad2b65d302b9e2f8d8786a7081b3dce64 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml @@ -0,0 +1,16 @@ +<?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\Cms\Test\TestCase\DeleteCmsPageEntityTest"> + <variation name="DeleteCmsPageEntityTestVariation1"> + <data name="cmsPage/dataSet" xsi:type="string">default</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDeleteMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageNotInGrid" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7d5364c7c6fe48279ef35c797ddce98eefa828c2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\UrlRewrite\Test\Fixture\UrlRewrite; +use Magento\UrlRewrite\Test\Page\Adminhtml\UrlRewriteEdit; +use Magento\UrlRewrite\Test\Page\Adminhtml\UrlRewriteIndex; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. Create CMS Page. + * 2. Create CMS Page URL Redirect. + * + * Steps: + * 1. Login to backend as Admin. + * 2. Go to the Marketing > SEO & Search > URL Redirects. + * 3. Search and open created URL Redirect. + * 4. Delete Redirect. + * 5. Perform all assertions. + * + * @group URL_Rewrites_(PS) + * @ZephyrId MAGETWO-25915 + */ +class DeleteCmsPageUrlRewriteEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * Url rewrite index page. + * + * @var UrlRewriteIndex + */ + protected $urlRewriteIndex; + + /** + * Url rewrite edit page. + * + * @var UrlRewriteEdit + */ + protected $urlRewriteEdit; + + /** + * Inject pages. + * + * @param UrlRewriteIndex $urlRewriteIndex + * @param UrlRewriteEdit $urlRewriteEdit + * @return void + */ + public function __inject( + UrlRewriteIndex $urlRewriteIndex, + UrlRewriteEdit $urlRewriteEdit + ) { + $this->urlRewriteIndex = $urlRewriteIndex; + $this->urlRewriteEdit = $urlRewriteEdit; + } + + /** + * Delete CMS page rewrites entity. + * + * @param UrlRewrite $urlRewrite + * @return void + */ + public function test(UrlRewrite $urlRewrite) + { + // Precondition + $urlRewrite->persist(); + + // Steps + $this->urlRewriteIndex->open(); + $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen(['request_path' => $urlRewrite->getRequestPath()]); + $this->urlRewriteEdit->getPageMainActions()->delete(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..86128fd3a6411d2f0a9564c4d084b984079d02a2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml @@ -0,0 +1,29 @@ +<?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\Cms\Test\TestCase\DeleteCmsPageUrlRewriteEntityTest"> + <variation name="DeleteCmsPageUrlRewriteEntityTestVariation1"> + <data name="urlRewrite/dataSet" xsi:type="string">cms_default_no_redirect</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> + </variation> + <variation name="DeleteCmsPageUrlRewriteEntityTestVariation2"> + <data name="urlRewrite/dataSet" xsi:type="string">cms_default_permanent_redirect</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> + </variation> + <variation name="DeleteCmsPageUrlRewriteEntityTestVariation3"> + <data name="urlRewrite/dataSet" xsi:type="string">cms_default_temporary_redirect</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..529810975dd2b4c9fd5321a5e200aea49494e5ec --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,21 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest18"> + <data name="menuItem" xsi:type="string">Content > Pages</data> + <data name="pageTitle" xsi:type="string">Pages</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest19"> + <data name="menuItem" xsi:type="string">Content > Blocks</data> + <data name="pageTitle" xsi:type="string">Blocks</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7c2d579080f69e09b5d2629c20cc4213dcbc7d7b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Cms\Test\Fixture\CmsBlock; + +/** + * Preconditions: + * 1. Create store view. + * 2. Create CMS Block. + * + * Steps: + * 1. Open Backend. + * 2. Go to Content > Blocks. + * 3. Open created CMS block. + * 4. Fill data according to dataset. + * 5. Perform all assertions. + * + * @group CMS_Content_(PS) + * @ZephyrId MAGETWO-25941 + */ +class UpdateCmsBlockEntityTest extends AbstractCmsBlockEntityTest +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * Run Update CMS Block test. + * + * @param CmsBlock $initialCmsBlock + * @param CmsBlock $cmsBlock + * @return void + */ + public function test(CmsBlock $initialCmsBlock, CmsBlock $cmsBlock) + { + // Prepare data for tearDown + $this->storeName = $cmsBlock->getStores(); + + // Precondition + $initialCmsBlock->persist(); + + // Steps + $this->cmsBlockIndex->open(); + $this->cmsBlockIndex->getCmsBlockGrid()->searchAndOpen(['identifier' => $initialCmsBlock->getIdentifier()]); + $this->cmsBlockNew->getCmsForm()->fill($cmsBlock); + $this->cmsBlockNew->getFormPageActions()->save(); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..0b72bf77ef56654718f9c6ab6fc2bd6ac9b4025a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml @@ -0,0 +1,33 @@ +<?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\Cms\Test\TestCase\UpdateCmsBlockEntityTest"> + <variation name="UpdateCmsBlockEntityTestVariation1"> + <data name="issue" xsi:type="string">Bug: MAGETWO-32125</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">All Store Views</data> + <data name="cmsBlock/data/is_active" xsi:type="string">Enabled</data> + <data name="cmsBlock/data/content" xsi:type="string">description_updated_%isolation%</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> + </variation> + <variation name="UpdateCmsBlockEntityTestVariation2"> + <data name="issue" xsi:type="string">Bug: MAGETWO-32125</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> + <data name="cmsBlock/data/is_active" xsi:type="string">Disabled</data> + <data name="cmsBlock/data/content" xsi:type="string">description_updated_%isolation%</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockInGrid" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage" /> + </variation> + </testCase> +</config> 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 new file mode 100644 index 0000000000000000000000000000000000000000..4c8f8d1cf29e792b75501b2d16471d83671cb0cc --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php @@ -0,0 +1,102 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex; +use Magento\Cms\Test\Page\Adminhtml\CmsPageNew; +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. CMS Page is created. + * + * Steps: + * 1. Log in to Backend. + * 2. Navigate to Content > Elements > Pages. + * 3. Click on CMS Page from grid. + * 4. Edit test value(s) according to data set. + * 5. Click 'Save' CMS Page. + * 6. Perform asserts. + * + * @group CMS_Content_(PS) + * @ZephyrId MAGETWO-25186 + */ +class UpdateCmsPageEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * CMS Index page. + * + * @var CmsPageIndex + */ + protected $cmsPageIndex; + + /** + * Edit CMS page. + * + * @var CmsPageNew + */ + protected $cmsPageNew; + + /** + * Fixture Factory. + * + * @var FixtureFactory + */ + protected $factory; + + /** + * Inject page. + * + * @param CmsPageIndex $cmsPageIndex + * @param CmsPageNew $cmsPageNew + * @param CmsPage $cmsOriginal + * @param FixtureFactory $factory + * @return array + */ + public function __inject( + CmsPageIndex $cmsPageIndex, + CmsPageNew $cmsPageNew, + CmsPage $cmsOriginal, + FixtureFactory $factory + ) { + $cmsOriginal->persist(); + $this->cmsPageIndex = $cmsPageIndex; + $this->cmsPageNew = $cmsPageNew; + $this->factory = $factory; + return ['cmsOriginal' => $cmsOriginal]; + } + + /** + * Update CMS Page. + * + * @param CmsPage $cms + * @param CmsPage $cmsOriginal + * @return array + */ + public function test(CmsPage $cms, CmsPage $cmsOriginal) + { + // Steps + $this->cmsPageIndex->open(); + $this->cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cmsOriginal->getTitle()]); + $this->cmsPageNew->getPageForm()->fill($cms); + $this->cmsPageNew->getPageMainActions()->save(); + + return [ + 'cms' => $this->factory->createByCode( + 'cmsPage', + ['data' => array_merge($cmsOriginal->getData(), $cms->getData())] + ) + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..d487f94272c8d1f32efc7679c1e646cb73f99711 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml @@ -0,0 +1,27 @@ +<?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\Cms\Test\TestCase\UpdateCmsPageEntityTest"> + <variation name="UpdateCmsPageEntityTestVariation1"> + <data name="cms/data/title" xsi:type="string">CmsPageEdited%isolation%</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_after_edit</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDisabledOnFrontend" /> + </variation> + <variation name="UpdateCmsPageEntityTestVariation2"> + <data name="cms/data/title" xsi:type="string">CmsPageEdited%isolation%</data> + <data name="cms/data/identifier" xsi:type="string">cms_page_url_edited_%isolation%</data> + <data name="cms/data/content_heading" xsi:type="string">Content Heading TexEdited</data> + <data name="cms/data/content/content" xsi:type="string">cms_page_text_content_after_edit</data> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> + <constraint name="Magento\Cms\Test\Constraint\AssertCmsPagePreview" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d1e65faea3d4e0dced9094619989da641b5f1fcb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php @@ -0,0 +1,157 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Cms\Test\TestCase; + +use Magento\Backend\Test\Page\Adminhtml\StoreDelete; +use Magento\Backend\Test\Page\Adminhtml\StoreIndex; +use Magento\Backend\Test\Page\Adminhtml\StoreNew; +use Magento\UrlRewrite\Test\Fixture\UrlRewrite; +use Magento\UrlRewrite\Test\Page\Adminhtml\UrlRewriteEdit; +use Magento\UrlRewrite\Test\Page\Adminhtml\UrlRewriteIndex; +use Magento\Mtf\TestCase\Injectable; + +/** + * Preconditions: + * 1. Create custom store view. + * 2. Create CMS Page. + * 3. Create CMS Page URL Redirect. + * + * Steps: + * 1. Login to backend as Admin. + * 2. Go to the Marketing-> SEO & Search->URL Redirects. + * 3. Search and open created URL Redirect. + * 4. Fill data according to data set. + * 5. Save Redirect. + * 6. Perform all assertions. + * + * @group URL_Rewrites_(PS) + * @ZephyrId MAGETWO-26173 + */ +class UpdateCmsPageRewriteEntityTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const DOMAIN = 'PS'; + /* end tags */ + + /** + * Url rewrite index page. + * + * @var UrlRewriteIndex + */ + protected $urlRewriteIndex; + + /** + * Url rewrite edit page. + * + * @var UrlRewriteEdit + */ + protected $urlRewriteEdit; + + /** + * Page StoreIndex. + * + * @var StoreIndex + */ + protected $storeIndex; + + /** + * Page StoreNew. + * + * @var StoreNew + */ + protected $storeNew; + + /** + * Page StoreDelete. + * + * @var StoreDelete + */ + protected $storeDelete; + + /** + * Store Name. + * + * @var string + */ + protected $storeName; + + /** + * Skipped stores for tearDown. + * + * @var array + */ + protected $skippedStores = [ + 'Main Website/Main Website Store/Default Store View', + ]; + + /** + * Inject pages. + * + * @param UrlRewriteIndex $urlRewriteIndex + * @param UrlRewriteEdit $urlRewriteEdit + * @param StoreIndex $storeIndex + * @param StoreNew $storeNew + * @param StoreDelete $storeDelete + * @return void + */ + public function __inject( + UrlRewriteIndex $urlRewriteIndex, + UrlRewriteEdit $urlRewriteEdit, + StoreIndex $storeIndex, + StoreNew $storeNew, + StoreDelete $storeDelete + ) { + $this->urlRewriteIndex = $urlRewriteIndex; + $this->urlRewriteEdit = $urlRewriteEdit; + $this->storeIndex = $storeIndex; + $this->storeNew = $storeNew; + $this->storeDelete = $storeDelete; + } + + /** + * Update CMS page rewrites. + * + * @param UrlRewrite $urlRewrite + * @param UrlRewrite $cmsPageRewrite + * @return array + */ + public function test(UrlRewrite $urlRewrite, UrlRewrite $cmsPageRewrite) + { + // Preconditions + $cmsPageRewrite->persist(); + + // Steps + $this->urlRewriteIndex->open(); + $this->storeName = $urlRewrite->getStoreId(); + $filter = ['request_path' => $cmsPageRewrite->getRequestPath()]; + $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen($filter); + $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite); + $this->urlRewriteEdit->getPageMainActions()->save(); + + return ['cmsPage' => $cmsPageRewrite->getDataFieldConfig('target_path')['source']->getEntity()]; + } + + /** + * Delete Store after test. + * + * @return void|null + */ + public function tearDown() + { + if (in_array($this->storeName, $this->skippedStores)) { + return; + } + $storeName = explode("/", $this->storeName); + $filter['store_title'] = end($storeName); + $this->storeIndex->open(); + $this->storeIndex->getStoreGrid()->searchAndOpen($filter); + $this->storeNew->getFormPageActions()->delete(); + $this->storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']); + $this->storeDelete->getFormPageActions()->delete(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..ebf6cc9116491916eb95a74a55217360e6987cc9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml @@ -0,0 +1,38 @@ +<?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\Cms\Test\TestCase\UpdateCmsPageRewriteEntityTest"> + <variation name="UpdateCmsPageRewriteEntityTestVariation1"> + <data name="cmsPageRewrite/dataSet" xsi:type="string">cms_default_no_redirect</data> + <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/%default%</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> + <data name="urlRewrite/data/description" xsi:type="string">test_description_custom_store</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + <variation name="UpdateCmsPageRewriteEntityTestVariation2"> + <data name="cmsPageRewrite/dataSet" xsi:type="string">cms_default_temporary_redirect</data> + <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.html</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> + <data name="urlRewrite/data/description" xsi:type="string">test description_302</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + <variation name="UpdateCmsPageRewriteEntityTestVariation3"> + <data name="cmsPageRewrite/dataSet" xsi:type="string">cms_default_permanent_redirect</data> + <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> + <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.htm</data> + <data name="urlRewrite/data/redirect_type" xsi:type="string">Permanent (301)</data> + <data name="urlRewrite/data/description" xsi:type="string">test description_301</data> + <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSaveMessage" /> + <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml new file mode 100644 index 0000000000000000000000000000000000000000..1827e66341e7b0e3aa9d47e1464576a79e3010ee --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <preference for="\Magento\Cms\Test\Handler\CmsPage\CmsPageInterface" type="\Magento\Cms\Test\Handler\CmsPage\Curl" /> + <preference for="\Magento\Cms\Test\Handler\CmsBlock\CmsBlockInterface" type="\Magento\Cms\Test\Handler\CmsBlock\Curl" /> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml new file mode 100644 index 0000000000000000000000000000000000000000..8b297f22903f1ff3ba003043921d6e77f160dc4c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml @@ -0,0 +1,29 @@ +<?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="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <type name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage"> + <arguments> + <argument name="severity" xsi:type="string">high</argument> + </arguments> + </type> + <type name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage"> + <arguments> + <argument name="severity" xsi:type="string">high</argument> + </arguments> + </type> + <type name="Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage"> + <arguments> + <argument name="severity" xsi:type="string">high</argument> + </arguments> + </type> + <type name="Magento\Cms\Test\Constraint\AssertCmsBlockDeleteMessage"> + <arguments> + <argument name="severity" xsi:type="string">high</argument> + </arguments> + </type> +</config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php index e00f4e4e90f074166f810256dec43f444b382683..fe8b0dca7a593758f1b5ea59cf691ac080665e3e 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php @@ -715,6 +715,50 @@ class ConfigurableAttributesData implements FixtureInterface ], ], ], + + 'two_variations_with_fixed_price' => [ + 'attributes_data' => [ + 'attribute_key_0' => [ + 'options' => [ + 'option_key_0' => [ + 'label' => 'option_key_1_%isolation%', + 'pricing_value' => 1, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + 'option_key_1' => [ + 'label' => 'option_2_%isolation%', + 'pricing_value' => 2, + 'is_percent' => 'No', + 'include' => 'Yes', + ], + ], + ], + ], + 'attributes' => [ + 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', + ], + 'products' => [ + 'attribute_key_0:option_key_0' => 'catalogProductSimple::product_without_category', + 'attribute_key_0:option_key_1' => 'catalogProductSimple::product_without_category', + ], + 'matrix' => [ + 'attribute_key_0:option_key_0' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 100, + ], + 'weight' => 1, + ], + 'attribute_key_0:option_key_1' => [ + 'display' => 'Yes', + 'quantity_and_stock_status' => [ + 'qty' => 200, + ], + 'weight' => 1, + ], + ], + ], ]; /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml index 1e716ac2f3b163505ebd14af8596f7122fe98470..fa36f1aef661ab28d1eceace46b405d40e263af9 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml @@ -275,6 +275,31 @@ </field> </dataset> + <dataset name="two_variations_with_fixed_price"> + <field name="name" xsi:type="string">Configurable product %isolation%</field> + <field name="url_key" xsi:type="string">test-configurable-product-%isolation%</field> + <field name="sku" xsi:type="string">sku_configurable_product_%isolation%</field> + <field name="price" xsi:type="array"> + <item name="value" xsi:type="string">10</item> + </field> + <field name="tax_class_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">taxable_goods</item> + </field> + <field name="weight" xsi:type="string">1</field> + <field name="website_ids" xsi:type="array"> + <item name="0" xsi:type="string">Main Website</item> + </field> + <field name="configurable_attributes_data" xsi:type="array"> + <item name="preset" xsi:type="string">two_variations_with_fixed_price</item> + </field> + <field name="attribute_set_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">custom_attribute_set</item> + </field> + <field name="checkout_data" xsi:type="array"> + <item name="preset" xsi:type="string">two_options_by_one_dollar</item> + </field> + </dataset> + <dataset name="filterable_two_options_with_zero_price"> <field name="name" xsi:type="string">Test configurable product %isolation%</field> <field name="sku" xsi:type="string">sku_test_configurable_product_%isolation%</field> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml index 5d9a0ef2c098102b6d7ef447d7dde0eeffb6612b..1605e59d91b2e1636c387ee812bc02049bb5d042 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml @@ -5,156 +5,130 @@ * 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\ConfigurableProduct\Test\TestCase\CreateConfigurableProductEntityTest"> - <variation name="CreateConfigurableProductEntityTestVariation1" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with category and two new options</data> - <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_new_options</data> - <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> - <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> - <data name="product/data/tax_class_id" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/short_description" xsi:type="string">Configurable short description</data> - <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">2</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <data name="tag" xsi:type="string">Bug: MTA-1616</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately"/> - </variation> - <variation name="CreateConfigurableProductEntityTestVariation2" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with two options</data> - <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_options</data> - <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> - <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> - <data name="product/data/tax_class_id" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Configurable short description</data> - <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">2</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> - </variation> - <variation name="CreateConfigurableProductEntityTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with special price</data> - <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_new_options_with_special_price</data> - <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> - <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> - <data name="product/data/tax_class_id" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/special_price" xsi:type="string">10</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Configurable short description</data> - <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">2</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <data name="issue" xsi:type="string">Bug: MTA-1616</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage"/> - </variation> - <variation name="CreateConfigurableProductEntityTestVariation4" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create product with assigned products to options</data> - <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options_with_assigned_product</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_options_with_assigned_product</data> - <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> - <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> - <data name="product/data/tax_class_id" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">Configurable short description</data> - <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> - <data name="product/data/weight" xsi:type="string">2</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> - </variation> - <variation name="CreateConfigurableProductEntityTestVariation5" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12620: Create Configurable Product and Assign it to Category</data> - <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options_with_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> - <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> - <data name="product/data/tax_class_id" xsi:type="string">Taxable Goods</data> - <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/category_ids/new_category" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">1</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" next="Magento\Catalog\Test\Constraint\AssertProductInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" next="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - </variation> - <variation name="CreateConfigurableProductEntityTestVariation6" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)</data> - <data name="product/data/url_key" xsi:type="string">-</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_searchable_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> - <data name="product/data/sku" xsi:type="string">-</data> - <data name="product/data/tax_class_id" xsi:type="string">-</data> - <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/special_price" xsi:type="string">-</data> - <data name="product/data/category_ids/new_category" xsi:type="string">no</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <data name="tag" xsi:type="string">test_type:acceptance_test</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm" next="Magento\Catalog\Test\Constraint\AssertProductInCategory" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" next="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" prev="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> - <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> - </variation> - </testCase> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> + <testCase name="Magento\ConfigurableProduct\Test\TestCase\CreateConfigurableProductEntityTest"> + <variation name="CreateConfigurableProductEntityTestVariation1"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34195</data> + <data name="description" xsi:type="string">Create product with category and two new options</data> + <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> + <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> + <data name="product/data/checkout_data/preset" xsi:type="string">two_new_options</data> + <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> + <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">100</data> + <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/short_description" xsi:type="string">Configurable short description</data> + <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">2</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductIsNotDisplayedSeparately"/> + </variation> + <variation name="CreateConfigurableProductEntityTestVariation2"> + <data name="description" xsi:type="string">Create product with two options</data> + <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> + <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options</data> + <data name="product/data/checkout_data/preset" xsi:type="string">two_options</data> + <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> + <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">100</data> + <data name="product/data/short_description" xsi:type="string">Configurable short description</data> + <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">2</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> + <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> + </variation> + <variation name="CreateConfigurableProductEntityTestVariation3"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34195</data> + <data name="description" xsi:type="string">Create product with special price</data> + <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> + <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> + <data name="product/data/checkout_data/preset" xsi:type="string">two_new_options_with_special_price</data> + <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> + <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">100</data> + <data name="product/data/special_price" xsi:type="string">10</data> + <data name="product/data/short_description" xsi:type="string">Configurable short description</data> + <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">2</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage"/> + </variation> + <variation name="CreateConfigurableProductEntityTestVariation4"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34791</data> + <data name="description" xsi:type="string">Create product with assigned products to options</data> + <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> + <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options_with_assigned_product</data> + <data name="product/data/checkout_data/preset" xsi:type="string">two_options_with_assigned_product</data> + <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> + <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">100</data> + <data name="product/data/short_description" xsi:type="string">Configurable short description</data> + <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> + <data name="product/data/weight" xsi:type="string">2</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage"/> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCart"/> + </variation> + <variation name="CreateConfigurableProductEntityTestVariation5"> + <data name="description" xsi:type="string">MAGETWO-12620: Create Configurable Product and Assign it to Category</data> + <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> + <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options_with_fixed_price</data> + <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> + <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> + <data name="product/data/tax_class_id" xsi:type="string">Taxable Goods</data> + <data name="product/data/price/value" xsi:type="string">10</data> + <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/weight" xsi:type="string">1</data> + <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" /> + </variation> + <variation name="CreateConfigurableProductEntityTestVariation6" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34195</data> + <data name="description" xsi:type="string">MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)</data> + <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_searchable_options</data> + <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> + <data name="product/data/price/value" xsi:type="string">100</data> + <data name="product/data/category_ids/new_category" xsi:type="string">no</data> + <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/DuplicateProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/DuplicateProductEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..b5586d999f7e304d0904c33329d82aa18265a962 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/DuplicateProductEntityTest.xml @@ -0,0 +1,19 @@ +<?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\Catalog\Test\TestCase\Product\DuplicateProductEntityTest"> + <variation name="DuplicateProductEntityTestVariation2" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> + <data name="productType" xsi:type="string">configurableProduct::default</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductDuplicateMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateMessage" next="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductDuplicateForm" /> + <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductDuplicateForm" next="Magento\Catalog\Test\Constraint\AssertProductDuplicatedInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicatedInGrid" next="Magento\Catalog\Test\Constraint\AssertProductDuplicateIsNotDisplayingOnFrontend" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateIsNotDisplayingOnFrontend" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml index c74b44ab0638b04e6c138b7221085ea3c3b2bc9a..943de11174926b759bd97566f7d1b5b4a8cf80f5 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml @@ -50,7 +50,6 @@ <data name="updatedProduct/data/weight" xsi:type="string">3</data> <data name="updatedProduct/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="updatedProduct/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> - <data name="issue" xsi:type="string">Bug: MTA-1616</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> @@ -75,7 +74,6 @@ <data name="updatedProduct/data/weight" xsi:type="string">3</data> <data name="updatedProduct/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="updatedProduct/data/affected_attribute_set" xsi:type="string">-</data> - <data name="issue" xsi:type="string">Bug: MTA-1616</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php index 5289324d5c8377aea222a69ccb60460ac98aa397..7fe761407b715695ee64edd96ca42fa1b1d69292 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestStep/UpdateConfigurableProductStep.php @@ -72,7 +72,7 @@ class UpdateConfigurableProductStep implements TestStepInterface CatalogProductEdit $catalogProductEdit, ConfigurableProduct $product, ConfigurableProduct $updatedProduct, - $attributeTypeAction + $attributeTypeAction = '' ) { $this->fixtureFactory = $fixtureFactory; $this->catalogProductEdit = $catalogProductEdit; diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..2cff21bd91adf22b55288d661c274e7588bb7e4e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,21 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest20"> + <data name="menuItem" xsi:type="string">Stores > Currency Rates</data> + <data name="pageTitle" xsi:type="string">Currency Rates</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest21"> + <data name="menuItem" xsi:type="string">Stores > Currency Symbols</data> + <data name="pageTitle" xsi:type="string">Currency Symbols</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesDefault.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesDefault.php index 056a514f08295d8693cc8c0d55c0515a4e4e8e49..0de0e9658a1e7362d2cefb0012e0435a186ee627 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesDefault.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesDefault.php @@ -19,7 +19,7 @@ class AddressesDefault extends Block * * @var string */ - protected $changeBillingAddressSelector = '.box-billing-address a'; + protected $changeBillingAddressSelector = '.box-address-billing a'; /** * Click on address book menu item diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml index 6cb8e9be7977dea87d5df2064d352578d2430a91..d5afd5538951e8d4ecddcfaaeb6820c742ce3e04 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml @@ -10,6 +10,9 @@ <dataset name="default"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> + <field name="group_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">General</item> + </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> 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 7e8cfe0865fd63cf4578bf6d565656402f5087e1..b42c48cbb8013423b8dd0e502972d240387331b5 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 @@ -31,7 +31,8 @@ class Curl extends AbstractCurl implements CustomerInterface */ protected $mappingData = [ 'country_id' => [ - 'United States' => 'US' + 'United States' => 'US', + 'United Kingdom' => 'GB' ], 'region_id' => [ 'California' => 12, @@ -57,6 +58,16 @@ class Curl extends AbstractCurl implements CustomerInterface ] ]; + /** + * Fields that have to be send using update curl. + * + * @var array + */ + protected $fieldsToUpdate = [ + 'address', + 'group_id', + ]; + /** * Post request for creating customer in frontend * @@ -91,8 +102,8 @@ class Curl extends AbstractCurl implements CustomerInterface if (!empty($address)) { $data['address'] = $address; - $this->addAddress($data); } + $this->updateCustomer($data); return $result; } @@ -130,16 +141,21 @@ class Curl extends AbstractCurl implements CustomerInterface } /** - * Add addresses in to customer account + * Update customer fields that can not be added at creation step. + * - address + * - group_id * * @param array $data * @return void * @throws \Exception */ - protected function addAddress(array $data) + protected function updateCustomer(array $data) { + $result = array_intersect($this->fieldsToUpdate, array_keys($data)); + if (empty($result)) { + return; + } $curlData = []; - $url = $_ENV['app_backend_url'] . 'customer/index/save/id/' . $data['customer_id']; foreach ($data as $key => $value) { foreach ($this->curlMapping as $prefix => $prefixValues) { if (in_array($key, $prefixValues)) { @@ -151,15 +167,18 @@ class Curl extends AbstractCurl implements CustomerInterface unset($data['password'], $data['password_confirmation']); $curlData = $this->replaceMappingData(array_merge($curlData, $data)); - $curlData = $this->prepareAddressData($curlData); + if (!empty($data['address'])) { + $curlData = $this->prepareAddressData($curlData); + } + $url = $_ENV['app_backend_url'] . 'customer/index/save/id/' . $data['customer_id']; $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); $curl->write(CurlInterface::POST, $url, '1.0', [], $curlData); $response = $curl->read(); $curl->close(); if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception('Failed to assign an address to the customer!'); + throw new \Exception('Failed to update customer!'); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php index 225aa4a5660264f6bdbfdac873c776f1c970ceff..90b432c8d47acde1326078a623e26c5389675c07 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Address/DefaultAddress.php @@ -26,7 +26,7 @@ class DefaultAddress extends Page * * @var string */ - protected $defaultAddressesSelector = '.block-addresses-default .box-billing-address'; + protected $defaultAddressesSelector = '.block-addresses-default'; /** * Get default addresses block 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 37b655390419d33bf60bbb5bb749efee2338ac96..3510a9b9750299ed9a985447233748352d2f66b0 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 @@ -149,6 +149,22 @@ <field name="fax" xsi:type="string">444-44-444-44</field> </dataset> + <dataset name="address_UK_default_billing_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> + <field name="company" xsi:type="string">Magento %isolation%</field> + <field name="city" xsi:type="string">London</field> + <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" 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> 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 1649cb7b9e41132872563d569e85628dc5b8d5a3..eeea09970da769ab9eb00d22491aa9b4d6937999 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 @@ -18,6 +18,17 @@ <field name="password_confirmation" xsi:type="string">123123q</field> </dataset> + <dataset name="customer_with_new_customer_group"> + <field name="firstname" xsi:type="string">John</field> + <field name="lastname" xsi:type="string">Doe</field> + <field name="group_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">customer_group_retail_customer</item> + </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="johndoe"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> @@ -183,5 +194,16 @@ <item name="presets" xsi:type="string">address_UK</item> </field> </dataset> + + <dataset name="customer_UK_1_default_billing_address"> + <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_default_billing_address</item> + </field> + </dataset> </repository> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroupInjectable.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroupInjectable.xml index ed4fa8d8b49ebb0960141fbd1b87a5bedbeae5e6..0ac1bbdda5d592747ead4826b8cf9242c933cf1e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroupInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroupInjectable.xml @@ -43,5 +43,12 @@ <item name="dataSet" xsi:type="string">retail_customer</item> </field> </dataset> + + <dataset name="customer_group_retail_customer"> + <field name="customer_group_code" xsi:type="string">Customer_group_%isolation%</field> + <field name="tax_class_id" xsi:type="array"> + <item name="dataSet" xsi:type="string">retail_customer</item> + </field> + </dataset> </repository> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml index 39290c7f86b8a8f127afaed30ec458ab058c4e14..a939641976d0a71b01f4a743d0d57eb171c3316f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml @@ -8,14 +8,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\CreateCustomerGroupEntityTest"> <variation name="CreateCustomerGroupEntityTestVariation1"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">Retail Customer</data> + <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail_customer</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">GroupName%isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupOnCustomerForm"/> </variation> <variation name="CreateCustomerGroupEntityTestVariation2"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">Retail Customer</data> + <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail_customer</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">General</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupAlreadyExists"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php index 36cb46a29b4eed4f0716feecbbf02149c5a61f7a..a2fdc4922e7a127cb958d10787802e0807ff3429 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.php @@ -13,21 +13,17 @@ use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for DeleteCustomerAddress - * - * Test Flow: - * * Preconditions: - * 1. Create customer - * 2. Add default address (NY) - * 3. Add one more address (CA) + * 1. Create customer. + * 2. Add default address (NY). + * 3. Add one more address (CA). * * Steps: - * 1. Open frontend - * 2. Login as customer - * 3. Go to 'Address Book' tab > Additional Address Entries - * 4. Delete second address - click 'Delete Address' button - * 5. Perform all assertions + * 1. Open frontend. + * 2. Login as customer. + * 3. Go to 'Address Book' tab > Additional Address Entries. + * 4. Delete second address - click 'Delete Address' button. + * 5. Perform all assertions. * * @group Customers_(CS) * @ZephyrId MAGETWO-28066 @@ -40,28 +36,28 @@ class DeleteCustomerAddressTest extends Injectable /* end tags */ /** - * Cms index page + * Cms index page. * * @var CmsIndex */ protected $cmsIndex; /** - * Customer login page + * Customer login page. * * @var CustomerAccountLogin */ protected $customerAccountLogin; /** - * Customer index page + * Customer index page. * * @var CustomerAccountIndex */ protected $customerAccountIndex; /** - * Prepare pages for test + * Prepare pages for test. * * @param CustomerAccountLogin $customerAccountLogin * @param CmsIndex $cmsIndex @@ -79,13 +75,14 @@ class DeleteCustomerAddressTest extends Injectable } /** - * Runs Delete Customer Address test + * Runs Delete Customer Address test. * * @param Customer $customer * @return array */ public function test(Customer $customer) { + $this->markTestIncomplete('Bug: MAGETWO-34634'); // Precondition: $customer->persist(); $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1]; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..a8b352b7514ee376f664f20cb9958c70d351ae18 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,26 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest22"> + <data name="menuItem" xsi:type="string">Customers > All Customers</data> + <data name="pageTitle" xsi:type="string">Customers</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest23"> + <data name="menuItem" xsi:type="string">Customers > Now Online</data> + <data name="pageTitle" xsi:type="string">Customers Now Online</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest24"> + <data name="menuItem" xsi:type="string">Stores > Customer Groups</data> + <data name="pageTitle" xsi:type="string">Customer Groups</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml index 84116576ab62ef13b0ab3fbd272e35a1b94eb6ca..198270813fc12df42be6cae0e92cbdce385bd16b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.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\UpdateCustomerGroupEntityTest"> <variation name="UpdateCustomerGroupEntityTestVariation1"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail Customer</data> + <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail_customer</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">GroupName%isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php index 745b576a528abc0e4c0543bc6855563d69f68055..b305528390cf0b200c7d867450459f2af2e3d576 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php @@ -61,7 +61,7 @@ class LoginCustomerOnFrontendStep implements TestStepInterface public function run() { $this->cmsIndex->open(); - $this->cmsIndex->getLinksBlock()->waitWelcomeMessage(); + $this->cmsIndex->getCmsPageBlock()->waitPageInit(); if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) { $this->cmsIndex->getLinksBlock()->openLink("Log Out"); $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php index 57fb8c5d9527d6aef60e7d82d67b317bea811a58..8e3861485f44756cd873591898ba6a2aafc30b4f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php @@ -39,6 +39,7 @@ class LogoutCustomerOnFrontendStep implements TestStepInterface public function run() { $this->cmsIndex->open(); + $this->cmsIndex->getCmsPageBlock()->waitPageInit(); if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) { $this->cmsIndex->getLinksBlock()->openLink("Log Out"); $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php index a68a64dc05794cd5046a5e82ab72023bad9d200e..e620a4ca4ac6ad2617a4a0f45492358fc05f0be5 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php @@ -29,7 +29,7 @@ class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\Ch 'options' => [ 'links' => [ [ - 'label' => 'link_1', + 'label' => 'link_0', 'value' => 'Yes', ], ], @@ -43,11 +43,11 @@ class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\Ch 'options' => [ 'links' => [ [ - 'label' => 'link_1', + 'label' => 'link_0', 'value' => 'Yes', ], [ - 'label' => 'link_2', + 'label' => 'link_1', 'value' => 'Yes' ], ], @@ -75,7 +75,7 @@ class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\Ch 'options' => [ 'links' => [ [ - 'label' => 'link_1', + 'label' => 'link_0', 'value' => 'Yes', ], ], @@ -92,7 +92,7 @@ class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\Ch ], 'links' => [ [ - 'label' => 'link_1', + 'label' => 'link_0', 'value' => 'Yes' ] ], diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/DuplicateProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/DuplicateProductEntityTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..1409e9a0d2f08893d5f2422654ca1cdd2e2b3fc4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/DuplicateProductEntityTest.xml @@ -0,0 +1,19 @@ +<?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\Catalog\Test\TestCase\Product\DuplicateProductEntityTest"> + <variation name="DuplicateProductEntityTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> + <data name="productType" xsi:type="string">downloadableProduct::default</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductDuplicateMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateMessage" next="Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm" /> + <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm" next="Magento\Catalog\Test\Constraint\AssertProductDuplicatedInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicatedInGrid" next="Magento\Catalog\Test\Constraint\AssertProductDuplicateIsNotDisplayingOnFrontend" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductDuplicateIsNotDisplayingOnFrontend" /> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..dccd3aa8972084cc1b05ed09a0705658446203d1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest29"> + <data name="menuItem" xsi:type="string">Marketing > Email Templates</data> + <data name="pageTitle" xsi:type="string">Email Templates</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index 4d111e4a6f603754f3ce8fed33d09ee0950b8fa8..a9a17c123c4c1b44d43312727d49111b29735da7 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -10,7 +10,7 @@ use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Sales\Test\Page\OrderHistory; -use Magento\Sales\Test\Page\SalesOrderView; +use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -25,7 +25,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint * @param GiftMessage $giftMessage * @param Customer $customer * @param OrderHistory $orderHistory - * @param SalesOrderView $salesOrderView + * @param CustomerOrderView $customerOrderView * @param CustomerAccountLogout $customerAccountLogout * @param string $orderId * @param array $products @@ -35,7 +35,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint GiftMessage $giftMessage, Customer $customer, OrderHistory $orderHistory, - SalesOrderView $salesOrderView, + CustomerOrderView $customerOrderView, CustomerAccountLogout $customerAccountLogout, $orderId, $products = [] @@ -64,7 +64,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint } \PHPUnit_Framework_Assert::assertEquals( $expectedData, - $salesOrderView->getGiftMessageForItemBlock()->getGiftMessage($product->getName()), + $customerOrderView->getGiftMessageForItemBlock()->getGiftMessage($product->getName()), 'Wrong gift message is displayed on "' . $product->getName() . '" item.' ); } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/scenario.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/scenario.xml deleted file mode 100644 index 10cedb90faf834d7390a7d9176672135b79e70c5..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/scenario.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<scenarios xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Config/etc/scenario.xsd"> - <scenario name="CheckoutWithGiftMessagesTest" module="Magento_GiftMessage"> - <methods> - <method name="test"> - <steps> - <first>setupConfiguration</first> - <step name="setupConfiguration" module="Magento_Core"> - <arguments> - <item name="configData">cashondelivery, enable_gift_messages</item> - </arguments> - <next>createProducts</next> - </step> - <step name="createProducts" module="Magento_Catalog"> - <next>createCustomer</next> - </step> - <step name="createCustomer" module="Magento_Customer"> - <next>loginCustomerOnFrontend</next> - </step> - <step name="loginCustomerOnFrontend" module="Magento_Customer"> - <next>addProductsToTheCart</next> - </step> - <step name="addProductsToTheCart" module="Magento_Checkout"> - <next>proceedToCheckout</next> - </step> - <step name="proceedToCheckout" module="Magento_Checkout"> - <next>fillBillingInformation</next> - </step> - <step name="fillBillingInformation" module="Magento_Checkout"> - <next>fillShippingMethod</next> - </step> - <step name="addGiftMessage" module="Magento_GiftMessage"> - <next>fillShippingMethod</next> - </step> - <step name="fillShippingMethod" module="Magento_Checkout"> - <next>selectPaymentMethod</next> - </step> - <step name="selectPaymentMethod" module="Magento_Checkout"> - <next>placeOrder</next> - </step> - <step name="placeOrder" module="Magento_Checkout" /> - </steps> - </method> - </methods> - </scenario> - <scenario name="CreateGiftMessageOnBackendTest" module="Magento_GiftMessage"> - <methods> - <method name="test"> - <steps> - <first>setupConfiguration</first> - <step name="setupConfiguration" module="Magento_Core"> - <arguments> - <item name="configData">cashondelivery, enable_gift_messages</item> - </arguments> - <next>createProducts</next> - </step> - <step name="createProducts" module="Magento_Catalog"> - <next>createCustomer</next> - </step> - <step name="createCustomer" module="Magento_Customer"> - <arguments> - <items name="customer"> - <item name="dataSet">johndoe_with_addresses</item> - </items> - </arguments> - <next>openSalesOrders</next> - </step> - <step name="openSalesOrders" module="Magento_Sales"> - <next>createNewOrder</next> - </step> - <step name="createNewOrder" module="Magento_Sales"> - <next>selectCustomerOrder</next> - </step> - <step name="selectCustomerOrder" module="Magento_Sales"> - <next>selectStore</next> - </step> - <step name="selectStore" module="Magento_Sales"> - <next>addProducts</next> - </step> - <step name="addProducts" module="Magento_Sales"> - <next>addGiftMessageBackend</next> - </step> - <step name="addGiftMessageBackend" module="Magento_GiftMessage"> - <next>fillBillingAddress</next> - </step> - <step name="fillBillingAddress" module="Magento_Sales"> - <next>selectPaymentMethodForOrder</next> - </step> - <step name="selectPaymentMethodForOrder" module="Magento_Sales"> - <next>selectShippingMethodForOrder</next> - </step> - <step name="selectShippingMethodForOrder" module="Magento_Sales"> - <next>submitOrder</next> - </step> - <step name="submitOrder" module="Magento_Sales" /> - </steps> - </method> - </methods> - </scenario> -</scenarios> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml index 06784435184291fa7692da85704268f3401f4a3d..44be0fed9e25d120a412c63d54967587ab3d184a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml @@ -6,40 +6,40 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/TestCase/etc/testcase.xsd"> - <scenario name="CheckoutWithGiftMessagesTest" firstStep="setupConfiguration"> - <step name="setupConfiguration" module="Magento_Core" next="createProducts"> - <item name="configData" value="cashondelivery, enableGiftMessages"/> - </step> - <step name="createProducts" module="Magento_Catalog" next="createCustomer"/> - <step name="createCustomer" module="Magento_Customer" next="loginCustomerOnFrontend"/> - <step name="loginCustomerOnFrontend" module="Magento_Customer" next="addProductsToTheCart"/> - <step name="addProductsToTheCart" module="Magento_Checkout" next="proceedToCheckout"/> - <step name="proceedToCheckout" module="Magento_Checkout" next="fillBillingInformation"/> - <step name="fillBillingInformation" module="Magento_Checkout" next="fillShippingMethod"/> - <step name="addGiftMessage" module="Magento_GiftMessage" next="fillShippingMethod"/> - <step name="fillShippingMethod" module="Magento_Checkout" next="selectPaymentMethod"/> - <step name="selectPaymentMethod" module="Magento_Checkout" next="placeOrder"/> - <step name="placeOrder" module="Magento_Checkout"/> - </scenario> - <scenario name="CreateGiftMessageOnBackendTest" firstStep="setupConfiguration"> - <step name="setupConfiguration" module="Magento_Core" next="createProducts"> - <item name="configData" value="cashondelivery, enableGiftMessages"/> - </step> - <step name="createProducts" module="Magento_Catalog" next="createCustomer"/> - <step name="createCustomer" module="Magento_Customer" next="openSalesOrders"> - <item name="customer"> - <item name="dataSet" value="johndoe_with_addresses"/> - </item> - </step> - <step name="openSalesOrders" module="Magento_Sales" next="createNewOrder"/> - <step name="createNewOrder" module="Magento_Sales" next="selectCustomerOrder"/> - <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore"/> - <step name="selectStore" module="Magento_Sales" next="addProducts"/> - <step name="addProducts" module="Magento_Sales" next="addGiftMessageBackend"/> - <step name="addGiftMessageBackend" module="Magento_GiftMessage" next="fillBillingAddress"/> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"/> - <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder"/> - <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder"/> - <step name="submitOrder" module="Magento_Sales"/> - </scenario> + <scenario name="CheckoutWithGiftMessagesTest" firstStep="setupConfiguration"> + <step name="setupConfiguration" module="Magento_Core" next="createProducts"> + <item name="configData" value="cashondelivery, enable_gift_messages" /> + </step> + <step name="createProducts" module="Magento_Catalog" next="createCustomer" /> + <step name="createCustomer" module="Magento_Customer" next="loginCustomerOnFrontend" /> + <step name="loginCustomerOnFrontend" module="Magento_Customer" next="addProductsToTheCart" /> + <step name="addProductsToTheCart" module="Magento_Checkout" next="proceedToCheckout" /> + <step name="proceedToCheckout" module="Magento_Checkout" next="fillBillingInformation" /> + <step name="fillBillingInformation" module="Magento_Checkout" next="addGiftMessage" /> + <step name="addGiftMessage" module="Magento_GiftMessage" next="fillShippingMethod" /> + <step name="fillShippingMethod" module="Magento_Checkout" next="selectPaymentMethod" /> + <step name="selectPaymentMethod" module="Magento_Checkout" next="placeOrder" /> + <step name="placeOrder" module="Magento_Checkout" /> + </scenario> + <scenario name="CreateGiftMessageOnBackendTest" firstStep="setupConfiguration"> + <step name="setupConfiguration" module="Magento_Core" next="createProducts"> + <item name="configData" value="cashondelivery, enable_gift_messages" /> + </step> + <step name="createProducts" module="Magento_Catalog" next="createCustomer" /> + <step name="createCustomer" module="Magento_Customer" next="openSalesOrders"> + <item name="customer"> + <item name="dataSet" value="johndoe_with_addresses" /> + </item> + </step> + <step name="openSalesOrders" module="Magento_Sales" next="createNewOrder" /> + <step name="createNewOrder" module="Magento_Sales" next="selectCustomerOrder" /> + <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore" /> + <step name="selectStore" module="Magento_Sales" next="addProducts" /> + <step name="addProducts" module="Magento_Sales" next="addGiftMessageBackend" /> + <step name="addGiftMessageBackend" module="Magento_GiftMessage" next="fillBillingAddress" /> + <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> + <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder" /> + <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" /> + <step name="submitOrder" module="Magento_Sales" /> + </scenario> </config> diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..528dc68a50b1ca268c00da11e502a530592fff3b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,21 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest33"> + <data name="menuItem" xsi:type="string">Products > Attributes</data> + <data name="pageTitle" xsi:type="string">Google Content Attributes</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest34"> + <data name="menuItem" xsi:type="string">Products > Items</data> + <data name="pageTitle" xsi:type="string">Google Content Items</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php index e7605924ad25889e630046ccac227fab7528dc1c..0a883fed4545d3f2d6eab56bd8e495b3fe549729 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php @@ -12,10 +12,6 @@ use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for Update GroupedProductEntity - * - * Test Flow: - * * Preconditions: * 1. Create Grouped Product. * @@ -38,21 +34,21 @@ class UpdateGroupedProductEntityTest extends Injectable /* end tags */ /** - * Page product on backend + * Page product on backend. * * @var CatalogProductIndex */ protected $catalogProductIndex; /** - * Edit page on backend + * Edit page on backend. * * @var CatalogProductEdit */ protected $catalogProductEdit; /** - * Filling objects of the class + * Filling objects of the class. * * @param CatalogProductIndex $catalogProductIndexNewPage * @param CatalogProductEdit $catalogProductEditPage @@ -67,7 +63,7 @@ class UpdateGroupedProductEntityTest extends Injectable } /** - * Test update grouped product + * Test update grouped product. * * @param GroupedProduct $product * @param GroupedProduct $originalProduct diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml index dd1f2144e4e3f9fd9c606ff96d7e9866fd79b27a..cc918d24c96e699998e7896553dc3d225ebe8250 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml @@ -6,78 +6,59 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\GroupedProduct\Test\TestCase\UpdateGroupedProductEntityTest"> - <variation name="UpdateGroupedProductEntityTestVariation1"> - <data name="originalProduct/dataSet" xsi:type="string">grouped_product_out_of_stock</data> - <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category_ids/presets" xsi:type="string">category_%isolation%</data> - <data name="product/data/associated/products" xsi:type="string">-</data> - <data name="product/data/associated/preset" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">This is edited description for grouped product</data> - <data name="product/data/short_description" xsi:type="string">This is edited short description for grouped product</data> - <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="UpdateGroupedProductEntityTestVariation2"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> - <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductVirtual::default,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/associated/preset" xsi:type="string">defaultVirtualProduct</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm"/> - </variation> - <variation name="UpdateGroupedProductEntityTestVariation3"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> - <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::default</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct_without_qty</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm"/> - </variation> - <variation name="UpdateGroupedProductEntityTestVariation4"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> - <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct_with_specialPrice</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage"/> - </variation> - <variation name="UpdateGroupedProductEntityTestVariation5" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> - <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">-</data> - <data name="product/data/associated/preset" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductOutOfStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - </testCase> + <testCase name="Magento\GroupedProduct\Test\TestCase\UpdateGroupedProductEntityTest"> + <variation name="UpdateGroupedProductEntityTestVariation1"> + <data name="originalProduct/dataSet" xsi:type="string">grouped_product_out_of_stock</data> + <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category_ids/presets" xsi:type="string">category_%isolation%</data> + <data name="product/data/description" xsi:type="string">This is edited description for grouped product</data> + <data name="product/data/short_description" xsi:type="string">This is edited short description for grouped product</data> + <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="UpdateGroupedProductEntityTestVariation2"> + <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductVirtual::default,catalogProductVirtual::product_50_dollar</data> + <data name="product/data/associated/preset" xsi:type="string">defaultVirtualProduct</data> + <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> + </variation> + <variation name="UpdateGroupedProductEntityTestVariation3"> + <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::default</data> + <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct_without_qty</data> + <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> + </variation> + <variation name="UpdateGroupedProductEntityTestVariation4"> + <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice</data> + <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct_with_specialPrice</data> + <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage" /> + </variation> + <variation name="UpdateGroupedProductEntityTestVariation5"> + <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> + <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a696047e1e9976dd840d72c6dc53071e494c40 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,21 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest35"> + <data name="menuItem" xsi:type="string">System > Import</data> + <data name="pageTitle" xsi:type="string">Import</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest36"> + <data name="menuItem" xsi:type="string">System > Export</data> + <data name="pageTitle" xsi:type="string">Export</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a1afb249ef8f60fa62a9be36a73c9425e769f8a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest37"> + <data name="menuItem" xsi:type="string">System > Index Management</data> + <data name="pageTitle" xsi:type="string">Index Management</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..ab448ae81e249a63f1fb3eb8937b68536b69e800 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest38"> + <data name="menuItem" xsi:type="string">System > Integrations</data> + <data name="pageTitle" xsi:type="string">Integrations</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php index 23b69f71234439c9db12a7ae60740aaa245affc6..a05c605294479ab13de8186fecd56db3f5240a7f 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php @@ -35,6 +35,7 @@ class ProceedToMultipleAddressCheckoutStep implements TestStepInterface */ public function run() { + $this->checkoutCart->open(); $this->checkoutCart->getMultipleAddressCheckoutBlock()->multipleAddressesCheckout(); } } diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php index 3de754dffa925d1f920b77c079b0df95a6cf63c7..098fff98e7ec599c1de64a2f55908e91005aa090 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php @@ -45,6 +45,9 @@ class Preview extends Block ); $this->browser->switchToFrame(new Locator($this->iFrame)); - return $this->_rootElement->getText(); + $content = $this->_rootElement->getText(); + + $this->browser->switchToFrame(); + return $content; } } diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..b830ba8af1c5d1620cde6a20799b327c06fee910 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.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\NavigateMenuTest"> + <variation name="NavigateMenuTest46"> + <data name="menuItem" xsi:type="string">Marketing > Newsletter Template</data> + <data name="pageTitle" xsi:type="string">Newsletter Templates</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest47"> + <data name="menuItem" xsi:type="string">Marketing > Newsletter Queue</data> + <data name="pageTitle" xsi:type="string">Newsletter Queue</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest48"> + <data name="menuItem" xsi:type="string">Marketing > Newsletter Subscribers</data> + <data name="pageTitle" xsi:type="string">Newsletter Subscribers</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest49"> + <data name="menuItem" xsi:type="string">Reports > Newsletter Problem Reports</data> + <data name="pageTitle" xsi:type="string">Newsletter Problems Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..46bb69f248a90ac90a6f816564fc4e1504af4480 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,86 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest55"> + <data name="menuItem" xsi:type="string">Reports > Products in Cart</data> + <data name="pageTitle" xsi:type="string">Products in Carts</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest56"> + <data name="menuItem" xsi:type="string">Reports > Abandoned Carts</data> + <data name="pageTitle" xsi:type="string">Abandoned Carts</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest57"> + <data name="menuItem" xsi:type="string">Reports > Orders</data> + <data name="pageTitle" xsi:type="string">Sales Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest58"> + <data name="menuItem" xsi:type="string">Reports > Tax</data> + <data name="pageTitle" xsi:type="string">Tax Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest59"> + <data name="menuItem" xsi:type="string">Reports > Invoiced</data> + <data name="pageTitle" xsi:type="string">Invoice Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest60"> + <data name="menuItem" xsi:type="string">Reports > Coupons</data> + <data name="pageTitle" xsi:type="string">Coupons Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest61"> + <data name="menuItem" xsi:type="string">Reports > Order Total</data> + <data name="pageTitle" xsi:type="string">Order Total Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest62"> + <data name="menuItem" xsi:type="string">Reports > Order Count</data> + <data name="pageTitle" xsi:type="string">Order Count Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest63"> + <data name="menuItem" xsi:type="string">Reports > New</data> + <data name="pageTitle" xsi:type="string">New Accounts Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest64"> + <data name="menuItem" xsi:type="string">Reports > Views</data> + <data name="pageTitle" xsi:type="string">Product Views Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest65"> + <data name="menuItem" xsi:type="string">Reports > Bestsellers</data> + <data name="pageTitle" xsi:type="string">Best Sellers Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest66"> + <data name="menuItem" xsi:type="string">Reports > Low Stock</data> + <data name="pageTitle" xsi:type="string">Low Stock Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest67"> + <data name="menuItem" xsi:type="string">Reports > Ordered</data> + <data name="pageTitle" xsi:type="string">Ordered Products Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest68"> + <data name="menuItem" xsi:type="string">Reports > Downloads</data> + <data name="pageTitle" xsi:type="string">Downloads Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest69"> + <data name="menuItem" xsi:type="string">Reports > Refresh statistics</data> + <data name="pageTitle" xsi:type="string">Refresh Statistics</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php index f00195c8369134c2a1b2f0862a58684b9bea7aee..f71fd73490e3a6cdebede5f6ffc28436c531e5e5 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php @@ -70,7 +70,7 @@ class NewAccountsReportEntityTest extends Injectable */ public function test(Customer $customer, array $customersReport) { - $this->markTestIncomplete('MAGETWO-26663'); + $this->markTestIncomplete('Bug: MAGETWO-35037'); // Preconditions $this->customerIndexPage->open(); $this->customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All'); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php index a850585fabc198be53980992942c8c1d4a31a29c..b260e667b7fd17172b5c57dcfe38cf95035b39b9 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php @@ -65,7 +65,6 @@ class ViewedProductsReportEntityTest extends Injectable */ public function __prepare(CatalogProductIndex $catalogProductIndexPage) { - $this->markTestIncomplete('Bug: MAGETWO-33029'); $catalogProductIndexPage->open(); $catalogProductIndexPage->getProductGrid()->massaction([], 'Delete', true, 'Select All'); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml index 631230c2956a1f82997324a253d466491cfc3120..b0d0b350efa711f84fc0addab09a1e5dc7b6f95f 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml @@ -6,36 +6,36 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\ViewedProductsReportEntityTest"> - <variation name="ViewedProductsReportEntityTestVariation1"> - <data name="description" xsi:type="string">view products on front and verify they all reflected in Year report</data> - <data name="total" xsi:type="string">2, 1</data> - <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="viewsReport/period_type" xsi:type="string">Year</data> - <data name="viewsReport/from" xsi:type="string">m/d/Y -1 year</data> - <data name="viewsReport/to" xsi:type="string">m/d/Y</data> - <data name="viewsReport/show_empty_rows" xsi:type="string">No</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult"/> - </variation> - <variation name="ViewedProductsReportEntityTestVariation2"> - <data name="description" xsi:type="string">view products on front and verify they all reflected in Month report</data> - <data name="total" xsi:type="string">1, 1</data> - <data name="products" xsi:type="string">downloadableProduct::default, bundleProduct::bundle_dynamic_product</data> - <data name="viewsReport/period_type" xsi:type="string">Month</data> - <data name="viewsReport/from" xsi:type="string">m/d/Y</data> - <data name="viewsReport/to" xsi:type="string">m/d/Y</data> - <data name="viewsReport/show_empty_rows" xsi:type="string">No</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult"/> - </variation> - <variation name="ViewedProductsReportEntityTestVariation3"> - <data name="description" xsi:type="string">view products on front and verify they all reflected in Day report</data> - <data name="total" xsi:type="string">1, 1</data> - <data name="products" xsi:type="string">configurableProduct::default, groupedProduct::default</data> - <data name="viewsReport/period_type" xsi:type="string">Day</data> - <data name="viewsReport/from" xsi:type="string">m/d/Y -1 day</data> - <data name="viewsReport/to" xsi:type="string">m/d/Y +1 day</data> - <data name="viewsReport/show_empty_rows" xsi:type="string">Yes</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\ViewedProductsReportEntityTest"> + <variation name="ViewedProductsReportEntityTestVariation1"> + <data name="description" xsi:type="string">View products on front and verify they all reflected in Year report.</data> + <data name="total" xsi:type="string">1, 1</data> + <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> + <data name="viewsReport/period_type" xsi:type="string">Year</data> + <data name="viewsReport/from" xsi:type="string">m/d/Y -1 year</data> + <data name="viewsReport/to" xsi:type="string">m/d/Y</data> + <data name="viewsReport/show_empty_rows" xsi:type="string">No</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult" /> + </variation> + <variation name="ViewedProductsReportEntityTestVariation2"> + <data name="description" xsi:type="string">View products on front and verify they all reflected in Month report.</data> + <data name="total" xsi:type="string">1, 1</data> + <data name="products" xsi:type="string">downloadableProduct::default, bundleProduct::bundle_dynamic_product</data> + <data name="viewsReport/period_type" xsi:type="string">Month</data> + <data name="viewsReport/from" xsi:type="string">m/d/Y - 1 month</data> + <data name="viewsReport/to" xsi:type="string">m/d/Y</data> + <data name="viewsReport/show_empty_rows" xsi:type="string">No</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult" /> + </variation> + <variation name="ViewedProductsReportEntityTestVariation3"> + <data name="description" xsi:type="string">View products on front and verify they all reflected in Day report.</data> + <data name="total" xsi:type="string">1, 1</data> + <data name="products" xsi:type="string">configurableProduct::default, groupedProduct::default</data> + <data name="viewsReport/period_type" xsi:type="string">Day</data> + <data name="viewsReport/from" xsi:type="string">m/d/Y -1 day</data> + <data name="viewsReport/to" xsi:type="string">m/d/Y +1 day</data> + <data name="viewsReport/show_empty_rows" xsi:type="string">Yes</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php index 6d38c764c63b992e2c806ee104a03f20ac0ac94e..d2042d8a8370e0c044c87d0a688e3e16e8a70ef2 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php @@ -80,16 +80,6 @@ class CreateProductReviewBackendEntityTest extends Injectable */ protected $review; - /** - * Skip test due to a Magento bug. - * - * @return void - */ - public function __prepare() - { - $this->markTestIncomplete('Bug: MAGETWO-33912'); - } - /** * Inject pages into test * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..2c68c7f55f9697e6a31b8f494d3056b1a6e6c345 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.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\NavigateMenuTest"> + <variation name="NavigateMenuTest70"> + <data name="menuItem" xsi:type="string">Marketing > Reviews</data> + <data name="pageTitle" xsi:type="string">Reviews</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest71"> + <data name="menuItem" xsi:type="string">Reports > By Customers</data> + <data name="pageTitle" xsi:type="string">Customer Reviews Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest72"> + <data name="menuItem" xsi:type="string">Reports > By Products</data> + <data name="pageTitle" xsi:type="string">Product Reviews Report</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest73"> + <data name="menuItem" xsi:type="string">Stores > Rating</data> + <data name="pageTitle" xsi:type="string">Ratings</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php index 09919efbd1dba62122652d3e52e1317cd4005028..f402dd1f6273ce61c7acdb242a7ac34495b8fe14 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php @@ -10,48 +10,49 @@ use Magento\Backend\Test\Block\Widget\Grid as GridInterface; use Magento\Mtf\Client\Locator; /** - * Class Grid - * Sales order grid + * Sales order grid. */ class Grid extends GridInterface { /** - * 'Add New' order button + * 'Add New' order button. * * @var string */ protected $addNewOrder = "../*[@class='page-actions']//*[@id='add']"; /** - * Purchase Point Filter selector + * Purchase Point Filter selector. * * @var string */ protected $purchasePointFilter = '//*[@data-ui-id="widget-grid-column-filter-store-0-filter-store-id"]'; /** - * Purchase Point Filter option group elements selector + * Purchase Point Filter option group elements selector. * * @var string */ protected $purchasePointOptGroup = '//*[@data-ui-id="widget-grid-column-filter-store-0-filter-store-id"]/optgroup'; /** - * Order Id td selector + * Order Id td selector. * * @var string */ protected $editLink = 'td[class*=col-action] a'; /** - * First row selector + * First row selector. * * @var string */ protected $firstRowSelector = '//tbody/tr[1]//a'; /** - * {@inheritdoc} + * Filters array mapping. + * + * @var array */ protected $filters = [ 'id' => [ @@ -64,7 +65,7 @@ class Grid extends GridInterface ]; /** - * Start to create new order + * Start to create new order. */ public function addNewOrder() { @@ -72,24 +73,20 @@ class Grid extends GridInterface } /** - * Get selected data from Purchase Point filter + * Get StoreGroup list of Purchase Point on filter. * - * @return string + * @return array */ - public function getPurchasePointFilterText() + public function getPurchasePointStoreGroups() { - return $this->_rootElement->find($this->purchasePointFilter, Locator::SELECTOR_XPATH)->getText(); - } + $storeGroupElements = $this->_rootElement->find($this->purchasePointFilter, Locator::SELECTOR_XPATH) + ->getElements('.//optgroup[./option]', Locator::SELECTOR_XPATH); + $result = []; - /** - * Assert the number of Purchase Point Filter option group elements by checking non-existing group - * - * @param $number - * @return bool - */ - public function assertNumberOfPurchasePointFilterOptionsGroup($number) - { - $selector = $this->purchasePointOptGroup . '[' . ($number + 1) . ']'; - return !$this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->isVisible(); + foreach ($storeGroupElements as $storeGroupElement) { + $result[] = trim($storeGroupElement->getAttribute('label'), ' '); + } + + return $result; } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php index 893bde7b41f364ff54b3e62ea3a2b3f51fe919eb..fda4c7814591b1d4dd2faad01cc954c2dd5300e1 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php @@ -36,8 +36,8 @@ class AssertReorderStatusIsCorrect extends AbstractConstraint $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); \PHPUnit_Framework_Assert::assertEquals( - $salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(), $previousOrderStatus, + $salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(), 'Order status is incorrect on order page in backend.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..0278a74760af2adf5f5a107e7f79fdd0784749c5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,41 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest77"> + <data name="menuItem" xsi:type="string">Sales > Orders</data> + <data name="pageTitle" xsi:type="string">Orders</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest78"> + <data name="menuItem" xsi:type="string">Sales > Invoices</data> + <data name="pageTitle" xsi:type="string">Invoices</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest79"> + <data name="menuItem" xsi:type="string">Sales > Shipments</data> + <data name="pageTitle" xsi:type="string">Shipments</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest80"> + <data name="menuItem" xsi:type="string">Sales > Credit Memos</data> + <data name="pageTitle" xsi:type="string">Credit Memos</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest81"> + <data name="menuItem" xsi:type="string">Sales > Transactions</data> + <data name="pageTitle" xsi:type="string">Transactions</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest82"> + <data name="menuItem" xsi:type="string">Stores > Order Status</data> + <data name="pageTitle" xsi:type="string">Order Status</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php index e873f8fc8e758e6c6a3d24c96c59c5ccdf3d6a3a..8deb7b0dbb0281e100c52c7fa5681bdbbb68f78d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php @@ -42,7 +42,7 @@ class FillBillingAddressStep implements TestStepInterface * @param Address $billingAddress * @param string $saveAddress */ - public function __construct(OrderCreateIndex $orderCreateIndex, Address $billingAddress, $saveAddress) + public function __construct(OrderCreateIndex $orderCreateIndex, Address $billingAddress, $saveAddress = 'No') { $this->orderCreateIndex = $orderCreateIndex; $this->billingAddress = $billingAddress; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml index c80098f59e6369bd9a4bf87bbe662ac9aba88bfe..f42ed2705b6c7a931d9b687d7127bd38e5238e30 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml @@ -6,72 +6,73 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/TestCase/etc/testcase.xsd"> - <scenario name="ReorderOrderEntityTest" firstStep="setupConfiguration"> - <step name="setupConfiguration" module="Magento_Core" next="createOrder"/> - <step name="createOrder" module="Magento_Sales" next="openOrder"/> - <step name="openOrder" module="Magento_Sales" next="reorder"/> - <step name="reorder" module="Magento_Sales" next="fillBillingAddress"/> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"/> - <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder"/> - <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder"/> - <step name="submitOrder" module="Magento_Sales"/> - </scenario> - <scenario name="CreateOrderBackendTest" firstStep="setupConfiguration"> - <step name="setupConfiguration" module="Magento_Core" next="createProducts"/> - <step name="createProducts" module="Magento_Catalog" next="createTaxRule"/> - <step name="createTaxRule" module="Magento_Tax" next="createCustomer"/> - <step name="createCustomer" module="Magento_Customer" next="openSalesOrders"/> - <step name="openSalesOrders" module="Magento_Sales" next="createNewOrder"/> - <step name="createNewOrder" module="Magento_Sales" next="selectCustomerOrder"/> - <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore"/> - <step name="selectStore" module="Magento_Sales" next="addProducts"/> - <step name="addProducts" module="Magento_Sales" next="fillAccountInformation"/> - <step name="fillAccountInformation" module="Magento_Sales" next="updateProductsData"/> - <step name="updateProductsData" module="Magento_Sales" next="fillBillingAddress"/> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"/> - <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder"/> - <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder"/> - <step name="submitOrder" module="Magento_Sales"/> - </scenario> - <scenario name="MoveRecentlyViewedProductsOnOrderPageTest" firstStep="createProducts"> - <step name="createProducts" module="Magento_Catalog" next="createCustomer"/> - <step name="createCustomer" module="Magento_Customer" next="loginCustomerOnFrontend"> - <item name="customer"> - <item name="dataSet" value="default"/> - </item> - </step> - <step name="loginCustomerOnFrontend" module="Magento_Customer" next="openProductsOnFrontend"/> - <step name="openProductsOnFrontend" module="Magento_Catalog" next="openCustomerOnBackend"/> - <step name="openCustomerOnBackend" module="Magento_Customer" next="createOrderFromCustomerAccount"/> - <step name="createOrderFromCustomerAccount" module="Magento_Customer" next="addRecentlyViewedProductsToCart"/> - <step name="addRecentlyViewedProductsToCart" module="Magento_Sales" next="configureProducts"/> - <step name="configureProducts" module="Magento_Sales"/> - </scenario> - <scenario name="PrintOrderFrontendGuestTest" firstStep="createProducts"> - <step name="createProducts" module="Magento_Catalog" next="createCustomer"/> - <step name="createCustomer" module="Magento_Customer" next="openSalesOrders"> - <item name="customer"> - <item name="dataSet" value="johndoe_with_addresses"/> - </item> - </step> - <step name="openSalesOrders" module="Magento_Sales" next="createNewOrder"/> - <step name="createNewOrder" module="Magento_Sales" next="selectCustomerOrder"/> - <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore"/> - <step name="selectStore" module="Magento_Sales" next="addProducts"/> - <step name="addProducts" module="Magento_Sales" next="fillBillingAddress"/> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"> - <item name="billingAddress"> - <item name="dataSet" value="customer_US"/> - </item> - </step> - <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder"> - <item name="payment"> - <item name="method" value="checkmo"/> - </item> - </step> - <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder"/> - <step name="submitOrder" module="Magento_Sales" next="openSalesOrderOnFrontendForGuest"/> - <step name="openSalesOrderOnFrontendForGuest" module="Magento_Sales" next="printOrderOnFrontend"/> - <step name="printOrderOnFrontend" module="Magento_Sales"/> - </scenario> + <scenario name="ReorderOrderEntityTest" firstStep="setupConfiguration"> + <step name="setupConfiguration" module="Magento_Core" next="createOrder" /> + <step name="createOrder" module="Magento_Sales" next="openOrder" /> + <step name="openOrder" module="Magento_Sales" next="reorder" /> + <step name="reorder" module="Magento_Sales" next="fillBillingAddress" /> + <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> + <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder" /> + <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" /> + <step name="submitOrder" module="Magento_Sales" /> + </scenario> + <scenario name="CreateOrderBackendTest" firstStep="setupConfiguration"> + <step name="setupConfiguration" module="Magento_Core" next="createProducts" /> + <step name="createProducts" module="Magento_Catalog" next="createTaxRule" /> + <step name="createTaxRule" module="Magento_Tax" next="createCustomer" /> + <step name="createCustomer" module="Magento_Customer" next="openSalesOrders" /> + <step name="openSalesOrders" module="Magento_Sales" next="createNewOrder" /> + <step name="createNewOrder" module="Magento_Sales" next="selectCustomerOrder" /> + <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore" /> + <step name="selectStore" module="Magento_Sales" next="addProducts" /> + <step name="addProducts" module="Magento_Sales" next="fillAccountInformation" /> + <step name="fillAccountInformation" module="Magento_Sales" next="updateProductsData" /> + <step name="updateProductsData" module="Magento_Sales" next="fillBillingAddress" /> + <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> + <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder" /> + <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" /> + <step name="submitOrder" module="Magento_Sales" /> + </scenario> + <scenario name="MoveRecentlyViewedProductsOnOrderPageTest" firstStep="createProducts"> + <step name="createProducts" module="Magento_Catalog" next="createCustomer" /> + <step name="createCustomer" module="Magento_Customer" next="loginCustomerOnFrontend"> + <item name="customer"> + <item name="dataSet" value="default" /> + </item> + </step> + <step name="loginCustomerOnFrontend" module="Magento_Customer" next="openProductsOnFrontend" /> + <step name="openProductsOnFrontend" module="Magento_Catalog" next="openCustomerOnBackend" /> + <step name="openCustomerOnBackend" module="Magento_Customer" next="createOrderFromCustomerAccount" /> + <step name="createOrderFromCustomerAccount" module="Magento_Customer" next="selectStore" /> + <step name="selectStore" module="Magento_Sales" next="addRecentlyViewedProductsToCart" /> + <step name="addRecentlyViewedProductsToCart" module="Magento_Sales" next="configureProducts" /> + <step name="configureProducts" module="Magento_Sales" /> + </scenario> + <scenario name="PrintOrderFrontendGuestTest" firstStep="createProducts"> + <step name="createProducts" module="Magento_Catalog" next="createCustomer" /> + <step name="createCustomer" module="Magento_Customer" next="openSalesOrders"> + <item name="customer"> + <item name="dataSet" value="johndoe_with_addresses" /> + </item> + </step> + <step name="openSalesOrders" module="Magento_Sales" next="createNewOrder" /> + <step name="createNewOrder" module="Magento_Sales" next="selectCustomerOrder" /> + <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore" /> + <step name="selectStore" module="Magento_Sales" next="addProducts" /> + <step name="addProducts" module="Magento_Sales" next="fillBillingAddress" /> + <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"> + <item name="billingAddress"> + <item name="dataSet" value="customer_US" /> + </item> + </step> + <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder"> + <item name="payment"> + <item name="method" value="checkmo" /> + </item> + </step> + <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" /> + <step name="submitOrder" module="Magento_Sales" next="openSalesOrderOnFrontendForGuest" /> + <step name="openSalesOrderOnFrontendForGuest" module="Magento_Sales" next="printOrderOnFrontend" /> + <step name="printOrderOnFrontend" module="Magento_Sales" /> + </scenario> </config> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..14a87c13b7efcba2c1a068ae239f827abe6659fd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest83"> + <data name="menuItem" xsi:type="string">Marketing > Cart Price Rules</data> + <data name="pageTitle" xsi:type="string">Cart Price Rules</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php index 670aca38ebfd3278e99503ec3e45ba86fc7b2bc2..c8b09124666bd8ab70c40b40bdf1f93affca8550 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php @@ -62,8 +62,7 @@ class Curl extends AbstractCurl implements SitemapInterface { //Sort data in grid to define sitemap id if more than 20 items in grid $url = 'admin/sitemap/index/sort/sitemap_id/dir/desc'; - $pattern = '/class=\" col\-id col\-sitemap_id\W*>\W+(\d+)\W+<\/td>\W+<td[\w\s\"=\-]*?>\W+?' - . $data['sitemap_filename'] . '/siu'; + $pattern = '/col-sitemap_id\W*(\d+)<.td><[^<>]*?>' . $data['sitemap_filename'] . '/siu'; $extractor = new Extractor($url, $pattern); $match = $extractor->getData(); diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..fbebdaee2d655b33a6112e15c1b08f6c188ef88b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest85"> + <data name="menuItem" xsi:type="string">Marketing > Site Map</data> + <data name="pageTitle" xsi:type="string">Site Map</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php index 3e796d62655d43403e8ed8ecf069def881c6b1a2..3e23c4cbfb1d7d156ed0e3f096938fe0f79836f8 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php @@ -34,6 +34,7 @@ class CreateStoreEntityTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'PS'; + const TEST_TYPE = 'acceptance_test'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml index 1da9ff702e422245440b78ff82583d538e206338..4ba86215b1c13a8851f4300298bd825521f0e341 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml @@ -6,39 +6,52 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Store\Test\TestCase\CreateStoreEntityTest"> - <variation name="CreateStoreEntityTestVariation1"> - <data name="store/data/group_id/dataSet" xsi:type="string">default</data> - <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> - <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> - <data name="store/data/is_active" xsi:type="string">Enabled</data> - <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreForm"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreBackend"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreFrontend"/> - </variation> - <variation name="CreateStoreEntityTestVariation2"> - <data name="store/data/group_id/dataSet" xsi:type="string">default</data> - <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> - <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> - <data name="store/data/is_active" xsi:type="string">Disabled</data> - <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreForm"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreBackend"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreNotOnFrontend"/> - </variation> - <variation name="CreateStoreEntityTestVariation3"> - <data name="store/data/group_id/dataSet" xsi:type="string">custom</data> - <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> - <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> - <data name="store/data/is_active" xsi:type="string">Enabled</data> - <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreForm"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreBackend"/> - <constraint name="Magento\Store\Test\Constraint\AssertStoreFrontend"/> - </variation> - </testCase> + <testCase name="Magento\Store\Test\TestCase\CreateStoreEntityTest"> + <variation name="CreateStoreEntityTestVariation1"> + <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> + <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> + <data name="store/data/is_active" xsi:type="string">Enabled</data> + <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreForm" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreBackend" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreFrontend" /> + </variation> + <variation name="CreateStoreEntityTestVariation2"> + <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> + <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> + <data name="store/data/is_active" xsi:type="string">Disabled</data> + <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreForm" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreBackend" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreNotOnFrontend" /> + </variation> + <variation name="CreateStoreEntityTestVariation3"> + <data name="store/data/group_id/dataSet" xsi:type="string">custom</data> + <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> + <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> + <data name="store/data/is_active" xsi:type="string">Enabled</data> + <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreForm" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreBackend" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreFrontend" /> + </variation> + <variation name="CreateStoreEntityTestVariation4"> + <data name="description" xsi:type="string">MAGETWO-12405: Create New Localized Store View</data> + <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="store/data/name" xsi:type="string">DE_%isolation%</data> + <data name="store/data/code" xsi:type="string">de_%isolation%</data> + <data name="store/data/is_active" xsi:type="string">Enabled</data> + <data name="locale" xsi:type="string">German (Germany)</data> + <data name="welcomeText" xsi:type="string">Den gesamten Shop durchsuchen</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessSaveMessage" /> + <constraint name="Magento\Store\Test\Constraint\AssertStoreInGrid" /> + <constraint name="Magento\Backend\Test\Constraint\AssertStoreCanBeLocalized" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php deleted file mode 100644 index ab189ce353019e5e821f66713b8491f63bb87aaf..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Store test - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Store\Test\TestCase; - -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\TestCase\Functional; - -class StoreTest extends Functional -{ - /* tags */ - const TEST_TYPE = 'acceptance_test'; - /* end tags */ - - /** - * Login into backend area before test - */ - protected function setUp() - { - Factory::getApp()->magentoBackendLoginUser(); - } - - /** - * @ZephyrId MAGETWO-12405 - */ - public function testCreateNewLocalizedStoreView() - { - $objectManager = Factory::getObjectManager(); - $storeFixture = $objectManager->create('Magento\Store\Test\Fixture\Store', ['dataSet' => 'german']); - - $storeListPage = Factory::getPageFactory()->getAdminSystemStore(); - $storeListPage->open(); - $storeListPage->getGridPageActions()->addStoreView(); - - $newStorePage = Factory::getPageFactory()->getAdminSystemStoreNewStore(); - $newStorePage->getStoreForm()->fill($storeFixture); - $newStorePage->getFormPageActions()->save(); - $storeListPage->getMessagesBlock()->waitSuccessMessage(); - $this->assertContains( - 'The store view has been saved', - $storeListPage->getMessagesBlock()->getSuccessMessages() - ); - $this->assertTrue( - $storeListPage->getStoreGrid()->isStoreExists($storeFixture->getName()) - ); - - $cachePage = Factory::getPageFactory()->getAdminCache(); - $cachePage->open(); - $cachePage->getActionsBlock()->flushCacheStorage(); - $cachePage->getMessagesBlock()->waitSuccessMessage(); - - $configPage = Factory::getPageFactory()->getAdminSystemConfig(); - $configPage->open(); - $configPage->getPageActions()->selectStore($storeFixture->getGroupId() . "/" . $storeFixture->getName()); - $configGroup = $configPage->getForm()->getGroup('Locale Options'); - $configGroup->open(); - $configGroup->setValue('select-groups-locale-fields-code-value', 'German (Germany)'); - $configPage->getPageActions()->save(); - $configPage->getMessagesBlock()->waitSuccessMessage(); - - $homePage = Factory::getPageFactory()->getCmsIndexIndex(); - $homePage->open(); - - $homePage->getStoreSwitcherBlock()->selectStoreView($storeFixture->getName()); - $this->assertTrue($homePage->getSearchBlock()->isPlaceholderContains('Den gesamten Shop durchsuchen')); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php index 4c5e2cabf1c610cfacdef73b0b639bbe3fad0b95..b5631910c0d44a00f93df89cc540b56734348c1a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php @@ -141,7 +141,9 @@ abstract class AssertTaxRuleApplying extends AbstractConstraint $checkoutCart->open()->getCartBlock()->clearShoppingCart(); $browser->open($_ENV['app_frontend_url'] . $this->productSimple->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCart(); + $catalogProductView->getMessagesBlock()->waitSuccessMessage(); // Estimate Shipping and Tax + $checkoutCart->open(); $checkoutCart->getShippingBlock()->openEstimateShippingAndTax(); $checkoutCart->getShippingBlock()->fill($address); $checkoutCart->getShippingBlock()->clickGetQuote(); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php index 997d0600cc759907a4e86346d420b53e61bb3a3c..b40b943db578694f85058bb4c165c854101b2c00 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php @@ -6,8 +6,8 @@ namespace Magento\Tax\Test\Fixture\TaxRule; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Class TaxClass @@ -15,23 +15,17 @@ use Magento\Mtf\Fixture\FixtureInterface; * Data keys: * - dataSet */ -class TaxClass implements FixtureInterface +class TaxClass extends DataSource { /** - * Array with tax class names - * - * @var array - */ - protected $data; - - /** - * Array with tax class fixtures + * Array with tax class fixtures. * * @var array */ protected $fixture; /** + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -42,51 +36,16 @@ class TaxClass implements FixtureInterface if (isset($data['dataSet'])) { $dataSets = $data['dataSet']; foreach ($dataSets as $dataSet) { - if ($dataSet !== '-') { - /** @var \Magento\Tax\Test\Fixture\TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataSet' => $dataSet]); - $this->fixture[] = $taxClass; - $this->data[] = $taxClass->getClassName(); - } + /** @var \Magento\Tax\Test\Fixture\TaxClass $taxClass */ + $taxClass = $fixtureFactory->createByCode('taxClass', ['dataSet' => $dataSet]); + $this->fixture[] = $taxClass; + $this->data[] = $taxClass->getClassName(); } } } /** - * Persist custom selections tax classes - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return tax class fixture + * Return tax class fixture. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php index aacc3a65e7ab91f8292fc0461f9ed0de4b4e826d..238a754ee60480e310045ce8b6fec70ae836a9da 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php @@ -6,8 +6,8 @@ namespace Magento\Tax\Test\Fixture\TaxRule; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Class TaxRate @@ -15,23 +15,17 @@ use Magento\Mtf\Fixture\FixtureInterface; * Data keys: * - dataSet */ -class TaxRate implements FixtureInterface +class TaxRate extends DataSource { /** - * Array with tax rates codes - * - * @var array - */ - protected $data; - - /** - * Array with tax rate fixtures + * Array with tax rate fixtures. * * @var array */ protected $fixture; /** + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -42,51 +36,16 @@ class TaxRate implements FixtureInterface if (isset($data['dataSet'])) { $dataSets = $data['dataSet']; foreach ($dataSets as $dataSet) { - if ($dataSet !== '-') { - /** @var \Magento\Tax\Test\Fixture\TaxRate $taxRate */ - $taxRate = $fixtureFactory->createByCode('taxRate', ['dataSet' => $dataSet]); - $this->fixture[] = $taxRate; - $this->data[] = $taxRate->getCode(); - } + /** @var \Magento\Tax\Test\Fixture\TaxRate $taxRate */ + $taxRate = $fixtureFactory->createByCode('taxRate', ['dataSet' => $dataSet]); + $this->fixture[] = $taxRate; + $this->data[] = $taxRate->getCode(); } } } /** - * Persist custom selections tax rates - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return tax rate fixtures + * Return tax rate fixtures. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php index a183fa5490125341f2750697f7d23e0ff13fe987..28e77379db72e1010f28e6bf0212e34ac8a2feea 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php @@ -14,13 +14,12 @@ use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; /** - * Class Curl - * Curl handler for creating customer and product tax class + * Curl handler for creating customer and product tax class. */ class Curl extends AbstractCurl implements TaxClassInterface { /** - * Post request for creating tax class + * Post request for creating tax class. * * @param FixtureInterface $fixture [optional] * @return mixed|string @@ -29,7 +28,7 @@ class Curl extends AbstractCurl implements TaxClassInterface { $data = $fixture->getData(); - $url = $_ENV['app_backend_url'] . 'tax/tax/ajaxSAve/?isAjax=true'; + $url = $_ENV['app_backend_url'] . 'tax/tax/ajaxSave/?isAjax=true'; $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); $curl->write(CurlInterface::POST, $url, '1.0', [], $data); $response = $curl->read(); @@ -40,7 +39,7 @@ class Curl extends AbstractCurl implements TaxClassInterface } /** - * Return saved class id if saved + * Return saved class id if saved. * * @param $response * @return int|null diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml index fe148b022e7170f8aa76c6f1d0b7a964f86b2b34..b8770c32386bd731c9dfc2f1cab9f2aa42ceefeb 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml @@ -6,82 +6,72 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Tax\Test\TestCase\CreateTaxRuleEntityTest"> - <variation name="CreateTaxRuleEntityTestVariation1"> - <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">-</data> - <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">-</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/priority" xsi:type="string">-</data> - <data name="taxRule/data/position" xsi:type="string">-</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - <variation name="CreateTaxRuleEntityTestVariation2"> - <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-NY-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">-</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/priority" xsi:type="string">1</data> - <data name="taxRule/data/position" xsi:type="string">1</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - <variation name="CreateTaxRuleEntityTestVariation3"> - <data name="description" xsi:type="string">Creating tax rule with new tax classes and tax rate</data> - <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">default</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-NY-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">Taxable Goods</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/priority" xsi:type="string">-</data> - <data name="taxRule/data/position" xsi:type="string">1</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - <variation name="CreateTaxRuleEntityTestVariation4"> - <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withZipRange</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">-</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">Taxable Goods</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/priority" xsi:type="string">1</data> - <data name="taxRule/data/position" xsi:type="string">-</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - <variation name="CreateTaxRuleEntityTestVariation5"> - <data name="description" xsi:type="string">MAGETWO-12438: Create Tax Rule with New and Existing Tax Rate, Customer Tax Class, Product Tax Class</data> - <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-*-Rate 1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">us_ny_rate_8_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">-</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">Retail Customer</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">Taxable Goods</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> - <data name="tag" xsi:type="string">bamboo_plan:end_to_end,test_type:acceptance_test</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - </testCase> + <testCase name="Magento\Tax\Test\TestCase\CreateTaxRuleEntityTest"> + <variation name="CreateTaxRuleEntityTestVariation1"> + <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + <variation name="CreateTaxRuleEntityTestVariation2"> + <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-NY-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/priority" xsi:type="string">1</data> + <data name="taxRule/data/position" xsi:type="string">1</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + <variation name="CreateTaxRuleEntityTestVariation3"> + <data name="description" xsi:type="string">Creating tax rule with new tax classes and tax rate</data> + <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">default</data> + <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-NY-Rate_1</data> + <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">taxable_goods</data> + <data name="taxRule/data/position" xsi:type="string">1</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + <variation name="CreateTaxRuleEntityTestVariation4"> + <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withZipRange</data> + <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">taxable_goods</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/priority" xsi:type="string">1</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + <variation name="CreateTaxRuleEntityTestVariation5"> + <data name="description" xsi:type="string">MAGETWO-12438: Create Tax Rule with New and Existing Tax Rate, Customer Tax Class, Product Tax Class</data> + <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-*-Rate 1</data> + <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">us_ny_rate_8_1</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">taxable_goods</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> + <data name="tag" xsi:type="string">bamboo_plan:end_to_end,test_type:acceptance_test</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php index 3c8e925589b39f5caf6218d7b5d8a35e176e3283..bef4c799b43f3a3603fb29b7706b12def4732cc0 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php @@ -6,26 +6,22 @@ namespace Magento\Tax\Test\TestCase; -use Magento\Customer\Test\Fixture\Address; use Magento\Tax\Test\Fixture\TaxRule; use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex; use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew; -use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for Delete TaxRuleEntity - * - * Test Flow: * Preconditions: - * 1. Tax Rule is created + * 1. Tax Rule is created. * * Steps: * 1. Log in as default admin user. - * 2. Go to Sales > Tax Rules - * 3. Select required tax rule from preconditions - * 4. Click on the "Delete Rule" button - * 5. Perform all assertions + * 2. Go to Sales > Tax Rules. + * 3. Select required tax rule from preconditions. + * 4. Click on the "Delete Rule" button. + * 5. Perform all assertions. * * @group Tax_(CS) * @ZephyrId MAGETWO-20924 @@ -38,35 +34,34 @@ class DeleteTaxRuleEntityTest extends Injectable /* end tags */ /** - * Tax Rule grid page + * Tax Rule grid page. * * @var TaxRuleIndex */ protected $taxRuleIndexPage; /** - * Tax Rule new and edit page + * Tax Rule new and edit page. * * @var TaxRuleNew */ protected $taxRuleNewPage; /** - * Preparing data + * Create customer. * - * @param FixtureFactory $fixtureFactory + * @param Customer $customer * @return array */ - public function __prepare(FixtureFactory $fixtureFactory) + public function __prepare(Customer $customer) { - $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'default']); $customer->persist(); return ['customer' => $customer]; } /** - * Injection data + * Inject pages. * * @param TaxRuleIndex $taxRuleIndexPage * @param TaxRuleNew $taxRuleNewPage @@ -80,28 +75,19 @@ class DeleteTaxRuleEntityTest extends Injectable } /** - * Delete Tax Rule Entity test + * Delete Tax Rule Entity test. * * @param TaxRule $taxRule - * @param Address $address - * @param array $shipping - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @return void */ - public function testDeleteTaxRule( - TaxRule $taxRule, - Address $address, - array $shipping - ) { + public function testDeleteTaxRule(TaxRule $taxRule) + { // Precondition $taxRule->persist(); // Steps - $filters = [ - 'code' => $taxRule->getCode(), - ]; $this->taxRuleIndexPage->open(); - $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen($filters); + $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]); $this->taxRuleNewPage->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml index 86c84ac32a3928f3779b647f8515339139bb6bf2..8c8aa1e3888b449ecb35b4cd65f5df9ce68baa96 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml @@ -6,18 +6,18 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Tax\Test\TestCase\DeleteTaxRuleEntityTest"> - <variation name="DeleteTaxRuleEntityTestVariation1"> - <data name="taxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> - <data name="address/data/country_id" xsi:type="string">United States</data> - <data name="address/data/region_id" xsi:type="string">California</data> - <data name="address/data/postcode" xsi:type="string">90001</data> - <data name="shipping/carrier" xsi:type="string">Flat Rate</data> - <data name="shipping/method" xsi:type="string">Fixed</data> - <data name="shipping/price" xsi:type="string">5</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessDeleteMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleNotInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsNotApplied"/> - </variation> - </testCase> + <testCase name="Magento\Tax\Test\TestCase\DeleteTaxRuleEntityTest"> + <variation name="DeleteTaxRuleEntityTestVariation1"> + <data name="taxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="address/data/country_id" xsi:type="string">United States</data> + <data name="address/data/region_id" xsi:type="string">California</data> + <data name="address/data/postcode" xsi:type="string">90001</data> + <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> + <data name="shipping/shipping_method" xsi:type="string">Fixed</data> + <data name="shipping/price" xsi:type="string">5</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessDeleteMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleNotInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsNotApplied" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..2b07ad78838c0aef85bd7f355aebe1099ea126fa --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,26 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest87"> + <data name="menuItem" xsi:type="string">Stores > Tax Rules</data> + <data name="pageTitle" xsi:type="string">Tax Rules</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest88"> + <data name="menuItem" xsi:type="string">Stores > Tax Zones and Rates</data> + <data name="pageTitle" xsi:type="string">Tax Zones and Rates</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest89"> + <data name="menuItem" xsi:type="string">System > Import/Export Tax Rates</data> + <data name="pageTitle" xsi:type="string">Import and Export Tax Rates</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml index 48c142a660842fc1dcd21fb721cd380257c02202..1cc98aeb5bf1a0dfc16dc5dd1129a3d29461dd19 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml @@ -6,84 +6,63 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Tax\Test\TestCase\UpdateTaxRuleEntityTest"> - <variation name="UpdateTaxRuleEntityTestVariation1"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_default</data> - <data name="address/data/country_id" xsi:type="string">-</data> - <data name="address/data/region_id" xsi:type="string">-</data> - <data name="address/data/postcode" xsi:type="string">-</data> - <data name="shipping/carrier" xsi:type="string">-</data> - <data name="shipping/method" xsi:type="string">-</data> - <data name="shipping/price" xsi:type="string">-</data> - <data name="taxRule/data/code" xsi:type="string">New Tax Rule name%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">default</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/priority" xsi:type="string">2</data> - <data name="taxRule/data/position" xsi:type="string">2</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - <variation name="UpdateTaxRuleEntityTestVariation2"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> - <data name="address/data/country_id" xsi:type="string">-</data> - <data name="address/data/region_id" xsi:type="string">-</data> - <data name="address/data/postcode" xsi:type="string">-</data> - <data name="shipping/carrier" xsi:type="string">-</data> - <data name="shipping/method" xsi:type="string">-</data> - <data name="shipping/price" xsi:type="string">-</data> - <data name="taxRule/data/code" xsi:type="string">-</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withZipRange</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">taxable_goods</data> - <data name="taxRule/data/priority" xsi:type="string">-</data> - <data name="taxRule/data/position" xsi:type="string">-</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - </variation> - <variation name="UpdateTaxRuleEntityTestVariation3"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> - <data name="address/data/country_id" xsi:type="string">United States</data> - <data name="address/data/region_id" xsi:type="string">Utah</data> - <data name="address/data/postcode" xsi:type="string">84001</data> - <data name="shipping/carrier" xsi:type="string">Flat Rate</data> - <data name="shipping/method" xsi:type="string">Fixed</data> - <data name="shipping/price" xsi:type="string">5</data> - <data name="taxRule/data/code" xsi:type="string">-</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">us_ut_fixed_zip_rate_20</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/priority" xsi:type="string">-</data> - <data name="taxRule/data/position" xsi:type="string">-</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsApplied"/> - </variation> - <variation name="UpdateTaxRuleEntityTestVariation4"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> - <data name="address/data/country_id" xsi:type="string">United States</data> - <data name="address/data/region_id" xsi:type="string">Idaho</data> - <data name="address/data/postcode" xsi:type="string">83201</data> - <data name="shipping/carrier" xsi:type="string">Flat Rate</data> - <data name="shipping/method" xsi:type="string">Fixed</data> - <data name="shipping/price" xsi:type="string">5</data> - <data name="taxRule/data/code" xsi:type="string">-</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withFixedZip</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/priority" xsi:type="string">-</data> - <data name="taxRule/data/position" xsi:type="string">-</data> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm"/> - <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsNotApplied"/> - </variation> - </testCase> + <testCase name="Magento\Tax\Test\TestCase\UpdateTaxRuleEntityTest"> + <variation name="UpdateTaxRuleEntityTestVariation1"> + <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_default</data> + <data name="taxRule/data/code" xsi:type="string">New Tax Rule name%isolation%</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">default</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/priority" xsi:type="string">2</data> + <data name="taxRule/data/position" xsi:type="string">2</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + <variation name="UpdateTaxRuleEntityTestVariation2"> + <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withZipRange</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">taxable_goods</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + </variation> + <variation name="UpdateTaxRuleEntityTestVariation3"> + <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="address/data/country_id" xsi:type="string">United States</data> + <data name="address/data/region_id" xsi:type="string">Utah</data> + <data name="address/data/postcode" xsi:type="string">84001</data> + <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> + <data name="shipping/shipping_method" xsi:type="string">Fixed</data> + <data name="shipping/price" xsi:type="string">5</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">us_ut_fixed_zip_rate_20</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsApplied" /> + </variation> + <variation name="UpdateTaxRuleEntityTestVariation4"> + <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="address/data/country_id" xsi:type="string">United States</data> + <data name="address/data/region_id" xsi:type="string">Idaho</data> + <data name="address/data/postcode" xsi:type="string">83201</data> + <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> + <data name="shipping/shipping_method" xsi:type="string">Fixed</data> + <data name="shipping/price" xsi:type="string">5</data> + <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withFixedZip</data> + <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> + <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsNotApplied" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php index dd7936803646c968ddbf503484427328bb50133e..027b1ca6ec7fff352865e5d0a001e059f4044372 100644 --- a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php +++ b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php @@ -57,6 +57,24 @@ class Links extends Block return $this->_rootElement->find(sprintf($this->link, $linkTitle), Locator::SELECTOR_XPATH)->isVisible(); } + /** + * Wait for link is visible. + * + * @param string $linkTitle + * @return void + */ + public function waitLinkIsVisible($linkTitle) + { + $browser = $this->_rootElement; + $selector = sprintf($this->link, $linkTitle); + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector, Locator::SELECTOR_XPATH); + return $element->isVisible() ? true : null; + } + ); + } + /** * Get the number of products added to compare list. * diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..4fb8159fe987005275a625c72c1f97ea01c64e2d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest90"> + <data name="menuItem" xsi:type="string">Content > Themes</data> + <data name="pageTitle" xsi:type="string">Themes</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> 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 dcae5848887be99e10b707cbebb4c9bb35788b5b..373c6c4cabd7c90d4920667f958868594b4b3946 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 @@ -12,13 +12,12 @@ use Magento\Mtf\Client\Element; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class UrlRewriteForm - * Catalog URL rewrite edit form + * Catalog URL rewrite edit form. */ class UrlRewriteForm extends Form { /** - * Fill the root form + * Fill the root form. * * @param FixtureInterface $fixture * @param SimpleElement|null $element diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php index 8b176051fc18384f164d80381a2870f9b258c075..9dc49ec06a9bacdcea1c9d869eb26ac83564abbc 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php @@ -29,7 +29,7 @@ class AssertUrlRewriteCustomRedirect extends AbstractConstraint { $browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath()); $entity = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity(); - $title = $entity->hasData('name') ? $entity->getName() : $entity->getTitle(); + $title = $entity->hasData('name') ? $entity->getName() : $entity->getContentHeading(); $pageTitle = $cmsIndex->getTitleBlock()->getTitle(); \PHPUnit_Framework_Assert::assertEquals( $pageTitle, diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..3423afc8018e060a403ba5b91ad53c6ed73d0da9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest91"> + <data name="menuItem" xsi:type="string">Marketing > URL Rewrites</data> + <data name="pageTitle" xsi:type="string">URL Rewrites</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php index 8c034e549edfaa9900cc434375a9e04112de2cf3..3127b4b3f195ab13e015d8cf976ce9272efe3ca9 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php @@ -6,7 +6,7 @@ namespace Magento\User\Test\Constraint; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\User\Test\Page\Adminhtml\UserRoleIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -19,14 +19,14 @@ class AssertRoleInGrid extends AbstractConstraint * Asserts that saved role is present in Role Grid. * * @param UserRoleIndex $rolePage - * @param AdminUserRole $role - * @param AdminUserRole $roleInit + * @param Role $role + * @param Role $roleInit * @return void */ public function processAssert( UserRoleIndex $rolePage, - AdminUserRole $role, - AdminUserRole $roleInit = null + Role $role, + Role $roleInit = null ) { $filter = ['rolename' => $role->hasData('rolename') ? $role->getRoleName() : $roleInit->getRoleName()]; $rolePage->open(); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php index 9615318c08384d87d44f735570551c9e1a8ce983..2eb134bb51309355e52efcd9522b17f0c151bc6c 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php @@ -6,7 +6,7 @@ namespace Magento\User\Test\Constraint; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\User\Test\Page\Adminhtml\UserRoleIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -19,12 +19,12 @@ class AssertRoleNotInGrid extends AbstractConstraint * Asserts that role is not present in Role Grid. * * @param UserRoleIndex $rolePage - * @param AdminUserRole $role + * @param Role $role * @return void */ public function processAssert( UserRoleIndex $rolePage, - AdminUserRole $role + Role $role ) { $filter = ['rolename' => $role->getRoleName()]; $rolePage->open(); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php index 4e409ccc9f3b4ac3c36ce74f90e64fadcd9b0cb2..2761f880264532f93c0dd0d16399a637f810977a 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php @@ -11,7 +11,7 @@ use Magento\User\Test\Page\Adminhtml\UserIndex; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertUserInGrid + * Asserts that user is present in User Grid. */ class AssertUserInGrid extends AbstractConstraint { @@ -20,20 +20,16 @@ class AssertUserInGrid extends AbstractConstraint * * @param UserIndex $userIndex * @param User $user - * @param User $customAdmin * @return void */ - public function processAssert( - UserIndex $userIndex, - User $user, - User $customAdmin = null - ) { - $adminUser = ($user->hasData('password') || $user->hasData('username')) ? $user : $customAdmin; - $filter = ['username' => $adminUser->getUsername()]; + public function processAssert(UserIndex $userIndex, User $user) + { + $filter = ['username' => $user->getUsername()]; + $userIndex->open(); \PHPUnit_Framework_Assert::assertTrue( $userIndex->getUserGrid()->isRowVisible($filter), - 'User with name \'' . $adminUser->getUsername() . '\' is absent in User grid.' + 'User with name \'' . $user->getUsername() . '\' is absent in User grid.' ); } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php new file mode 100644 index 0000000000000000000000000000000000000000..3cc808867742e584fca8a34990cde630560ea22a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\User\Test\Constraint; + +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Constraint\AbstractConstraint; +use Magento\User\Test\Fixture\User; + +/** + * Asserts that user has only related permissions. + */ +class AssertUserRoleRestrictedAccess extends AbstractConstraint +{ + const DENIED_ACCESS = 'Access denied'; + + /** + * Asserts that user has only related permissions. + * + * @param BrowserInterface $browser + * @param Dashboard $dashboard + * @param User $user + * @param array $restrictedAccess + * @param string $denyUrl + * @return void + */ + public function processAssert( + BrowserInterface $browser, + Dashboard $dashboard, + User $user, + array $restrictedAccess, + $denyUrl + ) { + $this->objectManager->create('Magento\User\Test\TestStep\LoginUserOnBackendStep', ['user' => $user])->run(); + + $menuItems = $dashboard->getMenuBlock()->getTopMenuItems(); + \PHPUnit_Framework_Assert::assertEquals($menuItems, $restrictedAccess, 'Wrong display menu.'); + + $browser->open($_ENV['app_backend_url'] . $denyUrl); + $deniedMessage = $dashboard->getAccessDeniedBlock()->getTextFromAccessDeniedBlock(); + \PHPUnit_Framework_Assert::assertEquals(self::DENIED_ACCESS, $deniedMessage, 'Possible access to denied page.'); + } + + /** + * Returns success message if assert true. + * + * @return string + */ + public function toString() + { + return 'Sales item is present in Menu block.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php deleted file mode 100644 index 7d1f1e298a4e6460c7b69be9d24211e2dc543ebc..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Constraint; - -use Magento\Backend\Test\Page\Adminhtml\Dashboard; -use Magento\User\Test\Page\Adminhtml\UserIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Class AssertUserRoleSalesRestrictedAccess - */ -class AssertUserRoleSalesRestrictedAccess extends AbstractConstraint -{ - const ROLE_RESOURCE = 'sales'; - const DENIED_ACCESS = 'Access denied'; - - /** - * Asserts that user has only Sales-related permissions - * - * @param Dashboard $dashboard - * @param UserIndex $userIndex - * @return void - */ - public function processAssert( - Dashboard $dashboard, - UserIndex $userIndex - ) { - $menuItems = $dashboard->getMenuBlock()->getTopMenuItems(); - $userIndex->open(); - $deniedMessage = $userIndex->getAccessDeniedBlock()->getTextFromAccessDeniedBlock(); - $isMenuItemSingle = (count($menuItems) == 1); - $hasSales = in_array(self::ROLE_RESOURCE, $menuItems); - \PHPUnit_Framework_Assert::assertTrue( - $hasSales && $isMenuItemSingle && (self::DENIED_ACCESS == $deniedMessage), - 'Sales item is absent in Menu block or possible access to another page, not related to Sales.' - ); - } - - /** - * Returns success message if assert true. - * - * @return string - */ - public function toString() - { - return 'Sales item is present in Menu block.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php index c1214de922e8d930618d37428838ebfa1d9fdf07..ef60f6f4703859a8efd91f84e4b768e54d9d84cf 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php @@ -6,40 +6,25 @@ namespace Magento\User\Test\Constraint; -use Magento\Backend\Test\Page\AdminAuthLogin; use Magento\Backend\Test\Page\Adminhtml\Dashboard; use Magento\User\Test\Fixture\User; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertUserSuccessLogin + * Verify whether customer has logged in to the Backend. */ class AssertUserSuccessLogin extends AbstractConstraint { /** - * Verify whether customer has logged in to the Backend + * Verify whether customer has logged in to the Backend. * * @param User $user - * @param AdminAuthLogin $adminAuth * @param Dashboard $dashboard - * @param User $customAdmin - * @internal param null|string $userToLoginInAssert * @return void */ - public function processAssert( - User $user, - AdminAuthLogin $adminAuth, - Dashboard $dashboard, - User $customAdmin = null - ) { - $adminAuth->open(); - $adminUser = $customAdmin === null ? $user : $customAdmin; - if ($dashboard->getAdminPanelHeader()->isVisible()) { - $dashboard->getAdminPanelHeader()->logOut(); - } - $adminAuth->getLoginBlock()->fill($adminUser); - $adminAuth->getLoginBlock()->submit(); - + public function processAssert(User $user, Dashboard $dashboard) + { + $this->objectManager->create('Magento\User\Test\TestStep\LoginUserOnBackendStep', ['user' => $user])->run(); \PHPUnit_Framework_Assert::assertTrue( $dashboard->getAdminPanelHeader()->isLoggedIn(), 'Admin user was not logged in.' @@ -47,7 +32,7 @@ class AssertUserSuccessLogin extends AbstractConstraint } /** - * Returns success message if equals to expected message + * Returns success message if equals to expected message. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUser.php deleted file mode 100644 index 669ab32c19e254aadbcb66da4152203a65f2ed6f..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUser.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Fixture; - -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\DataFixture; -use Magento\Mtf\ObjectManager; -use Magento\Mtf\Config; - -/** - * Fixture with all necessary data for user creation on backend - * - */ -class AdminUser extends DataFixture -{ - /** - * @param Config $configuration - * @param array $placeholders - */ - public function __construct(Config $configuration, $placeholders = []) - { - $placeholders['password'] = isset($placeholders['password']) ? $placeholders['password'] : '123123q'; - parent::__construct($configuration, $placeholders); - $this->_placeholders['sales_all_scopes'] = [$this, 'roleProvider']; - } - - /** - * Retrieve specify data from role.trieve specify data from role. - * - * @param $roleName - * @return mixed - */ - protected function roleProvider($roleName) - { - $role = Factory::getFixtureFactory()->getMagentoUserRole(); - $role->switchData($roleName); - $data = $role->persist(); - return $data['id']; - } - - /** - * initialize data - */ - protected function _initData() - { - /** @var \Magento\Mtf\Config $systemConfig */ - $systemConfig = ObjectManager::getInstance()->create('Magento\Mtf\Config'); - $superAdminPassword = $systemConfig->get('application/backendPassword'); - $this->_data = [ - 'fields' => [ - 'email' => [ - 'value' => 'email%isolation%@example.com', - ], - 'firstname' => [ - 'value' => 'firstname%isolation%', - ], - 'lastname' => [ - 'value' => 'lastname%isolation%', - ], - 'password' => [ - 'value' => '%password%', - ], - 'password_confirmation' => [ - 'value' => '%password%', - ], - 'roles' => [ - 'value' => ['1'], - ], - 'username' => [ - 'value' => 'admin%isolation%', - ], - 'current_password' => [ - 'value' => $superAdminPassword, - ], - ], - ]; - } - - /** - * @return string - */ - public function getEmail() - { - return $this->getData('fields/email/value'); - } - - /** - * @return string - */ - public function getPassword() - { - return $this->getData('fields/password/value'); - } - - /** - * @return string - */ - public function getUsername() - { - return $this->getData('fields/username/value'); - } - - /** - * Create user - */ - public function persist() - { - Factory::getApp()->magentoUserCreateUser($this); - } - - /** - * Set password for user - * - * @param string $password - */ - public function setPassword($password) - { - $this->_data['fields']['password']['value'] = $password; - $this->_data['fields']['password_confirmation']['value'] = $password; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole.xml b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole.xml deleted file mode 100644 index 3cdab7dfc0b11bc54d89f847a947055afeebd8ce..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?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:schemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="adminUserRole" module="Magento_User" type="flat" entity_type="authorization_role" collection="Magento\User\Model\Resource\Role\User\Collection" repository_class="Magento\User\Test\Repository\AdminUserRole" handler_interface="Magento\User\Test\Handler\AdminUserRole\AdminUserRoleInterface" class="Magento\User\Test\Fixture\AdminUserRole"> - <dataset name="default"> - <field name="rolename" xsi:type="string">AdminRole%isolation%</field> - <field name="resource_access" xsi:type="string">All</field> - </dataset> - <field name="role_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="parent_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="tree_level" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="sort_order" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="role_type" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="user_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="rolename" is_required="" group="role-info"> - <default_value xsi:type="string">AdminRole%isolation%</default_value> - </field> - <field name="user_type" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="resource_access" group="role-resources"> - <default_value xsi:type="string">All</default_value> - </field> - <field name="roles_resources" group="role-resources"/> - <field name="in_role_users" group="in_role_users" source="Magento\User\Test\Fixture\AdminUserRole\InRoleUsers"/> - </fixture> -</config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Resource.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Resource.php deleted file mode 100644 index 89e81d3e7b73db217e8e7f1b95a0d37d2af8192b..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Resource.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\User\Test\Fixture; - -use Magento\Mtf\Fixture\DataFixture; - -/** - * ACL resources fixture - * - */ -class Resource extends DataFixture -{ - /** - * resources from the three in array - * key is resource id, value is parent id - * - * @var array - */ - protected $resources = [ - 'Magento_Backend::dashboard' => null, - 'Magento_Sales::sales' => null, - 'Magento_Sales::sales_operation' => 'Magento_Sales::sales', - 'Magento_Sales::sales_order' => 'Magento_Sales::sales_operation', - 'Magento_Sales::actions' => 'Magento_Sales::sales_order', - 'Magento_Sales::create' => 'Magento_Sales::actions', - 'Magento_Sales::actions_view' => 'Magento_Sales::actions', - 'Magento_Sales::email' => 'Magento_Sales::actions', - 'Magento_Sales::reorder' => 'Magento_Sales::actions', - 'Magento_Sales::actions_edit' => 'Magento_Sales::actions', - 'Magento_Sales::cancel' => 'Magento_Sales::actions', - 'Magento_Sales::review_payment' => 'Magento_Sales::actions', - 'Magento_Sales::capture' => 'Magento_Sales::actions', - 'Magento_Sales::invoice' => 'Magento_Sales::actions', - 'Magento_Sales::creditmemo' => 'Magento_Sales::actions', - 'Magento_Sales::hold' => 'Magento_Sales::actions', - 'Magento_Sales::unhold' => 'Magento_Sales::actions', - 'Magento_Sales::ship' => 'Magento_Sales::actions', - 'Magento_Sales::comment' => 'Magento_Sales::actions', - 'Magento_Sales::emails' => 'Magento_Sales::actions', - 'Magento_Sales::sales_invoice' => 'Magento_Sales::sales_operation', - 'Magento_Sales::shipment' => 'Magento_Sales::sales_operation', - 'Magento_Sales::sales_creditmemo' => 'Magento_Sales::sales_operation', - 'Magento_Paypal::billing_agreement' => 'Magento_Sales::sales_operation', - 'Magento_Paypal::billing_agreement_actions' => 'Magento_Paypal::billing_agreement', - 'Magento_Paypal::billing_agreement_actions_view' => 'Magento_Paypal::billing_agreement_actions', - 'Magento_Paypal::actions_manage' => 'Magento_Paypal::billing_agreement_actions', - 'Magento_Paypal::use' => 'Magento_Paypal::billing_agreement_actions', - 'Magento_Sales::transactions' => 'Magento_Sales::sales_operation', - 'Magento_Sales::transactions_fetch' => 'Magento_Sales::transactions', - ]; - - /** - * {@inheritdoc} - */ - protected function _initData() - { - } - - /** - * Just a stub of inherited method - * - * @throws \BadMethodCallException - */ - public function persist() - { - throw new \BadMethodCallException('This method is not applicable here. It is data provider for role fixture'); - } - - /** - * Return requested resource, all it's children and parents - * - * @param string $resourceId - * @throws \InvalidArgumentException - * @return array - */ - public function get($resourceId = null) - { - if (!array_key_exists($resourceId, $this->resources)) { - throw new \InvalidArgumentException('No resource "' . $resourceId . '" found'); - } - $withParents = $this->getParents($resourceId); - $withParents[] = $resourceId; - return array_merge($withParents, $this->getChildren($resourceId)); - } - - /** - * Get all direct parents - * - * @param string $resourceId - * @return array - */ - protected function getParents($resourceId) - { - if (is_null($this->resources[$resourceId])) { - return []; - } - - $parents = []; - $current = $this->resources[$resourceId]; - - while (!is_null($this->resources[$current])) { - $parents[] = $current; - $current = $this->resources[$current]; - } - $parents[] = $current; - - return $parents; - } - - /** - * Get all child resources - * - * @param string $resourceId - * @return array - */ - protected function getChildren($resourceId) - { - $children = array_keys($this->resources, $resourceId); - $result = $children; - foreach ($children as $child) { - $result = array_merge($result, $this->getChildren($child)); - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.php deleted file mode 100644 index acb266f5d6c6978f4a7b9ffee53445115d0d2f33..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Fixture; - -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\DataFixture; - -/** - * Class Role - * - */ -class Role extends DataFixture -{ - /** - * {@inheritdoc} - */ - public function persist() - { - return Factory::getApp()->magentoUserCreateRole($this); - } - - /** - * {@inheritdoc} - */ - protected function _initData() - { - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoUserRole($this->_dataConfig, $this->_data); - } - - /** - * Set custom ACL resource array to role - * - * @param array $resource - */ - public function setResource(array $resource) - { - $this->_data['fields']['resource']['value'] = $resource; - } - - /** - * Merge resource array with existing values - * - * @param array $resource - */ - public function addResource(array $resource) - { - $this->_data['fields']['resource']['value'] = array_merge_recursive( - $this->_data['fields']['resource']['value'], - $resource - ); - } - - /** - * Set websites of stores if current data set works with them - * - * @param array $items - * @throws \InvalidArgumentException - */ - public function setScopeItems(array $items) - { - if (array_key_exists('gws_store_groups', $this->_data['fields'])) { - $scope = 'gws_store_groups'; - } elseif (array_key_exists('gws_websites', $this->_data['fields'])) { - $scope = 'gws_websites'; - } else { - throw new \InvalidArgumentException('Current data set doesn\'t work with stores and websites'); - } - $this->_data['fields'][$scope]['value'] = $items; - } - - /** - * Convert data from canonical array to repository native format - * - * @param array $data - * @return array - */ - protected function convertData(array $data) - { - $result = []; - foreach ($data as $key => $value) { - $result['fields'][$key]['value'] = $value; - } - return $result; - } - - /** - * Save custom data set to repository - * - * @param string $name - * @param array $data - * @param bool $convert convert data from canonical array to repository native format - */ - public function save($name, array $data, $convert = true) - { - if ($convert) { - $data = $this->convertData($data); - } - $this->_repository->set($name, $data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml new file mode 100644 index 0000000000000000000000000000000000000000..671556ced60023e557fce39be0f51dd6fef2d5d9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml @@ -0,0 +1,44 @@ +<?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:schemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> + <fixture name="role" module="Magento_User" type="flat" entity_type="authorization_role" collection="Magento\User\Model\Resource\Role\User\Collection" repository_class="Magento\User\Test\Repository\Role" handler_interface="Magento\User\Test\Handler\Role\RoleInterface" class="Magento\User\Test\Fixture\Role"> + <dataset name="default"> + <field name="rolename" xsi:type="string">AdminRole%isolation%</field> + <field name="resource_access" xsi:type="string">All</field> + </dataset> + <field name="role_id" is_required="1"> + <default_value xsi:type="null"/> + </field> + <field name="parent_id" is_required=""> + <default_value xsi:type="number">0</default_value> + </field> + <field name="tree_level" is_required=""> + <default_value xsi:type="number">0</default_value> + </field> + <field name="sort_order" is_required=""> + <default_value xsi:type="number">0</default_value> + </field> + <field name="role_type" is_required=""> + <default_value xsi:type="number">0</default_value> + </field> + <field name="user_id" is_required=""> + <default_value xsi:type="number">0</default_value> + </field> + <field name="rolename" is_required="" group="role-info"> + <default_value xsi:type="string">AdminRole%isolation%</default_value> + </field> + <field name="user_type" is_required=""> + <default_value xsi:type="null"/> + </field> + <field name="resource_access" group="role-resources"> + <default_value xsi:type="string">All</default_value> + </field> + <field name="roles_resources" group="role-resources"/> + <field name="in_role_users" group="in_role_users" source="Magento\User\Test\Fixture\Role\InRoleUsers"/> + </fixture> +</config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole/InRoleUsers.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php similarity index 97% rename from dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole/InRoleUsers.php rename to dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php index eb1f27ccdc821d844c57b3607abcf09b43b429a0..bd716bbeabb47af94db3a766d59fa37cc14559d5 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole/InRoleUsers.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\User\Test\Fixture\AdminUserRole; +namespace Magento\User\Test\Fixture\Role; use Magento\User\Test\Fixture\User; use Magento\Mtf\Fixture\FixtureFactory; diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php index 6ee9c5eb5ed81f2379f24ba2c4f3ef69cc3d96d3..93e9e336080fe47fbad5c152dfa9347458029076 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php @@ -6,12 +6,12 @@ namespace Magento\User\Test\Fixture\User; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class RoleId + * Source for Role of User. * * Data keys: * - dataSet @@ -20,14 +20,14 @@ use Magento\Mtf\Fixture\FixtureInterface; class RoleId implements FixtureInterface { /** - * Admin User Role + * Admin User Role. * - * @var AdminUserRole + * @var Role */ protected $role; /** - * User role name + * User role name. * * @var string */ @@ -43,20 +43,23 @@ class RoleId implements FixtureInterface { $this->params = $params; if (isset($data['dataSet']) && $data['dataSet'] !== '-') { - $this->role = $fixtureFactory->createByCode('adminUserRole', ['dataSet' => $data['dataSet']]); + list($fixtureCode, $dataSet) = explode('::', $data['dataSet']); + $this->role = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); if (!$this->role->hasData('role_id')) { $this->role->persist(); } $this->data = $this->role->getRoleName(); } - if (isset($data['role']) && $data['role'] instanceof AdminUserRole) { + if (isset($data['role']) && $data['role'] instanceof Role) { $this->role = $data['role']; $this->data = $data['role']->getRoleName(); + } elseif (isset($data['value'])) { + $this->data = $data['value']; } } /** - * Persist user role + * Persist user role. * * @return void */ @@ -66,7 +69,7 @@ class RoleId implements FixtureInterface } /** - * Return prepared data set + * Return prepared data set. * * @param string $key [optional] * @return string|null @@ -79,7 +82,7 @@ class RoleId implements FixtureInterface } /** - * Return data set configuration settings + * Return data set configuration settings. * * @return array */ @@ -89,9 +92,9 @@ class RoleId implements FixtureInterface } /** - * Return role fixture + * Return role fixture. * - * @return AdminUserRole + * @return Role */ public function getRole() { diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/Curl.php deleted file mode 100644 index faec3b0798ed32cf7d9ab2ae1a51052f2f985fc1..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/Curl.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Handler\AdminUserRole; - -use Magento\Backend\Test\Handler\Extractor; -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl as AbstractCurl; -use Magento\Mtf\Config; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Class Curl - * Creates Admin User role - */ -class Curl extends AbstractCurl implements AdminUserRoleInterface -{ - /** - * Curl creation of Admin User Role - * - * @param FixtureInterface $fixture - * @return array|mixed - * @throws \Exception - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $fixture->getData(); - $data['all'] = ($data['resource_access'] == 'All') ? 1 : 0; - if (isset($data['roles_resources'])) { - foreach ((array)$data['roles_resources'] as $resource) { - $data['resource'][] = $resource; - } - } - unset($data['roles_resources']); - $data['gws_is_all'] = (isset($data['gws_is_all'])) ? $data['gws_is_all'] : '1'; - if ($fixture->hasData('in_role_user')) { - $adminUsers = $fixture->getDataFieldConfig('in_role_user')['source']->getAdminUsers(); - $userIds = []; - foreach ($adminUsers as $adminUser) { - $userIds[] = $adminUser->getUserId() . "=true"; - } - $data['in_role_user'] = implode('&', $userIds); - } - $url = $_ENV['app_backend_url'] . 'admin/user_role/saverole/active_tab/info/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception("Role creating by curl handler was not successful! Response: $response"); - } - - $url = 'admin/user_role/roleGrid/sort/role_id/dir/desc/'; - $regExpPattern = '/class=\"\scol\-id col\-role_id\W*>\W+(\d+)\W+<\/td>\W+<td[\w\s\"=\-]*?>\W+?' - . $data['rolename'] . '/siu'; - - $extractor = new Extractor($url, $regExpPattern); - - return ['role_id' => $extractor->getData()[1]]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateRole.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateRole.php deleted file mode 100644 index 8c5e8cde4eb080d682749193982dbebe8fc72407..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateRole.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Handler\Curl; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Config; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Class CreateCategory. - * Curl handler for creating category. - * - */ -class CreateRole extends Curl -{ - /** - * Convert array from canonical to UI format - * - * @param array $fields - * @return array - */ - protected function _preparePostData(array $fields) - { - $data = []; - foreach ($fields as $key => $value) { - $data[$key] = $value['value']; - } - return $data; - } - - /** - * Look for role id on grid - * - * @param string $name - * @param string $page - * @return bool|string - */ - protected function findRoleOnPage($name, $page) - { - $dom = new \DOMDocument(); - $dom->loadHTML($page); - $xpath = new \DOMXPath($dom); - $row = '//tr[td[@data-column="role_name" and contains(text(),"' . $name . '")]]'; - $nodes = $xpath->query($row . '/td[@data-column="role_id"]'); - if ($nodes->length == 0) { - return false; - } - $node = $nodes->item(0); - $id = trim($node->nodeValue); - return $id; - } - - /** - * Send POST request with encoded filter parameters in URL - * - * @param $name - * @return string - */ - protected function filterByName($name) - { - $filter = base64_encode('role_name=' . $name); - $url = $_ENV['app_backend_url'] . 'admin/user_role/roleGrid/filter/' . $filter . '/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write(CurlInterface::POST, $url, '1.0', [], []); - $response = $curl->read(); - $curl->close(); - return $response; - } - - /** - * Look for needed role name and define id by name, - * if the role is absent on the page, filtering is performed - * - * @param string $name - * @param string $response - * @return bool|string - * @throws \UnderflowException - * @throws \Exception - */ - protected function findIdWithFilter($name, $response) - { - preg_match('/<table[\ \w\"\=]+id\="roleGrid_table">.*?<\/table>/siu', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find grid in response'); - } - $gridHtml = $matches[0]; - - $id = $this->findRoleOnPage($name, $gridHtml); - - // maybe, role is on another page, let's filter - if (false === $id) { - $newPage = $this->filterByName($name); - $id = $this->findRoleOnPage($name, $newPage); - } - - // still not found?? It's very suspicious. - if (false === $id) { - throw new \UnderflowException('Role with name "' . $name . '" not found'); - } - - return $id; - } - - /** - * Execute handler - * - * @param FixtureInterface|null $fixture [optional] - * @throws \UnexpectedValueException - * @throws \UnderflowException from findIdWithFilter - * @throws \Exception from findIdWithFilter - * @return mixed - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . 'admin/user_role/saverole/'; - $data = $this->_preparePostData($fixture->getData('fields')); - - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \UnexpectedValueException('Success confirmation not found'); - } - - $data['id'] = $this->findIdWithFilter($data['rolename'], $response); - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php deleted file mode 100644 index ed2c2f0a2e039ef034f238a183ea0c6e56623108..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\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 persisting Magento user - * - */ -class CreateUser extends Curl -{ - /** - * Prepare data for using in the execute method - * - * @param array $fields - * @return array - */ - protected function _prepareData(array $fields) - { - $data = []; - foreach ($fields as $key => $value) { - $data[$key] = $value['value']; - } - return $data; - } - - /** - * Get id for newly created user - * - * @param $data - * @return mixed - * @throws \Exception - */ - protected function _getUserId($data) - { - //Sort data in grid to define user id if more than 20 items in grid - $url = $_ENV['app_backend_url'] . 'admin/user/roleGrid/sort/user_id/dir/desc'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0'); - $response = $curl->read(); - $curl->close(); - preg_match( - '/class=\"\scol\-id col\-user_id\W*>\W*(\d+)\W*<\/td>\W*<td[\w\s\"=\-]*?>\W*?' . $data['username'] . '/siu', - $response, - $matches - ); - if (empty($matches)) { - throw new \Exception('Cannot find user id'); - } - return $matches[1]; - } - - /** - * Post request for creating user in backend - * - * @param FixtureInterface $fixture - * @return array|mixed - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . 'admin/user/save'; - $data = $this->_prepareData($fixture->getData('fields')); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'data-ui-id="messages-message-success"')) { - throw new \Exception("User creation by curl handler was not successful! Response: $response"); - } - //Sort data in grid to define user id if more than 20 items in grid - $url = $_ENV['app_backend_url'] . 'admin/user/roleGrid/sort/user_id/dir/desc'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write(CurlInterface::POST, $url, '1.0', [], $data); - $curl->read(); - $curl->close(); - $data['id'] = $this->_getUserId($data); - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php new file mode 100644 index 0000000000000000000000000000000000000000..ad63a648f0bd1c74f183d09dcb12a99defa2b6c0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php @@ -0,0 +1,142 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\User\Test\Handler\Role; + +use Magento\Backend\Test\Handler\Extractor; +use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Handler\Curl as AbstractCurl; +use Magento\Mtf\Config; +use Magento\Mtf\Util\Protocol\CurlInterface; +use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; + +/** + * Creates Admin User role. + */ +class Curl extends AbstractCurl implements RoleInterface +{ + /** + * Additional mapping values for data. + * + * @var array + */ + protected $additionalMappingData = []; + + /** + * @constructor + * @param Config $configuration + */ + public function __construct(Config $configuration) + { + $this->mappingData = array_merge( + (null !== $this->mappingData) ? $this->mappingData : [], + $this->additionalMappingData + ); + parent::__construct($configuration); + } + + /** + * Curl creation of Admin User Role. + * + * @param FixtureInterface $fixture + * @return array|mixed + * @throws \Exception + */ + public function persist(FixtureInterface $fixture = null) + { + $data = $this->prepareData($fixture); + $url = $_ENV['app_backend_url'] . 'admin/user_role/saverole/active_tab/info/'; + $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); + $curl->addOption(CURLOPT_HEADER, 1); + $curl->write(CurlInterface::POST, $url, '1.0', [], $data); + $response = $curl->read(); + $curl->close(); + + if (!strpos($response, 'data-ui-id="messages-message-success"')) { + throw new \Exception("Role creating by curl handler was not successful! Response: $response"); + } + + $url = 'admin/user_role/roleGrid/sort/role_id/dir/desc/'; + $regExpPattern = '/col\-role_id\W*(\d+)<.td><[^<>]*?>' . $data['rolename'] . '/siu'; + + $extractor = new Extractor($url, $regExpPattern); + + return ['role_id' => $extractor->getData()[1]]; + } + + /** + * Prepare fixture data before send. + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareData(FixtureInterface $fixture = null) + { + $data = $fixture->getData(); + $data = $this->prepareResourceAccess($data); + $data = array_merge($data, $this->prepareAssignedUsers($fixture)); + $data = array_merge($data, $this->prepareAdminScope($data)); + + return $this->replaceMappingData($data); + } + + /** + * Prepare role resources data. + * + * @param array $data + * @return array + */ + protected function prepareResourceAccess(array $data) + { + $data['all'] = ($data['resource_access'] == 'All') ? 1 : 0; + if (isset($data['roles_resources'])) { + foreach ((array)$data['roles_resources'] as $resource) { + $data['resource'][] = $resource; + } + } + + return $data; + } + + /** + * Assign users to the role. + * + * @param FixtureInterface $fixture + * @return array + */ + protected function prepareAssignedUsers(FixtureInterface $fixture) + { + if (!$fixture->hasData('in_role_user')) { + return []; + } + $adminUsers = $fixture->getDataFieldConfig('in_role_user')['source']->getAdminUsers(); + $userIds = []; + foreach ($adminUsers as $adminUser) { + $userIds[] = $adminUser->getUserId() . "=true"; + } + + return ['in_role_user' => implode('&', $userIds)]; + } + + // TODO: Method should be removed in scope of MAGETWO-31563 + /** + * Prepare admin gws option. + * + * @param array $data + * @return array + */ + protected function prepareAdminScope(array $data) + { + if (isset($data['gws_is_all'])) { + $data['gws_is_all'] = 'All' == $data['gws_is_all'] ? 1 : 0; + } else { + $data['gws_is_all'] = 1; + } + + return $data; + } +} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/AdminUserRoleInterface.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/RoleInterface.php similarity index 53% rename from dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/AdminUserRoleInterface.php rename to dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/RoleInterface.php index a7d0408abdba75e672a9131b4d2b45b0ff4cdba9..904bf57a01ca5c77237878fc684d9ad6bf66ae5b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/AdminUserRoleInterface.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/RoleInterface.php @@ -4,14 +4,14 @@ * See COPYING.txt for license details. */ -namespace Magento\User\Test\Handler\AdminUserRole; +namespace Magento\User\Test\Handler\Role; use Magento\Mtf\Handler\HandlerInterface; /** - * Interface AdminUserRoleInterface + * Interface RoleInterface */ -interface AdminUserRoleInterface extends HandlerInterface +interface RoleInterface extends HandlerInterface { // } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php index 2ba46490546be3923237737ceeca1b03b4b5b0b5..a79b2ec796f6c18e51dc1783d109a244ba7f29ca 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php @@ -47,8 +47,7 @@ class Curl extends AbstractCurl implements UserInterface } $url = 'admin/user/roleGrid/sort/user_id/dir/desc'; - $regExpPattern = '/class=\"\scol\-id col\-user_id\W*>\W+(\d+)\W+<\/td>\W+<td[\w\s\"=\-]*?>\W+?' - . $data['username'] . '/siu'; + $regExpPattern = '/col-user_id\W*(\d+)<.td><[^<>]*?>' . $data['username'] . '/siu'; $extractor = new Extractor($url, $regExpPattern); return ['user_id' => $extractor->getData()[1]]; diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml b/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml index 93868a2d47a883da99dd796941821f2cefa4bc88..35e58ff38d2fa1e0033e3949f49e4474315019da 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml @@ -6,10 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="UserIndex" area="Adminhtml" mca="admin/user" module="Magento_User"> - <block name="pageActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="userGrid" class="Magento\User\Test\Block\Adminhtml\UserGrid" locator="#permissionsUserGrid" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> - <block name="accessDeniedBlock" class="Magento\Backend\Test\Block\Denied" locator="#anchor-content" strategy="css selector"/> - </page> + <page name="UserIndex" area="Adminhtml" mca="admin/user" module="Magento_User"> + <block name="pageActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector"/> + <block name="userGrid" class="Magento\User\Test\Block\Adminhtml\UserGrid" locator="#permissionsUserGrid" strategy="css selector"/> + <block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUser.php deleted file mode 100644 index 9046699e1a452f9bb5b7987654c28a62594219e3..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUser.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Repository; - -use Magento\Mtf\Repository\AbstractRepository; - -/** - * Class Admin User Repository - * - */ -class AdminUser extends AbstractRepository -{ - /** - * {@inheritdoc} - */ - public function __construct(array $defaultConfig = [], array $defaultData = []) - { - $this->_data['admin_default'] = [ - 'config' => $defaultConfig, - 'data' => $defaultData, - ]; - $this->_data['user_with_sales_resource'] = $this->_getUserWithRole('sales_all_scopes'); - } - - /** - * Build data for user - * - * @param string $roleName - * @return array - */ - protected function _getUserWithRole($roleName) - { - $role = [ - 'data' => [ - 'fields' => [ - 'roles' => [ - 'value' => ["%$roleName%"], - ], - ], - ], - ]; - - return array_replace_recursive($this->_data['admin_default'], $role); - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.php b/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.php deleted file mode 100644 index 08eb926a06a3e94c0a16ab168b2e50b31a41eb59..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.php +++ /dev/null @@ -1,152 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Test\Repository; - -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Repository\AbstractRepository; - -/** - * Class Abstract Repository - * - */ -class Role extends AbstractRepository -{ - /** - * {@inheritdoc} - */ - public function __construct(array $defaultConfig = [], array $defaultData = []) - { - $this->_data['default'] = [ - 'config' => $defaultConfig, - 'data' => $defaultData, - ]; - - $this->initRoleTemplates(); - $this->initCustomRoles(); - } - - /** - * Role templates with different scopes for custom filling with resources, sites or stores - */ - protected function initRoleTemplates() - { - $dataTemplate = [ - 'fields' => [ - 'all' => [ - 'value' => 0, - ], - 'gws_is_all' => [ - 'value' => 0, - ], - 'rolename' => [ - 'value' => 'auto%isolation%', - ], - ], - ]; - - $this->_data['all_permissions_all_scopes']['data'] = $this->setPermissions( - 'all', - $this->setScope('all', $dataTemplate) - ); - - $this->_data['all_permissions_website_scope']['data'] = $this->setPermissions( - 'all', - $this->setScope('website', $dataTemplate) - ); - - $this->_data['all_permissions_store_scope']['data'] = $this->setPermissions( - 'all', - $this->setScope('store', $dataTemplate) - ); - - $this->_data['custom_permissions_all_scopes']['data'] = $this->setPermissions( - 'custom', - $this->setScope('all', $dataTemplate) - ); - - $this->_data['custom_permissions_website_scope']['data'] = $this->setPermissions( - 'custom', - $this->setScope('website', $dataTemplate) - ); - - $this->_data['custom_permissions_store_scope']['data'] = $this->setPermissions( - 'custom', - $this->setScope('store', $dataTemplate) - ); - } - - /** - * Init most popular custom roles - */ - protected function initCustomRoles() - { - $resourceFixture = Factory::getFixtureFactory()->getMagentoUserResource(); - $salesAllScopes = $this->_data['custom_permissions_all_scopes']['data']; - $salesAllScopes['fields']['resource']['value'] = $resourceFixture->get('Magento_Sales::sales'); - $this->_data['sales_all_scopes']['data'] = $salesAllScopes; - } - - /** - * Add role permission values to data array - * - * @param $permissions string. Possible values 'custom' or 'all' - * @param array $data - * @return array - * @throws \InvalidArgumentException - */ - protected function setPermissions($permissions, $data = []) - { - if ('all' == $permissions) { - $data['fields']['all']['value'] = 1; - } elseif ('custom' == $permissions) { - $data['fields']['all']['value'] = 0; - $data['fields']['resource']['value'] = []; - } else { - throw new \InvalidArgumentException('Invalid permissions "' . $permissions . '"'); - } - return $data; - } - - /** - * Set role scope: all, website or store - * - * @param string $scope possible values 'all', 'website', 'store' - * @param array $data - * @return array - * @throws \InvalidArgumentException - */ - protected function setScope($scope, $data = []) - { - switch ($scope) { - case 'all': - $data['fields']['gws_is_all']['value'] = 1; - break; - case 'website': - $data['fields']['gws_is_all']['value'] = 0; - $data['fields']['gws_websites']['value'] = []; - break; - case 'store': - $data['fields']['gws_is_all']['value'] = 0; - $data['fields']['gws_store_groups']['value'] = []; - break; - default: - throw new \InvalidArgumentException('Invalid role scope "' . $scope . '"'); - } - return $data; - } - - /** - * Save custom data set to repository - * - * @param string $dataSetName - * @param array $data - */ - public function set($dataSetName, array $data) - { - $this->_data[$dataSetName]['data'] = $data; - } -} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUserRole.xml b/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.xml similarity index 97% rename from dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUserRole.xml rename to dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.xml index 153c99a4b94368a9c8c6a7da4fd253c8bdb655a9..0413aad55c01e2cfe74d044a29b2cf8007b5b38b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUserRole.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.xml @@ -7,7 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Magento\User\Test\Repository\AdminUserRole"> + <repository class="Magento\User\Test\Repository\Role"> <dataset name="default"> <field name="rolename" xsi:type="string">RoleName%isolation%</field> <field name="resource_access" xsi:type="string">All</field> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml b/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml index e16fae4b2fc760e5f813174b5a2d869d2cc17f99..ab4fdba7cb44fb5833a6e2f994f3c2693d217e07 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml @@ -36,7 +36,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="role_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataSet" xsi:type="string">role::default</item> </field> <field name="current_password" xsi:type="string">%current_password%</field> <field name="is_active" xsi:type="string">Active</field> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml index 39f5dee8caa4b240a667cb8dcf00f9410eef9099..c71d32fb5b91f118f3c8067ff82d467861638f4b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml @@ -6,93 +6,89 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\User\Test\TestCase\CreateAdminUserEntityTest"> - <variation name="CreateAdminUserEntityTestVariation1"> - <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> - <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> - <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> - <data name="user/data/password" xsi:type="string">123123q</data> - <data name="user/data/password_confirmation" xsi:type="string">123123q</data> - <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">Administrators</data> - <data name="isDuplicated" xsi:type="string">-</data> - <data name="user/data/current_password" xsi:type="string">%current_password%</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="CreateAdminUserEntityTestVariation2"> - <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> - <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> - <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> - <data name="user/data/password" xsi:type="string">123123q</data> - <data name="user/data/password_confirmation" xsi:type="string">123123q</data> - <data name="user/data/is_active" xsi:type="string">Inactive</data> - <data name="user/data/role_id/dataSet" xsi:type="string">Administrators</data> - <data name="isDuplicated" xsi:type="string">-</data> - <data name="user/data/current_password" xsi:type="string">%current_password%</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserWrongCredentialsMessage"/> - </variation> - <variation name="CreateAdminUserEntityTestVariation3"> - <data name="user/data/username" xsi:type="string">-</data> - <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> - <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> - <data name="user/data/password" xsi:type="string">123123q</data> - <data name="user/data/password_confirmation" xsi:type="string">123123q</data> - <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">Administrators</data> - <data name="isDuplicated" xsi:type="string">username</data> - <data name="user/data/current_password" xsi:type="string">%current_password%</data> - <constraint name="Magento\User\Test\Constraint\AssertUserDuplicateMessage"/> - </variation> - <variation name="CreateAdminUserEntityTestVariation4"> - <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> - <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> - <data name="user/data/email" xsi:type="string">-</data> - <data name="user/data/password" xsi:type="string">123123q</data> - <data name="user/data/password_confirmation" xsi:type="string">123123q</data> - <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">Administrators</data> - <data name="isDuplicated" xsi:type="string">email</data> - <data name="user/data/current_password" xsi:type="string">%current_password%</data> - <constraint name="Magento\User\Test\Constraint\AssertUserDuplicateMessage"/> - </variation> - <variation name="CreateAdminUserEntityTestVariation5"> - <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> - <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> - <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> - <data name="user/data/password" xsi:type="string">123123q</data> - <data name="user/data/password_confirmation" xsi:type="string">123123q</data> - <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">-</data> - <data name="isDuplicated" xsi:type="string">-</data> - <data name="user/data/current_password" xsi:type="string">%current_password%</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserWrongCredentialsMessage"/> - </variation> - <variation name="CreateAdminUserEntityTestVariation6"> - <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> - <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> - <data name="user/data/email" xsi:type="string">email%isolation%@example.cim</data> - <data name="user/data/password" xsi:type="string">123123q</data> - <data name="user/data/password_confirmation" xsi:type="string">123123q</data> - <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">-</data> - <data name="isDuplicated" xsi:type="string">-</data> - <data name="user/data/current_password" xsi:type="string">%current_password%</data> - <constraint name="Magento\User\Test\Constraint\AssertUserInvalidEmailMessage"/> - </variation> - </testCase> + <testCase name="Magento\User\Test\TestCase\CreateAdminUserEntityTest"> + <variation name="CreateAdminUserEntityTestVariation1"> + <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> + <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> + <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> + <data name="user/data/password" xsi:type="string">123123q</data> + <data name="user/data/password_confirmation" xsi:type="string">123123q</data> + <data name="user/data/is_active" xsi:type="string">Active</data> + <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="isDuplicated" xsi:type="string">-</data> + <data name="user/data/current_password" xsi:type="string">%current_password%</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> + </variation> + <variation name="CreateAdminUserEntityTestVariation2"> + <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> + <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> + <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> + <data name="user/data/password" xsi:type="string">123123q</data> + <data name="user/data/password_confirmation" xsi:type="string">123123q</data> + <data name="user/data/is_active" xsi:type="string">Inactive</data> + <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="isDuplicated" xsi:type="string">-</data> + <data name="user/data/current_password" xsi:type="string">%current_password%</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> + <constraint name="Magento\User\Test\Constraint\AssertUserWrongCredentialsMessage"/> + </variation> + <variation name="CreateAdminUserEntityTestVariation3"> + <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> + <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> + <data name="user/data/password" xsi:type="string">123123q</data> + <data name="user/data/password_confirmation" xsi:type="string">123123q</data> + <data name="user/data/is_active" xsi:type="string">Active</data> + <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="isDuplicated" xsi:type="string">username</data> + <data name="user/data/current_password" xsi:type="string">%current_password%</data> + <constraint name="Magento\User\Test\Constraint\AssertUserDuplicateMessage"/> + </variation> + <variation name="CreateAdminUserEntityTestVariation4"> + <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> + <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> + <data name="user/data/password" xsi:type="string">123123q</data> + <data name="user/data/password_confirmation" xsi:type="string">123123q</data> + <data name="user/data/is_active" xsi:type="string">Active</data> + <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="isDuplicated" xsi:type="string">email</data> + <data name="user/data/current_password" xsi:type="string">%current_password%</data> + <constraint name="Magento\User\Test\Constraint\AssertUserDuplicateMessage"/> + </variation> + <variation name="CreateAdminUserEntityTestVariation5"> + <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> + <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> + <data name="user/data/email" xsi:type="string">email%isolation%@example.com</data> + <data name="user/data/password" xsi:type="string">123123q</data> + <data name="user/data/password_confirmation" xsi:type="string">123123q</data> + <data name="user/data/is_active" xsi:type="string">Active</data> + <data name="isDuplicated" xsi:type="string">-</data> + <data name="user/data/current_password" xsi:type="string">%current_password%</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> + <constraint name="Magento\User\Test\Constraint\AssertUserWrongCredentialsMessage"/> + </variation> + <variation name="CreateAdminUserEntityTestVariation6"> + <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> + <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">LastName%isolation%</data> + <data name="user/data/email" xsi:type="string">email%isolation%@example.cim</data> + <data name="user/data/password" xsi:type="string">123123q</data> + <data name="user/data/password_confirmation" xsi:type="string">123123q</data> + <data name="user/data/is_active" xsi:type="string">Active</data> + <data name="isDuplicated" xsi:type="string">-</data> + <data name="user/data/current_password" xsi:type="string">%current_password%</data> + <constraint name="Magento\User\Test\Constraint\AssertUserInvalidEmailMessage"/> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php index 57ae388e1a34cd35a209afbacee0758a62c99b6b..f37fc9ab0694a145c81bf435685bd68e24475b64 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php @@ -6,7 +6,7 @@ namespace Magento\User\Test\TestCase; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\User\Test\Page\Adminhtml\UserRoleEditRole; use Magento\User\Test\Page\Adminhtml\UserRoleIndex; use Magento\Mtf\TestCase\Injectable; @@ -59,9 +59,9 @@ class CreateAdminUserRoleEntityTest extends Injectable /** * Runs Create Admin User Role Entity test. * - * @param AdminUserRole $role + * @param Role $role */ - public function testCreateUserRole(AdminUserRole $role) + public function testCreateUserRole(Role $role) { //Steps $this->userRoleIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml index 0113079846524c4766208c56a6b23cd4e7cf3aca..aa70d5ad8bf4ec8fd910a5d90782edc20ee6aa5b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml @@ -6,20 +6,19 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\User\Test\TestCase\CreateAdminUserRoleEntityTest"> - <variation name="CreateAdminUserRoleEntityTestVariation1"> - <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> - <data name="role/data/resource_access" xsi:type="string">Custom</data> - <data name="role/data/roles_resources" xsi:type="string">Sales</data> - <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> - </variation> - <variation name="CreateAdminUserRoleEntityTestVariation2"> - <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> - <data name="role/data/resource_access" xsi:type="string">All</data> - <data name="role/data/roles_resources" xsi:type="string">-</data> - <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> - </variation> - </testCase> + <testCase name="Magento\User\Test\TestCase\CreateAdminUserRoleEntityTest"> + <variation name="CreateAdminUserRoleEntityTestVariation1"> + <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> + <data name="role/data/resource_access" xsi:type="string">Custom</data> + <data name="role/data/roles_resources" xsi:type="string">Sales</data> + <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> + </variation> + <variation name="CreateAdminUserRoleEntityTestVariation2"> + <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> + <data name="role/data/resource_access" xsi:type="string">All</data> + <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml index 49cf5bf2094e79d057a0e225395307aca49c1f25..0a8c1deb857b4ca0a083b80808332f58485fe375 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml @@ -6,15 +6,16 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\User\Test\TestCase\DeleteAdminUserEntityTest"> - <variation name="DeleteAdminUserEntityTestVariation1"> - <constraint name="Magento\User\Test\Constraint\AssertImpossibleDeleteYourOwnAccount"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - </variation> - <variation name="DeleteAdminUserEntityTestVariation2"> - <data name="isDefaultUser" xsi:type="string">1</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessDeleteMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserNotInGrid"/> - </variation> - </testCase> + <testCase name="Magento\User\Test\TestCase\DeleteAdminUserEntityTest"> + <variation name="DeleteAdminUserEntityTestVariation1"> + <data name="isDefaultUser" xsi:type="string">0</data> + <constraint name="Magento\User\Test\Constraint\AssertImpossibleDeleteYourOwnAccount" /> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid" /> + </variation> + <variation name="DeleteAdminUserEntityTestVariation2"> + <data name="isDefaultUser" xsi:type="string">1</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessDeleteMessage" /> + <constraint name="Magento\User\Test\Constraint\AssertUserNotInGrid" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php index 161917c3b546196c4ac0619af2aa9d94a2170da8..b4cf004d50b0139d06c4aba565a19b351d3512bd 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php @@ -8,7 +8,7 @@ namespace Magento\User\Test\TestCase; use Magento\Backend\Test\Page\AdminAuthLogin; use Magento\Backend\Test\Page\Adminhtml\Dashboard; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\User\Test\Fixture\User; use Magento\User\Test\Page\Adminhtml\UserRoleEditRole; use Magento\User\Test\Page\Adminhtml\UserRoleIndex; @@ -100,13 +100,13 @@ class DeleteUserRoleEntityTest extends Injectable /** * Runs Delete User Role Entity test. * - * @param AdminUserRole $role + * @param Role $role * @param User $adminUser * @param string $isDefaultUser * @return void */ public function testDeleteAdminUserRole( - AdminUserRole $role, + Role $role, User $adminUser, $isDefaultUser ) { diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml index 5a3817a86bf8940c655ab918616c5b0cebe66c06..51c92524b1b0c2d2301bb65b1047ad6367f43b7d 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\DeleteUserRoleEntityTest"> <variation name="DeleteUserRoleEntityTestVariation1"> + <data name="isDefaultUser" xsi:type="string">0</data> <constraint name="Magento\User\Test\Constraint\AssertImpossibleDeleteYourOwnRole"/> <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..692af412394d29b11c476861d27c119b054d12a1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,21 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest92"> + <data name="menuItem" xsi:type="string">System > All Users</data> + <data name="pageTitle" xsi:type="string">Users</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + <variation name="NavigateMenuTest93"> + <data name="menuItem" xsi:type="string">System > User Roles</data> + <data name="pageTitle" xsi:type="string">Roles</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php index cad7c857bfb4794f0d5abb76d72e42045a7e8937..66c76db855a19df4e1dc703639354022969daedc 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php @@ -15,9 +15,6 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for UpdateAdminUserEntity - * - * Test Flow: * Preconditions: * 1. Admin user with assigned full access role is created. * 2. Custom role with restricted permission: Sales is created @@ -38,35 +35,46 @@ class UpdateAdminUserEntityTest extends Injectable /* tags */ const MVP = 'no'; const DOMAIN = 'PS'; + const TEST_TYPE = 'acceptance_test'; /* end tags */ /** + * User list page on backend. + * * @var UserIndex */ protected $userIndex; /** + * User edit page on backend. + * * @var UserEdit */ protected $userEdit; /** + * Dashboard page on backend. + * * @var Dashboard */ protected $dashboard; /** + * Authorization page on backend. + * * @var AdminAuthLogin */ protected $adminAuth; /** + * Fixture factory. + * * @var FixtureFactory */ protected $fixtureFactory; /** - * Setup necessary data for test + * Setup necessary data for test. * * @param UserIndex $userIndex * @param UserEdit $userEdit @@ -90,16 +98,17 @@ class UpdateAdminUserEntityTest extends Injectable } /** - * Runs Update Admin User test + * Runs Update Admin User test. * - * @param User $user * @param User $initialUser + * @param User $user * @param string $loginAsDefaultAdmin * @return array + * @throws \Exception */ public function testUpdateAdminUser( - User $user, User $initialUser, + User $user, $loginAsDefaultAdmin ) { // Precondition @@ -117,20 +126,18 @@ class UpdateAdminUserEntityTest extends Injectable $this->userEdit->getUserForm()->fill($user); $this->userEdit->getPageActions()->save(); - return ['customAdmin' => $this->mergeUsers($user, $initialUser)]; + return ['user' => $this->mergeUsers($initialUser, $user)]; } /** - * Merging user data and returns custom user + * Merging user data and returns custom user. * - * @param User $user * @param User $initialUser + * @param User $user * @return User */ - protected function mergeUsers( - User $user, - User $initialUser - ) { + protected function mergeUsers(User $initialUser, User $user) + { $data = array_merge($initialUser->getData(), $user->getData()); if (isset($data['role_id'])) { $data['role_id'] = [ @@ -144,7 +151,7 @@ class UpdateAdminUserEntityTest extends Injectable } /** - * Logout Admin User from account + * Logout Admin User from account. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml index dd0f2c27818ef7106a348d6556f50ec3d56c38a9..c002a9df38696ef99b8112ca7282bdeef6203cfa 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml @@ -7,55 +7,59 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\UpdateAdminUserEntityTest"> - <variation name="UpdateAdminUserEntityTestVariation1"> - <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> - <data name="user/data/username" xsi:type="string">NewAdminUser%isolation%</data> - <data name="user/data/firstname" xsi:type="string">NewFirstName%isolation%</data> - <data name="user/data/lastname" xsi:type="string">NewLastName%isolation%</data> - <data name="user/data/email" xsi:type="string">NewEmail%isolation%@example.com</data> - <data name="user/data/password" xsi:type="string">123123qa</data> - <data name="user/data/password_confirmation" xsi:type="string">123123qa</data> - <data name="user/data/is_active" xsi:type="string">-</data> - <data name="user/data/role_id/dataSet" xsi:type="string">-</data> - <data name="user/data/current_password" xsi:type="string">123123q</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="UpdateAdminUserEntityTestVariation2"> - <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> - <data name="user/data/username" xsi:type="string">-</data> - <data name="user/data/firstname" xsi:type="string">-</data> - <data name="user/data/lastname" xsi:type="string">-</data> - <data name="user/data/email" xsi:type="string">-</data> - <data name="user/data/password" xsi:type="string">-</data> - <data name="user/data/password_confirmation" xsi:type="string">-</data> - <data name="user/data/is_active" xsi:type="string">-</data> - <data name="user/data/role_id/dataSet" xsi:type="string">role_sales</data> - <data name="user/data/current_password" xsi:type="string">123123q</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\User\Test\Constraint\AssertUserRoleSalesRestrictedAccess"/> - </variation> - <variation name="UpdateAdminUserEntityTestVariation3"> - <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> - <data name="user/data/username" xsi:type="string">-</data> - <data name="user/data/firstname" xsi:type="string">-</data> - <data name="user/data/lastname" xsi:type="string">-</data> - <data name="user/data/email" xsi:type="string">-</data> - <data name="user/data/password" xsi:type="string">-</data> - <data name="user/data/password_confirmation" xsi:type="string">-</data> - <data name="user/data/is_active" xsi:type="string">Inactive</data> - <data name="user/data/role_id/dataSet" xsi:type="string">-</data> - <data name="loginAsDefaultAdmin" xsi:type="string">1</data> - <data name="user/data/current_password" xsi:type="string">123123q</data> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserWrongCredentialsMessage"/> - </variation> + <variation name="UpdateAdminUserEntityTestVariation1"> + <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> + <data name="user/data/username" xsi:type="string">NewAdminUser%isolation%</data> + <data name="user/data/firstname" xsi:type="string">NewFirstName%isolation%</data> + <data name="user/data/lastname" xsi:type="string">NewLastName%isolation%</data> + <data name="user/data/email" xsi:type="string">NewEmail%isolation%@example.com</data> + <data name="user/data/password" xsi:type="string">123123qa</data> + <data name="user/data/password_confirmation" xsi:type="string">123123qa</data> + <data name="user/data/current_password" xsi:type="string">123123q</data> + <data name="loginAsDefaultAdmin" xsi:type="string">0</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage" /> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + </variation> + <variation name="UpdateAdminUserEntityTestVariation2"> + <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> + <data name="user/data/role_id/dataSet" xsi:type="string">role::role_sales</data> + <data name="user/data/current_password" xsi:type="string">123123q</data> + <data name="loginAsDefaultAdmin" xsi:type="string">0</data> + <data name="restrictedAccess" xsi:type="array"> + <item name="0" xsi:type="string">sales</item> + </data> + <data name="denyUrl" xsi:type="string">admin/user</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage" /> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> + <constraint name="Magento\User\Test\Constraint\AssertUserRoleRestrictedAccess" /> + </variation> + <variation name="UpdateAdminUserEntityTestVariation3"> + <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> + <data name="user/data/is_active" xsi:type="string">Inactive</data> + <data name="user/data/current_password" xsi:type="string">123123q</data> + <data name="loginAsDefaultAdmin" xsi:type="string">1</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage" /> + <constraint name="Magento\User\Test\Constraint\AssertUserInGrid" /> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut" /> + <constraint name="Magento\User\Test\Constraint\AssertUserWrongCredentialsMessage" /> + </variation> + <variation name="UpdateAdminUserEntityTestVariation4"> + <data name="description" xsi:type="string">MAGETWO-12375: Use ACL Role with Full GWS Scope (without Using Secret Key to URLs)</data> + <data name="loginAsDefaultAdmin" xsi:type="string">1</data> + <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> + <data name="user/data/role_id/dataSet" xsi:type="string">role::role_sales</data> + <data name="user/data/current_password" xsi:type="string">123123q</data> + <data name="restrictedAccess" xsi:type="array"> + <item name="0" xsi:type="string">sales</item> + </data> + <data name="denyUrl" xsi:type="string">catalog/product</data> + <data name="tag" xsi:type="string">test_type:acceptance_test</data> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage" /> + <constraint name="Magento\User\Test\Constraint\AssertUserRoleRestrictedAccess" /> + </variation> </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php index 06a396c982cbac2ccd316f69d478f20d0a6b9b00..5908a7ffd7b916234fd0d09aeb6382a9bddb58aa 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php @@ -8,7 +8,7 @@ namespace Magento\User\Test\TestCase; use Magento\Backend\Test\Page\AdminAuthLogin; use Magento\Backend\Test\Page\Adminhtml\Dashboard; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\User\Test\Fixture\User; use Magento\User\Test\Page\Adminhtml\UserRoleEditRole; use Magento\User\Test\Page\Adminhtml\UserRoleIndex; @@ -81,14 +81,14 @@ class UpdateAdminUserRoleEntityTest extends Injectable /** * Runs Update Admin User Roles Entity test * - * @param AdminUserRole $roleInit - * @param AdminUserRole $role + * @param Role $roleInit + * @param Role $role * @param User $user * @return array */ public function testUpdateAdminUserRolesEntity( - AdminUserRole $roleInit, - AdminUserRole $role, + Role $roleInit, + Role $role, User $user ) { // Preconditions @@ -108,7 +108,7 @@ class UpdateAdminUserRoleEntityTest extends Injectable $this->userRoleEditRole->getPageActions()->save(); return [ - 'customAdmin' => $role->hasData('in_role_users') + 'user' => $role->hasData('in_role_users') ? $role->getDataFieldConfig('in_role_users')['source']->getAdminUsers()[0] : $user, ]; diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml index b4ce41cdb8545f2955ea01c6fa6e5e5e9a53f6b6..e64b21124c8b1db49907f7571c2ce2242f2aa157 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml @@ -6,29 +6,33 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\User\Test\TestCase\UpdateAdminUserRoleEntityTest"> - <variation name="UpdateAdminUserRoleEntityTestVariation1"> - <data name="user/dataSet" xsi:type="string">custom_admin_with_default_role</data> - <data name="role/data/rolename" xsi:type="string">NewAdminRole%isolation%</data> - <data name="role/data/resource_access" xsi:type="string">-</data> - <data name="role/data/roles_resources" xsi:type="string">-</data> - <data name="role/data/in_role_users/dataSet" xsi:type="string">-</data> - <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - </variation> - <variation name="UpdateAdminUserRoleEntityTestVariation2"> - <data name="user/dataSet" xsi:type="string">default</data> - <data name="role/data/rolename" xsi:type="string">-</data> - <data name="role/data/resource_access" xsi:type="string">Custom</data> - <data name="role/data/roles_resources" xsi:type="string">Sales</data> - <data name="role/data/in_role_users/dataSet" xsi:type="string">custom_admin</data> - <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> - <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> - <constraint name="Magento\User\Test\Constraint\AssertUserRoleSalesRestrictedAccess"/> - </variation> - </testCase> + <testCase name="Magento\User\Test\TestCase\UpdateAdminUserRoleEntityTest"> + <variation name="UpdateAdminUserRoleEntityTestVariation1"> + <data name="user/dataSet" xsi:type="string">custom_admin_with_default_role</data> + <data name="role/data/rolename" xsi:type="string">NewAdminRole%isolation%</data> + <data name="role/data/resource_access" xsi:type="string">-</data> + <data name="role/data/roles_resources" xsi:type="string">-</data> + <data name="role/data/in_role_users/dataSet" xsi:type="string">-</data> + <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> + </variation> + <variation name="UpdateAdminUserRoleEntityTestVariation2"> + <data name="user/dataSet" xsi:type="string">default</data> + <data name="role/data/rolename" xsi:type="string">-</data> + <data name="role/data/resource_access" xsi:type="string">Custom</data> + <data name="role/data/roles_resources" xsi:type="string">Sales</data> + <data name="role/data/in_role_users/dataSet" xsi:type="string">custom_admin</data> + <data name="restrictedAccess" xsi:type="array"> + <item name="0" xsi:type="string">sales</item> + </data> + <data name="denyUrl" xsi:type="string">catalog/product</data> + <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> + <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> + <constraint name="Magento\User\Test\Constraint\AssertUserRoleRestrictedAccess"/> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php index 003e6640bdfe763919f694d9115d8a78e3d77ea4..b67ceaa5b97e363ec1116ad60abd5f217ef68aad 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php @@ -7,7 +7,7 @@ namespace Magento\User\Test\TestCase; use Magento\Backend\Test\Page\Adminhtml\Dashboard; -use Magento\User\Test\Fixture\AdminUserRole; +use Magento\User\Test\Fixture\Role; use Magento\User\Test\Fixture\User; use Magento\User\Test\Page\Adminhtml\UserEdit; use Magento\User\Test\Page\Adminhtml\UserIndex; @@ -122,14 +122,14 @@ class UserLoginAfterChangingPermissionsTest extends Injectable } /** - * @param AdminUserRole $role - * @param AdminUserRole $updatedRole + * @param Role $role + * @param Role $updatedRole * @param User $user * @return void */ public function testLoginAfterChangingPermissions( - AdminUserRole $role, - AdminUserRole $updatedRole, + Role $role, + Role $updatedRole, User $user ) { /** Create role and a new user with this role */ diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendStep.php b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendStep.php new file mode 100644 index 0000000000000000000000000000000000000000..de73873c4950e1f611ff7ba3e33a72fac1e88f3d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendStep.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\User\Test\TestStep; + +use Magento\Backend\Test\Page\AdminAuthLogin; +use Magento\Mtf\TestStep\TestStepInterface; +use Magento\User\Test\Fixture\User; + +/** + * Login user on backend. + */ +class LoginUserOnBackendStep implements TestStepInterface +{ + /** + * Logout user on backend step. + * + * @var LogoutUserOnBackendStep + */ + protected $logoutUserOnBackendStep; + + /** + * Authorization backend page. + * + * @var AdminAuthLogin + */ + protected $adminAuth; + + /** + * Fixture User. + * + * @var User + */ + protected $user; + + /** + * @constructor + * @param LogoutUserOnBackendStep $logoutUserOnBackendStep + * @param AdminAuthLogin $adminAuth + * @param User $user + */ + public function __construct( + LogoutUserOnBackendStep $logoutUserOnBackendStep, + AdminAuthLogin $adminAuth, + User $user + ) { + $this->logoutUserOnBackendStep = $logoutUserOnBackendStep; + $this->adminAuth = $adminAuth; + $this->user = $user; + } + + /** + * Run step flow. + * + * @return void + */ + public function run() + { + $this->logoutUserOnBackendStep->run(); + + $this->adminAuth->open(); + $this->adminAuth->getLoginBlock()->fill($this->user); + $this->adminAuth->getLoginBlock()->submit(); + $this->adminAuth->getLoginBlock()->waitFormNotVisible(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LogoutUserOnBackendStep.php b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LogoutUserOnBackendStep.php new file mode 100644 index 0000000000000000000000000000000000000000..cf3227fafecbabb0a89ef565a67aaa430711170c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LogoutUserOnBackendStep.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\User\Test\TestStep; + +use Magento\Backend\Test\Page\AdminAuthLogin; +use Magento\Backend\Test\Page\Adminhtml\Dashboard; +use Magento\Mtf\TestStep\TestStepInterface; + +/** + * Logout user on backend. + */ +class LogoutUserOnBackendStep implements TestStepInterface +{ + /** + * Authorization backend page. + * + * @var AdminAuthLogin + */ + protected $adminAuth; + + /** + * Dashboard backend page. + * + * @var Dashboard + */ + protected $dashboard; + + /** + * @construct + * @param AdminAuthLogin $adminAuth + * @param Dashboard $dashboard + */ + public function __construct(AdminAuthLogin $adminAuth, Dashboard $dashboard) + { + $this->adminAuth = $adminAuth; + $this->dashboard = $dashboard; + } + + /** + * Run step flow. + * + * @return void + */ + public function run() + { + $this->adminAuth->open(); + if ($this->dashboard->getAdminPanelHeader()->isVisible()) { + $this->dashboard->getAdminPanelHeader()->logOut(); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml index e5d8c6b54b072cad708f2d679a28afb398df3097..7801b2d8fc637c445e6071545c3ef2bd81912d66 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml @@ -6,6 +6,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> - <preference for="Magento\User\Test\Handler\AdminUserRole\AdminUserRoleInterface" type="\Magento\User\Test\Handler\AdminUserRole\Curl" /> + <preference for="Magento\User\Test\Handler\Role\RoleInterface" type="\Magento\User\Test\Handler\Role\Curl" /> <preference for="Magento\User\Test\Handler\User\UserInterface" type="\Magento\User\Test\Handler\User\Curl" /> </config> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..7a832e8763322093a2814bcd7468bfbab9848d6a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest94"> + <data name="menuItem" xsi:type="string">System > Custom Variables</data> + <data name="pageTitle" xsi:type="string">Custom Variables</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php new file mode 100644 index 0000000000000000000000000000000000000000..bce4e8a44da8145e626017b91ea45819613a5470 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php @@ -0,0 +1,143 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Widget\Test\Block\Adminhtml\Widget; + +use Magento\Mtf\Client\Locator; +use Magento\Mtf\Client\Element\SimpleElement; + +/** + * Widget Chosen Option. + */ +class ChosenOption extends SimpleElement +{ + /** + * Select page button selector. + * + * @var string + */ + protected $selectButton = '//ancestor::body//button[contains(@class,"btn-chooser")]'; + + /** + * Magento varienLoader.js loader. + * + * @var string + */ + protected $loaderOld = '//ancestor::body/div[@id="loading-mask"]'; + + // @codingStandardsIgnoreStart + /** + * Select block selector. + * + * @var string + */ + protected $selectBlock = "//ancestor::body//div[contains(@style,'display: block')]//*[contains(@id,'responseCntoptions')]"; + // @codingStandardsIgnoreEnd + + /** + * Page widget chooser block class. + * + * @var string + */ + protected $pageWidgetChooserBlockClass = 'Magento\Cms\Test\Block\Adminhtml\Page\Widget\Chooser'; + + /** + * Category widget chooser block class. + * + * @var string + */ + protected $categoryWidgetChooserBlockClass = '\Magento\Catalog\Test\Block\Adminhtml\Category\Widget\Chooser'; + + /** + * Product widget chooser block class. + * + * @var string + */ + protected $productWidgetChooserBlockClass = '\Magento\Catalog\Test\Block\Adminhtml\Product\Widget\Chooser'; + + /** + * Entity chooser block class mapping. + * + * @var array + */ + protected $chooserClasses = [ + 'page' => 'Magento\Cms\Test\Block\Adminhtml\Page\Widget\Chooser', + 'category' => 'Magento\Catalog\Test\Block\Adminhtml\Category\Widget\Chooser', + 'product' => 'Magento\Catalog\Test\Block\Adminhtml\Product\Widget\Chooser', + ]; + + /** + * Select widget options. + * + * @param string $value + * @return void + */ + public function setValue($value) + { + $this->clickSelectButton(); + if (isset($value['filter_url_key'])) { + $this->getClassBlock($this->chooserClasses['page']) + ->searchAndOpen(['chooser_identifier' => $value['filter_url_key']]); + } + if (isset($value['filter_identifier'])) { + $this->getClassBlock($this->chooserClasses['page']) + ->searchAndOpen(['chooser_identifier' => $value['filter_identifier']]); + } + if (isset($value['category_path'])) { + if (isset($value['filter_sku'])) { + $this->getClassBlock($this->chooserClasses['category']) + ->selectCategoryByName($value['category_path']); + $this->getClassBlock($this->chooserClasses['product']) + ->searchAndOpen(['chooser_sku' => $value['filter_sku']]); + } else { + $this->getClassBlock($this->chooserClasses['category']) + ->selectCategoryByName($value['category_path']); + } + } + } + + /** + * Clicking to select button. + * + * @return void + */ + protected function clickSelectButton() + { + $this->find($this->selectButton, Locator::SELECTOR_XPATH)->click(); + $this->waitLoader(); + } + + /** + * Waiting loader. + * + * @return void + */ + protected function waitLoader() + { + $browser = $this; + $loaderSelector = $this->loaderOld; + $this->waitUntil( + function () use ($browser, $loaderSelector) { + $loader = $browser->find($loaderSelector); + return $loader->isVisible() == false ? true : null; + } + ); + } + + /** + * Get block by class. + * + * @param string $class + * @return mixed + */ + protected function getClassBlock($class) + { + return \Magento\Mtf\ObjectManager::getInstance()->create( + $class, + ['element' => $this->find($this->selectBlock, Locator::SELECTOR_XPATH)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..570f597f47de9a91485843983004c4e5d68700e8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Widget\Test\Block\Adminhtml\Widget; + +use Magento\Backend\Test\Block\Widget\Grid as AbstractGrid; + +/** + * Widget grid on the Widget Instance Index page. + */ +class WidgetGrid extends AbstractGrid +{ + /** + * Locator value for link in action column. + * + * @var string + */ + protected $editLink = 'tbody tr td.col-title'; + + /** + * First row selector. + * + * @var string + */ + protected $firstRowSelector = '//tr[./td[contains(@class, "col-title")]][1]/td'; + + /** + * Filters array mapping. + * + * @var array + */ + protected $filters = [ + 'title' => [ + 'selector' => 'input[name="title"]', + ], + ]; +} diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.php new file mode 100644 index 0000000000000000000000000000000000000000..27cdefabd160dcd24b274feb480b4040f8b7392e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Widget\Test\Block\Adminhtml; + +use Magento\Mtf\Block\Form; +use Magento\Mtf\Client\Locator; + +/** + * Backend add widget block form. + */ +class WidgetForm extends Form +{ + /** + * Widget type selector. + * + * @var string + */ + protected $widgetType = '[name="widget_type"]'; + + /** + * Insert widget button selector. + * + * @var string + */ + protected $insertButton = '#insert_button'; + + /** + * Magento varienLoader.js loader. + * + * @var string + */ + protected $loaderOld = '//ancestor::body/div[@id="loading-mask"]'; + + /** + * Add widgets. + * + * @param array $widget + * @return void + */ + public function addWidget($widget) + { + $this->selectWidgetType($widget['widget_type']); + $mapping = $this->dataMapping($widget); + $this->_fill($mapping); + $this->insertWidget(); + } + + /** + * Select widget type. + * + * @param string $type + * @return void + */ + protected function selectWidgetType($type) + { + $this->_rootElement->find($this->widgetType, Locator::SELECTOR_CSS, 'select')->setValue($type); + $this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH); + } + + /** + * Click Insert Widget button. + * + * @return void + */ + protected function insertWidget() + { + $this->_rootElement->find($this->insertButton)->click(); + $this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f089a8e4ff001b8fdce60be66eb22b41fe6466d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<mapping strict="0"> + <wrapper>parameters</wrapper> + <fields> + <widget_type> + <selector>#select_widget_type</selector> + <input>select</input> + </widget_type> + <anchor_text/> + <title/> + <template> + <input>select</input> + </template> + <chosen_option> + <selector>.control button</selector> + <class>\Magento\Widget\Test\Block\Adminhtml\Widget\ChosenOption</class> + </chosen_option> + <display_type> + <input>select</input> + </display_type> + <show_pager> + <input>select</input> + </show_pager> + <products_count/> + <cache_lifetime/> + <page_size/> + </fields> +</mapping> diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..d66ba7af5f9c185f96fed2b96ecffa293dc9f4a7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml @@ -0,0 +1,16 @@ +<?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\NavigateMenuTest"> + <variation name="NavigateMenuTest96"> + <data name="menuItem" xsi:type="string">Content > Frontend Apps</data> + <data name="pageTitle" xsi:type="string">Frontend Apps</data> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + </variation> + </testCase> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AbstractAssertWishlistProductDetails.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AbstractAssertWishlistProductDetails.php new file mode 100644 index 0000000000000000000000000000000000000000..bb60457362c20cc97c78a5e1208e86e66b30319b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AbstractAssertWishlistProductDetails.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Wishlist\Test\Constraint; + +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\Fixture\InjectableFixture; +use Magento\Wishlist\Test\Page\WishlistIndex; +use Magento\Mtf\Constraint\AbstractAssertForm; + +/** + * Assert that the correct option details are displayed on the "View Details" tool tip. + */ +abstract class AbstractAssertWishlistProductDetails extends AbstractAssertForm +{ + /** + * Assert product details. + * + * @param WishlistIndex $wishlistIndex + * @param InjectableFixture $product + * @param FixtureFactory $fixtureFactory + * @return void + */ + protected function assertProductDetails( + WishlistIndex $wishlistIndex, + InjectableFixture $product, + FixtureFactory $fixtureFactory + ) { + $actualOptions = $wishlistIndex->getItemsBlock()->getItemProduct($product)->getOptions(); + $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]); + $expectedOptions = $cartFixture->getItems()[0]->getData()['options']; + + $errors = $this->verifyData( + $this->sortDataByPath($expectedOptions, '::title'), + $this->sortDataByPath($actualOptions, '::title') + ); + \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php index a3a6c805a6fcecb17eea2cae36186a8f9ffc6b62..405852f2ee186bbbee71db6b088423988b582922 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php @@ -13,13 +13,12 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\InjectableFixture; /** - * Class AssertBundleProductDetailsInWishlist - * Assert that the correct option details are displayed on the "View Details" tool tip + * Assert that the correct option details are displayed on the "View Details" tool tip. */ -class AssertProductDetailsInWishlist extends AbstractAssertForm +class AssertProductDetailsInWishlist extends AbstractAssertWishlistProductDetails { /** - * Assert that the correct option details are displayed on the "View Details" tool tip + * Assert that the correct option details are displayed on the "View Details" tool tip. * * @param CmsIndex $cmsIndex * @param WishlistIndex $wishlistIndex @@ -34,19 +33,11 @@ class AssertProductDetailsInWishlist extends AbstractAssertForm FixtureFactory $fixtureFactory ) { $cmsIndex->getLinksBlock()->openLink('My Wish List'); - $actualOptions = $wishlistIndex->getItemsBlock()->getItemProduct($product)->getOptions(); - $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]); - $expectedOptions = $cartFixture->getItems()[0]->getData()['options']; - - $errors = $this->verifyData( - $this->sortDataByPath($expectedOptions, '::title'), - $this->sortDataByPath($actualOptions, '::title') - ); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); + $this->assertProductDetails($wishlistIndex, $fixtureFactory, $product); } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php index b83ca2292615ded60e73de1cf71269806660935c..5c1d7416344989bff1c60c8dfae26978a2df2b35 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php @@ -43,6 +43,7 @@ class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishli */ public function test(Customer $customer, $products, $qty) { + $this->markTestIncomplete('Bug: MAGETWO-34757'); // Preconditions $customer->persist(); $this->loginCustomer($customer); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php index b358e5c1344026b539c9ce5b17766f1f21f4edc2..233640f3eb4908ec7072d51579ca20d25851b9a0 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php @@ -44,6 +44,7 @@ class ConfigureProductInCustomerWishlistOnBackendTest extends AbstractWishlistTe */ public function __prepare(Customer $customer) { + $this->markTestIncomplete('Bug: MAGETWO-31868'); $customer->persist(); return ['customer' => $customer]; diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml index 65a635664b919e904c2c50dbf85faab476a02cdd..c1ff8db58e314ce323563668344faa431e61e46e 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml @@ -6,31 +6,33 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Wishlist\Test\TestCase\ConfigureProductInCustomerWishlistOnFrontendTest"> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation1" firstConstraint="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" method="test"> - <data name="product" xsi:type="string">catalogProductSimple::with_two_custom_option</data> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" next="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist"/> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" prev="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist"/> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation2" firstConstraint="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" method="test"> - <data name="product" xsi:type="string">configurableProduct::default</data> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" next="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist"/> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" prev="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist"/> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation3" firstConstraint="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" method="test"> - <data name="product" xsi:type="string">bundleProduct::bundle_dynamic_product</data> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" next="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist"/> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" prev="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist"/> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation4" firstConstraint="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" method="test"> - <data name="product" xsi:type="string">downloadableProduct::with_two_separately_links</data> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" next="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist"/> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" prev="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist"/> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation5" firstConstraint="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" method="test"> - <data name="product" xsi:type="string">groupedProduct::three_simple_products</data> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" next="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist"/> - <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" prev="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist"/> - </variation> - </testCase> + <testCase name="Magento\Wishlist\Test\TestCase\ConfigureProductInCustomerWishlistOnFrontendTest"> + <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation1"> + <data name="product" xsi:type="string">catalogProductSimple::with_two_custom_option</data> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> + </variation> + <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation2"> + <data name="product" xsi:type="string">configurableProduct::default</data> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> + </variation> + <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation3"> + <data name="issue" xsi:type="string">Bug: MAGETWO-33952</data> + <data name="product" xsi:type="string">bundleProduct::bundle_dynamic_product</data> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> + </variation> + <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation4"> + <data name="issue" xsi:type="string">Bug: MAGETWO-33952</data> + <data name="product" xsi:type="string">downloadableProduct::with_two_separately_links</data> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> + </variation> + <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation5"> + <data name="product" xsi:type="string">groupedProduct::three_simple_products</data> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> + <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php index 7083e3e70ace578881d1d755adb684bee008b772..d325e868b4e703ba7bfb19e1e5816da24c5bdb07 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php @@ -12,8 +12,6 @@ use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Fixture\FixtureInterface; /** - * Test Flow: - * * Preconditions: * 1. Test products are created. * @@ -68,6 +66,7 @@ class MoveProductFromShoppingCartToWishlistTest extends AbstractWishlistTest // Steps: $this->addToCart($product); $assertAddedProductToCartSuccessMessage->processAssert($checkoutCart, $product); + $checkoutCart->open(); $checkoutCart->getCartBlock()->getCartItem($product)->moveToWishlist(); return ['product' => $product]; diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php index 881161d8d5166908db9177091e868654fd858895..47ffc259d718d459b218cdd4e7ab3988dc24135b 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php @@ -165,7 +165,9 @@ class ShareWishlistEntityTest extends Injectable $this->loginCustomer($customer); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $this->catalogProductView->getViewBlock()->clickAddToWishlist(); + $this->wishlistIndex->getMessagesBlock()->waitSuccessMessage(); $this->wishlistIndex->getWishlistBlock()->clickShareWishList(); + $this->cmsIndex->getCmsPageBlock()->waitPageInit(); $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo); $this->wishlistShare->getSharingInfoForm()->shareWishlist(); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml index ee8bb1239977960850da8c7052eb45f461fbe6b1..1282b05826c506eb02f838064efd98658cebe579 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml @@ -16,10 +16,12 @@ <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInCustomerWishlistOnBackendGrid"/> </variation> <variation name="ViewProductInCustomerWishlistOnBackendTestVariation3" firstConstraint="Magento\Bundle\Test\Constraint\AssertBundleProductInCustomerWishlistOnBackendGrid" method="test"> + <data name="issue" xsi:type="string">Bug: MAGETWO-33952</data> <data name="product" xsi:type="string">bundleProduct::bundle_dynamic_product</data> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductInCustomerWishlistOnBackendGrid"/> </variation> <variation name="ViewProductInCustomerWishlistOnBackendTestVariation4" firstConstraint="Magento\Downloadable\Test\Constraint\AssertDownloadableProductInCustomerWishlistOnBackendGrid" method="test"> + <data name="issue" xsi:type="string">Bug: MAGETWO-34633</data> <data name="product" xsi:type="string">downloadableProduct::with_two_separately_links</data> <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductInCustomerWishlistOnBackendGrid"/> </variation>