Skip to content

Commit d3afbff

Browse files
soumyautomreece
authored andcommitted
MQE-2087: [PHPUnit 9] Update MFTF tests to use assertStringContainsString and assertStringNotContainsString
1 parent ed38cc7 commit d3afbff

File tree

25 files changed

+131
-131
lines changed

25 files changed

+131
-131
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,45 +65,45 @@
6565
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.sku$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct1"/>
6666
<seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.sku$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct1"/>
6767
<grabTextFrom selector="{{StorefrontBundledSection.dropDownOptionTierPrices('Drop-down Option')}}" stepKey="DropDownTierPriceTextProduct1"/>
68-
<assertContains stepKey="assertDropDownTierPriceTextProduct1">
68+
<assertStringContainsString stepKey="assertDropDownTierPriceTextProduct1">
6969
<expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult>
7070
<actualResult type="variable">DropDownTierPriceTextProduct1</actualResult>
71-
</assertContains>
71+
</assertStringContainsString>
7272
<!-- Check Tier Prices for product 2 -->
7373
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct2"/>
7474
<seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct2"/>
7575
<grabTextFrom selector="{{StorefrontBundledSection.dropDownOptionTierPrices('Drop-down Option')}}" stepKey="dropDownTierPriceTextProduct2"/>
76-
<assertContains stepKey="assertDropDownTierPriceTextProduct2">
76+
<assertStringContainsString stepKey="assertDropDownTierPriceTextProduct2">
7777
<expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult>
7878
<actualResult type="variable">dropDownTierPriceTextProduct2</actualResult>
79-
</assertContains>
79+
</assertStringContainsString>
8080

8181
<!--"Radio Buttons" type option-->
8282
<!-- Check Tier Prices for product 1 -->
8383
<grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct1CreateBundleProduct.sku$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct1"/>
84-
<assertContains stepKey="assertRadioButtonsOptionTierPriceTextProduct1">
84+
<assertStringContainsString stepKey="assertRadioButtonsOptionTierPriceTextProduct1">
8585
<expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult>
8686
<actualResult type="variable">radioButtonsOptionTierPriceTextProduct1</actualResult>
87-
</assertContains>
87+
</assertStringContainsString>
8888
<!-- Check Tier Prices for product 2 -->
8989
<grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct2CreateBundleProduct.sku$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct2"/>
90-
<assertContains stepKey="assertRadioButtonsOptionTierPriceTextProduct2">
90+
<assertStringContainsString stepKey="assertRadioButtonsOptionTierPriceTextProduct2">
9191
<expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult>
9292
<actualResult type="variable">radioButtonsOptionTierPriceTextProduct2</actualResult>
93-
</assertContains>
93+
</assertStringContainsString>
9494

9595
<!--"Checkbox" type option-->
9696
<!-- Check Tier Prices for product 1 -->
9797
<grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct1CreateBundleProduct.sku$$')}}" stepKey="checkBoxOptionTierPriceTextProduct1"/>
98-
<assertContains stepKey="assertCheckBoxOptionTierPriceTextProduct1">
98+
<assertStringContainsString stepKey="assertCheckBoxOptionTierPriceTextProduct1">
9999
<expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult>
100100
<actualResult type="variable">checkBoxOptionTierPriceTextProduct1</actualResult>
101-
</assertContains>
101+
</assertStringContainsString>
102102
<!-- Check Tier Prices for product 2 -->
103103
<grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct2CreateBundleProduct.sku$$')}}" stepKey="checkBoxOptionTierPriceTextProduct2"/>
104-
<assertContains stepKey="assertCheckBoxOptionTierPriceTextProduct2">
104+
<assertStringContainsString stepKey="assertCheckBoxOptionTierPriceTextProduct2">
105105
<expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult>
106106
<actualResult type="variable">checkBoxOptionTierPriceTextProduct2</actualResult>
107-
</assertContains>
107+
</assertStringContainsString>
108108
</test>
109109
</tests>

