Skip to content

Commit 85dfbb0

Browse files
author
Aponasenko, Dmytro(daponasenko)
committed
Merge pull request #218 from magento-qmt/develop
[Mavericks] Create domain plans and test maintenance
2 parents dfd7e03 + 0637f41 commit 85dfbb0

File tree

314 files changed

+4924
-4518
lines changed

Some content is hidden

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

314 files changed

+4924
-4518
lines changed

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

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,55 @@
77
namespace Magento\Mtf\App\State;
88

99
use Magento\Mtf\ObjectManager;
10-
use Magento\Mtf\Fixture\FixtureFactory;
11-
use Magento\Core\Test\Fixture\ConfigData;
1210

1311
/**
14-
* Class State1
15-
* Example Application State class
12+
* Example Application State class.
1613
*/
1714
class State1 extends AbstractState
1815
{
19-
// TODO: Move data set to ConfigData fixture after implement merging fixture xml
2016
/**
21-
* Data set for configuration state
17+
* Object Manager.
2218
*
23-
* @var array
19+
* @var ObjectManager
2420
*/
25-
protected $configDataSet = [
26-
'section' => [
27-
[
28-
'path' => 'cms/wysiwyg/enabled',
29-
'scope' => 'default',
30-
'scope_id' => 1,
31-
'value' => 'disabled',
32-
],
33-
]
34-
];
21+
protected $objectManager;
3522

3623
/**
37-
* Configuration fixture
24+
* Data for configuration state.
3825
*
39-
* @var ConfigData
26+
* @var string
4027
*/
41-
protected $config;
28+
protected $config ='admin_session_lifetime_1_hour, wysiwyg_disabled';
4229

4330
/**
4431
* @construct
45-
* @param FixtureFactory $fixtureFactory
32+
* @param ObjectManager $objectManager
4633
*/
47-
public function __construct(FixtureFactory $fixtureFactory)
34+
public function __construct(ObjectManager $objectManager)
4835
{
49-
$this->config = $fixtureFactory->createByCode('configData', ['data' => $this->configDataSet]);
36+
$this->objectManager = $objectManager;
5037
}
5138

5239
/**
53-
* @inheritdoc
40+
* Apply set up configuration profile.
41+
*
42+
* @return void
5443
*/
5544
public function apply()
5645
{
5746
parent::apply();
5847
if (file_exists(dirname(dirname(dirname(MTF_BP))) . '/app/etc/config.php')) {
59-
$this->config->persist();
48+
$this->objectManager->create(
49+
'\Magento\Config\Test\TestStep\SetupConfigurationStep',
50+
['configData' => $this->config]
51+
)->run();
6052
}
6153
}
6254

6355
/**
64-
* @inheritdoc
56+
* Get name of the Application State Profile.
57+
*
58+
* @return string
6559
*/
6660
public function getName()
6761
{

dev/tests/functional/lib/Magento/Mtf/Client/Element/DatepickerElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DatepickerElement extends SimpleElement
1818
*
1919
* @var string
2020
*/
21-
protected $datePickerButton = './../img[contains(@class,"ui-datepicker-trigger")]';
21+
protected $datePickerButton = './../button[contains(@class,"ui-datepicker-trigger")]';
2222

2323
/**
2424
* DatePicker block.

dev/tests/functional/lib/Magento/Mtf/Client/Element/GlobalsearchElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function clear()
9797
*/
9898
protected function selectWindow()
9999
{
100-
$this->driver->closeWindow();
100+
$this->driver->selectWindow();
101101
}
102102

103103
/**

dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Mtf\Client\Element;
88

9+
use Magento\Framework\Webapi\Exception;
910
use Magento\Mtf\Client\Locator;
1011

1112
/**
@@ -69,8 +70,13 @@ public function setValue($value)
6970
$this->waitResult();
7071
$searchedItem = $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH);
7172
if ($searchedItem->isVisible()) {
72-
$searchedItem->click();
73-
break;
73+
try {
74+
$searchedItem->click();
75+
break;
76+
} catch (\Exception $e) {
77+
// In parallel run on windows change the focus is lost on element
78+
// that causes disappearing of category suggest list.
79+
}
7480
}
7581
}
7682
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\AdminNotification\Test\Block\System;
8+
9+
use Magento\Mtf\Block\Block;
10+
11+
/**
12+
* Global messages block.
13+
*/
14+
class Messages extends Block
15+
{
16+
/**
17+
* Locator for close message block.
18+
*
19+
* @var string
20+
*/
21+
protected $closePopup = '.ui-dialog-titlebar-close';
22+
23+
/**
24+
* Close popup block.
25+
*
26+
* @return void
27+
*/
28+
public function closePopup()
29+
{
30+
if ($this->_rootElement->isVisible()) {
31+
$this->_rootElement->find($this->closePopup)->click();
32+
}
33+
}
34+
}

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: 7 additions & 9 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.
@@ -89,12 +90,9 @@ public function navigate($menuItem)
8990
}
9091
$subMenuSelector = sprintf($this->subMenu, $mainMenu);
9192
$this->waitForElementVisible($subMenuSelector, Locator::SELECTOR_XPATH);
92-
$subMenuItem = $this->_rootElement->find($subMenuSelector, Locator::SELECTOR_XPATH)
93-
->find(sprintf($this->subMenuItem, $subMenu), Locator::SELECTOR_XPATH);
94-
if (!$subMenuItem->isVisible()) {
95-
throw new \Exception('Submenu item "' . $subMenu . '" is not visible in "' . $mainMenu . '"');
96-
}
97-
$subMenuItem->click();
93+
$subMenuItem = $subMenuSelector . sprintf($this->subMenuItem, $subMenu);
94+
$this->waitForElementVisible($subMenuItem, Locator::SELECTOR_XPATH);
95+
$this->_rootElement->find($subMenuItem, Locator::SELECTOR_XPATH)->click();
9896
$this->waitForElementNotVisible($subMenuSelector, Locator::SELECTOR_XPATH);
9997
}
10098
}

0 commit comments

Comments
 (0)