Skip to content

Commit c79d722

Browse files
committed
Refactoring. Use action groups instead of direct actions in the test
1 parent 8af620a commit c79d722

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup">
12+
<dontSeeElement selector="{{CheckoutShippingSection.addressFieldValidationError}}" stepKey="checkFieldsValidationIsPassed"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
<element name="editActiveAddress" type="button" selector="//div[@class='shipping-address-item selected-item']//span[text()='Edit']" timeout="30"/>
4040
<element name="loginButton" type="button" selector=".action.login" timeout="30"/>
4141
<element name="shipHereButton" type="button" selector="//div[text()='{{street}}']/button[@class='action action-select-shipping-item']" parameterized="true" timeout="30"/>
42+
<element name="addressFieldValidationError" type="text" selector="div.address div.field .field-error"/>
4243
</section>
4344
</sections>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121
<createData entity="ApiSimpleProduct" stepKey="createProduct">
2222
<requiredEntity createDataKey="createCategory"/>
2323
</createData>
24-
<actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage">
25-
<argument name="product" value="$$createProduct$$"/>
26-
</actionGroup>
27-
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart"/>
28-
<waitForPageLoad stepKey="waitForCheckoutPage"/>
2924
</before>
3025
<after>
3126
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3227
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
3328
</after>
3429

35-
<dontSeeElement selector="div .field-error" stepKey="dontSeeValidationErrors"/>
30+
<actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage">
31+
<argument name="product" value="$$createProduct$$"/>
32+
</actionGroup>
33+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestGoToCheckout"/>
34+
<actionGroup ref="StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup" stepKey="seeNoValidationErrors"/>
3635
</test>
3736
</tests>

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
<testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutJsValidationTest" summary="JS validation verification for Checkout flow" ticketId="MAGETWO-59697">
1010
<variation name="OnePageCheckoutJsValidationTestVariation1" summary="JS validation is not applied for empty required checkout fields if customer did not fill them">
1111
<data name="issue" xsi:type="string">MAGETWO-97990: [MTF] OnePageCheckoutJsValidationTestVariation1_0 randomly fails on jenkins</data>
12-
<data name="tag" xsi:type="string">severity:S2</data>
12+
<data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data>
1313
<data name="products/0" xsi:type="string">catalogProductSimple::default</data>
1414
<data name="checkoutMethod" xsi:type="string">guest</data>
15-
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1615
<constraint name="Magento\Checkout\Test\Constraint\AssertShippingAddressJsValidationMessagesIsAbsent" />
1716
</variation>
1817
</testCase>

0 commit comments

Comments
 (0)