Skip to content

Commit

Permalink
Merge pull request magento#5340 from magento-tsg/2.4-develop-pr15
Browse files Browse the repository at this point in the history
[TSG] TESTs Fixes for 2.4 (pr15) (2.4-develop)
  • Loading branch information
zakdma committed Feb 18, 2020
2 parents edc5c90 + 6b06577 commit cde4f67
Show file tree
Hide file tree
Showing 30 changed files with 746 additions and 320 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSetStoreInformationConfigurationActionGroup">
<annotations>
<description>Set Store Information configurations</description>
</annotations>
<arguments>
<argument name="storeName" type="string" defaultValue="{{AdminGeneralSetStoreNameConfigData.value}}"/>
<argument name="storeHoursOfOperation" type="string" defaultValue="{{AdminGeneralSetStoreHoursConfigData.value}}"/>
<argument name="vatNumber" type="string" defaultValue="{{AdminGeneralSetVatNumberConfigData.value}}"/>
<argument name="telephone" type="string" defaultValue="{{US_Address_TX.telephone}}"/>
<argument name="country" type="string" defaultValue="{{US_Address_TX.country_id}}"/>
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
<argument name="city" type="string" defaultValue="{{US_Address_TX.city}}"/>
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
<argument name="street" type="string" defaultValue="{{US_Address_TX.street[0]}}"/>
</arguments>
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{storeName}}'" stepKey="setStoreInformationName"/>
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} '{{telephone}}'" stepKey="setStoreInformationPhone"/>
<magentoCLI command="config:set {{AdminGeneralSetStoreHoursConfigData.path}} '{{storeHoursOfOperation}}'" stepKey="setStoreHoursInformation"/>
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} '{{country}}'" stepKey="setStoreInformationCountry"/>
<magentoCLI command="config:set {{AdminGeneralSetStateConfigData.path}} '{{state}}'" stepKey="setStoreInformationState"/>
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} '{{city}}'" stepKey="setStoreInformationCity"/>
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} '{{postcode}}'" stepKey="setStoreInformationPostcode"/>
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{street}}'" stepKey="setStoreInformationStreetAddress"/>
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} '{{vatNumber}}'" stepKey="setStoreInformationVatNumber"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@
<entity name="AdminGeneralSetStreetAddress2ConfigData">
<data key="path">general/store_information/street_line2</data>
</entity>
<entity name="AdminGeneralSetStateConfigData">
<data key="path">general/store_information/region_id</data>
</entity>
<entity name="AdminGeneralSetStoreHoursConfigData">
<data key="path">general/store_information/hours</data>
<data key="value">8AM-8PM</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontCheckoutCartEstimateShippingAndTaxAddressActionGroup">
<annotations>
<description>Check address data in Estimate Shipping And Tax section of shopping cart on storefront</description>
</annotations>
<arguments>
<argument name="country" type="string" defaultValue="{{US_Address_TX.country}}"/>
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
</arguments>

<waitForElementVisible selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="waitForSubtotalVisible"/>
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTaxIfNeeded" />
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{country}}" stepKey="checkCountry"/>
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{state}}" stepKey="checkState" />
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabPostCodeText"/>
<assertEquals message="Address postcode is invalid" stepKey="checkPostcode">
<expectedResult type="string">{{postcode}}</expectedResult>
<actualResult type="variable">grabPostCodeText</actualResult>
</assertEquals>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontOrderIsNotPlacedActionGroup" extends="AssertStorefrontOrderCannotBePlacedActionGroup">
<annotations>
<description>Validates order cannot be placed and checks error message.</description>
</annotations>
<remove keyForRemoval="assertErrorMessage"/>
<seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText(error)}}" stepKey="assertErrorMessageInDOM"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontCheckoutCartFillEstimateShippingAndTaxActionGroup">
<annotations>
<description>Fill address data in Estimate Shipping And Tax section of shopping cart on storefront</description>
</annotations>
<arguments>
<argument name="country" type="string" defaultValue="{{US_Address_TX.country}}"/>
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
</arguments>

<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openEestimateShippingAndTaxSection"/>
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{country}}" stepKey="selectCountry"/>
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{state}}" stepKey="selectState"/>
<waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPostCodeVisible"/>
<fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{postcode}}" stepKey="selectPostCode"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontCheckoutClickNextOnShippingStepActionGroup" extends="StorefrontCheckoutForwardFromShippingStepActionGroup">
<annotations>
<description>Scrolls and clicks next on Checkout Shipping step</description>
</annotations>
<scrollTo selector="{{CheckoutShippingSection.next}}" before="clickNext" stepKey="scrollToNextButton"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<section name="CheckoutHeaderSection">
<element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)"/>
<element name="reviewAndPaymentsStep" type="text" selector=".opc-progress-bar-item:nth-of-type(2)"/>
<element name="errorMessageContainsText" type="text" selector="//div[contains(@class, 'message message-error error')]//div[contains(text(), '{{text}}')]" parameterized="true"/>
</section>
</sections>
Loading

0 comments on commit cde4f67

Please sign in to comment.