app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaFormsDisplayingTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
<waitForPageLoad stepKey="WaitForPageLoaded"/>
2626
<!--Verify fields removed-->
2727
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.forms}}" stepKey="formItems"/>
28-
<assertNotContains stepKey="checkoutAsGuest">
28+
<assertStringNotContainsString stepKey="checkoutAsGuest">
2929
<expectedResult type="string">{{CaptchaData.checkoutAsGuest}}</expectedResult>
3030
<actualResult type="variable">$formItems</actualResult>
31-
</assertNotContains>
32-
<assertNotContains stepKey="register">
31+
</assertStringNotContainsString>
32+
<assertStringNotContainsString stepKey="register">
3333
<expectedResult type="string">{{CaptchaData.register}}</expectedResult>
3434
<actualResult type="variable">$formItems</actualResult>
35-
</assertNotContains>
35+
</assertStringNotContainsString>
3636
<!--Verify fields existence-->
3737
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.createUser}}" stepKey="createUser"/>
3838
<assertEquals stepKey="CreateUserFieldIsPresent">

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<argument name="productPosition" type="string"/>
1818
</arguments>
1919
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName(productPosition)}}" stepKey="grabRelatedProductPosition"/>
20-
<assertContains stepKey="assertRelatedProductName">
20+
<assertStringContainsString stepKey="assertRelatedProductName">
2121
<actualResult type="const">$grabRelatedProductPosition</actualResult>
2222
<expectedResult type="const">{{productName}}</expectedResult>
23-
</assertContains>
23+
</assertStringContainsString>
2424
</actionGroup>
25-
</actionGroups>
25+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductFormFirstTime"/>
4444
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSEOSection"/>
4545
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabDuplicatedProductUrlKey"/>
46-
<assertContains stepKey="assertDuplicatedProductUrlKey">
46+
<assertStringContainsString stepKey="assertDuplicatedProductUrlKey">
4747
<actualResult type="const">$grabDuplicatedProductUrlKey</actualResult>
4848
<expectedResult type="const">$$createSimpleProduct.custom_attributes[url_key]$$</expectedResult>
49-
</assertContains>
50-
<assertContains stepKey="assertDuplicatedProductUrlKey1">
49+
</assertStringContainsString>
50+
<assertStringContainsString stepKey="assertDuplicatedProductUrlKey1">
5151
<actualResult type="const">$grabDuplicatedProductUrlKey</actualResult>
5252
<expectedResult type="string">-1</expectedResult>
53-
</assertContains>
53+
</assertStringContainsString>
5454
<!--Add duplicated product to the simple product-->
5555
<comment userInput="Add duplicated product to the simple product" stepKey="commentAddProduct"/>
5656
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSimpleProductPage">
@@ -81,14 +81,14 @@
8181
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openProductSEOSection"/>
8282
<waitForElementVisible selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="waitForUrlKeyField"/>
8383
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabSecondDuplicatedProductUrlKey"/>
84-
<assertContains stepKey="assertSecondDuplicatedProductUrlKey">
84+
<assertStringContainsString stepKey="assertSecondDuplicatedProductUrlKey">
8585
<actualResult type="const">$grabSecondDuplicatedProductUrlKey</actualResult>
8686
<expectedResult type="const">$$createSimpleProduct.custom_attributes[url_key]$$</expectedResult>
87-
</assertContains>
88-
<assertContains stepKey="assertSecondDuplicatedProductUrlKey1">
87+
</assertStringContainsString>
88+
<assertStringContainsString stepKey="assertSecondDuplicatedProductUrlKey1">
8989
<actualResult type="const">$grabSecondDuplicatedProductUrlKey</actualResult>
9090
<expectedResult type="string">-2</expectedResult>
91-
</assertContains>
91+
</assertStringContainsString>
9292
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" visible="false" stepKey="openProductRUSSection1"/>
9393
<waitForElementVisible selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" stepKey="waitForSelectedProductSku"/>
9494
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeRelatedProductForDuplicated"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@
9494
<!--Product with no images uses placeholder-->
9595
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageByName($$productNoImages.name$$)}}" stepKey="seeProductNoImagesInCategory"/>
9696
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$productNoImages.name$$)}}" userInput="src" stepKey="getSmallPlaceholderImageSrc"/>
97-
<assertContains stepKey="checkSmallPlaceholderImage">
97+
<assertStringContainsString stepKey="checkSmallPlaceholderImage">
9898
<actualResult type="variable">$getSmallPlaceholderImageSrc</actualResult>
9999
<expectedResult type="string">{{placeholderSmallImage.name}}</expectedResult>
100-
</assertContains>
100+
</assertStringContainsString>
101101
<!--Product with images does not use placeholder-->
102102
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName($$productWithImages.name$$)}}" stepKey="seeProductWithImagesInCategory"/>
103103
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$productWithImages.name$$)}}" userInput="src" stepKey="getSmallNonPlaceholderImageSrc"/>
104-
<assertNotContains stepKey="checkSmallPlaceholderImageNotUsed">
104+
<assertStringNotContainsString stepKey="checkSmallPlaceholderImageNotUsed">
105105
<actualResult type="variable">$getSmallNonPlaceholderImageSrc</actualResult>
106106
<expectedResult type="string">{{placeholderSmallImage.name}}</expectedResult>
107-
</assertNotContains>
107+
</assertStringNotContainsString>
108108

