Skip to content

Commit 30ef71e

Browse files
committed
Fix MFTF issues
1 parent c12e2e1 commit 30ef71e

File tree

6 files changed

+109
-2
lines changed

6 files changed

+109
-2
lines changed

app/code/Meta/Conversion/Test/Mftf/Data/SearchPixelEventData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
55
<entity name="_defaultSearch" type="SearchQuery">
6-
<data key="query">book</data>
6+
<data key="query">Console1</data>
77
</entity>
88
</entities>

app/code/Meta/Conversion/Test/Mftf/Test/AddToCartPixelEventCreatedTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
<magentoCLI
2727
command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
2828
stepKey="setFacebookBusinessExtensionPixelId"/>
29+
30+
<!-- Do reindex -->
31+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
32+
<argument name="indices" value=""/>
33+
</actionGroup>
2934
</before>
3035
<after>
3136
<!-- Delete sample product -->
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
5+
<test name="CartPixelEventCreatedTest">
6+
<annotations>
7+
<features value="Pixel"/>
8+
<stories value="Search Pixel Event"/>
9+
<title value="The page has a pixel search event."/>
10+
<description value="The page should contain a fbq call with a search pixel event."/>
11+
<severity value="MAJOR"/>
12+
<group value="Pixel"/>
13+
</annotations>
14+
<before>
15+
<!-- Create sample product -->
16+
<createData entity="_defaultMetaCategory" stepKey="createCategory"/>
17+
<createData entity="_defaultMetaProduct" stepKey="createProduct">
18+
<requiredEntity createDataKey="createCategory"/>
19+
</createData>
20+
21+
<!-- Do reindex -->
22+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
23+
<argument name="indices" value=""/>
24+
</actionGroup>
25+
26+
<!-- Add Pixel -->
27+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 1"
28+
stepKey="enableFacebookBusinessExtension"/>
29+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
30+
stepKey="setFacebookBusinessExtensionPixelId"/>
31+
</before>
32+
<after>
33+
<!-- Delete sample product -->
34+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
35+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
36+
37+
<!-- Remove Pixel -->
38+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 0"
39+
stepKey="disableFacebookBusinessExtension"/>
40+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} ''"
41+
stepKey="unsetFacebookBusinessExtensionPixelId"/>
42+
</after>
43+
44+
<!-- Navigate to Home page -->
45+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/>
46+
47+
<!-- Fill and submit search form -->
48+
<actionGroup ref="fillSearchForm" stepKey="fillSearchForm">
49+
<argument name="searchQuery" value="_defaultSearch" />
50+
</actionGroup>
51+
52+
<!-- Navigate to product page -->
53+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
54+
<argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/>
55+
</actionGroup>
56+
57+
<!-- Submit add to cart form -->
58+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
59+
60+
<!-- Navigate to Cart page-->
61+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart"/>
62+
63+
<!-- Select Payment Method -->
64+
<click selector=".action.action-delete" stepKey="selectPaymentMethod"/>
65+
66+
<!-- Check pixel status element in dom on page -->
67+
<seeElementInDOM selector="{{StorefrontBodySection.PixelStatus}}" stepKey="seePixelStatusElement"/>
68+
</test>
69+
</tests>

app/code/Meta/Conversion/Test/Mftf/Test/InitiateCheckoutPixelEventCreatedTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
stepKey="enableFacebookBusinessExtension"/>
2424
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
2525
stepKey="setFacebookBusinessExtensionPixelId"/>
26+
27+
<!-- Do reindex -->
28+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
29+
<argument name="indices" value=""/>
30+
</actionGroup>
2631
</before>
2732
<after>
2833
<!-- Delete sample product -->

app/code/Meta/Conversion/Test/Mftf/Test/PurchasePixelEventCreatedTest.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@
1818
<requiredEntity createDataKey="createCategory"/>
1919
</createData>
2020

21+
<!-- Do reindex -->
22+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
23+
<argument name="indices" value=""/>
24+
</actionGroup>
25+
2126
<!-- Add Pixel -->
2227
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 1"
2328
stepKey="enableFacebookBusinessExtension"/>
2429
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
2530
stepKey="setFacebookBusinessExtensionPixelId"/>
31+
32+
<!-- Enable Shipping and Payment Method -->
33+
<magentoCLI command="config:set carriers/freeshipping/active 1" stepKey="enableShippingMethod"/>
34+
<magentoCLI command="config:set payment/cashondelivery/active 1" stepKey="enablePaymentMethod"/>
2635
</before>
2736
<after>
2837
<!-- Delete sample product -->
@@ -34,6 +43,10 @@
3443
stepKey="disableFacebookBusinessExtension"/>
3544
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} ''"
3645
stepKey="unsetFacebookBusinessExtensionPixelId"/>
46+
47+
<!-- Disable Shipping and Payment Method -->
48+
<magentoCLI command="config:set carriers/freeshipping/active 0" stepKey="disableShippingMethod"/>
49+
<magentoCLI command="config:set payment/cashondelivery/active 0" stepKey="disablePaymentMethod"/>
3750
</after>
3851

3952
<!-- Navigate to Home page -->
@@ -55,15 +68,25 @@
5568
<argument name="customer" value="_defaultMetaCustomer" />
5669
</actionGroup>
5770

71+
<!-- Select Shipping Method -->
72+
<waitForPageLoad stepKey="waitForShippingMethodLoad" time="60" />
73+
<click selector="input[value='freeshipping_freeshipping']" stepKey="selectShippingMethod"/>
74+
<waitForPageLoad stepKey="waitForShippingMethodSelection" time="60" />
75+
5876
<!-- Click on Next button -->
5977
<click selector="button.button.action.continue.primary" stepKey="clickNextButton"/>
6078
<waitForPageLoad stepKey="waitForConfirmationPage" time="60" />
6179

80+
<!-- Select Payment Method -->
81+
<click selector="input[value='cashondelivery']" stepKey="selectPaymentMethod"/>
82+
6283
<!-- Checking box for shipping address-->
84+
<waitForPageLoad stepKey="waitForBillingAddressPage" time="60" />
6385
<checkOption selector="#billing-address-same-as-shipping-checkmo" stepKey="checkShippingAddressEqualToBilling" />
86+
<waitForPageLoad stepKey="waitForBillingAddressSelect" time="60" />
6487

6588
<!-- Click on place order -->
66-
<click selector="button.action.primary.checkout" stepKey="clickPlaceOrder"/>
89+
<click selector=".payment-method._active button.action.primary.checkout" stepKey="clickPlaceOrder"/>
6790

6891
<!-- Wait for thank you page -->
6992
<waitForPageLoad stepKey="waitForThankYouPage" time="60" />

app/code/Meta/Conversion/Test/Mftf/Test/SearchPixelEventCreatedTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
<requiredEntity createDataKey="createCategory"/>
1919
</createData>
2020

21+
<!-- Do reindex -->
22+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
23+
<argument name="indices" value=""/>
24+
</actionGroup>
25+
2126
<!-- Add Pixel -->
2227
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 1"
2328
stepKey="enableFacebookBusinessExtension"/>

0 commit comments

Comments
 (0)