From 9cbb323fa42367380441d543ce96a477e4722ac5 Mon Sep 17 00:00:00 2001 From: Oleksii Kolesnyk Date: Fri, 29 May 2015 17:47:43 +0300 Subject: [PATCH] MTA-2211: Deliver functional tests fixes which were made during regression --- dev/tests/functional/.gitignore | 5 -- dev/tests/functional/composer.json | 2 +- dev/tests/functional/phpunit.xml.dist | 2 +- .../Magento/Backend/Test/Block/Messages.php | 4 +- .../Backend/Test/Block/Widget/FormTabs.php | 69 ++++++++++++------- .../Backend/Test/Block/Widget/Grid.php | 2 +- .../AssertBestsellersOnDashboard.php | 2 +- .../Product/Attribute/Edit/AttributeForm.php | 20 +----- .../Adminhtml/Product/Composite/Configure.php | 9 ++- .../ProductDetails/ProductOnlineSwitcher.php | 2 +- .../Block/Adminhtml/Product/ProductForm.php | 13 ++-- ...ssertProductTemplateGroupOnProductForm.php | 2 +- .../Page/Product/CatalogProductCompare.xml | 2 +- .../Test/Page/Product/CatalogProductView.xml | 2 +- .../Product/MassProductUpdateTest.php | 1 - .../ProductTypeSwitchingOnUpdateTest.php | 4 +- .../SaveAttributeOnProductPageStep.php | 42 ++++++++++- .../Test/TestStep/SaveAttributeStep.php | 2 +- .../Test/TestCase/CreateCatalogRuleTest.php | 1 - .../Checkout/Test/Block/Cart/Sidebar.php | 25 ++++--- .../Checkout/Test/Block/Onepage/Billing.php | 14 ++-- .../Checkout/Test/Block/Onepage/Login.xml | 3 +- .../Checkout/Test/Page/CheckoutCart.xml | 2 +- .../TestStep/SelectCheckoutMethodStep.php | 47 ++++++++++--- .../Block/Adminhtml/Page/Edit/PageForm.php | 2 +- ...ductAttributeAbsenceInVariationsSearch.php | 2 +- .../AssertProductAttributeIsConfigurable.php | 2 +- .../UpdateConfigurableProductStep.php | 2 +- .../Block/Adminhtml/Edit/CustomerForm.php | 6 +- .../Customer/Test/Repository/Address.xml | 2 +- .../Customer/Test/TestCase/ApplyVatIdTest.xml | 2 + .../TestCase/DeleteCustomerAddressTest.php | 29 ++------ .../TestStep/LoginCustomerOnFrontendStep.php | 8 +-- .../TestStep/LogoutCustomerOnFrontendStep.php | 41 ++++++++--- .../TestCase/CheckoutWithGiftMessagesTest.php | 1 + .../ActivateIntegrationEntityTest.php | 1 - .../Constraint/AssertCouponReportResult.php | 4 -- .../AbandonedCartsReportEntityTest.php | 2 +- .../ProductsInCartReportEntityTest.php | 30 ++------ .../ProductsInCartReportEntityTest.xml | 28 ++++---- .../ViewedProductsReportEntityTest.php | 1 + ...ssertProductReviewInGridOnCustomerPage.php | 2 +- ...anageProductReviewFromCustomerPageTest.php | 33 ++------- ...teProductReviewEntityOnProductPageTest.php | 2 +- .../Test/Block/Adminhtml/Order/StatusGrid.php | 1 - .../Constraint/AssertInvoiceInInvoicesTab.php | 4 +- .../AssertRefundInCreditMemoTab.php | 2 +- .../Test/Handler/OrderInjectable/Curl.php | 6 +- .../Test/Page/Adminhtml/OrderInvoiceView.xml | 2 +- .../Test/Page/Adminhtml/SalesInvoiceView.xml | 6 +- .../Sales/Test/Repository/OrderInjectable.xml | 2 +- .../Test/TestCase/CreateOrderBackendTest.xml | 1 - .../Test/TestStep/CreateCreditMemoStep.php | 2 +- .../Sales/Test/TestStep/CreateInvoiceStep.php | 4 +- .../Test/TestStep/CreateShipmentStep.php | 2 +- .../SalesRule/Test/Repository/SalesRule.xml | 2 +- .../TestCase/CreateSalesRuleEntityTest.php | 1 - .../TestCase/UpdateSalesRuleEntityTest.php | 1 - .../TestStep/ApplySalesRuleOnBackendStep.php | 2 +- .../Magento/SalesRule/Test/etc/testcase.xml | 2 +- .../AssertShipmentInShipmentsTab.php | 2 +- .../Test/Page/Adminhtml/SalesShipmentView.xml | 2 +- .../TestCase/ApplyTaxBasedOnVatIdTest.xml | 1 + .../Ui/Test/Block/Adminhtml/DataGrid.php | 37 +++++++++- .../Weee/Test/Block/Cart/CartItem/Fpt.php | 2 +- .../Customer/Edit/Tab/Wishlist/Grid.php | 10 ++- ...ProductInCustomerWishlistOnBackendGrid.php | 2 +- ...ductIsPresentInCustomerBackendWishlist.php | 2 +- ...ProductInCustomerWishlistOnBackendTest.php | 2 +- ...oductFromCustomerWishlistOnBackendTest.php | 2 +- .../Mtf/TestSuite/InjectableTests/basic.xml | 11 ++- .../TestSuite/InjectableTests/domain_cs.xml | 2 +- .../TestSuite/InjectableTests/domain_mx.xml | 2 +- .../TestSuite/InjectableTests/domain_ps.xml | 2 +- 74 files changed, 324 insertions(+), 272 deletions(-) diff --git a/dev/tests/functional/.gitignore b/dev/tests/functional/.gitignore index 7e46f3cf256a6..78113e9adbdb2 100755 --- a/dev/tests/functional/.gitignore +++ b/dev/tests/functional/.gitignore @@ -1,12 +1,7 @@ **/var /composer.lock -/config/* /generated /lib/Magento/Mtf/Util/Generate/testcase.xml /vendor -!/config/application.yml.dist -!/config/handler.yml.dist -!/config/isolation.yml.dist -!/config/server.yml.dist phpunit.xml credentials.xml diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index 62706ed5abb25..8ce924bd190d7 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc25", + "magento/mtf": "1.0.0-rc26", "php": "~5.5.0|~5.6.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index f99b813aa1073..a88d4b922b643 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -35,7 +35,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php index 043937e8dddf1..586f0d9205f9e 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php @@ -70,8 +70,8 @@ public function getSuccessMessages() $elements = $this->_rootElement->getElements($this->successMessage); $messages = []; - foreach ($elements as $key => $element) { - $messages[$key] = $element->getText(); + foreach ($elements as $element) { + $messages[] = $element->getText(); } return count($messages) > 1 ? $messages : $messages[0]; diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php index 006da9cb0f663..b11db4365fa2d 100755 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php @@ -9,6 +9,7 @@ use Magento\Mtf\Block\BlockFactory; use Magento\Mtf\Block\Mapper; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Client\ElementInterface; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; use Magento\Mtf\Client\BrowserInterface; @@ -84,10 +85,10 @@ protected function fillTabs(array $tabs, SimpleElement $element = null) { $context = ($element === null) ? $this->_rootElement : $element; foreach ($tabs as $tabName => $tabFields) { - $tabElement = $this->getTabElement($tabName); + $tab = $this->getTab($tabName); $this->openTab($tabName); - $tabElement->fillFormTab(array_merge($tabFields, $this->unassignedFields), $context); - $this->updateUnassignedFields($tabElement); + $tab->fillFormTab(array_merge($tabFields, $this->unassignedFields), $context); + $this->updateUnassignedFields($tab); } if (!empty($this->unassignedFields)) { $this->fillMissedFields($tabs); @@ -99,13 +100,13 @@ protected function fillTabs(array $tabs, SimpleElement $element = null) /** * Update array with fields which aren't assigned to any tab * - * @param Tab $tabElement + * @param Tab $tab */ - protected function updateUnassignedFields(Tab $tabElement) + protected function updateUnassignedFields(Tab $tab) { $this->unassignedFields = array_diff_key( $this->unassignedFields, - array_intersect_key($this->unassignedFields, $tabElement->setFields) + array_intersect_key($this->unassignedFields, $tab->setFields) ); } @@ -120,10 +121,10 @@ protected function updateUnassignedFields(Tab $tabElement) protected function fillMissedFields(array $tabs) { foreach (array_diff_key($this->tabs, $tabs) as $tabName => $tabData) { - $tabElement = $this->getTabElement($tabName); + $tab = $this->getTab($tabName); if ($this->openTab($tabName)) { - $tabElement->fillFormTab($this->unassignedFields, $this->_rootElement); - $this->updateUnassignedFields($tabElement); + $tab->fillFormTab($this->unassignedFields, $this->_rootElement); + $this->updateUnassignedFields($tab); if (empty($this->unassignedFields)) { break; } @@ -154,7 +155,7 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element if (null === $fixture) { foreach ($this->tabs as $tabName => $tab) { $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); + $tabData = $this->getTab($tabName)->getDataFormTab(); $data = array_merge($data, $tabData); } } else { @@ -162,7 +163,7 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element $tabsFields = $isHasData ? $this->getFieldsByTabs($fixture) : []; foreach ($tabsFields as $tabName => $fields) { $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); + $tabData = $this->getTab($tabName)->getDataFormTab($fields, $this->_rootElement); $data = array_merge($data, $tabData); } } @@ -249,41 +250,61 @@ private function getFixtureFieldsByTabsDeprecated(FixtureInterface $fixture) } /** - * Get tab element + * Get tab class. * * @param string $tabName * @return Tab * @throws \Exception */ - public function getTabElement($tabName) + public function getTab($tabName) { $tabClass = $this->tabs[$tabName]['class']; - /** @var Tab $tabElement */ - $tabElement = $this->blockFactory->create($tabClass, ['element' => $this->_rootElement]); - if (!$tabElement instanceof Tab) { + /** @var Tab $tab */ + $tab = $this->blockFactory->create($tabClass, ['element' => $this->_rootElement]); + if (!$tab instanceof Tab) { throw new \Exception('Wrong Tab Class.'); } - $tabElement->setWrapper(isset($this->tabs[$tabName]['wrapper']) ? $this->tabs[$tabName]['wrapper'] : ''); - $tabElement->setMapping(isset($this->tabs[$tabName]['fields']) ? (array)$this->tabs[$tabName]['fields'] : []); + $tab->setWrapper(isset($this->tabs[$tabName]['wrapper']) ? $this->tabs[$tabName]['wrapper'] : ''); + $tab->setMapping(isset($this->tabs[$tabName]['fields']) ? (array)$this->tabs[$tabName]['fields'] : []); - return $tabElement; + return $tab; } /** - * Open tab + * Get tab element. * * @param string $tabName - * @return FormTabs + * @return ElementInterface */ - public function openTab($tabName) + protected function getTabElement($tabName) { $selector = $this->tabs[$tabName]['selector']; $strategy = isset($this->tabs[$tabName]['strategy']) ? $this->tabs[$tabName]['strategy'] : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $tab->click(); + return $this->_rootElement->find($selector, $strategy); + } + /** + * Open tab. + * + * @param string $tabName + * @return FormTabs + */ + public function openTab($tabName) + { + $this->getTabElement($tabName)->click(); return $this; } + + /** + * Check whether tab is visible. + * + * @param string $tabName + * @return bool + */ + public function isTabVisible($tabName) + { + return $this->getTabElement($tabName)->isVisible(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php index 9989b092a6ec8..32e4652e88d00 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php @@ -206,7 +206,7 @@ protected function getTemplateBlock() * @param array $filters * @throws \Exception */ - private function prepareForSearch(array $filters) + protected function prepareForSearch(array $filters) { foreach ($filters as $key => $value) { if (isset($this->filters[$key])) { diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBestsellersOnDashboard.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBestsellersOnDashboard.php index 2db5fe1018056..a2219508a67bb 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBestsellersOnDashboard.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertBestsellersOnDashboard.php @@ -31,7 +31,7 @@ public function processAssert(OrderInjectable $order, Dashboard $dashboard) $dashboard->open(); $dashboard->getStoreStatsBlock()->refreshData(); /** @var \Magento\Backend\Test\Block\Dashboard\Tab\Products\Ordered $bestsellersGrid */ - $bestsellersGrid = $dashboard->getStoreStatsBlock()->getTabElement('bestsellers')->getBestsellersGrid(); + $bestsellersGrid = $dashboard->getStoreStatsBlock()->getTab('bestsellers')->getBestsellersGrid(); $products = $order->getEntityId()['products']; foreach ($products as $product) { \PHPUnit_Framework_Assert::assertTrue( diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php index d80a7e7545894..791edb5f52296 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php @@ -10,7 +10,6 @@ use Magento\Backend\Test\Block\Widget\FormTabs; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Element; -use Magento\Mtf\Client\Locator; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; @@ -60,7 +59,7 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element if ($this->isTabVisible($tabName)) { $this->openTab($tabName); $this->expandAllToggles(); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); + $tabData = $this->getTab($tabName)->getDataFormTab(); $data = array_merge($data, $tabData); } } @@ -71,7 +70,7 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element if ($this->isTabVisible($tabName)) { $this->openTab($tabName); $this->expandAllToggles(); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); + $tabData = $this->getTab($tabName)->getDataFormTab($fields, $this->_rootElement); $data = array_merge($data, $tabData); } } @@ -104,19 +103,4 @@ public function openTab($tabName) $this->browser->find($this->pageTitle)->click(); // Handle menu overlap problem return parent::openTab($tabName); } - - /** - * Check if tab is visible. - * - * @param string $tabName - * @return bool - */ - protected function isTabVisible($tabName) - { - $selector = $this->tabs[$tabName]['selector']; - $strategy = isset($this->tabs[$tabName]['strategy']) - ? $this->tabs[$tabName]['strategy'] - : Locator::SELECTOR_CSS; - return $this->_rootElement->find($selector, $strategy)->isVisible(); - } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php index 95b79ed21380b..4308b05b35bc7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php @@ -31,6 +31,13 @@ class Configure extends AbstractConfigureBlock */ protected $customOptionsSelector = '#product_composite_configure_fields_options'; + /** + * Product quantity selector. + * + * @var string + */ + protected $qty = '[name="qty"]'; + /** * Selector for "Ok" button. * @@ -53,7 +60,7 @@ class Configure extends AbstractConfigureBlock */ public function setQty($qty) { - $this->_fill($this->dataMapping(['qty' => $qty])); + $this->_rootElement->find($this->qty)->setValue($qty); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/ProductOnlineSwitcher.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/ProductOnlineSwitcher.php index 55f800b3f67b7..68f3b677cb6f9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/ProductOnlineSwitcher.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/ProductOnlineSwitcher.php @@ -27,7 +27,7 @@ class ProductOnlineSwitcher extends SimpleElement * * @var string */ - protected $topPage = './ancestor::body//*[@class="page-main-actions"]'; + protected $topPage = './ancestor::body//*[contains(@class,"page-header")]'; /** * Set value 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 988821e4ab89e..d8febacc64478 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 @@ -116,7 +116,6 @@ public function fill(FixtureInterface $product, SimpleElement $element = null, F if ($category) { $tabs['product-details']['category_ids']['value'] = $category->getName(); } - $this->showAdvancedSettings(); $this->fillTabs($tabs, $element); if ($product->hasData('custom_attribute')) { @@ -168,7 +167,9 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element */ public function openTab($tabName) { - $this->showAdvancedSettings(); + if (!$this->isTabVisible($tabName)) { + $this->showAdvancedSettings(); + } return parent::openTab($tabName); } @@ -255,12 +256,12 @@ public function checkAttributeInSearchAttributeForm(CatalogProductAttribute $pro } /** - * Check tab visibility on Product form. + * Check custom tab visibility on Product form. * * @param string $tabName * @return bool */ - public function isTabVisible($tabName) + public function isCustomTabVisible($tabName) { $tabName = strtolower($tabName); $selector = sprintf($this->customTab, $tabName); @@ -294,7 +295,7 @@ public function getRequireNoticeAttributes(InjectableFixture $product) $data = []; $tabs = $this->getFieldsByTabs($product); foreach ($tabs as $tabName => $fields) { - $tab = $this->getTabElement($tabName); + $tab = $this->getTab($tabName); $this->openTab($tabName); $errors = $tab->getJsErrors(); if (!empty($errors)) { @@ -367,7 +368,7 @@ public function getAttributeElement(CatalogProductAttribute $attribute) */ public function addNewAttribute($tabName = 'product-details') { - $tab = $this->getTabElement($tabName); + $tab = $this->getTab($tabName); if ($tab instanceof ProductTab) { $this->openTab($tabName); $tab->addNewAttribute($tabName); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php index bc5ae4c912f7d..165f69f007b7e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php @@ -61,7 +61,7 @@ public function processAssert( $productBlockForm->fill($productSimple); \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->isTabVisible($attributeSet->getGroup()), + $productEdit->getProductForm()->isCustomTabVisible($attributeSet->getGroup()), "Product Group is absent on Product form tabs." ); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductCompare.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductCompare.xml index 6bfeb6be2b3b4..a7951c8c2a861 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductCompare.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductCompare.xml @@ -8,7 +8,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductView.xml index ff3443eee0b50..dbe16275a58a0 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductView.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Product/CatalogProductView.xml @@ -14,7 +14,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php index ea7f49ced512b..0f38833cdf94b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php @@ -84,7 +84,6 @@ public function __inject( */ public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product, $configData) { - $this->markTestIncomplete('Bug: MAGETWO-37154'); $this->configData = $configData; // Preconditions diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php index 7448eb5eb3281..d856f2bdd684a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php @@ -129,7 +129,7 @@ protected function deleteAttributes() { $this->catalogProductEdit->getProductForm()->openTab('variations'); /** @var Config $variationsTab */ - $variationsTab = $this->catalogProductEdit->getProductForm()->getTabElement('variations'); + $variationsTab = $this->catalogProductEdit->getProductForm()->getTab('variations'); $variationsTab->deleteAttributes(); } @@ -142,7 +142,7 @@ protected function clearDownloadableData() { $this->catalogProductEdit->getProductForm()->openTab('downloadable_information'); /** @var Downloadable $downloadableInfoTab */ - $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getTabElement('downloadable_information'); + $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getTab('downloadable_information'); $downloadableInfoTab->getDownloadableBlock('Links')->clearDownloadableData(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeOnProductPageStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeOnProductPageStep.php index 38d6ebdf1b59d..92811b864335f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeOnProductPageStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeOnProductPageStep.php @@ -6,8 +6,10 @@ namespace Magento\Catalog\Test\TestStep; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; +use Magento\Mtf\ObjectManager; use Magento\Mtf\TestStep\TestStepInterface; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; /** * Click "Save" button on attribute form on product page. @@ -21,13 +23,34 @@ class SaveAttributeOnProductPageStep implements TestStepInterface */ protected $catalogProductEdit; + /** + * Product attribute fixture. + * + * @var CatalogProductAttribute + */ + protected $attribute; + + /** + * Object manager instance. + * + * @var ObjectManager + */ + protected $objectManager; + /** * @constructor * @param CatalogProductEdit $catalogProductEdit + * @param CatalogProductAttribute $attribute + * @param ObjectManager $objectManager */ - public function __construct(CatalogProductEdit $catalogProductEdit) - { + public function __construct( + CatalogProductEdit $catalogProductEdit, + CatalogProductAttribute $attribute, + ObjectManager $objectManager + ) { $this->catalogProductEdit = $catalogProductEdit; + $this->attribute = $attribute; + $this->objectManager = $objectManager; } /** @@ -39,4 +62,17 @@ public function run() { $this->catalogProductEdit->getProductForm()->saveAttributeForm(); } + + /** + * Delete attribute after test. + * + * @return void + */ + public function cleanup() + { + $this->objectManager->create( + 'Magento\Catalog\Test\TestStep\DeleteAttributeStep', + ['attribute' => $this->attribute] + )->run(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeStep.php index 55c0d87167004..a298c0eba871a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeStep.php @@ -73,6 +73,6 @@ public function cleanup() $this->objectManager->create( 'Magento\Catalog\Test\TestStep\DeleteAttributeStep', ['attribute' => $this->attribute] - ); + )->run(); } } 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 dac358d1f9907..5944e457a3549 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 @@ -31,7 +31,6 @@ class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest const TEST_TYPE = 'acceptance_test'; const MVP = 'yes'; const DOMAIN = 'MX'; - const TO_MAINTAIN = 'yes'; // Selecting conditions in parallel mode /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar.php index 2cfdcb95eafcc..8b86e8e788f54 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar.php @@ -11,31 +11,30 @@ use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Sidebar - * Mini shopping cart block + * Mini shopping cart block. */ class Sidebar extends Block { /** - * Quantity input selector + * Quantity input selector. * * @var string */ protected $qty = '//*[@class="product"]/*[@title="%s"]/following-sibling::*//*[contains(@class,"item-qty")]'; /** - * Mini cart link selector + * Mini cart link selector. * * @var string */ protected $cartLink = 'a.showcart'; /** - * Mini cart content selector + * Mini cart content selector. * * @var string */ - protected $cartContent = 'div.minicart'; + protected $cartContent = 'div.block-minicart'; /** * Product list in mini shopping cart. @@ -45,21 +44,21 @@ class Sidebar extends Block protected $cartProductList = './/*[contains(@role, "dialog") and not(contains(@style,"display: none;"))]'; /** - * Selector for cart item block + * Selector for cart item block. * * @var string */ protected $cartProductName = '//*[@id="mini-cart"]//li[.//a[normalize-space(text())="%s"]]'; /** - * Counter qty locator + * Counter qty locator. * * @var string */ - protected $counterQty = './/span[@class="counter qty"]'; + protected $counterQty = './/div[@class="minicart-wrapper"]//span[@class="counter qty"]'; /** - * Open mini cart + * Open mini cart. * * @return void */ @@ -72,7 +71,7 @@ public function openMiniCart() } /** - * Wait counter qty visibility + * Wait counter qty visibility. * * @return void */ @@ -89,7 +88,7 @@ function () use ($browser, $selector) { } /** - * Get product quantity + * Get product quantity. * * @param string $productName * @return string @@ -102,7 +101,7 @@ public function getProductQty($productName) } /** - * Get cart item block + * Get cart item block. * * @param FixtureInterface $product * @return Item diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php index 018dcbcac4b92..f4df8ae791b97 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php @@ -11,34 +11,33 @@ use Magento\Mtf\Block\Form; /** - * Class Billing - * One page checkout status billing block + * One page checkout status billing block. */ class Billing extends Form { /** - * Continue checkout button + * Continue checkout button. * * @var string */ protected $continue = '#billing-buttons-container button'; /** - * 'Ship to different address' radio button + * 'Ship to different address' radio button. * * @var string */ protected $useForShipping = '[id="billing:use_for_shipping_no"]'; /** - * Wait element + * Wait element. * * @var string */ protected $waitElement = '.loading-mask'; /** - * Fill billing address + * Fill billing address. * * @param Address $billingAddress * @param bool $isShippingAddress @@ -49,6 +48,7 @@ public function fillBilling( $isShippingAddress = false ) { if ($billingAddress) { + //@TODO: MAGETWO-34756 sleep(5); $this->fill($billingAddress); } @@ -59,7 +59,7 @@ public function fillBilling( } /** - * Click continue on billing information block + * Click continue on billing information block. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.xml index 6b1eed8e9a3ac..ad03998b17730 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.xml @@ -6,10 +6,9 @@ */ --> - login - [name='login[username]'] + [name='username'] diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml index 41c6ca7910406..894ec782a4b81 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml @@ -9,7 +9,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php index 97c2f87e365b2..b20b4cd6f58fe 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php @@ -6,52 +6,65 @@ namespace Magento\Checkout\Test\TestStep; -use Magento\Checkout\Test\Page\CheckoutOnepage; -use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\TestStep\TestStepInterface; +use Magento\Customer\Test\Fixture\Customer; +use Magento\Checkout\Test\Page\CheckoutOnepage; +use Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep; /** - * Class SelectCheckoutMethodStep - * Selecting checkout method + * Selecting checkout method. */ class SelectCheckoutMethodStep implements TestStepInterface { /** - * Onepage checkout page + * Onepage checkout page. * * @var CheckoutOnepage */ protected $checkoutOnepage; /** - * Checkout method + * Checkout method. * * @var string */ protected $checkoutMethod; /** - * Customer fixture + * Customer fixture. * * @var Customer */ protected $customer; + /** + * Logout customer on frontend step. + * + * @var LogoutCustomerOnFrontendStep + */ + protected $logoutCustomerOnFrontend; + /** * @constructor * @param CheckoutOnepage $checkoutOnepage * @param Customer $customer + * @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend * @param string $checkoutMethod */ - public function __construct(CheckoutOnepage $checkoutOnepage, Customer $customer, $checkoutMethod) - { + public function __construct( + CheckoutOnepage $checkoutOnepage, + Customer $customer, + LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend, + $checkoutMethod + ) { $this->checkoutOnepage = $checkoutOnepage; - $this->checkoutMethod = $checkoutMethod; $this->customer = $customer; + $this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend; + $this->checkoutMethod = $checkoutMethod; } /** - * Run step that selecting checkout method + * Run step that selecting checkout method. * * @return void * @throws \Exception @@ -71,4 +84,16 @@ public function run() break; } } + + /** + * Logout customer on fronted. + * + * @return void + */ + public function cleanup() + { + if ($this->checkoutMethod === 'login') { + $this->logoutCustomerOnFrontend->run(); + } + } } 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 index 5338aaaead068..c9d3f40314a2b 100644 --- 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 @@ -51,7 +51,7 @@ public function getSystemVariables() { $this->openTab('content'); /** @var \Magento\Cms\Test\Block\Adminhtml\Page\Edit\Tab\Content $contentTab */ - $contentTab = $this->getTabElement('content'); + $contentTab = $this->getTab('content'); /** @var \Magento\Cms\Test\Block\Adminhtml\Wysiwyg\Config $config */ $contentTab->clickInsertVariable(); $config = $contentTab->getWysiwygConfig(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php index 630fb675ac2b0..1c7edf16fe5f5 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php @@ -41,7 +41,7 @@ public function processAssert( $productGrid->getGridPageActionBlock()->addProduct('simple'); /** @var VariationsTab $variationsTab */ - $variationsTab = $newProductPage->getProductForm()->getTabElement(self::TAB_VARIATIONS); + $variationsTab = $newProductPage->getProductForm()->getTab(self::TAB_VARIATIONS); $variationsTab->showContent(); /** @var AttributeBlock $attributesBlock */ $attributesBlock = $variationsTab->getAttributeBlock(); diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php index 6db64a68914c1..9c1d9b988ed21 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php @@ -38,7 +38,7 @@ public function processAssert( $productBlockForm->openTab('variations'); /** @var TabVariation $tabVariation */ - $tabVariation = $productBlockForm->getTabElement('variations'); + $tabVariation = $productBlockForm->getTab('variations'); $configurableAttributeSelector = $tabVariation->getAttributeBlock()->getAttributeSelector(); \PHPUnit_Framework_Assert::assertTrue( $configurableAttributeSelector->isExistAttributeInSearchResult($attributeSearch), 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 7fe761407b715..3d6bab9ab474c 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 @@ -191,7 +191,7 @@ protected function updateProduct(ConfigurableProduct $product) { $productForm = $this->catalogProductEdit->getProductForm(); $productForm->openTab('variations'); - $productForm->getTabElement('variations')->deleteAttributes(); + $productForm->getTab('variations')->deleteAttributes(); $this->catalogProductEdit->getProductForm()->fill($product); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php index 6a034af9855a4..78bb463909c93 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php @@ -69,7 +69,7 @@ public function fillCustomer(FixtureInterface $customer, $address = null) } if (null !== $address) { $this->openTab('addresses'); - $this->getTabElement('addresses')->fillAddresses($address); + $this->getTab('addresses')->fillAddresses($address); } return $this; @@ -92,7 +92,7 @@ public function updateCustomer(FixtureInterface $customer, $address = null) } if (null !== $address) { $this->openTab('addresses'); - $this->getTabElement('addresses')->updateAddresses($address); + $this->getTab('addresses')->updateAddresses($address); } return $this; @@ -112,7 +112,7 @@ public function getDataCustomer(FixtureInterface $customer, $address = null) $data = ['customer' => $customer->hasData() ? parent::getData($customer) : parent::getData()]; if (null !== $address) { $this->openTab('addresses'); - $data['addresses'] = $this->getTabElement('addresses')->getDataAddresses($address); + $data['addresses'] = $this->getTab('addresses')->getDataAddresses($address); } return $data; 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 6e981074744ac..e379604530bcd 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 @@ -114,7 +114,7 @@ 7700 W. Parmer Lane Bldg. D Austin Texas - 78729 + 78729 United States 512-691-4400 Yes diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml index 94af84c9ee9de..e381864c2850e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml @@ -14,6 +14,7 @@ customer_UK_1_default_billing_address 584451913 valid_intra_union_group + test_type:3rd_party_test @@ -24,6 +25,7 @@ customer_UK_1_default_billing_address 123456789 invalid_group + test_type:3rd_party_test 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 a2fdc4922e7a1..c9dc9642b47e7 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 @@ -6,10 +6,8 @@ namespace Magento\Customer\Test\TestCase; -use Magento\Cms\Test\Page\CmsIndex; use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\CustomerAccountIndex; -use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Mtf\TestCase\Injectable; /** @@ -35,20 +33,6 @@ class DeleteCustomerAddressTest extends Injectable const DOMAIN = 'CS'; /* end tags */ - /** - * Cms index page. - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Customer login page. - * - * @var CustomerAccountLogin - */ - protected $customerAccountLogin; - /** * Customer index page. * @@ -59,18 +43,12 @@ class DeleteCustomerAddressTest extends Injectable /** * Prepare pages for test. * - * @param CustomerAccountLogin $customerAccountLogin - * @param CmsIndex $cmsIndex * @param CustomerAccountIndex $customerAccountIndex * @return void */ public function __inject( - CustomerAccountLogin $customerAccountLogin, - CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex ) { - $this->cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; $this->customerAccountIndex = $customerAccountIndex; } @@ -88,9 +66,10 @@ public function test(Customer $customer) $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1]; // Steps: - $this->cmsIndex->open(); - $this->cmsIndex->getLinksBlock()->openLink("Log In"); - $this->customerAccountLogin->getLoginBlock()->login($customer); + $this->objectManager->create( + 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book'); $this->customerAccountIndex->getAdditionalAddressBlock()->deleteAdditionalAddress($addressToDelete); 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 95561a50fd930..3cd67136fbb23 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 @@ -70,13 +70,7 @@ public function __construct( */ 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'); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); - } + $this->logoutCustomerOnFrontend->run(); $this->cmsIndex->getLinksBlock()->openLink("Log In"); $this->cmsIndex->getCmsPageBlock()->waitPageInit(); $this->customerAccountLogin->getLoginBlock()->login($this->customer); 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 c05e45a1fb094..21a17180e7e0f 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 @@ -7,43 +7,64 @@ namespace Magento\Customer\Test\TestStep; use Magento\Cms\Test\Page\CmsIndex; +use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\TestStep\TestStepInterface; /** - * Class LogoutCustomerOnFrontendStep - * Logout customer on frontend + * Logout customer on frontend. */ class LogoutCustomerOnFrontendStep implements TestStepInterface { /** - * Cms index page + * Logout page title. + */ + const LOGOUT_PAGE_TITLE = 'You are now logged out'; + + /** + * Cms index page. * * @var CmsIndex */ protected $cmsIndex; + /** + * Customer logout page. + * + * @var CustomerAccountLogout + */ + protected $customerAccountLogout; + /** * @constructor * @param CmsIndex $cmsIndex + * @param CustomerAccountLogout $customerAccountLogout */ - public function __construct(CmsIndex $cmsIndex) + public function __construct(CmsIndex $cmsIndex, CustomerAccountLogout $customerAccountLogout) { $this->cmsIndex = $cmsIndex; + $this->customerAccountLogout = $customerAccountLogout; } /** - * Logout customer + * Logout customer. * * @return void */ public function run() { - $this->cmsIndex->open(); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); - if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) { - $this->cmsIndex->getLinksBlock()->openLink("Log Out"); + /* @TODO: MAGETWO-37391 + * $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'); + * $this->cmsIndex->getCmsPageBlock()->waitPageInit(); + * } + */ + $this->customerAccountLogout->open(); + if (self::LOGOUT_PAGE_TITLE == $this->cmsIndex->getCmsPageBlock()->getPageTitle()) { $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); } + $this->cmsIndex->getCmsPageBlock()->waitPageInit(); } } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php index 26105a20e15e4..18a366d47dfda 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php @@ -30,6 +30,7 @@ class CheckoutWithGiftMessagesTest extends Scenario /* tags */ const MVP = 'no'; const DOMAIN = 'CS'; + const TO_MAINTAIN = 'yes'; // Consider variation #2 to work correctly with Virtual products /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php index 1ab4ba94b341a..caf67686a3604 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php @@ -31,7 +31,6 @@ class ActivateIntegrationEntityTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'PS'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php index 7eb3c3c97cbe9..3a45b93f0655d 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php @@ -16,10 +16,6 @@ */ class AssertCouponReportResult extends AbstractConstraint { - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - /** * Assert coupon info in report: code, rule name, subtotal, discount on coupons report page * diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php index 2770831f3b627..3e8e843404e53 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php @@ -36,6 +36,7 @@ class AbandonedCartsReportEntityTest extends Injectable /* tags */ const MVP = 'no'; const DOMAIN = 'MX'; + const STABLE = 'no'; /* end tags */ /** @@ -86,7 +87,6 @@ public function __inject( */ public function test($products, Customer $customer) { - $this->markTestIncomplete('Bug: MAGETWO-31737'); // Precondition $products = $this->createProducts($products); $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php index 7b781541ab287..734f575760920 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php @@ -10,8 +10,6 @@ use Magento\Catalog\Test\Page\Product\CatalogProductView; use Magento\Cms\Test\Page\CmsIndex; use Magento\Customer\Test\Fixture\Customer; -use Magento\Customer\Test\Page\CustomerAccountLogin; -use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\TestCase\Injectable; @@ -44,13 +42,6 @@ class ProductsInCartReportEntityTest extends Injectable */ protected $cmsIndex; - /** - * Customer login page - * - * @var CustomerAccountLogin - */ - protected $customerAccountLogin; - /** * Product view page * @@ -58,13 +49,6 @@ class ProductsInCartReportEntityTest extends Injectable */ protected $catalogProductView; - /** - * Customer logout page - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - /** * Prepare data * @@ -82,20 +66,14 @@ public function __prepare(Customer $customer) * Injection data * * @param CmsIndex $cmsIndex - * @param CustomerAccountLogin $customerAccountLogin - * @param CustomerAccountLogout $customerAccountLogout * @param CatalogProductView $catalogProductView * @return void */ public function __inject( CmsIndex $cmsIndex, - CustomerAccountLogin $customerAccountLogin, - CustomerAccountLogout $customerAccountLogout, CatalogProductView $catalogProductView ) { $this->cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customerAccountLogout = $customerAccountLogout; $this->catalogProductView = $catalogProductView; } @@ -118,8 +96,10 @@ public function test( $product->persist(); //Steps - $this->cmsIndex->open()->getLinksBlock()->openLink("Log In"); - $this->customerAccountLogin->getLoginBlock()->login($customer); + $this->objectManager->create( + 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); $productUrl = $_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'; $browser->open($productUrl); $this->catalogProductView->getViewBlock()->addToCart($product); @@ -137,6 +117,6 @@ public function test( */ public function tearDown() { - $this->customerAccountLogout->open(); + $this->objectManager->create('Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep')->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml index e848bde903491..c2b2cfec986de 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml @@ -6,18 +6,18 @@ */ --> - - - default - 1 - 0 - - - - default - 2 - 1 - - - + + + default + 1 + 0 + + + + default + 2 + 1 + + + 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 af35c7178b0a0..fe6ddf9400e7e 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 @@ -34,6 +34,7 @@ class ViewedProductsReportEntityTest extends Injectable /* tags */ const MVP = 'no'; const DOMAIN = 'MX'; + const STABLE = 'no'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php index 6de4b725cf6df..193a24f47bb59 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php @@ -45,7 +45,7 @@ public function processAssert( $customerIndexEdit->getCustomerForm()->openTab('product_reviews'); $filter = $assertProductReviewInGrid->prepareFilter($product, $this->prepareData($review, $reviewInitial)); /** @var ReviewsGrid $reviewsGrid */ - $reviewsGrid = $customerIndexEdit->getCustomerForm()->getTabElement('product_reviews')->getReviewsGrid(); + $reviewsGrid = $customerIndexEdit->getCustomerForm()->getTab('product_reviews')->getReviewsGrid(); $reviewsGrid->search($filter); unset($filter['visible_in']); \PHPUnit_Framework_Assert::assertTrue( diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php index 4f3c18759ca8c..67da4b208c8fd 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php @@ -8,11 +8,9 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Cms\Test\Page\CmsIndex; use Magento\Customer\Test\Fixture\Customer; use Magento\Customer\Test\Page\Adminhtml\CustomerIndex; use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; -use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\Review\Test\Fixture\Review; use Magento\Review\Test\Page\Adminhtml\RatingEdit; use Magento\Review\Test\Page\Adminhtml\RatingIndex; @@ -67,13 +65,6 @@ class ManageProductReviewFromCustomerPageTest extends Injectable */ protected $customerIndexEdit; - /** - * Customer login page - * - * @var CustomerAccountLogin - */ - protected $customerAccountLogin; - /** * Catalog product view page * @@ -88,13 +79,6 @@ class ManageProductReviewFromCustomerPageTest extends Injectable */ protected $browser; - /** - * Cms index page - * - * @var CmsIndex - */ - protected $cmsIndex; - /** * Backend rating grid page * @@ -140,8 +124,6 @@ public function __prepare(Customer $customer) * * @param CustomerIndexEdit $customerIndexEdit * @param CustomerIndex $customerIndex - * @param CmsIndex $cmsIndex - * @param CustomerAccountLogin $customerAccountLogin * @param CatalogProductView $catalogProductView * @param BrowserInterface $browser * @param RatingIndex $ratingIndex @@ -152,8 +134,6 @@ public function __prepare(Customer $customer) public function __inject( CustomerIndexEdit $customerIndexEdit, CustomerIndex $customerIndex, - CmsIndex $cmsIndex, - CustomerAccountLogin $customerAccountLogin, CatalogProductView $catalogProductView, BrowserInterface $browser, RatingIndex $ratingIndex, @@ -162,8 +142,6 @@ public function __inject( ) { $this->customerIndexEdit = $customerIndexEdit; $this->customerIndex = $customerIndex; - $this->cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; $this->catalogProductView = $catalogProductView; $this->browser = $browser; $this->ratingIndex = $ratingIndex; @@ -201,7 +179,7 @@ public function test( 'title' => $reviewInitial->getTitle(), 'sku' => $product->getSku(), ]; - $this->customerIndexEdit->getCustomerForm()->getTabElement('product_reviews')->getReviewsGrid() + $this->customerIndexEdit->getCustomerForm()->getTab('product_reviews')->getReviewsGrid() ->searchAndOpen($filter); $this->reviewEdit->getReviewForm()->fill($review); $this->reviewEdit->getPageActions()->save(); @@ -217,11 +195,10 @@ public function test( */ protected function login(Customer $customer) { - $this->cmsIndex->open(); - if (!$this->cmsIndex->getLinksBlock()->isLinkVisible('Log Out')) { - $this->cmsIndex->getLinksBlock()->openLink("Log In"); - $this->customerAccountLogin->getLoginBlock()->login($customer); - } + $this->objectManager->create( + 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + ['customer' => $customer] + )->run(); } /** diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php index ad745c1ae6cb4..28dff5a865f37 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php @@ -144,7 +144,7 @@ public function test(Review $review, $rating) 'title' => $this->reviewInitial->getTitle(), 'sku' => $product->getSku(), ]; - $this->catalogProductEdit->getProductForm()->getTabElement('product_reviews')->getReviewsGrid() + $this->catalogProductEdit->getProductForm()->getTab('product_reviews')->getReviewsGrid() ->searchAndOpen($filter); $this->reviewEdit->getReviewForm()->fill($review); $this->reviewEdit->getPageActions()->save(); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php index f0fa33ca3a36d..600158767897b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/StatusGrid.php @@ -49,7 +49,6 @@ class StatusGrid extends \Magento\Backend\Test\Block\Widget\Grid */ public function searchAndUnassign(array $filter) { - $this->openFilterBlock(); $this->search($filter); $selectItem = $this->_rootElement->find($this->unassignLink); if ($selectItem->isVisible()) { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php index 986750e32ea54..0de9511044caa 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php @@ -36,7 +36,7 @@ public function processAssert( $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); $salesOrderView->getOrderForm()->openTab('invoices'); /** @var Grid $grid */ - $grid = $salesOrderView->getOrderForm()->getTabElement('invoices')->getGridBlock(); + $grid = $salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock(); $amount = $order->getPrice(); foreach ($ids['invoiceIds'] as $key => $invoiceId) { $filter = [ @@ -46,7 +46,7 @@ public function processAssert( ]; $grid->search($filter); $filter['amount_from'] = number_format($amount[$key]['grand_invoice_total'], 2); - $filter['amount_to'] = number_format($amount[$key]['grand_invoice_total'], 2); + unset($filter['amount_to']); \PHPUnit_Framework_Assert::assertTrue( $grid->isRowVisible($filter, false, false), 'Invoice is absent on invoices tab.' diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php index f35278c78f1d6..972c94f56fce0 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php @@ -36,7 +36,7 @@ public function processAssert( $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); $salesOrderView->getOrderForm()->openTab('creditmemos'); /** @var Grid $grid */ - $grid = $salesOrderView->getOrderForm()->getTabElement('creditmemos')->getGridBlock(); + $grid = $salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock(); $amount = $order->getPrice(); foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Curl.php index 7d993cb5f0094..c5eb13dbb4a38 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Curl.php @@ -317,9 +317,9 @@ protected function prepareCustomerData(array $data) protected function prepareOrderProductsData(array $data) { $result = []; - foreach ($data['products'] as $value) { - if (isset($value->getCheckoutData()['qty'])) { - $result[$value->getId()] = ['qty' => ['qty' => $value->getCheckoutData()['qty']]]; + foreach ($data['products'] as $product) { + if (isset($product->getCheckoutData()['qty'])) { + $result[$product->getId()] = ['qty' => ['qty' => $product->getCheckoutData()['qty']]]; } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml index 25d1ce48de082..20d00da9b6a5f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderInvoiceView.xml @@ -9,6 +9,6 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml index 7913b781d0ed9..5f418de946c9a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml @@ -6,7 +6,7 @@ */ --> - - - + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml index e0ac81201f8b3..e08828f7bff3b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml @@ -210,7 +210,7 @@ - catalogProductSimple::virtual_big_qty + catalogProductVirtual::virtual_big_qty johndoe_unique diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml index c8328baab4af1..6371ae09b9981 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml @@ -29,7 +29,6 @@ - Bug: MAGETWO-36210 Create order with virtual product for registered UK customer using Check/Money Order payment method catalogProductVirtual::default customer_UK diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php index fa43917e81db2..2a84ce0de1610 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php @@ -101,6 +101,6 @@ public function run() protected function getCreditMemoIds() { $this->salesOrderView->getOrderForm()->openTab('creditmemos'); - return $this->salesOrderView->getOrderForm()->getTabElement('creditmemos')->getGridBlock()->getIds(); + return $this->salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock()->getIds(); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateInvoiceStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateInvoiceStep.php index 304f58063a029..e9a57dc4e4d68 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateInvoiceStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateInvoiceStep.php @@ -130,7 +130,7 @@ public function run() protected function getInvoiceIds() { $this->salesOrderView->getOrderForm()->openTab('invoices'); - return $this->salesOrderView->getOrderForm()->getTabElement('invoices')->getGridBlock()->getIds(); + return $this->salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock()->getIds(); } /** @@ -141,6 +141,6 @@ protected function getInvoiceIds() protected function getShipmentIds() { $this->salesOrderView->getOrderForm()->openTab('shipments'); - return $this->salesOrderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->getIds(); + return $this->salesOrderView->getOrderForm()->getTab('shipments')->getGridBlock()->getIds(); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateShipmentStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateShipmentStep.php index 1ea259d0e05cd..ece5d725555b0 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateShipmentStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateShipmentStep.php @@ -111,6 +111,6 @@ public function run() public function getShipmentIds() { $this->salesOrderView->getOrderForm()->openTab('shipments'); - return $this->salesOrderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->getIds(); + return $this->salesOrderView->getOrderForm()->getTab('shipments')->getGridBlock()->getIds(); } } diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml index 897aa57c1bf7f..9c1a431440b6c 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml @@ -156,7 +156,7 @@ - Shopping Cart Price Rule with Specific Coupon %isolation% + Shopping Cart Price Rule without Coupon %isolation% Description for Cart Price Rule Active diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php index e82c3e9bcc2c2..1a40513ce1e2b 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php @@ -33,7 +33,6 @@ class CreateSalesRuleEntityTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'CS'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php index 93e0e86280525..84c524d9cec06 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php @@ -32,7 +32,6 @@ class UpdateSalesRuleEntityTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'CS'; - const TO_MAINTAIN = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php index 709e2c1644b71..726dc678ee3ab 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php @@ -41,7 +41,7 @@ public function __construct(OrderCreateIndex $orderCreateIndex, SalesRule $sales } /** - * Apply gift card before one page checkout. + * Apply gift card on place order in admin. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/testcase.xml index ee5c69ad94715..88c81a0fb0274 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/testcase.xml @@ -19,7 +19,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php index 494496509b9aa..6095bc307182e 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php @@ -44,7 +44,7 @@ public function processAssert( 'qty_to' => $totalQty[$key], ]; \PHPUnit_Framework_Assert::assertTrue( - $salesOrderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->isRowVisible($filter), + $salesOrderView->getOrderForm()->getTab('shipments')->getGridBlock()->isRowVisible($filter), 'Shipment is absent on shipments tab.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml index 61425421392f9..9ea9fe428223a 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml @@ -8,6 +8,6 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml index 46afe8448d32a..ae3c83014c7f0 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml @@ -24,6 +24,7 @@ 17 + test_type:3rd_party_test diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php index 786403928d656..f4bdb4bb6f62e 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php @@ -54,6 +54,24 @@ public function resetFilter() } } + /** + * Wait filter to load on page. + * + * @return void + */ + protected function waitFilterToLoad() + { + $this->getTemplateBlock()->waitForElementNotVisible($this->loader); + $browser = $this->_rootElement; + $selector = $this->filterButton . ', ' . $this->resetButton; + $browser->waitUntil( + function () use ($browser, $selector) { + $filter = $browser->find($selector); + return $filter->isVisible() == true ? true : null; + } + ); + } + /** * Open "Filter" block. * @@ -61,7 +79,7 @@ public function resetFilter() */ protected function openFilterBlock() { - $this->getTemplateBlock()->waitForElementNotVisible($this->loader); + $this->waitFilterToLoad(); $toggleFilterButton = $this->_rootElement->find($this->filterButton); $searchButton = $this->_rootElement->find($this->searchButton); @@ -87,4 +105,21 @@ public function search(array $filter) $this->openFilterBlock(); parent::search($filter); } + + /** + * Search item and open it. + * + * @param array $filter + * @throws \Exception + */ + public function searchAndOpen(array $filter) + { + $rowItem = $this->getRow($filter); + if ($rowItem->isVisible()) { + $rowItem->find($this->editLink)->click(); + $this->waitForElement(); + } else { + throw new \Exception('Searched item was not found.'); + } + } } diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php index da370aa92d9d0..53fbeac9a7a80 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/CartItem/Fpt.php @@ -19,7 +19,7 @@ class Fpt extends Block * * @var string */ - protected $price = './*[@class="price-excluding-tax"]/span'; + protected $price = './/*[@class="price"]'; /** * Selector for fpt diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php index db52e68e51d0d..e4e4d4d829075 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php @@ -50,6 +50,13 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid */ protected $configureLink = 'a[onclick*="configureItem"]'; + /** + * Secondary part of row locator template for getRow() method with strict option. + * + * @var string + */ + protected $rowTemplateStrict = 'td[contains(.,normalize-space("%s"))]'; + /** * Delete product * @@ -96,7 +103,6 @@ public function searchAndAction(array $filter, $action) protected function getRow(array $filter, $isSearchable = true, $isStrict = true) { $options = []; - $this->openFilterBlock(); if (isset($filter['options'])) { $options = $filter['options']; unset($filter['options']); @@ -105,7 +111,7 @@ protected function getRow(array $filter, $isSearchable = true, $isStrict = true) $this->search($filter); } $location = '//tr['; - $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; + $rowTemplate = ($isStrict) ? $this->rowTemplateStrict : $this->rowTemplate; $rows = []; foreach ($filter as $value) { $rows[] = sprintf($rowTemplate, $value); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php index e0e346f9ccb5c..80ead47f4e3d3 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php @@ -29,7 +29,7 @@ public function processAssert(CustomerIndexEdit $customerIndexEdit, FixtureInter $filter = $this->prepareFilter($product); /** @var Grid $wishlistGrid */ - $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock(); + $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTab('wishlist')->getSearchGridBlock(); \PHPUnit_Framework_Assert::assertTrue( $wishlistGrid->isRowVisible($filter, true, false), 'Product ' . $product->getName() . ' is absent in grid with configure option.' diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php index 24ecde4e0a779..615b571ccb378 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php @@ -38,7 +38,7 @@ public function processAssert( $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); $customerIndexEdit->getCustomerForm()->openTab('wishlist'); /** @var \Magento\Wishlist\Test\Block\Adminhtml\Customer\Edit\Tab\Wishlist\Grid $wishlistGrid */ - $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock(); + $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTab('wishlist')->getSearchGridBlock(); \PHPUnit_Framework_Assert::assertTrue( $wishlistGrid->isRowVisible(['product_name' => $product->getName()], true, false), 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 b358e5c134402..ad5f58d16fe4d 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 @@ -73,7 +73,7 @@ public function test( $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); $customerForm = $customerIndexEdit->getCustomerForm(); $customerForm->openTab('wishlist'); - $customerForm->getTabElement('wishlist')->getSearchGridBlock()->searchAndAction( + $customerForm->getTab('wishlist')->getSearchGridBlock()->searchAndAction( ['product_name' => $product->getName()], 'Configure' ); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php index cd22f6cbc2e7f..f8673a5334d74 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php @@ -77,7 +77,7 @@ public function test( $customerForm = $customerIndexEdit->getCustomerForm(); $customerForm->openTab('wishlist'); $filter = ['product_name' => $product->getName()]; - $customerForm->getTabElement('wishlist')->getSearchGridBlock()->searchAndAction($filter, 'Delete'); + $customerForm->getTab('wishlist')->getSearchGridBlock()->searchAndAction($filter, 'Delete'); return ['products' => [$product]]; } diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml index 459cdc5125379..6bb0caf1abe69 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml @@ -7,15 +7,14 @@ --> - - - - - - + + + + + diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_cs.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_cs.xml index 90bd37fa95380..6bfa264edebc6 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_cs.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_cs.xml @@ -14,7 +14,6 @@ - @@ -22,6 +21,7 @@ + diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_mx.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_mx.xml index 03730f6897cb8..ae9b38f4d3194 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_mx.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_mx.xml @@ -14,7 +14,6 @@ - @@ -22,6 +21,7 @@ + diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_ps.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_ps.xml index 18054e3881d4d..f007237067601 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_ps.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/domain_ps.xml @@ -14,7 +14,6 @@ - @@ -22,6 +21,7 @@ +