109109
<!--Check base image on product page-->
110110
<!--Product which is using placeholder-->
@@ -116,10 +116,10 @@
116116
<waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" stepKey="waitForProductAdded1"/>
117117
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCart1"/>
118118
<grabAttributeFrom selector="{{StorefrontMinicartSection.productImageByName($$productNoImages.name$$)}}" userInput="src" stepKey="getThumbnailPlaceholderImageSrc"/>
119-
<assertContains stepKey="checkThumbnailPlaceholderImage">
119+
<assertStringContainsString stepKey="checkThumbnailPlaceholderImage">
120120
<actualResult type="variable">$getThumbnailPlaceholderImageSrc</actualResult>
121121
<expectedResult type="string">{{placeholderThumbnailImage.name}}</expectedResult>
122-
</assertContains>
122+
</assertStringContainsString>
123123
<actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromCart1">
124124
<argument name="productName" value="$$productNoImages.name$$"/>
125125
</actionGroup>
@@ -134,10 +134,10 @@
134134
<waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" stepKey="waitForProductAdded2"/>
135135
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCart2"/>
136136
<grabAttributeFrom selector="{{StorefrontMinicartSection.productImageByName($$productWithImages.name$$)}}" userInput="src" stepKey="getThumbnailImageSrc"/>
137-
<assertNotContains stepKey="checkThumbnailImage">
137+
<assertStringNotContainsString stepKey="checkThumbnailImage">
138138
<actualResult type="variable">$getThumbnailImageSrc</actualResult>
139139
<expectedResult type="string">{{placeholderThumbnailImage.name}}</expectedResult>
140-
</assertNotContains>
140+
</assertStringNotContainsString>
141141
<actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromCart2">
142142
<argument name="productName" value="$$productWithImages.name$$"/>
143143
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,19 @@
180180
<amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.name$$)}}" stepKey="navigateToCategoryPage"/>
181181
<waitForPageLoad stepKey="waitForCategoryPageLoad0"/>
182182
<grabAttributeFrom userInput="src" selector="{{StorefrontCategoryMainSection.mediaDescription($$createProduct.name$$)}}" stepKey="grabAttributeFromImage"/>
183-
<assertContains stepKey="assertProductImageAbsence">
183+
<assertStringContainsString stepKey="assertProductImageAbsence">
184184
<actualResult type="const">$grabAttributeFromImage</actualResult>
185185
<expectedResult type="string">{{ProductImage.filename}}</expectedResult>
186-
</assertContains>
186+
</assertStringContainsString>
187187
<!--Open Storefront on newly created store view and assert image absence-->
188188
<amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfSpecificStore"/>
189189
<waitForPageLoad stepKey="waitForHomePageLoad"/>
190190
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="clickCategory"/>
191191
<waitForPageLoad stepKey="waitForCategoryPageLoad1"/>
192192
<grabAttributeFrom userInput="src" selector="{{StorefrontCategoryMainSection.mediaDescription($$createProduct.name$$)}}" stepKey="grabAttributeFromImage2"/>
193-
<assertContains stepKey="assertProductImageAbsence2">
193+
<assertStringContainsString stepKey="assertProductImageAbsence2">
194194
<actualResult type="const">$grabAttributeFromImage2</actualResult>
195195
<expectedResult type="string">small_image</expectedResult>
196-
</assertContains>
196+
</assertStringContainsString>
197197
</test>
198198
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@
9393
<!--Assert that category exist in field-->
9494
<comment userInput="Assert that category exist in field" stepKey="commentAssertion"/>
9595
<grabTextFrom selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="grabCategoryName"/>
96-
<assertContains stepKey="assertThatCategory">
96+
<assertStringContainsString stepKey="assertThatCategory">
9797
<expectedResult type="variable">$$createCategory.name$$</expectedResult>
9898
<actualResult type="variable">$grabCategoryName</actualResult>
99-
</assertContains>
99+
</assertStringContainsString>
100100
<!--Remove the category from the product and assert that it removed-->
101101
<comment userInput="Remove the category from the product and assert that it removed" stepKey="assertCategoryRemoved"/>
102102
<actionGroup ref="RemoveCategoryFromProductActionGroup" stepKey="removeCategoryFromProduct">
103103
<argument name="categoryName" value="$$createCategory.name$$"/>
104104
</actionGroup>
105105
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterRemovingCategory"/>
106106
<grabTextFrom selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="grabCategoryFieldContent"/>
107-
<assertNotContains stepKey="assertThatCategoryRemoved">
107+
<assertStringNotContainsString stepKey="assertThatCategoryRemoved">
108108
<expectedResult type="variable">$$createCategory.name$$</expectedResult>
109109
<actualResult type="variable">$grabCategoryFieldContent</actualResult>
110-
</assertNotContains>
110+
</assertStringNotContainsString>
111111
</test>
112112
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
9494
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectOption"/>
9595
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="class" stepKey="grabGrabPriceClass"/>
96-
<assertNotContains stepKey="assertNotEquals">
96+
<assertStringNotContainsString stepKey="assertNotEquals">
9797
<actualResult type="const">$grabGrabPriceClass</actualResult>
9898
<expectedResult type="string">.price-box .price-tier_price</expectedResult>
99-
</assertNotContains>
99+
</assertStringNotContainsString>
100100
</test>
101101
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@
126126
</actionGroup>
127127

