Skip to content

Commit 0b443a8

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-61549: Use default URL Key
1 parent f02714f commit 0b443a8

File tree

1 file changed

+5
-54
lines changed

1 file changed

+5
-54
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryEdit;
1111
use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryIndex;
1212
use Magento\Mtf\Constraint\AbstractAssertForm;
13-
use Magento\Mtf\Client\Locator;
14-
use Magento\Mtf\Client\BrowserInterface;
15-
use Magento\Mtf\Block\BlockFactory;
1613

1714
/**
1815
* Assert that displayed category data on edit page equals passed from fixture.
@@ -34,77 +31,31 @@ class AssertCategoryForm extends AbstractAssertForm
3431
'store_id'
3532
];
3633

37-
/**
38-
* Default sore switcher block locator.
39-
*
40-
* @var string
41-
*/
42-
private $storeSwitcherBlock = '.store-switcher';
43-
44-
/**
45-
* Dropdown block locator.
46-
*
47-
* @var string
48-
*/
49-
private $dropdownBlock = '.dropdown';
50-
51-
/**
52-
* Selector for confirm.
53-
*
54-
* @var string
55-
*/
56-
private $confirmModal = '.confirm._show[data-role=modal]';
57-
5834
/**
5935
* Assert that displayed category data on edit page equals passed from fixture.
6036
*
6137
* @param CatalogCategoryIndex $catalogCategoryIndex
6238
* @param CatalogCategoryEdit $catalogCategoryEdit
6339
* @param Category $category
64-
* @param BrowserInterface $browser
65-
* @param BlockFactory $blockFactory
6640
* @return void
6741
*/
6842
public function processAssert(
6943
CatalogCategoryIndex $catalogCategoryIndex,
7044
CatalogCategoryEdit $catalogCategoryEdit,
71-
Category $category,
72-
BrowserInterface $browser,
73-
BlockFactory $blockFactory
45+
Category $category
7446
) {
7547
$catalogCategoryIndex->open();
7648
$catalogCategoryIndex->getTreeCategories()->selectCategory($category, true);
77-
$this->switchScope($category, $browser, $blockFactory);
49+
if ($category->hasData('store_id')) {
50+
$storeName = $category->getStoreId()['source']->getName();
51+
$catalogCategoryEdit->getFormPageActions()->selectStoreView($storeName);
52+
}
7853
$fixtureData = $this->prepareFixtureData($category->getData());
7954
$formData = $catalogCategoryEdit->getEditForm()->getData($category);
8055
$error = $this->verifyData($this->sortData($fixtureData), $this->sortData($formData));
8156
\PHPUnit_Framework_Assert::assertEmpty($error, $error);
8257
}
8358

84-
/**
85-
* Switches scope to selected store on the edit form
86-
*
87-
* @param Category $category
88-
* @param BrowserInterface $browser
89-
* @param BlockFactory $blockFactory
90-
* @return void
91-
*/
92-
private function switchScope(Category $category, BrowserInterface $browser, BlockFactory $blockFactory)
93-
{
94-
if ($category->hasData('store_id')) {
95-
$store = $category->getStoreId()['source']->getName();
96-
$storeSwitcherBlock = $browser->find($this->storeSwitcherBlock);
97-
$storeSwitcherBlock->find($this->dropdownBlock, Locator::SELECTOR_CSS, 'liselectstore')->setValue($store);
98-
$modalElement = $browser->find($this->confirmModal);
99-
/** @var \Magento\Ui\Test\Block\Adminhtml\Modal $modal */
100-
$modal = $blockFactory->create(
101-
\Magento\Ui\Test\Block\Adminhtml\Modal::class,
102-
['element' => $modalElement]
103-
);
104-
$modal->acceptAlert();
105-
}
106-
}
107-
10859
/**
10960
* Prepares fixture data for comparison.
11061
*

0 commit comments

Comments
 (0)