Skip to content

Commit c195361

Browse files
author
Dmytro Aponasenko
committed
MTA-1814: Analyse functional test failures - Sprint 9
1 parent 404e40a commit c195361

File tree

193 files changed

+2600
-2530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2600
-2530
lines changed

dev/tests/functional/lib/Magento/Mtf/App/State/State1.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@
88

99
use Magento\Mtf\ObjectManager;
1010
use Magento\Mtf\Fixture\FixtureFactory;
11-
use Magento\Core\Test\Fixture\ConfigData;
11+
use Magento\Config\Test\Fixture\ConfigData;
1212

1313
/**
14-
* Class State1
15-
* Example Application State class
14+
* Example Application State class.
1615
*/
1716
class State1 extends AbstractState
1817
{
1918
// TODO: Move data set to ConfigData fixture after implement merging fixture xml
2019
/**
21-
* Data set for configuration state
20+
* Data set for configuration state.
2221
*
2322
* @var array
2423
*/
@@ -34,7 +33,7 @@ class State1 extends AbstractState
3433
];
3534

3635
/**
37-
* Configuration fixture
36+
* Configuration fixture.
3837
*
3938
* @var ConfigData
4039
*/
@@ -50,7 +49,9 @@ public function __construct(FixtureFactory $fixtureFactory)
5049
}
5150

5251
/**
53-
* @inheritdoc
52+
* Apply set up configuration profile.
53+
*
54+
* @return void
5455
*/
5556
public function apply()
5657
{
@@ -61,7 +62,9 @@ public function apply()
6162
}
6263

6364
/**
64-
* @inheritdoc
65+
* Get name of the Application State Profile.
66+
*
67+
* @return string
6568
*/
6669
public function getName()
6770
{

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,35 @@
88

99
use Magento\Mtf\Block\Block;
1010
use Magento\Mtf\Client\Locator;
11-
use Magento\Mtf\Factory\Factory;
1211

1312
/**
14-
* Class Actions
15-
* Cache actions block
16-
*
13+
* Cache actions block.
1714
*/
1815
class Cache extends Block
1916
{
2017
/**
21-
* 'Flush Magento Cache' button
18+
* 'Flush Magento Cache' button.
2219
*
2320
* @var string
2421
*/
2522
protected $flushMagentoCacheButton = '[data-ui-id="adminhtml-cache-container-flush-magento-button"]';
2623

2724
/**
28-
* 'Flush Cache Storage' button
25+
* 'Flush Cache Storage' button.
2926
*
3027
* @var string
3128
*/
3229
protected $flushCacheStorageButton = '[data-ui-id="adminhtml-cache-container-flush-system-button"]';
3330

3431
/**
35-
* Selector for messages block
32+
* Selector for messages block.
3633
*
3734
* @var string
3835
*/
3936
protected $messagesSelector = '//ancestor::div//div[@id="messages"]';
4037

4138
/**
42-
* Messages texts
39+
* Messages texts.
4340
*
4441
* @var array
4542
*/
@@ -49,15 +46,15 @@ class Cache extends Block
4946
];
5047

5148
/**
52-
* Flush magento cache
49+
* Flush magento cache.
5350
*/
5451
public function flushMagentoCache()
5552
{
5653
$this->_rootElement->find($this->flushMagentoCacheButton)->click();
5754
}
5855

5956
/**
60-
* Flush cache storage
57+
* Flush cache storage.
6158
*/
6259
public function flushCacheStorage()
6360
{
@@ -66,7 +63,7 @@ public function flushCacheStorage()
6663
}
6764

6865
/**
69-
* Is storage cache flushed successfully
66+
* Is storage cache flushed successfully.
7067
*
7168
* @return bool
7269
*/
@@ -76,7 +73,7 @@ public function isStorageCacheFlushed()
7673
}
7774

7875
/**
79-
* Is magento cache flushed successfully
76+
* Is magento cache flushed successfully.
8077
*
8178
* @return bool
8279
*/
@@ -86,14 +83,15 @@ public function isMagentoCacheFlushed()
8683
}
8784