128128
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct3"/>
129-
<assertNotContains stepKey="assertNotSeeProduct3">
129+
<assertStringNotContainsString stepKey="assertNotSeeProduct3">
130130
<actualResult type="const">$grabDontSeeHomeProduct3</actualResult>
131131
<expectedResult type="const">$$createSimpleProduct3.name$$</expectedResult>
132-
</assertNotContains>
132+
</assertStringNotContainsString>
133133

134134
<!-- Switch Storeview-->
135135
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewActionGroup">
@@ -145,10 +145,10 @@
145145
</actionGroup>
146146

147147
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabStoreView2DontSeeHomeProduct3"/>
148-
<assertNotContains stepKey="assertStoreView2NotSeeProduct3">
148+
<assertStringNotContainsString stepKey="assertStoreView2NotSeeProduct3">
149149
<actualResult type="const">$grabDontSeeHomeProduct3</actualResult>
150150
<expectedResult type="const">$$createSimpleProduct3.name$$</expectedResult>
151-
</assertNotContains>
151+
</assertStringNotContainsString>
152152

153153
<!-- Switch to default store-->
154154

@@ -165,10 +165,10 @@
165165
<argument name="productPosition" value="1"/>
166166
</actionGroup>
167167
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName('2')}}" stepKey="grabDontSeeHomeProduct1"/>
168-
<assertNotContains stepKey="assertNotSeeProduct1">
168+
<assertStringNotContainsString stepKey="assertNotSeeProduct1">
169169
<actualResult type="const">$grabDontSeeHomeProduct1</actualResult>
170170
<expectedResult type="const">$$createSimpleProduct1.name$$</expectedResult>
171-
</assertNotContains>
171+
</assertStringNotContainsString>
172172

173173
</test>
174174
</tests>

0 commit comments

Comments
 (0)