File tree 3 files changed +59
-0
lines changed
dev/tests/functional/tests/app/Magento
Block/Adminhtml/Order/Create
3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,51 @@ class Totals extends Block
22
22
*/
23
23
protected $ submitOrder = '.order-totals-actions button ' ;
24
24
25
+ /**
26
+ * Order Totals rows locator.
27
+ *
28
+ * @var string
29
+ */
30
+ private $ totalsRowsLocator = '.data-table tr ' ;
31
+
32
+ /**
33
+ * Order Totals Item label locator.
34
+ *
35
+ * @var string
36
+ */
37
+ private $ totalsRowKeyLocator = '.admin__total-mark ' ;
38
+
39
+ /**
40
+ * Order Totals Item amount locator.
41
+ *
42
+ * @var string
43
+ */
44
+ private $ totalsRowValueLocator = '.price ' ;
45
+
25
46
/**
26
47
* Click 'Submit Order' button
27
48
*/
28
49
public function submitOrder ()
29
50
{
30
51
$ this ->_rootElement ->find ($ this ->submitOrder )->click ();
31
52
}
53
+
54
+ /**
55
+ * Get Order totals.
56
+ *
57
+ * @return array
58
+ */
59
+ public function getOrderTotals ()
60
+ {
61
+ $ totals = [];
62
+ $ elements = $ this ->_rootElement ->getElements ($ this ->totalsRowsLocator );
63
+ foreach ($ elements as $ row ) {
64
+ if ($ row ->isVisible ()) {
65
+ $ key = trim ($ row ->find ($ this ->totalsRowKeyLocator )->getText ());
66
+ $ value = $ row ->find ($ this ->totalsRowValueLocator )->getText ();
67
+ $ totals [$ key ] = $ value ;
68
+ }
69
+ }
70
+ return $ totals ;
71
+ }
32
72
}
Original file line number Diff line number Diff line change 15
15
<block name =" customerActivitiesBlock" class =" Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities" locator =" .customer-current-activity" strategy =" css selector" />
16
16
<block name =" configureProductBlock" class =" Magento\Catalog\Test\Block\Adminhtml\Product\Composite\Configure" locator =" //*[@data-role='modal' and .//*[@id='product_composite_configure'] and contains(@class,'_show')]" strategy =" xpath" />
17
17
<block name =" messagesBlock" class =" Magento\Backend\Test\Block\Messages" locator =" #messages .messages" strategy =" css selector" />
18
+ <block name =" totalsBlock" class =" Magento\Sales\Test\Block\Adminhtml\Order\Create\Totals" locator =" #order-totals" strategy =" css selector" />
18
19
</page >
19
20
</config >
Original file line number Diff line number Diff line change 888
888
<item name =" value" xsi : type =" number" >1</item >
889
889
</field >
890
890
</dataset >
891
+
892
+ <dataset name =" tax_cart_display_full_summary" >
893
+ <field name =" tax/cart_display/full_summary" xsi : type =" array" >
894
+ <item name =" scope" xsi : type =" string" >tax</item >
895
+ <item name =" scope_id" xsi : type =" number" >1</item >
896
+ <item name =" label" xsi : type =" string" >Yes</item >
897
+ <item name =" value" xsi : type =" number" >1</item >
898
+ </field >
899
+ </dataset >
900
+
901
+ <dataset name =" tax_cart_display_full_summary_rollback" >
902
+ <field name =" tax/cart_display/full_summary" xsi : type =" array" >
903
+ <item name =" scope" xsi : type =" string" >tax</item >
904
+ <item name =" scope_id" xsi : type =" number" >1</item >
905
+ <item name =" label" xsi : type =" string" >No</item >
906
+ <item name =" value" xsi : type =" number" >0</item >
907
+ </field >
908
+ </dataset >
891
909
</repository >
892
910
</config >
You can’t perform that action at this time.
0 commit comments