8885
/**
89-
* Get messages block
86+
* Get messages block.
9087
*
91-
* @return \Magento\Core\Test\Block\Messages
88+
* @return \Magento\Backend\Test\Block\Messages
9289
*/
9390
protected function getMessagesBlock()
9491
{
95-
return Factory::getBlockFactory()->getMagentoCoreMessages(
96-
$this->_rootElement->find($this->messagesSelector, Locator::SELECTOR_XPATH)
92+
return $this->blockFactory->create(
93+
'Magento\Backend\Test\Block\Messages',
94+
['element' => $this->_rootElement->find($this->messagesSelector, Locator::SELECTOR_XPATH)]
9795
);
9896
}
9997
}

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Menu.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Backend\Test\Block;
78

89
use Magento\Mtf\Block\Block;
@@ -18,21 +19,21 @@ class Menu extends Block
1819
*
1920
* @var string
2021
*/
21-
protected $mainMenu = './/li/a[span="%s"]';
22+
protected $mainMenu = './/li[@role="menu-item"]/a[span="%s"]';
2223

2324
/**
2425
* Submenu selector.
2526
*
2627
* @var string
2728
*/
28-
protected $subMenu = './/li[a[span="%s"]]/div[@class="submenu" and @style="display: block;"]';
29+
protected $subMenu = './/li[@role="menu-item" and a[span="%s"]]/div[@class="submenu"]';
2930

3031
/**
3132
* Submenu item selector.
3233
*
3334
* @var string
3435
*/
35-
protected $subMenuItem = './/a[span="%s"]';
36+
protected $subMenuItem = './/li[@role="menu-item"]//a[span="%s"]';
3637

3738
/**
3839
* Parent menu item.

dev/tests/functional/tests/app/Magento/Core/Test/Block/Messages.php renamed to dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Core\Test\Block;
7+
namespace Magento\Backend\Test\Block;
88

99
use Magento\Mtf\Block\Block;
1010
use Magento\Mtf\Client\Locator;
1111

1212
/**
13-
* Global messages block
14-
*
13+
* Global messages block.
1514
*/
1615
class Messages extends Block
1716
{
@@ -23,7 +22,7 @@ class Messages extends Block
2322
protected $successMessage = '[data-ui-id$=message-success]';
2423

2524
/**
26-
* Message link
25+
* Message link.
2726
*
2827
* @var string
2928
*/
@@ -37,7 +36,7 @@ class Messages extends Block
3736
protected $errorMessage = '[data-ui-id$=message-error]';
3837

3938
/**
40-
* Notice message selector
39+
* Notice message selector.
4140
*
4241
* @var string
4342
*/
@@ -51,7 +50,7 @@ class Messages extends Block
5150
protected $warningMessage = '[data-ui-id$=message-warning]';
5251

5352
/**
54-
* Wait for success message
53+
* Wait for success message.
5554
*
5655
* @return bool
5756
*/
@@ -61,7 +60,7 @@ public function waitSuccessMessage()
6160
}
6261

6362
/**
64-
* Get all success messages which are present on the page
63+
* Get all success messages which are present on the page.
6564
*
6665
* @return string|array
6766
*/
@@ -79,7 +78,7 @@ public function getSuccessMessages()
7978
}
8079

8180
/**
82-
* Wait for element is visible in the page
81+
* Wait for element is visible in the page.
8382
*
8483
* @param string $selector
8584
* @param string $strategy
@@ -97,7 +96,7 @@ function () use ($browser, $selector, $strategy) {
9796
}
9897

9998
/**
100-
* Get all error messages which are present on the page
99+
* Get all error messages which are present on the page.
101100
*
102101
* @return string
103102
*/
@@ -109,7 +108,7 @@ public function getErrorMessages()
109108
}
110109

111110
/**
112-
* Click on link in the messages which are present on the page
111+
* Click on link in the messages which are present on the page.
113112
*
114113
* @param string $messageType
115114
* @param string $linkText
@@ -126,7 +125,7 @@ public function clickLinkInMessages($messageType, $linkText)
126125
}
127126

128127
/**
129-
* Check is visible messages
128+
* Check is visible messages.
130129
*
131130
* @param string $messageType
132131
* @return bool
@@ -139,7 +138,7 @@ public function isVisibleMessage($messageType)
139138
}
140139

141140
/**
142-
* Check for error message
141+
* Check for error message.
143142
*
144143
* @return bool
145144
*/
@@ -149,7 +148,7 @@ public function assertErrorMessage()
149148
}
150149

