Skip to content

Commit a37b3fa

Browse files
authored
Merge pull request #860 from magento-commerce/mftf
[ADO-329] Fix MFTF issues
2 parents c12e2e1 + 79c76f2 commit a37b3fa

File tree

6 files changed

+114
-2
lines changed

6 files changed

+114
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<title value="The page has an add to cart pixel event."/>
1111
<description value="The product page should contain a fbq call with an add to cart pixel event."/>
1212
<severity value="MAJOR"/>
13+
<testCaseId value="META-2702202501"/>
1314
<group value="Pixel"/>
1415
</annotations>
1516
<before>
@@ -26,6 +27,11 @@
2627
<magentoCLI
2728
command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
2829
stepKey="setFacebookBusinessExtensionPixelId"/>
30+
31+
<!-- Do reindex -->
32+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
33+
<argument name="indices" value=""/>
34+
</actionGroup>
2935
</before>
3036
<after>
3137
<!-- Delete sample product -->
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
<testCaseId value="META-2702202502"/>
13+
<group value="Pixel"/>
14+
</annotations>
15+
<before>
16+
<!-- Create sample product -->
17+
<createData entity="_defaultMetaCategory" stepKey="createCategory"/>
18+
<createData entity="_defaultMetaProduct" stepKey="createProduct">
19+
<requiredEntity createDataKey="createCategory"/>
20+
</createData>
21+
22+
<!-- Do reindex -->
23+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
24+
<argument name="indices" value=""/>
25+
</actionGroup>
26+
27+
<!-- Add Pixel -->
28+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 1"
29+
stepKey="enableFacebookBusinessExtension"/>
30+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
31+
stepKey="setFacebookBusinessExtensionPixelId"/>
32+
</before>
33+
<after>
34+
<!-- Delete sample product -->
35+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
36+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
37+
38+
<!-- Remove Pixel -->
39+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 0"
40+
stepKey="disableFacebookBusinessExtension"/>
41+
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} ''"
42+
stepKey="unsetFacebookBusinessExtensionPixelId"/>
43+
</after>
44+
45+
<!-- Navigate to Home page -->
46+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/>
47+
48+
<!-- Fill and submit search form -->
49+
<actionGroup ref="fillSearchForm" stepKey="fillSearchForm">
50+
<argument name="searchQuery" value="_defaultSearch" />
51+
</actionGroup>
52+
53+
<!-- Navigate to product page -->
54+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
55+
<argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/>
56+
</actionGroup>
57+
58+
<!-- Submit add to cart form -->
59+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
60+
61+
<!-- Navigate to Cart page-->
62+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart"/>
63+
64+
<!-- Select Payment Method -->
65+
<click selector=".action.action-delete" stepKey="selectPaymentMethod"/>
66+
67+
<!-- Check pixel status element in dom on page -->
68+
<seeElementInDOM selector="{{StorefrontBodySection.PixelStatus}}" stepKey="seePixelStatusElement"/>
69+
</test>
70+
</tests>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title value="The page has an initiate checkout pixel event."/>
1010
<description value="The product page should contain a fbq call with an initiate checkout pixel event."/>
1111
<severity value="MAJOR"/>
12+
<testCaseId value="META-2702202503"/>
1213
<group value="Pixel"/>
1314
</annotations>
1415
<before>
@@ -23,6 +24,11 @@
2324
stepKey="enableFacebookBusinessExtension"/>
2425
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
2526
stepKey="setFacebookBusinessExtensionPixelId"/>
27+
28+
<!-- Do reindex -->
29+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
30+
<argument name="indices" value=""/>
31+
</actionGroup>
2632
</before>
2733
<after>
2834
<!-- Delete sample product -->

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title value="The page has a purchase pixel event."/>
1010
<description value="The product page should contain a fbq call with a purchase pixel event."/>
1111
<severity value="MAJOR"/>
12+
<testCaseId value="META-2702202504"/>
1213
<group value="Pixel"/>
1314
</annotations>
1415
<before>
@@ -18,11 +19,20 @@
1819
<requiredEntity createDataKey="createCategory"/>
1920
</createData>
2021

22+
<!-- Do reindex -->
23+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
24+
<argument name="indices" value=""/>
25+
</actionGroup>
26+
2127
<!-- Add Pixel -->
2228
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataEnabled.scope}} --scope-code={{FacebookBusinessConfigDataEnabled.scope_code}} {{FacebookBusinessConfigDataEnabled.path}} 1"
2329
stepKey="enableFacebookBusinessExtension"/>
2430
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} 123456789123456"
2531
stepKey="setFacebookBusinessExtensionPixelId"/>
32+
33+
<!-- Enable Shipping and Payment Method -->
34+
<magentoCLI command="config:set carriers/freeshipping/active 1" stepKey="enableShippingMethod"/>
35+
<magentoCLI command="config:set payment/cashondelivery/active 1" stepKey="enablePaymentMethod"/>
2636
</before>
2737
<after>
2838
<!-- Delete sample product -->
@@ -34,6 +44,10 @@
3444
stepKey="disableFacebookBusinessExtension"/>
3545
<magentoCLI command="config:set --scope={{FacebookBusinessConfigDataPixelId.scope}} --scope-code={{FacebookBusinessConfigDataPixelId.scope_code}} {{FacebookBusinessConfigDataPixelId.path}} ''"
3646
stepKey="unsetFacebookBusinessExtensionPixelId"/>
47+
48+
<!-- Disable Shipping and Payment Method -->
49+
<magentoCLI command="config:set carriers/freeshipping/active 0" stepKey="disableShippingMethod"/>
50+
<magentoCLI command="config:set payment/cashondelivery/active 0" stepKey="disablePaymentMethod"/>
3751
</after>
3852

3953
<!-- Navigate to Home page -->
@@ -55,15 +69,25 @@
5569
<argument name="customer" value="_defaultMetaCustomer" />
5670
</actionGroup>
5771

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

81+
<!-- Select Payment Method -->
82+
<click selector="input[value='cashondelivery']" stepKey="selectPaymentMethod"/>
83+
6284
<!-- Checking box for shipping address-->
85+
<waitForPageLoad stepKey="waitForBillingAddressPage" time="60" />
6386
<checkOption selector="#billing-address-same-as-shipping-checkmo" stepKey="checkShippingAddressEqualToBilling" />
87+
<waitForPageLoad stepKey="waitForBillingAddressSelect" time="60" />
6488

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

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title value="The page has a pixel search event."/>
1010
<description value="The page should contain a fbq call with a search pixel event."/>
1111
<severity value="MAJOR"/>
12+
<testCaseId value="META-2702202505"/>
1213
<group value="Pixel"/>
1314
</annotations>
1415
<before>
@@ -18,6 +19,11 @@
1819
<requiredEntity createDataKey="createCategory"/>
1920
</createData>
2021

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

0 commit comments

Comments
 (0)