Skip to content

Commit bda126b

Browse files
author
Oleksii Korshenko
committed
Merge remote-tracking branch 'mainline/2.0' into bugfixes20
2 parents ba0c611 + f3adf92 commit bda126b

File tree

23 files changed

+1012
-0
lines changed

23 files changed

+1012
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Client\Element;
8+
9+
use Magento\Mtf\Client\Locator;
10+
11+
/**
12+
* Custom checkbox that hidden by label
13+
*/
14+
class CheckboxwithlabelElement extends CheckboxElement
15+
{
16+
/**
17+
* Set checkbox value by clicking on label
18+
*
19+
* @param string $value
20+
*/
21+
public function setValue($value)
22+
{
23+
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
24+
if (($this->isSelected() && $value == 'No') || (!$this->isSelected() && $value == 'Yes')) {
25+
$this->find('./following-sibling::label', Locator::SELECTOR_XPATH)->click();
26+
}
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Backend\Test\Block;
8+
9+
use Magento\Mtf\Block\Block;
10+
use Magento\Mtf\Client\Locator;
11+
12+
class Version extends Block
13+
{
14+
/**
15+
* @var string
16+
*/
17+
protected $backendVersion = 'magento-version';
18+
19+
/**
20+
* Returns dashboard application version
21+
*
22+
* @return string
23+
*/
24+
public function getVersion()
25+
{
26+
return $this->_rootElement->find($this->backendVersion, Locator::SELECTOR_CLASS_NAME)->getText();
27+
}
28+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<block name="errorBlock" class="Magento\Backend\Test\Block\Page\Error" locator="[id='page:main-container']" strategy="css selector" />
1616
<block name="accessDeniedBlock" class="Magento\Backend\Test\Block\Denied" locator="#anchor-content" strategy="css selector" />
1717
<block name="systemMessageDialog" class="Magento\AdminNotification\Test\Block\System\Messages" locator='[role="dialog"].ui-popup-message' strategy="css selector" />
18+
<block name="applicationVersion" class="Magento\Backend\Test\Block\Version" locator="body" strategy="css selector" />
1819
</page>
1920
</config>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Upgrade\Test\Block;
8+
9+
use Magento\Mtf\Block\Form;
10+
use Magento\Mtf\Client\Element\SimpleElement;
11+
use Magento\Mtf\Client\Locator;
12+
use Magento\Mtf\Fixture\FixtureInterface;
13+
14+
/**
15+
* Perform Authentication block.
16+
*/
17+
class Authentication extends Form
18+
{
19+
/**
20+
* 'Save Config' button.
21+
*
22+
* @var string
23+
*/
24+
protected $save = "[ng-click*='saveAuthJson']";
25+
26+
/**
27+
* First field selector
28+
*
29+
* @var string
30+
*/
31+
protected $firstField = '[name="username"]';
32+
33+
/**
34+
* Click on 'Save Config' button.
35+
*
36+
* @return void
37+
*/
38+
public function clickSaveConfig()
39+
{
40+
$this->_rootElement->find($this->save, Locator::SELECTOR_CSS)->click();
41+
}
42+
43+
/**
44+
* Ensure the form is loaded and fill the root form
45+
*
46+
* @param FixtureInterface $fixture
47+
* @param SimpleElement|null $element
48+
* @return $this
49+
*/
50+
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
51+
{
52+
$this->waitForElementVisible($this->firstField);
53+
return parent::fill($fixture, $element);
54+
}
55+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="1">
9+
<fields>
10+
<publicKey>
11+
<selector>[name='username']</selector>
12+
</publicKey>
13+
<privateKey>
14+
<selector>[name='password']</selector>
15+
</privateKey>
16+
</fields>
17+
</mapping>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Upgrade\Test\Block;
8+
9+
use Magento\Mtf\Block\Form;
10+
use Magento\Mtf\Client\Element\SimpleElement;
11+
use Magento\Mtf\Client\Locator;
12+
use Magento\Mtf\Fixture\FixtureInterface;
13+
14+
/**
15+
* Create Backup block.
16+
*/
17+
class CreateBackup extends Form
18+
{
19+
/**
20+
* 'Start Update' button.
21+
*
22+
* @var string
23+
*/
24+
protected $startUpdate = "[ng-click*='goToStartUpdater']";
25+
26+
/**
27+
* Click on 'Start Update/Next' button.
28+
*
29+
* @return void
30+
*/
31+
public function clickNext()
32+
{
33+
$this->_rootElement->find($this->startUpdate, Locator::SELECTOR_CSS)->click();
34+
}
35+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="0">
9+
<fields>
10+
<optionsCode>
11+
<selector>#optionsCode</selector>
12+
<input>checkboxwithlabel</input>
13+
</optionsCode>
14+
<optionsMedia>
15+
<selector>#optionsMedia</selector>
16+
<input>checkboxwithlabel</input>
17+
</optionsMedia>
18+
<optionsDb>
19+
<selector>#optionsDb</selector>
20+
<input>checkboxwithlabel</input>
21+
</optionsDb>
22+
</fields>
23+
</mapping>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Upgrade\Test\Block;
8+
9+
use Magento\Mtf\Block\Block;
10+
use Magento\Mtf\Client\Locator;
11+
12+
/**
13+
* Home block.
14+
*/
15+
class Home extends Block
16+
{
17+
/**
18+
* @var string
19+
*/
20+
protected $systemUpgrade = '.setup-home-item-upgrade';
21+
22+
/**
23+
* Click on 'System Upgrade' button.
24+
*
25+
* @return void
26+
*/
27+
public function clickSystemUpgrade()
28+
{
29+
$this->_rootElement->find($this->systemUpgrade, Locator::SELECTOR_CSS)->click();
30+
}
31+
}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Upgrade\Test\Block;
8+
9+
use Magento\Mtf\Block\Block;
10+
use Magento\Mtf\Client\Locator;
11+
12+
/**
13+
* Readiness block.
14+
*/
15+
class Readiness extends Block
16+
{
17+
/**
18+
* 'Start Readiness Check' button.
19+
*
20+
* @var string
21+
*/
22+
protected $readinessCheck = "[ng-click*='state.go']";
23+
24+
/**
25+
* 'Next' button.
26+
*
27+
* @var string
28+
*/
29+
protected $next = "[ng-click*='next']";
30+
31+
/**
32+
* 'Completed!' message.
33+
* [ng-switch-when="true"]
34+
* @var string
35+
*/
36+
protected $completedMessage = '[ng-switch-when="true"]';
37+
38+
/**
39+
* Updater application successful check.
40+
*
41+
* @var string
42+
*/
43+
protected $updaterApplicationCheck = '#updater-application';
44+
45+
/**
46+
* Cron script successful check.
47+
*
48+
* @var string
49+
*/
50+
protected $cronScriptCheck = '#cron-script';
51+
52+
/**
53+
* Dependency successful check.
54+
*
55+
* @var string
56+
*/
57+
protected $dependencyCheck = '#component-dependency';
58+
59+
/**
60+
* PHP Version successful check.
61+
*
62+
* @var string
63+
*/
64+
protected $phpVersionCheck = '#php-version';
65+
66+
/**
67+
* PHP Settings successful check.
68+
*
69+
* @var string
70+
*/
71+
protected $phpSettingsCheck = '#php-settings';
72+
73+
/**
74+
* PHP Extensions successful check.
75+
*
76+
* @var string
77+
*/
78+
protected $phpExtensionCheck = '#php-extensions';
79+
80+
/**
81+
* Click on 'Start Readiness Check' button.
82+
*
83+
* @return void
84+
*/
85+
public function clickReadinessCheck()
86+
{
87+
$this->_rootElement->find($this->readinessCheck, Locator::SELECTOR_CSS)->click();
88+
$this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS);
89+
}
90+
91+
/**
92+
* Click on 'Next' button.
93+
*
94+
* @return void
95+
*/
96+
public function clickNext()
97+
{
98+
$this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click();
99+
}
100+
101+
/**
102+
* Get Updater application check result.
103+
*
104+
* @return string
105+
*/
106+
public function getUpdaterApplicationCheck()
107+
{
108+
return $this->_rootElement->find($this->updaterApplicationCheck, Locator::SELECTOR_CSS)->getText();
109+
}
110+
111+
/**
112+
* Get cron script check result.
113+
*
114+
* @return string
115+
*/
116+
public function getCronScriptCheck()
117+
{
118+
return $this->_rootElement->find($this->cronScriptCheck, Locator::SELECTOR_CSS)->getText();
119+
}
120+
121+
/**
122+
* Get dependency check result.
123+
*
124+
* @return string
125+
*/
126+
public function getDependencyCheck()
127+
{
128+
return $this->_rootElement->find($this->dependencyCheck, Locator::SELECTOR_CSS)->getText();
129+
}
130+
131+
/**
132+
* Get PHP Version check result.
133+
*
134+
* @return string
135+
*/
136+
public function getPhpVersionCheck()
137+
{
138+
return $this->_rootElement->find($this->phpVersionCheck, Locator::SELECTOR_CSS)->getText();
139+
}
140+
141+
/**
142+
* Get setting check result.
143+
*
144+
* @return string
145+
*/
146+
public function getSettingsCheck()
147+
{
148+
return $this->_rootElement->find($this->phpSettingsCheck, Locator::SELECTOR_CSS)->getText();
149+
}
150+
151+
/**
152+
* Get PHP Extensions check result.
153+
*
154+
* @return string
155+
*/
156+
public function getPhpExtensionsCheck()
157+
{
158+
return $this->_rootElement->find($this->phpExtensionCheck, Locator::SELECTOR_CSS)->getText();
159+
}
160+
}

0 commit comments

Comments
 (0)