Skip to content

Commit 0fe7f85

Browse files
committed
MAGETWO-90388: [FAT] Fix UpgradeSystemTest to correctly work with other components list
1 parent 8a038ca commit 0fe7f85

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

dev/tests/functional/tests/app/Magento/Setup/Test/Block/Readiness.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function getDependencyCheck()
195195
/**
196196
* @return bool
197197
*/
198-
public function isPhpVersionCheckVisible()
198+
public function isPhpVersionCheckVisible() : bool
199199
{
200200
return $this->_rootElement->find($this->phpVersionCheck)->isVisible();
201201
}

dev/tests/functional/tests/app/Magento/Setup/Test/Block/SelectVersion.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function chooseShowAllVersions()
105105
* @param array $packages
106106
* @return void
107107
*/
108-
public function chooseUpgradeOtherComponents(array $packages)
108+
public function chooseUpgradeOtherComponents(array $packages) :void
109109
{
110110
$this->_rootElement->find("[for=yesUpdateComponents]")->click();
111111
$this->waitForElementNotVisible("[ng-show=\"!componentsProcessed\"");
@@ -125,6 +125,7 @@ public function chooseUpgradeOtherComponents(array $packages)
125125
public function isComponentsEmpty()
126126
{
127127
$this->waitForElementVisible($this->waitEmpty, Locator::SELECTOR_XPATH);
128+
128129
return $this->_rootElement->find($this->empty)->isVisible();
129130
}
130131

@@ -143,14 +144,15 @@ public function getSelectedPackages()
143144
*
144145
* @return OtherComponentsGrid
145146
*/
146-
private function getOtherComponentsGrid()
147+
private function getOtherComponentsGrid() : OtherComponentsGrid
147148
{
148149
if (!isset($this->otherComponentGrid)) {
149150
$this->otherComponentGrid = $this->blockFactory->create(
150151
OtherComponentsGrid::class,
151152
['element' => $this->_rootElement->find($this->otherComponentsGrid)]
152153
);
153154
}
155+
154156
return $this->otherComponentGrid;
155157
}
156158
}

dev/tests/functional/tests/app/Magento/Setup/Test/Block/SelectVersion/OtherComponentsGrid.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Magento\Mtf\Client\Locator;
1313
use Magento\Setup\Test\Block\SelectVersion\OtherComponentsGrid\Item;
1414

15+
/**
16+
* Perform OtherComponentsGrid block.
17+
*/
1518
class OtherComponentsGrid extends Block
1619
{
1720
/**
@@ -30,9 +33,12 @@ class OtherComponentsGrid extends Block
3033
private $selectedPackages = [];
3134

3235
/**
33-
* @param $packages
36+
* Set version of the packages.
37+
*
38+
* @param array $packages
39+
* @return void
3440
*/
35-
public function setVersions(array $packages)
41+
public function setVersions(array $packages) : void
3642
{
3743
foreach ($packages as $package) {
3844
$selector = sprintf($this->itemComponent, $package['name']);
@@ -50,24 +56,29 @@ public function setVersions(array $packages)
5056
*
5157
* @return array
5258
*/
53-
public function getSelectedPackages()
59+
public function getSelectedPackages() : array
5460
{
5561
return $this->selectedPackages;
5662
}
5763

5864
/**
65+
* Set pager size.
66+
*
5967
* @param int $count
68+
* @return void
6069
*/
61-
public function setItemsPerPage($count)
70+
public function setItemsPerPage(int $count) : void
6271
{
6372
$this->_rootElement->find($this->perPage, Locator::SELECTOR_CSS, 'select')->setValue($count);
6473
}
6574

6675
/**
76+
* Get component block.
77+
*
6778
* @param ElementInterface $element
6879
* @return Item
6980
*/
70-
private function getComponentRow($element)
81+
private function getComponentRow(ElementInterface $element) : Item
7182
{
7283
return $this->blockFactory->create(
7384
Item::class,

dev/tests/functional/tests/app/Magento/Setup/Test/Block/SelectVersion/OtherComponentsGrid/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Item extends Block
3434
*
3535
* @param string $version
3636
*/
37-
public function setVersion($version)
37+
public function setVersion(string $version)
3838
{
3939
$this->_rootElement->find($this->version, Locator::SELECTOR_CSS, 'select')->setValue($version);
4040
}

dev/tests/functional/tests/app/Magento/Setup/Test/Constraint/AssertVersionAndEditionCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AssertVersionAndEditionCheck extends AbstractConstraint
2121
* @param array $upgrade
2222
* @return void
2323
*/
24-
public function processAssert(SetupWizard $setupWizard, array $upgrade)
24+
public function processAssert(SetupWizard $setupWizard, array $upgrade) :void
2525
{
2626
$message = "We're ready to upgrade {$upgrade['package']} to {$upgrade['version']}.";
2727
if ($upgrade['otherComponents'] === 'Yes' && isset($upgrade['selectedPackages'])) {

0 commit comments

Comments
 (0)