Skip to content

Commit 904c3fe

Browse files
author
Bohdan Korablov
committed
MAGETWO-61786: Implementation
1 parent 390a1f5 commit 904c3fe

File tree

5 files changed

+21
-25
lines changed

5 files changed

+21
-25
lines changed

app/code/Magento/Config/Model/Config/Structure/ConcealInProductionConfigList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ public function isDisabled($path)
7878
*/
7979
private function normalizePath($path)
8080
{
81-
return trim($path ,'/');
81+
return trim($path, '/');
8282
}
8383
}

dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Config/Tabs.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Mtf\Client\Locator;
1010

1111
/**
12-
* Class Tabs.
12+
* Block of tabs on Stores > Settings > Configuration page.
1313
*/
1414
class Tabs extends Block
1515
{
@@ -18,47 +18,43 @@ class Tabs extends Block
1818
*
1919
* @var string
2020
*/
21-
private $topTab = ".//*//strong[contains(., '%s')]/parent::div";
21+
private $topTab = ".//div[@role='tab' and *[contains(.,'%s')]]";
2222

2323
/**
2424
* Selector of block with sub tabs.
2525
*
2626
* @var string
2727
*/
28-
private $subTabs = ".//*//strong[contains(., '%s')]/parent::div/parent::div/ul";
28+
private $subTabs = "./following-sibling::ul";
2929

3030
/**
31-
* Selector of specific sub tab.
31+
* Selector of specific sub tab name.
3232
*
3333
* @var string
3434
*/
35-
private $subTab = 'li:nth-of-type(%s)';
35+
private $subTabName = 'li a span';
3636

3737
/**
38-
* Get list of sub tabs of tab.
38+
* Get list of sub tabs names of tab.
3939
*
4040
* @param string $tab
4141
* @return array
4242
*/
43-
public function getSubTabs($tab)
43+
public function getSubTabsNames($tab)
4444
{
45-
$subTabs = [];
46-
$textSelector = 'a span';
45+
$subTabsNames = [];
4746

48-
$subTabsBlock = $this->_rootElement->find(sprintf($this->subTabs, $tab), Locator::SELECTOR_XPATH);
47+
$topTab = $this->_rootElement->find(sprintf($this->topTab, $tab), Locator::SELECTOR_XPATH);
48+
$subTabsBlock = $topTab->find($this->subTabs, Locator::SELECTOR_XPATH);
4949

5050
if (!$subTabsBlock->isVisible()) {
51-
$this->_rootElement->find(sprintf($this->topTab, $tab), Locator::SELECTOR_XPATH)->click();
51+
$topTab->click();
5252
}
5353

54-
$count = 1;
55-
while ($subTabsBlock->find(sprintf($this->subTab, $count))->isVisible()) {
56-
$subTabs[] = $subTabsBlock->find(sprintf($this->subTab, $count))
57-
->find($textSelector)
58-
->getText();
59-
$count++;
54+
foreach ($subTabsBlock->getElements($this->subTabName) as $elements) {
55+
$subTabsNames[] = $elements->getText();
6056
}
6157

62-
return $subTabs;
58+
return $subTabsNames;
6359
}
6460
}

dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertDeveloperSectionVisibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public function processAssert(SystemConfigEdit $configEdit)
2323
{
2424
if ($_ENV['mage_mode'] === 'production') {
2525
\PHPUnit_Framework_Assert::assertFalse(
26-
in_array('Developer', $configEdit->getTabs()->getSubTabs('Advanced')),
26+
in_array('Developer', $configEdit->getTabs()->getSubTabsNames('Advanced')),
2727
'Developer section should be hidden in production mode.'
2828
);
2929
} else {
3030
\PHPUnit_Framework_Assert::assertTrue(
31-
in_array('Developer', $configEdit->getTabs()->getSubTabs('Advanced')),
31+
in_array('Developer', $configEdit->getTabs()->getSubTabsNames('Advanced')),
3232
'Developer section should be not hidden in developer or default mode.'
3333
);
3434
}

dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigPageVisibilityTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
1010

1111
/**
12-
* Verify visibility of Locale field and Developer section on Configuration page.
12+
* Verify visibility of form elements on Configuration page.
1313
*
1414
* @ZephyrId MAGETWO-63625, MAGETWO-63624
1515
*/
1616
class ConfigPageVisibilityTest extends Injectable
1717
{
1818
/* tags */
19-
const TEST_TYPE = 'acceptance_test';
19+
const SEVERITY = 'S1';
2020
/* end tags */
2121

2222
/**

dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigPageVisibilityTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
9-
<testCase name="Magento\Backend\Test\TestCase\VisibilityLocaleCodeTest" summary="Check Developer section and Locale field">
10-
<variation name="first" summary="Check Developer section and Locale field" ticketId="MAGETWO-63625, MAGETWO-63624">
9+
<testCase name="Magento\Backend\Test\TestCase\ConfigPageVisibilityTest" summary="Check Developer section and Locale field">
10+
<variation name="VisibilityOfDeveloperSectionAndLocaleField" summary="Check Developer section and Locale field" ticketId="MAGETWO-63625, MAGETWO-63624">
1111
<constraint name="Magento\Backend\Test\Constraint\AssertLocaleCodeVisibility" />
1212
<constraint name="Magento\Backend\Test\Constraint\AssertDeveloperSectionVisibility" />
1313
</variation>

0 commit comments

Comments
 (0)