Skip to content

Commit 9c3a50c

Browse files
Merge pull request #7753 from magento-gl/functional--test--automation
[Bengals] MFTF Automation Phase 1
2 parents bd97c6f + 0b9bc76 commit 9c3a50c

File tree

12 files changed

+141
-4
lines changed

12 files changed

+141
-4
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</actionGroup>
3333
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/>
3434
<actionGroup ref="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup" stepKey="seePriceValidationError">
35-
<argument name="errorMessage" value="Please enter a number 0 or greater in this field."/>
35+
<argument name="errorMessage" value="Please enter a number 0 or greater, without comma in this field."/>
3636
</actionGroup>
3737
</test>
3838
</tests>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@
4646
<element name="textFieldAttrRequireMessage" type="text" selector="//input[@name='custom_attributes[{{attribute}}]']/ancestor::div[contains(@class, 'control')]/div/span" parameterized="true" timeout="30"/>
4747
<element name="textFieldAttribute" type="input" selector="[name*='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/>
4848
<element name="shippingAddressRequiredField" type="text" selector="//div[@id='shipping-new-address-form']//div[contains(@class, 'field _required') and contains(@name, 'shippingAddress.{{fieldName}}')]" parameterized="true" timeout="30"/>
49+
<element name="stateProvince" type="text" selector="//div[@name='shippingAddress.region_id']//span[contains(text(),'State/Province')]" timeout="30"/>
50+
<element name="stateProvinceWithoutAsterisk" type="text" selector="//div[@class='field' and @name='shippingAddress.region_id']" timeout="30"/>
51+
<element name="stateProvinceWithAsterisk" type="text" selector="//div[@class='field _required' and @name='shippingAddress.region_id']" timeout="30"/>
4952
</section>
5053
</sections>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="VerifyStateOptionApplicableForCheckoutFlowTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Option State_is_Required_for is applicable for checkout flow"/>
15+
<title value="Verify that option State_is_Required_for is applicable for checkout flow"/>
16+
<description value="Verify that option State_is_Required_for is applicable for checkout flow"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-27422"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
22+
<!-- Create category and product -->
23+
<before>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/>
25+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
26+
<createData entity="SimpleProduct" stepKey="createProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<!--Unselect France from State is Required for listing & allow to choose State if it is optional for Country-->
31+
<actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setCustomCountryWithRequiredRegion">
32+
<argument name="countries" value="CustomCountryWithRequiredRegion"/>
33+
</actionGroup>
34+
</before>
35+
36+
<!--Goto storefront add the product into cart -->
37+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/>
38+
<waitForPageLoad stepKey="waitForOpenStorefront"/>
39+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
40+
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/>
41+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
42+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
43+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
44+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" />
45+
46+
<!--Fill shipping details of France-->
47+
<selectOption stepKey="selectCounty" selector="{{CheckoutShippingSection.country}}" userInput="{{France_Address.country_id}}"/>
48+
<waitForPageLoad stepKey="waitFormToReload"/>
49+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
50+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
51+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
52+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{France_Address.street[0]}}" stepKey="enterStreet"/>
53+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{France_Address.city}}" stepKey="enterCity"/>
54+
<seeElement selector="{{CheckoutShippingSection.stateProvince}}" stepKey="validateStateProvince"/>
55+
<seeElement selector="{{CheckoutShippingSection.stateProvinceWithoutAsterisk}}" stepKey="validateStateProvinceWithoutAsteriskIsDisplayed"/>
56+
<dontSeeElement selector="{{CheckoutShippingSection.stateProvinceWithAsterisk}}" stepKey="validateStateProvinceWithAsteriskIsNotDisplayed"/>
57+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{France_Address.postcode}}" stepKey="enterPostcode"/>
58+
<waitForPageLoad time="30" stepKey="waitForReload"/>
59+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{France_Address.telephone}}" stepKey="enterTelephone"/>
60+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
61+
<click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
62+
63+
<!--Do the payment and place the order-->
64+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/>
65+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
66+
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
67+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
68+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
69+
<seeElement selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="seeOrderNumber"/>
70+
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="seeEmailYou"/>
71+
72+
<!-- order number is captured for future validation -->
73+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="getOrderNumber"/>
74+
75+
<!--Delete created category and product-->
76+
<after>
77+
<actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setDefaultCountriesWithRequiredRegion">
78+
<argument name="countries" value="DefaultCountriesWithRequiredRegions"/>
79+
</actionGroup>
80+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
81+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
82+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
83+
</after>
84+
</test>
85+
</tests>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminAddOptionsToAttributeWithDefaultLayeredNavigationActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<argument name="option3" defaultValue="colorProductAttribute3"/>
2020
</arguments>
2121

22+
<scrollTo selector="//div/strong[@class='admin__collapsible-title']/span[contains(text(),'Configurations')]" stepKey="scrollToConfigurableProductButton"/>
23+
<waitForElementVisible selector="button[data-index='create_configurable_products_button']" time="30" stepKey="waitForELementVisible"/>
2224
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
2325
<click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/>
2426
<waitForPageLoad stepKey="waitForIFrame"/>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminGotoSelectValueAttributePageActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<argument name="defaultLabelAttribute" type="string" defaultValue="{{colorProductAttribute.default_label}}"/>
1818
</arguments>
1919

20+
<switchToIFrame stepKey="switchOutOfIFrame"/>
21+
<waitForPageLoad stepKey="waitForFilters"/>
2022
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/>
2123
<fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{defaultLabelAttribute}}" stepKey="fillFilterAttributeCodeField"/>
2224
<click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<!--Click Save Attribute button-->
5050
<click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/>
5151
<waitForPageLoad stepKey="waitForSavingSettings"/>
52+
<switchToIFrame stepKey="switchOutOfIFrame"/>
5253

5354
<!--Select created Attribute -->
5455
<click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,15 @@
435435
<data key="default_billing">true</data>
436436
<data key="region_qty">66</data>
437437
</entity>
438+
<entity name="France_Address" type="address">
439+
<array key="street">
440+
<item>1234 Some France address</item>
441+
<item>113</item>
442+
</array>
443+
<data key="city">City</data>
444+
<data key="country_id">FR</data>
445+
<data key="country">France</data>
446+
<data key="postcode">12345</data>
447+
<data key="telephone">512-345-6789</data>
448+
</entity>
438449
</entities>

app/code/Magento/MediaGalleryUi/Test/Mftf/Test/AdminMediaGallerySwitchingBetweenViewsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<severity value="CRITICAL"/>
1919
<group value="media_gallery_ui"/>
2020
<group value="pr_exclude"/>
21+
<skip>
22+
<issueId value="AC-5916">Skipped</issueId>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<createData entity="SimpleSubCategory" stepKey="category"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeFrenchCanadaInterfaceLocaleTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<group value="backend"/>
2020
<group value="ui"/>
2121
<group value="sales"/>
22+
<skip>
23+
<issueId value="AC-5916">Skipped</issueId>
24+
</skip>
2225
</annotations>
2326
<before>
2427
<!--Deploy static content with French(Canada) locale-->

app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77
-->
88

9-
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1110
<actionGroup name="AssertSwatchColorActionGroup">
1211
<annotations>
1312
<description>Validates that the provided Color Picker contains the provided Style.</description>

0 commit comments

Comments
 (0)