Skip to content

Commit c1390c8

Browse files
author
Joan He
authored
Merge pull request #787 from magento-fearless-kiwis/FearlessKiwi-MAGETWO-59948
Fearless kiwi magetwo 59948
2 parents 5bf5e5f + 624ddee commit c1390c8

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,51 @@ class Totals extends Block
2222
*/
2323
protected $submitOrder = '.order-totals-actions button';
2424

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+
2546
/**
2647
* Click 'Submit Order' button
2748
*/
2849
public function submitOrder()
2950
{
3051
$this->_rootElement->find($this->submitOrder)->click();
3152
}
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+
}
3272
}

dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderCreateIndex.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<block name="customerActivitiesBlock" class="Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities" locator=".customer-current-activity" strategy="css selector"/>
1616
<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"/>
1717
<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"/>
1819
</page>
1920
</config>

dev/tests/functional/tests/app/Magento/Tax/Test/Repository/ConfigData.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,5 +888,23 @@
888888
<item name="value" xsi:type="number">1</item>
889889
</field>
890890
</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>
891909
</repository>
892910
</config>

0 commit comments

Comments
 (0)