Skip to content

Commit 9872afd

Browse files
ENGCOM-5952: Add 'reorder from customer dashboard' action and 'assert product is absent on category page' groups. #24655
- Merge Pull Request #24655 from nmalevanec/magento2:ReorderActionGroup - Merged commits: 1. 2fe00c3 2. 35306c2 3. 3ffdd5f
2 parents 502abab + 3ffdd5f commit 9872afd

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertProductAbsentOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Navigate to category page and verify product is absent.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="category" defaultValue="_defaultCategory"/>
17+
<argument name="product" defaultValue="SimpleProduct"/>
18+
</arguments>
19+
<amOnPage url="{{StorefrontCategoryPage.url(category.name)}}" stepKey="navigateToCategoryPage"/>
20+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
21+
<dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{product.name}}" stepKey="assertProductIsNotPresent"/>
22+
<dontSee selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="{{product.price}}" stepKey="assertProductIsNotPricePresent"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontCustomerReorderActionGroup">
12+
<annotations>
13+
<description>Navigate to customer dashboard -> orders. Press 'reorder' button for specified order id. Notice: customer should be logged in.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="orderNumber" type="string"/>
17+
</arguments>
18+
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToCustomerDashboardPage"/>
19+
<waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/>
20+
<click selector="{{StorefrontCustomerSidebarSection.sidebarTab('My Orders')}}" stepKey="navigateToOrders"/>
21+
<waitForPageLoad stepKey="waitForOrdersPageLoad"/>
22+
<click selector="{{StorefrontCustomerOrdersGridSection.reorderBtn(orderNumber)}}" stepKey="clickReorderBtn"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormTotalSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<section name="AdminOrderFormTotalSection">
1212
<element name="subtotalRow" type="text" selector="#order-totals>table tr.row-totals:nth-of-type({{row}}) span.price" parameterized="true"/>
1313
<element name="total" type="text" selector="//tr[contains(@class,'row-totals')]/td[contains(text(), '{{total}}')]/following-sibling::td/span[contains(@class, 'price')]" parameterized="true"/>
14-
<element name="grandTotal" type="text" selector="#order-totals>table tr.row-totals:nth-of-type(3) span.price"/>
14+
<element name="grandTotal" type="text" selector="//tr[contains(@class,'row-totals')]/td/strong[contains(text(), 'Grand Total')]/parent::td/following-sibling::td//span[contains(@class, 'price')]"/>
1515
</section>
16-
</sections>
16+
</sections>

app/code/Magento/Sales/Test/Mftf/Section/StorefrontCustomerOrdersGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerOrdersGridSection">
1212
<element name="orderView" type="button" selector="//td[text()='{{orderNumber}}']/following-sibling::td[@class='col actions']/a[contains(@class, 'view')]" parameterized="true" />
13+
<element name="reorderBtn" type="button" selector="//td[text()='{{orderNumber}}']/following-sibling::td[@class='col actions']/a[contains(@class, 'order')]" parameterized="true" />
1314
</section>
1415
</sections>

0 commit comments

Comments
 (0)