Skip to content

Commit 689f28a

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-62623' into 2.1.8-develop-pr7
2 parents 479fbbf + ebb22f8 commit 689f28a

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function getShippingMethodBlock()
191191
*
192192
* @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Totals
193193
*/
194-
protected function getTotalsBlock()
194+
public function getTotalsBlock()
195195
{
196196
return $this->blockFactory->create(
197197
\Magento\Sales\Test\Block\Adminhtml\Order\Create\Totals::class,

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Totals.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Sales\Test\Block\Adminhtml\Order\Create;
88

99
use Magento\Mtf\Block\Block;
10+
use Magento\Mtf\Client\Locator;
1011

1112
/**
1213
* Class Totals
@@ -22,11 +23,39 @@ class Totals extends Block
2223
*/
2324
protected $submitOrder = '.order-totals-actions button';
2425

26+
/**
27+
* Order totals table.
28+
*
29+
* @var string
30+
*/
31+
protected $totalsTable = '.data-table';
32+
33+
/**
34+
* Total row label selector.
35+
*
36+
* @var string
37+
*/
38+
protected $totalLabelLocator = './/tr[normalize-space(td)="%s"]';
39+
2540
/**
2641
* Click 'Submit Order' button
2742
*/
2843
public function submitOrder()
2944
{
3045
$this->_rootElement->find($this->submitOrder)->click();
3146
}
47+
48+
/**
49+
* Return total presence by label.
50+
*
51+
* @param string $total
52+
* @return bool
53+
*/
54+
public function isTotalPresent($total)
55+
{
56+
$totalsTable = $this->_rootElement->find($this->totalsTable);
57+
$totalRow = $totalsTable->find(sprintf($this->totalLabelLocator, $total), Locator::SELECTOR_XPATH);
58+
59+
return $totalRow->isVisible();
60+
}
3261
}

0 commit comments

Comments
 (0)