Skip to content

Commit cde4f67

Browse files
authored
Merge pull request #5340 from magento-tsg/2.4-develop-pr15
[TSG] TESTs Fixes for 2.4 (pr15) (2.4-develop)
2 parents edc5c90 + 6b06577 commit cde4f67

File tree

30 files changed

+746
-320
lines changed

30 files changed

+746
-320
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminSetStoreInformationConfigurationActionGroup">
12+
<annotations>
13+
<description>Set Store Information configurations</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeName" type="string" defaultValue="{{AdminGeneralSetStoreNameConfigData.value}}"/>
17+
<argument name="storeHoursOfOperation" type="string" defaultValue="{{AdminGeneralSetStoreHoursConfigData.value}}"/>
18+
<argument name="vatNumber" type="string" defaultValue="{{AdminGeneralSetVatNumberConfigData.value}}"/>
19+
<argument name="telephone" type="string" defaultValue="{{US_Address_TX.telephone}}"/>
20+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country_id}}"/>
21+
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
22+
<argument name="city" type="string" defaultValue="{{US_Address_TX.city}}"/>
23+
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
24+
<argument name="street" type="string" defaultValue="{{US_Address_TX.street[0]}}"/>
25+
</arguments>
26+
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{storeName}}'" stepKey="setStoreInformationName"/>
27+
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} '{{telephone}}'" stepKey="setStoreInformationPhone"/>
28+
<magentoCLI command="config:set {{AdminGeneralSetStoreHoursConfigData.path}} '{{storeHoursOfOperation}}'" stepKey="setStoreHoursInformation"/>
29+
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} '{{country}}'" stepKey="setStoreInformationCountry"/>
30+
<magentoCLI command="config:set {{AdminGeneralSetStateConfigData.path}} '{{state}}'" stepKey="setStoreInformationState"/>
31+
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} '{{city}}'" stepKey="setStoreInformationCity"/>
32+
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} '{{postcode}}'" stepKey="setStoreInformationPostcode"/>
33+
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{street}}'" stepKey="setStoreInformationStreetAddress"/>
34+
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} '{{vatNumber}}'" stepKey="setStoreInformationVatNumber"/>
35+
</actionGroup>
36+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/AdminGeneralStoreInfomationConfigData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@
3030
<entity name="AdminGeneralSetStreetAddress2ConfigData">
3131
<data key="path">general/store_information/street_line2</data>
3232
</entity>
33+
<entity name="AdminGeneralSetStateConfigData">
34+
<data key="path">general/store_information/region_id</data>
35+
</entity>
36+
<entity name="AdminGeneralSetStoreHoursConfigData">
37+
<data key="path">general/store_information/hours</data>
38+
<data key="value">8AM-8PM</data>
39+
</entity>
3340
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="AssertStorefrontCheckoutCartEstimateShippingAndTaxAddressActionGroup">
12+
<annotations>
13+
<description>Check address data in Estimate Shipping And Tax section of shopping cart on storefront</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country}}"/>
17+
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
18+
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
19+
</arguments>
20+
21+
<waitForElementVisible selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="waitForSubtotalVisible"/>
22+
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTaxIfNeeded" />
23+
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{country}}" stepKey="checkCountry"/>
24+
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{state}}" stepKey="checkState" />
25+
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabPostCodeText"/>
26+
<assertEquals message="Address postcode is invalid" stepKey="checkPostcode">
27+
<expectedResult type="string">{{postcode}}</expectedResult>
28+
<actualResult type="variable">grabPostCodeText</actualResult>
29+
</assertEquals>
30+
</actionGroup>
31+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontOrderIsNotPlacedActionGroup" extends="AssertStorefrontOrderCannotBePlacedActionGroup">
11+
<annotations>
12+
<description>Validates order cannot be placed and checks error message.</description>
13+
</annotations>
14+
<remove keyForRemoval="assertErrorMessage"/>
15+
<seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText(error)}}" stepKey="assertErrorMessageInDOM"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="StorefrontCheckoutCartFillEstimateShippingAndTaxActionGroup">
12+
<annotations>
13+
<description>Fill address data in Estimate Shipping And Tax section of shopping cart on storefront</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country}}"/>
17+
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
18+
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
19+
</arguments>
20+
21+
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openEestimateShippingAndTaxSection"/>
22+
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{country}}" stepKey="selectCountry"/>
23+
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{state}}" stepKey="selectState"/>
24+
<waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPostCodeVisible"/>
25+
<fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{postcode}}" stepKey="selectPostCode"/>
26+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/>
27+
</actionGroup>
28+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontCheckoutClickNextOnShippingStepActionGroup" extends="StorefrontCheckoutForwardFromShippingStepActionGroup">
12+
<annotations>
13+
<description>Scrolls and clicks next on Checkout Shipping step</description>
14+
</annotations>
15+
<scrollTo selector="{{CheckoutShippingSection.next}}" before="clickNext" stepKey="scrollToNextButton"/>
16+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
17+
</actionGroup>
18+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<section name="CheckoutHeaderSection">
1010
<element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)"/>
1111
<element name="reviewAndPaymentsStep" type="text" selector=".opc-progress-bar-item:nth-of-type(2)"/>
12+
<element name="errorMessageContainsText" type="text" selector="//div[contains(@class, 'message message-error error')]//div[contains(text(), '{{text}}')]" parameterized="true"/>
1213
</section>
1314
</sections>

0 commit comments

Comments
 (0)