Skip to content

Commit e7b4f05

Browse files
author
Dmytro Bursak
committed
MTA-2316: [MX] Reports module functional tests maintenance
1 parent 1bf7800 commit e7b4f05

File tree

6 files changed

+30
-5
lines changed

6 files changed

+30
-5
lines changed

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ abstract class Grid extends Block
179179
*
180180
* @var string
181181
*/
182-
protected $noRecords = '[data-role="row"] .empty-text';
182+
protected $noRecords = '.empty-text';
183183

184184
/**
185185
* Get backend abstract block

dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Customer/Products/ListProducts.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,15 @@ public function openLink($linkTitle)
3232
{
3333
$this->_rootElement->find(sprintf($this->link, $linkTitle), Locator::SELECTOR_XPATH)->click();
3434
}
35+
36+
/**
37+
* Get link url by title.
38+
*
39+
* @param string $title
40+
* @return string
41+
*/
42+
public function getLinkUrl($title)
43+
{
44+
return $this->_rootElement->find(sprintf($this->link, $title), Locator::SELECTOR_XPATH)->getAttribute('href');
45+
}
3546
}

dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function processAssert(
3333
$this->salesReportPage = $salesReportPage;
3434
$this->order = $order;
3535
$this->searchInSalesReportGrid($salesReport);
36-
$salesResult = $salesReportPage->getGridBlock()->getLastResult();
36+
$salesResult = $this->prepareSalesResult($salesReportPage->getGridBlock()->getLastResult());
3737
$prepareInitialResult = $this->prepareExpectedResult($initialSalesResult);
3838
\PHPUnit_Framework_Assert::assertEquals(
3939
$prepareInitialResult,
@@ -42,6 +42,22 @@ public function processAssert(
4242
);
4343
}
4444

45+
/**
46+
* Prepare sales result.
47+
*
48+
* @param array $salesResult
49+
* @return array
50+
*/
51+
protected function prepareSalesResult($salesResult)
52+
{
53+
$data = [];
54+
foreach ($salesResult as $key => $result) {
55+
$data[$key] = str_replace('.00', '', $result);
56+
}
57+
58+
return $data;
59+
}
60+
4561
/**
4662
* Returns a string representation of the object
4763
*

dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SalesCouponReportView.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<page name="SalesCouponReportView" area="Adminhtml" mca="reports/report_sales/coupons" module="Magento_Reports">
1010
<block name="filterBlock" class="Magento\Reports\Test\Block\Adminhtml\Sales\Coupons\Filter" locator="#filter_form" strategy="css selector"/>
1111
<block name="actionBlock" class="Magento\Reports\Test\Block\Adminhtml\Sales\Coupons\Action" locator=".page-main-actions" strategy="css selector"/>
12-
<block name="gridBlock" class="Magento\Reports\Test\Block\Adminhtml\Sales\Coupons\Grid" locator="//*[@class='grid']/.." strategy="xpath"/>
12+
<block name="gridBlock" class="Magento\Reports\Test\Block\Adminhtml\Sales\Coupons\Grid" locator="//*[@class='data-grid']" strategy="xpath"/>
1313
</page>
1414
</config>

dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class AbandonedCartsReportEntityTest extends Injectable
3636
/* tags */
3737
const MVP = 'no';
3838
const DOMAIN = 'MX';
39-
const STABLE = 'no';
4039
/* end tags */
4140

4241
/**

dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class ViewedProductsReportEntityTest extends Injectable
3434
/* tags */
3535
const MVP = 'no';
3636
const DOMAIN = 'MX';
37-
const STABLE = 'no';
3837
/* end tags */
3938

4039
/**

0 commit comments

Comments
 (0)