Skip to content

Commit f8b6886

Browse files
committed
Issue-628. Convert CreateTermEntityTest to MFTF
1 parent 0f96aac commit f8b6886

28 files changed

+758
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminAssertTermInGrid">
12+
<arguments>
13+
<argument name="termName" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/>
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{termName}}" stepKey="fillTermNameFilter"/>
18+
<click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/>
19+
<see selector="{{AdminTermGridSection.firstRowConditionName}}" userInput="{{termName}}" stepKey="assertTermInGrid"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="CreateNewTerm">
12+
<arguments>
13+
<argument name="term"/>
14+
</arguments>
15+
<amOnPage url="{{AdminNewTermPage.url}}" stepKey="amOnNewTermPage"/>
16+
<waitForPageLoad stepKey="waitForPageLoad1"/>
17+
<fillField selector="{{AdminNewTermFormSection.conditionName}}" userInput="{{term.name}}" stepKey="fillFieldConditionName"/>
18+
<selectOption selector="{{AdminNewTermFormSection.isActive}}" userInput="{{term.isActive}}" stepKey="selectOptionIsActive"/>
19+
<selectOption selector="{{AdminNewTermFormSection.isHtml}}" userInput="{{term.isHtml}}" stepKey="selectOptionIsHtml"/>
20+
<selectOption selector="{{AdminNewTermFormSection.mode}}" userInput="{{term.mode}}" stepKey="selectOptionMode"/>
21+
<selectOption selector="{{AdminNewTermFormSection.storeView}}" userInput="{{term.storeView}}" stepKey="selectOptionStoreView" />
22+
<fillField selector="{{AdminNewTermFormSection.checkboxText}}" userInput="{{term.checkboxText}}" stepKey="fillFieldCheckboxText"/>
23+
<fillField selector="{{AdminNewTermFormSection.content}}" userInput="{{term.content}}" stepKey="fillFieldContent"/>
24+
<click selector="{{AdminNewTermFormSection.save}}" stepKey="saveTerm"/>
25+
<see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You saved the condition." stepKey="seeSuccessMessage"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="DeleteTerm">
12+
<arguments>
13+
<argument name="term" />
14+
</arguments>
15+
<amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/>
16+
<waitForPageLoad stepKey="waitForPageLoad1"/>
17+
<fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{term.name}}" stepKey="fillTermNameFilter"/>
18+
<click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/>
19+
<click selector="{{AdminTermGridSection.firstRowConditionId}}" stepKey="clickFirstRow"/>
20+
<waitForPageLoad stepKey="waitForPageLoad2"/>
21+
<click selector="{{AdminEditTermFormSection.delete}}" stepKey="clickDeleteButton"/>
22+
<click selector="{{AdminEditTermFormSection.acceptPopupButton}}" stepKey="clickDeleteOkButton"/>
23+
<waitForPageLoad stepKey="waitForPageLoad3"/>
24+
<see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You deleted the condition." stepKey="seeSuccessMessage"/>
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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="StorefrontAssertTermAbsentInCheckout">
12+
<arguments>
13+
<argument name="termCheckboxText" type="string"/>
14+
<argument name="product" defaultValue="SimpleTwo"/>
15+
</arguments>
16+
17+
<!--Add product to cart-->
18+
<amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/>
19+
<waitForPageLoad stepKey="waitForProductPage"/>
20+
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/>
21+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/>
22+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/>
23+
<waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/>
24+
<waitForPageLoad stepKey="waitForPageLoad"/>
25+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/>
26+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
27+
28+
<!--Go to Checkout-->
29+
<waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/>
30+
<wait time="5" stepKey="waitMinicartRendering"/>
31+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
32+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
33+
34+
<!--Process steps-->
35+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
36+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
37+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
38+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/>
39+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/>
40+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/>
41+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/>
42+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/>
43+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/>
44+
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/>
45+
<waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
46+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
47+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
48+
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
49+
50+
<!--Check if agreement is absent on checkout-->
51+
<dontSee selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/>
52+
53+
<!--Checkout select Check/Money Order payment-->
54+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/>
55+
<waitForPageLoad stepKey="waitForPageLoad2"/>
56+
<conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/>
57+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
58+
59+
<!--Click Place Order button-->
60+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
61+
62+
<!--See success messages-->
63+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
64+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
65+
</actionGroup>
66+
</actionGroups>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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="StorefrontAssertTermInCheckout">
12+
<arguments>
13+
<argument name="termCheckboxText" type="string"/>
14+
<argument name="product" defaultValue="SimpleTwo"/>
15+
</arguments>
16+
17+
<!--Add product to cart-->
18+
<amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/>
19+
<waitForPageLoad stepKey="waitForProductPage"/>
20+
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/>
21+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/>
22+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/>
23+
<waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/>
24+
<waitForPageLoad stepKey="waitForPageLoad"/>
25+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/>
26+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
27+
28+
<!--Go to Checkout-->
29+
<waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/>
30+
<wait time="5" stepKey="waitMinicartRendering"/>
31+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
32+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
33+
34+
<!--Process steps-->
35+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
36+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
37+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
38+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/>
39+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/>
40+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/>
41+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/>
42+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/>
43+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/>
44+
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/>
45+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/>
46+
<waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
47+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
48+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
49+
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
50+
51+
<!--Check if agreement is present on checkout and select it-->
52+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/>
53+
<selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/>
54+
55+
<!--Checkout select Check/Money Order payment-->
56+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
57+
<waitForPageLoad stepKey="waitForPageLoad2"/>
58+
<conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/>
59+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
60+
61+
<!--Click Place Order button-->
62+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
63+
64+
<!--See success messages-->
65+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
66+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
67+
</actionGroup>
68+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="StorefrontAssertTermRequireMessageInMultishippingCheckout">
12+
<arguments>
13+
<argument name="termCheckboxText" type="string"/>
14+
<argument name="product1" defaultValue="SimpleTwo"/>
15+
<argument name="product2" defaultValue="SimpleTwo"/>
16+
</arguments>
17+
18+
<!--Add product1 to cart-->
19+
<amOnPage url="{{StorefrontProductPage.url(product1.custom_attributes[url_key])}}" stepKey="goToProduct1Page"/>
20+
<waitForPageLoad stepKey="waitForProduct1Page"/>
21+
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart1"/>
22+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButton1TitleIsAdding"/>
23+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButton1TitleIsAdded"/>
24+
<waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButton1TitleIsAddToCart"/>
25+
<waitForPageLoad stepKey="waitForPageLoad1"/>
26+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProduct1AddedMessage"/>
27+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product1.name}} to your shopping cart." stepKey="seeAddToCart1SuccessMessage"/>
28+
29+
<!--Add product2 to cart-->
30+
<amOnPage url="{{StorefrontProductPage.url(product2.custom_attributes[url_key])}}" stepKey="goToProduct2Page"/>
31+
<waitForPageLoad stepKey="waitForProduct2Page"/>
32+
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart2"/>
33+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButton2TitleIsAdding"/>
34+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButton2TitleIsAdded"/>
35+
<waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButton2TitleIsAddToCart"/>
36+
<waitForPageLoad stepKey="waitForPageLoad2"/>
37+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProduct2AddedMessage"/>
38+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product2.name}} to your shopping cart." stepKey="seeAddToCart2SuccessMessage"/>
39+
40+
<!--Go to Checkout Cart and proceed with multiple addresses-->
41+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCheckoutCart"/>
42+
<waitForPageLoad stepKey="waitForPageLoad3"/>
43+
<click selector="{{MultishippingSection.checkoutWithMultipleAddresses}}" stepKey="proceedMultishipping"/>
44+
45+
<!--Procees do overview page-->
46+
<click selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.goToShippingInformation}}" stepKey="clickGoToShippingInformation"/>
47+
<waitForPageLoad stepKey="waitForPageLoad4"/>
48+
<click selector="{{StorefrontMultishippingCheckoutShippingToolbarSection.continueToBilling}}" stepKey="clickContinueToBilling"/>
49+
<waitForPageLoad stepKey="waitForPageLoad5"/>
50+
<click selector="{{StorefrontMultishippingCheckoutBillingToolbarSection.goToReviewOrder}}" stepKey="clickGoToReviewOrder"/>
51+
<waitForPageLoad stepKey="waitForPageLoad6"/>
52+
53+
<!--Check if agreement is present on checkout and select it-->
54+
<scrollTo selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="scrollToButtonPlaceOrder"/>
55+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/>
56+
<click selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="tryToPlaceOrder1"/>
57+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeErrorMessage"/>
58+
<selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/>
59+
<click selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="tryToPlaceOrder2"/>
60+
<dontSee selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="dontSeeErrorMessage"/>
61+
62+
<!--See success message-->
63+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
64+
</actionGroup>
65+
</actionGroups>

0 commit comments

Comments
 (0)