diff --git a/app/code/Magento/CatalogInventory/Helper/Stock.php b/app/code/Magento/CatalogInventory/Helper/Stock.php index 6169efca64bd0..4c177c09d4b79 100644 --- a/app/code/Magento/CatalogInventory/Helper/Stock.php +++ b/app/code/Magento/CatalogInventory/Helper/Stock.php @@ -154,7 +154,10 @@ public function addIsInStockFilterToCollection($collection) \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); $resource = $this->getStockStatusResource(); - $resource->addStockDataToCollection($collection, !$isShowOutOfStock); + $resource->addStockDataToCollection( + $collection, + !$isShowOutOfStock && $collection->getFlag('require_stock_items') + ); $collection->setFlag($stockFlag, true); } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/Edit/Form/StoreForm.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/Edit/Form/StoreForm.php index 3aa4352265535..9f20ae953c211 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/Edit/Form/StoreForm.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/Edit/Form/StoreForm.php @@ -22,6 +22,13 @@ class StoreForm extends Form */ protected $store = '//option[contains(.,"%s")]'; + /** + * Store dropdown selector + * + * @var string + */ + protected $storeGroupId = '//select[@id="store_group_id"]'; + /** * Check that Store visible in Store dropdown * @@ -32,4 +39,16 @@ public function isStoreVisible($name) { return $this->_rootElement->find(sprintf($this->store, $name), Locator::SELECTOR_XPATH)->isVisible(); } + + /** + * Select store view by name from dropdown + * + * @param string $name + * @return bool + */ + public function selectStore($name) + { + return $this->_rootElement->find($this->storeGroupId, Locator::SELECTOR_XPATH, 'optgroupselect') + ->setValue($name); + } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageOnFrontend.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageOnFrontend.php new file mode 100644 index 0000000000000..401042c031259 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageOnFrontend.php @@ -0,0 +1,52 @@ +open($_ENV['app_frontend_url'] . $cms->getIdentifier()); + $fixtureContent = $cms->getContent(); + \PHPUnit_Framework_Assert::assertContains( + $displayContent != null ? $displayContent : $fixtureContent['content'], + $frontCmsPage->getCmsPageBlock()->getPageContent(), + 'Wrong content is displayed.' + ); + } + + /** + * CMS Page content equals to data from fixture. + * + * @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/AssertCmsPagePreview.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php index 51e9b428892cc..6db35e88efe49 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php @@ -30,6 +30,7 @@ class AssertCmsPagePreview extends AbstractConstraint * @param FrontCmsPage $frontCmsPage * @param CmsPage $cms * @param BrowserInterface $browser + * @param string $displayContent * @return void */ public function processAssert( @@ -37,7 +38,8 @@ public function processAssert( FrontCmsIndex $frontCmsIndex, FrontCmsPage $frontCmsPage, CmsPage $cms, - BrowserInterface $browser + BrowserInterface $browser, + $displayContent = null ) { $cmsIndex->open(); $filter = ['title' => $cms->getTitle()]; @@ -46,7 +48,7 @@ public function processAssert( $fixtureContent = $cms->getContent(); \PHPUnit_Framework_Assert::assertContains( - $fixtureContent['content'], + $displayContent != null ? $displayContent : $fixtureContent['content'], $frontCmsPage->getCmsPageBlock()->getPageContent(), 'Wrong content is displayed.' ); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 67b4421182848..f8b6c8c3d9e06 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -54,5 +54,18 @@ + + severity:S2 + cmsPage + NewCmsPage%isolation% + identifier-%isolation% + Main Website/Main Website Store/Default Store View + Yes + \\{{block class='Magento\Framework\View\Element\Text' text='bla bla bla' cache_key='BACKEND_ACL_RESOURCES' cache_lifetime=999\}} + bla bla bla + + + + 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 index f4b96844b2738..0d3e1b4ea9710 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml @@ -6,24 +6,84 @@ */ --> - + - high + S1 - + + + S2 + + + - high + S3 - high + S3 - + + + S1 + + + + + S1 + + + + + S1 + + + + + S2 + + + + + S1 + + + + + S2 + + + + + S2 + + + + + S3 + + + + + S1 + + + + + S1 + + + + + S1 + + + - high + S1 diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php index 9f05188e2ebb4..e1e8f2ddebb70 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php @@ -110,4 +110,92 @@ public function getLastName() $mapping['lastname']['strategy'] )->getValue(); } + + /** + * Set 'Change Email' checkbox value. + * + * @param boolean $value + * @return void + */ + public function setChangeEmail($value) + { + $mapping = $this->dataMapping(); + $this->_rootElement->find( + $mapping['change_email']['selector'], + $mapping['change_email']['strategy'], + 'checkbox' + )->setValue($value ? "Yes" : "No"); + } + + /** + * Set 'Change Password' checkbox value. + * + * @param boolean $value + * @return void + */ + public function setChangePassword($value) + { + $mapping = $this->dataMapping(); + $this->_rootElement->find( + $mapping['change_password']['selector'], + $mapping['change_password']['strategy'], + 'checkbox' + )->setValue($value ? "Yes" : "No"); + } + + /** + * Check if Current Password field is visible. + * + * @return boolean + */ + public function isCurrentPasswordVisible() + { + $mapping = $this->dataMapping(); + return $this->_rootElement->find( + $mapping['current_password']['selector'], + $mapping['current_password']['strategy'] + )->isVisible(); + } + + /** + * Check if Password field is visible. + * + * @return boolean + */ + public function isPasswordVisible() + { + $mapping = $this->dataMapping(); + return $this->_rootElement->find( + $mapping['password']['selector'], + $mapping['password']['strategy'] + )->isVisible(); + } + + /** + * Check if Confirmation field is visible. + * + * @return boolean + */ + public function isConfirmPasswordVisible() + { + $mapping = $this->dataMapping(); + return $this->_rootElement->find( + $mapping['confirmation']['selector'], + $mapping['confirmation']['strategy'] + )->isVisible(); + } + + /** + * Check if Email field is visible. + * + * @return boolean + */ + public function isEmailVisible() + { + $mapping = $this->dataMapping(); + return $this->_rootElement->find( + $mapping['email']['selector'], + $mapping['email']['strategy'] + )->isVisible(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.xml index 9bbc247787e62..20610b0672722 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.xml @@ -9,6 +9,12 @@ + + checkbox + + + checkbox + diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountEdit.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountEdit.xml index 66a7e57279113..362e66aa19d43 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountEdit.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountEdit.xml @@ -9,5 +9,6 @@ + diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/Constraint/AssertCustomerEmailChanged.php b/dev/tests/functional/tests/app/Magento/Security/Test/Constraint/AssertCustomerEmailChanged.php new file mode 100644 index 0000000000000..68384aacbc70c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/Constraint/AssertCustomerEmailChanged.php @@ -0,0 +1,64 @@ +createByCode( + 'customer', + [ + 'data' => [ + 'email' => $customer->getEmail(), + 'password' => $initialCustomer->getPassword() + ], + ] + ); + + $this->objectManager->create( + \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, + ['customer' => $customer] + )->run(); + + \PHPUnit_Framework_Assert::assertTrue( + $customerAccountIndex->getAccountMenuBlock()->isVisible(), + 'Customer Account Dashboard is not visible.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Customer email was changed.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/Constraint/AssertDefaultAccountInformation.php b/dev/tests/functional/tests/app/Magento/Security/Test/Constraint/AssertDefaultAccountInformation.php new file mode 100644 index 0000000000000..642db59251574 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/Constraint/AssertDefaultAccountInformation.php @@ -0,0 +1,58 @@ +getAccountInfoForm(); + + \PHPUnit_Framework_Assert::assertFalse( + $infoForm->isEmailVisible(), + 'Email text field should not be visible.' + ); + + \PHPUnit_Framework_Assert::assertFalse( + $infoForm->isCurrentPasswordVisible(), + 'Current Password text field should not be visible.' + ); + + \PHPUnit_Framework_Assert::assertFalse( + $infoForm->isPasswordVisible(), + 'New Password text field should not be visible.' + ); + + \PHPUnit_Framework_Assert::assertFalse( + $infoForm->isConfirmPasswordVisible(), + 'Password Confirmation text field should not be visible.' + ); + } + + /** + * String representation of success assert. + * + * @return string + */ + public function toString() + { + return 'Default customer account information tab is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php new file mode 100644 index 0000000000000..9f1acd69d92a2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php @@ -0,0 +1,88 @@ +customerAccountEdit = $customerAccountEdit; + } + + /** + * Change customer password in Account Information tab. + * + * @param Customer $initialCustomer + * @param Customer $customer + * @return void + */ + public function test(Customer $initialCustomer, Customer $customer) + { + // Preconditions + $initialCustomer->persist(); + + // Steps + $this->objectManager->create( + \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, + ['customer' => $initialCustomer] + )->run(); + + $this->customerAccountEdit->getAccountMenuBlock()->openMenuItem('Account Information'); + $this->customerAccountEdit->getAccountInfoForm()->SetChangeEmail(true); + $this->customerAccountEdit->getAccountInfoForm()->fill($customer); + $this->customerAccountEdit->getAccountInfoForm()->submit(); + } + + /** + * Logout customer from frontend account. + * + * @return void + */ + public function tearDown() + { + $this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml new file mode 100644 index 0000000000000..dc3ad06e842fd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml @@ -0,0 +1,26 @@ + + + + + + severity:S1 + default + JaneDoe_%isolation%@example.com + 123123^q + + + + + severity:S2 + default + JaneDoe_%isolation%@example.com + 123123123 + + + + diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php new file mode 100644 index 0000000000000..225ef6b397aa4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php @@ -0,0 +1,91 @@ +customerAccountEdit = $customerAccountEdit; + } + + /** + * Change customer password in Account Information tab. + * + * @param Customer $initialCustomer + * @param Customer $customer + * @param boolean $check + * @return void + */ + public function test(Customer $initialCustomer, Customer $customer, $check) + { + // Preconditions + $initialCustomer->persist(); + + // Steps + $this->objectManager->create( + \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, + ['customer' => $initialCustomer] + )->run(); + + $this->customerAccountEdit->getAccountMenuBlock()->openMenuItem('Account Information'); + if ($check) { + $this->customerAccountEdit->getAccountInfoForm()->SetChangePassword(true); + $this->customerAccountEdit->getAccountInfoForm()->fill($customer); + $this->customerAccountEdit->getAccountInfoForm()->submit(); + } + } + + /** + * Logout customer from frontend account. + * + * @return void + */ + public function tearDown() + { + $this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml new file mode 100644 index 0000000000000..9fc2f50435a98 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml @@ -0,0 +1,36 @@ + + + + + + severity:S1 + default + 123123^q + 123123Qa + 123123Qa + 1 + + + + + severity:S2 + default + 123123123 + 123123Qa + 123123Qa + 1 + + + + severity:S3 + default + 0 + + + + diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php index 93bf1a9001cbf..a5fa6d4a83cbe 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php @@ -43,6 +43,15 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array $this->storeGroup = $data['fixture']; $this->data = $this->storeGroup->getWebsiteId() . "/" . $this->storeGroup->getName(); } + + if (isset($data['storeGroup']) && $data['storeGroup'] instanceof StoreGroup) { + $this->storeGroup = $data['storeGroup']; + $this->data = $data['storeGroup']->getWebsiteId() . "/" . $data['storeGroup']->getName(); + } + + if (isset($data['value'])) { + $this->data = $data['value']; + } } /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml index 12ca9f5e03a20..37faba3d75524 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml @@ -52,5 +52,14 @@ store_%isolation% Enabled + + + + custom + + Custom_Store_%isolation% + code_%isolation% + Enabled + 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 804111c497cca..56ec632ffd09f 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 TEST_TYPE = 'acceptance_test, extended_acceptance_test'; + const SEVERITY = 'S0'; /* 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 d0fb3738910cd..26d9aa9beba0a 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 @@ -8,28 +8,27 @@ + severity:S1 default store_name_%isolation% storecode_%isolation% Enabled - - + severity:S3 default store_name_%isolation% storecode_%isolation% Disabled - - + severity:S1 custom store_name_%isolation% storecode_%isolation% @@ -41,7 +40,7 @@ - test_type:acceptance_test, test_type:extended_acceptance_test + test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0 default DE_%isolation% de_%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.php index 5d638d781d173..76589026b70a0 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.php @@ -29,6 +29,7 @@ class CreateStoreGroupEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml index d3644ff6ddc59..39adbb9c41840 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml @@ -8,15 +8,16 @@ + severity:S1 main_website store_name_%isolation% default_category - + severity:S1 custom_website store_name_%isolation% root_category diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.php index 766e030b3f618..3e0b3670f4945 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.php @@ -29,6 +29,7 @@ class CreateWebsiteEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.xml index e5ec1371587a6..810a4b9ac88f2 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateWebsiteEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 website_%isolation% code_%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php index cbe261fe750a8..baee46f869703 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php @@ -36,6 +36,7 @@ class DeleteStoreEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml index 05132aeefda4c..b888ba1f77837 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml @@ -8,6 +8,7 @@ + severity:S2 custom Yes @@ -16,10 +17,10 @@ + severity:S2 custom No - diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php index e7ba27b44c1a8..5890298650c5c 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php @@ -38,6 +38,7 @@ class DeleteStoreGroupEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S3'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml index bbedbfc8d1037..16c0aeb358bb0 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml @@ -8,6 +8,7 @@ + severity:S3 custom Yes @@ -15,6 +16,7 @@ + severity:S3 custom No diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php index 5d4af70cb03e3..94e14b4a42317 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php @@ -38,6 +38,7 @@ class DeleteWebsiteEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S3'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml index 93c63d42d4de5..21327a0ced20b 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml @@ -8,6 +8,7 @@ + severity:S3 custom_website Yes @@ -15,6 +16,7 @@ + severity:S3 custom_website No diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.php new file mode 100644 index 0000000000000..9a335e1cbd0e3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.php @@ -0,0 +1,107 @@ + All Stores + * 3. Open store view SVB from grid + * 4. Change store group setting from STB to STA + * 5. Save store entity + * 6. Perform all assertions + * + * @group Store_Management + * @ZephyrId MAGETWO-54026 + */ +class MoveStoreToOtherGroupSameWebsiteTest extends Injectable +{ + /* tags */ + const MVP = 'yes'; + const SEVERITY = 'S1'; + /* end tags */ + + /** + * Page StoreIndex + * + * @var StoreIndex + */ + protected $storeIndex; + + /** + * Page EditStore + * + * @var EditStore + */ + protected $editStore; + + /** + * Preparing pages for test + * + * @param StoreIndex $storeIndex + * @param EditStore $editStore + * @return void + */ + public function __inject(StoreIndex $storeIndex, EditStore $editStore) + { + $this->storeIndex = $storeIndex; + $this->editStore = $editStore; + } + + /** + * Move store view to another store group within a website + * + * @param FixtureFactory $fixtureFactory + * @param Store $storeInitialA + * @param Store $storeInitialB + * @return array + */ + public function test(FixtureFactory $fixtureFactory, Store $storeInitialA, Store $storeInitialB) + { + // Prepare data for constraints + $store = $fixtureFactory->createByCode( + 'store', + [ + 'data' => [ + 'name' => $storeInitialB->getName(), + 'code' => $storeInitialB->getCode(), + 'is_active' => $storeInitialB->getIsActive(), + 'group_id' => [ + 'storeGroup' => $storeInitialA->getDataFieldConfig('group_id')['source']->getStoreGroup() + ], + ], + ] + ); + + // Preconditions + $storeInitialA->persist(); + $storeInitialB->persist(); + + // Steps + $this->storeIndex->open(); + $this->storeIndex->getStoreGrid()->searchAndOpenStore($storeInitialB); + $this->editStore->getStoreForm()->selectStore($storeInitialA->getGroupId()); + $this->editStore->getFormPageActions()->save(); + + return ['store' => $store]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml new file mode 100644 index 0000000000000..d6353d8379532 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml @@ -0,0 +1,20 @@ + + + + + + custom_group_custom_store + custom_group_custom_store + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php index 38250d958bc10..43a219cba62e6 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php @@ -33,6 +33,7 @@ class UpdateStoreEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml index 92028c303a529..c32df2c53396b 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml @@ -8,6 +8,7 @@ + severity:S2 custom default storename_updated%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.php index 7e9143a5c91df..f81d0989e2481 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.php @@ -34,6 +34,7 @@ class UpdateStoreGroupEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml index ce1a67575c675..07309135f607a 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml @@ -8,16 +8,17 @@ + severity:S2 custom main_website store_name_updated_%isolation% default_category - + severity:S2 custom custom_website store_name_updated_%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.php index b187f05856670..28fcfd79131fa 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.php @@ -35,6 +35,7 @@ class UpdateWebsiteEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml index 94f0a891e61cc..c1b3af6749727 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml @@ -8,6 +8,7 @@ + severity:S2 custom_website website_upd%isolation% code_upd%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Store/Test/etc/di.xml new file mode 100644 index 0000000000000..737f33ebebe1f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Store/Test/etc/di.xml @@ -0,0 +1,124 @@ + + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S2 + + + + + S3 + + + + + S1 + + + + + S3 + + + + + S3 + + + + + S1 + + + + + S2 + + + + + S3 + + + + + S3 + + + + + S2 + + + + + S2 + + + + + S1 + + + + + S1 + + + + + S2 + + + + + S3 + + + + + S1 + + + + + S3 + + + + + S3 + + + + + S1 + + +