Skip to content

Commit 9d2d2a1

Browse files
author
Dmytro Vilchynskyi
committed
MAGETWO-31515: [UI] CSS styling for Installation Form
- fixed functional tests
1 parent ffc5407 commit 9d2d2a1

File tree

1 file changed

+19
-16
lines changed
  • dev/tests/functional/tests/app/Magento/Install/Test/Block

1 file changed

+19
-16
lines changed

dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,7 @@ public function clickInstallNow()
6060
*/
6161
public function getAdminInfo()
6262
{
63-
$adminData = [];
64-
$rows = $this->_rootElement->getElements('#admin-info .row');
65-
foreach ($rows as $row) {
66-
$dataRow = $row->getElements('div');
67-
$key = strtolower(str_replace(' ', '_', str_replace(':', '', $dataRow[0]->getText())));
68-
$adminData[$key] = $dataRow[1]->getText();
69-
}
70-
71-
return $adminData;
63+
return $this->getTableDataByCssLocator('#admin-info');
7264
}
7365

7466
/**
@@ -78,15 +70,26 @@ public function getAdminInfo()
7870
*/
7971
public function getDbInfo()
8072
{
81-
$dbData = [];
82-
$rows = $this->_rootElement->getElements('#db-info .row');
83-
foreach ($rows as $row) {
84-
$dataRow = $row->getElements('div');
85-
$key = strtolower(str_replace(' ', '_', str_replace(':', '', $dataRow[0]->getText())));
86-
$dbData[$key] = $dataRow[1]->getText();
73+
return $this->getTableDataByCssLocator('#db-info');
74+
}
75+
76+
private function getTableDataByCssLocator($locator)
77+
{
78+
$data = [];
79+
$keys = [];
80+
$definitionTitles = $this->_rootElement->getElements($locator . ' dt');
81+
foreach ($definitionTitles as $dt) {
82+
$keys[] = strtolower(str_replace(' ', '_', str_replace(':', '', $dt->getText())));
83+
}
84+
reset($keys);
85+
86+
$definitionDescriptions = $this->_rootElement->getElements($locator . ' dd');
87+
foreach ($definitionDescriptions as $dd) {
88+
$data[current($keys)] = $dd->getText();
89+
next($keys);
8790
}
8891

89-
return $dbData;
92+
return $data;
9093
}
9194

9295
/**

0 commit comments

Comments
 (0)