File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ protected function getShippingMethodBlock()
191
191
*
192
192
* @return \Magento\Sales\Test\Block\Adminhtml\Order\Create\Totals
193
193
*/
194
- protected function getTotalsBlock ()
194
+ public function getTotalsBlock ()
195
195
{
196
196
return $ this ->blockFactory ->create (
197
197
\Magento \Sales \Test \Block \Adminhtml \Order \Create \Totals::class,
Original file line number Diff line number Diff line change 7
7
namespace Magento \Sales \Test \Block \Adminhtml \Order \Create ;
8
8
9
9
use Magento \Mtf \Block \Block ;
10
+ use Magento \Mtf \Client \Locator ;
10
11
11
12
/**
12
13
* Class Totals
@@ -22,11 +23,39 @@ class Totals extends Block
22
23
*/
23
24
protected $ submitOrder = '.order-totals-actions button ' ;
24
25
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
+
25
40
/**
26
41
* Click 'Submit Order' button
27
42
*/
28
43
public function submitOrder ()
29
44
{
30
45
$ this ->_rootElement ->find ($ this ->submitOrder )->click ();
31
46
}
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
+ }
32
61
}
You can’t perform that action at this time.
0 commit comments