151150
/**
152-
* Check for notice message
151+
* Check for notice message.
153152
*
154153
* @return bool
155154
*/
@@ -159,7 +158,7 @@ public function assertNoticeMessage()
159158
}
160159

161160
/**
162-
* Get notice message which is present on the page
161+
* Get notice message which is present on the page.
163162
*
164163
* @return string
165164
*/
@@ -170,7 +169,7 @@ public function getNoticeMessages()
170169
}
171170

172171
/**
173-
* Get warning message which is present on the page
172+
* Get warning message which is present on the page.
174173
*
175174
* @return string
176175
*/

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public function processAssert(SystemConfig $systemConfig, Store $store, CmsIndex
3939

4040
// Check presents income text on index page
4141
$cmsIndex->open();
42+
if ($cmsIndex->getFooterBlock()->isStoreGroupSwitcherVisible()
43+
&& $cmsIndex->getFooterBlock()->isStoreGroupVisible($store)
44+
) {
45+
$cmsIndex->getFooterBlock()->selectStoreGroup($store);
46+
}
47+
4248
$cmsIndex->getStoreSwitcherBlock()->selectStoreView($store->getName());
4349

4450
\PHPUnit_Framework_Assert::assertTrue(

dev/tests/functional/tests/app/Magento/Backend/Test/Page/AdminAuthLogin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
/**
1313
* Login page for backend.
14-
*
1514
*/
1615
class AdminAuthLogin extends Page
1716
{
@@ -39,7 +38,7 @@ class AdminAuthLogin extends Page
3938
*
4039
* @var string
4140
*/
42-
protected $messagesBlock = '#messages .messages';
41+
protected $messagesBlock = '.messages .message';
4342

4443
/**
4544
* Constructor.
@@ -76,11 +75,11 @@ public function getHeaderBlock()
7675
/**
7776
* Get global messages block.
7877
*
79-
* @return \Magento\Core\Test\Block\Messages
78+
* @return \Magento\Backend\Test\Block\Messages
8079
*/
8180
public function getMessagesBlock()
8281
{
83-
return Factory::getBlockFactory()->getMagentoCoreMessages($this->_browser->find($this->messagesBlock));
82+
return Factory::getBlockFactory()->getMagentoBackendMessages($this->_browser->find($this->messagesBlock));
8483
}
8584

8685
/**

dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/AdminCache.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
99
<page name="AdminCache" area="Adminhtml" mca="admin/cache/" module="Magento_Backend">
10-
<block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages .messages" strategy="css selector"/>
10+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages .messages" strategy="css selector"/>
1111
<block name="actionsBlock" class="Magento\Backend\Test\Block\Cache" locator="div.page-actions" strategy="css selector"/>
1212
</page>
1313
</config>

dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/EditStore.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<page name="EditStore" area="Adminhtml" mca="admin/system_store/editStore" module="Magento_Backend">
1010
<block name="formPageActions" class="Magento\Backend\Test\Block\System\Store\FormPageActions" locator=".page-main-actions" strategy="css selector"/>
1111
<block name="storeForm" class="Magento\Backend\Test\Block\System\Store\Edit\Form\StoreForm" locator="[id='page:main-container']" strategy="css selector"/>
12-
<block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/>
12+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/>
1313
</page>
1414
</config>

dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
99
<page name="StoreDelete" area="Adminhtml" mca="admin/system_store/deleteStore" module="Magento_Backend">
10-
<block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/>
10+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/>
1111
<block name="storeForm" class="Magento\Backend\Test\Block\System\Store\Delete\Form" locator="#edit_form" strategy="css selector"/>
1212
<block name="formPageActions" class="Magento\Backend\Test\Block\System\Store\FormPageActions" locator=".page-main-actions" strategy="css selector"/>
1313
</page>

dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreIndex.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
99
<page name="StoreIndex" area="Adminhtml" mca="admin/system_store" module="Magento_Backend">
10-
<block name="messagesBlock" class="Magento\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/>
10+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/>
1111
<block name="gridPageActions" class="Magento\Backend\Test\Block\System\Store\GridPageActions" locator=".page-main-actions" strategy="css selector"/>
1212
<block name="storeGrid" class="Magento\Backend\Test\Block\System\Store\StoreGrid" locator="[id='page:main-container']" strategy="css selector"/>
1313
</page>

0 commit comments

Comments
 (0)