Skip to content

Commit

Permalink
Merge pull request #236 from magento-pangolin/MQE-683
Browse files Browse the repository at this point in the history
MQE-683: [Deprecation] Only use more nested assertion syntax
  • Loading branch information
KevinBKozan authored Mar 12, 2020
2 parents 826fea9 + 58b25ca commit 85738a1
Show file tree
Hide file tree
Showing 84 changed files with 1,365 additions and 379 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@
<grabValueFrom selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" stepKey="grabDescriptionForAdmin"/>

<!-- Check that Swatch and Description fields for Admin are not empty-->
<assertNotEmpty actual="$grabSwatchForAdmin" stepKey="checkSwatchFieldForAdmin"/>
<assertNotEmpty actual="$grabDescriptionForAdmin" stepKey="checkDescriptionFieldForAdmin"/>
<assertNotEmpty stepKey="checkSwatchFieldForAdmin">
<actualResult type="const">$grabSwatchForAdmin</actualResult>
</assertNotEmpty>
<assertNotEmpty stepKey="checkDescriptionFieldForAdmin">
<actualResult type="const">$grabDescriptionForAdmin</actualResult>
</assertNotEmpty>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
<actionGroup ref="AdminOpenStoreConfigPageActionGroup" stepKey="openStoreConfigPage" />
<scrollTo selector="{{LocaleOptionsSection.sectionHeader}}" stepKey="scrollToLocaleSection" x="0" y="-80" />
<conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSection"/>
<assertElementContainsAttribute selector="{{LocaleOptionsSection.locale}}" attribute="disabled" stepKey="seeDisabledLocaleDropdown" />
<assertElementContainsAttribute stepKey="seeDisabledLocaleDropdown">
<expectedResult selector="{{LocaleOptionsSection.locale}}" attribute="disabled" type="string"></expectedResult>
</assertElementContainsAttribute>

<!-- Go to the developer configuration and make sure the redirect to the configuration page takes place -->
<actionGroup ref="AdminOpenStoreConfigDeveloperPageActionGroup" stepKey="goToDeveloperConfigPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<seeElement selector="{{AdminDashboardSection.dashboardDiagramAmountsContentTab}}" stepKey="seeDiagramAmountContent"/>
<seeElement selector="{{AdminDashboardSection.dashboardDiagramTotals}}" stepKey="seeAmountTotals"/>
<dontSeeJsError stepKey="dontSeeJsError"/>
<assertGreaterThan expected="$grabStartQuantity" actual="$grabEndQuantity" stepKey="checkQuantityWasChanged"/>
<assertGreaterThan stepKey="checkQuantityWasChanged">
<actualResult type="const">$grabEndQuantity</actualResult>
<expectedResult type="const">$grabStartQuantity</expectedResult>
</assertGreaterThan>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@
<grabTextFrom selector="{{CheckoutOrderSummarySection.additionalAddress}}" stepKey="additionalAddress"/>
<see userInput="Shipping Address" stepKey="seeShippingAddress"/>
<see userInput="Billing Address" stepKey="seeBillingAddress"/>
<assertEquals stepKey="assertValuesAreEqual" actual="$billingAddr" expected="$shippingAddr"/>
<assertNotEquals stepKey="assertValuesAreNotEqual" actual="$billingAddr" expected="$additionalAddress"/>
<assertEquals stepKey="assertValuesAreEqual">
<actualResult type="const">$billingAddr</actualResult>
<expectedResult type="const">$shippingAddr</expectedResult>
</assertEquals>
<assertNotEquals stepKey="assertValuesAreNotEqual">
<actualResult type="const">$billingAddr</actualResult>
<expectedResult type="const">$additionalAddress</expectedResult>
</assertNotEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@

<!--Assert Bundle Product Price-->
<grabTextFrom selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="grabProductsPrice"/>
<assertEquals expected='$123.00' expectedType="string" actual="$grabProductsPrice" message="ExpectedPrice" stepKey="assertBundleProductPrice"/>
<assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
<actualResult type="const">$grabProductsPrice</actualResult>
<expectedResult type="string">$123.00</expectedResult>
</assertEquals>

<!--Chose all products from 1st & 3rd options -->
<click stepKey="selectProduct1" selector="{{StorefrontBundledSection.productCheckbox('1','1')}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart1"/>
<waitForPageLoad stepKey="waitForCartPageLoad1"/>
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/>
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
<assertNotEquals stepKey="assertNotEquals">
<actualResult type="string">{$grabTotalAfter}</actualResult>
<expectedResult type="string">{$grabTotalBefore}</expectedResult>
</assertNotEquals>

<!-- Delete the bundled product -->
<actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@
<waitForElementVisible stepKey="waitForInfoDropdown2" selector="{{CheckoutCartSummarySection.total}}"/>
<waitForPageLoad stepKey="waitForCartPageLoad4"/>
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalAfter"/>
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
<assertNotEquals stepKey="assertNotEquals">
<actualResult type="string">{$grabTotalAfter}</actualResult>
<expectedResult type="string">{$grabTotalBefore}</expectedResult>
</assertNotEquals>

<!-- Delete the bundled product -->
<actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@
<grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/>
<grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/>
<grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/>
<assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/>
<assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/>
<assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/>
<assertEquals stepKey="assertOptionTitle">
<actualResult type="const">$grabOptionTitle</actualResult>
<expectedResult type="string">{{option.title}}</expectedResult>
</assertEquals>
<assertEquals stepKey="assertOptionPrice">
<actualResult type="const">$grabOptionPrice</actualResult>
<expectedResult type="string">{{option.price}}</expectedResult>
</assertEquals>
<assertEquals stepKey="assertOptionSku">
<actualResult type="const">$grabOptionSku</actualResult>
<expectedResult type="string">{{option.title}}</expectedResult>
</assertEquals>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
<waitForPageLoad stepKey="waitForPageLoad5AfterCacheCleared" time="60"/>
<waitForElement selector="{{StorefrontCategoryProductSection.ProductImageByNumber('1')}}" time="120" stepKey="waitCompareWidgetLoad" />
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByNumber('1')}}" userInput="alt" stepKey="grabFirstProductName1_1"/>
<assertEquals expected="{{product_1.name}}" actual="($grabFirstProductName1_1)" message="notExpectedOrder" stepKey="compare1"/>
<assertEquals message="notExpectedOrder" stepKey="compare1">
<actualResult type="const">($grabFirstProductName1_1)</actualResult>
<expectedResult type="const">{{product_1.name}}</expectedResult>
</assertEquals>
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByNumber('2')}}" userInput="alt" stepKey="grabFirstProductName2_2"/>
<assertEquals expected="{{product_2.name}}" actual="($grabFirstProductName2_2)" message="notExpectedOrder" stepKey="compare2"/>
<assertEquals message="notExpectedOrder" stepKey="compare2">
<actualResult type="const">($grabFirstProductName2_2)</actualResult>
<expectedResult type="const">{{product_2.name}}</expectedResult>
</assertEquals>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<waitForPageLoad stepKey="waitForFirstProductPage"/>
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="waitForProductSpecialPrice"/>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabProductSpecialPrice"/>
<assertEquals actual="$grabProductSpecialPrice" expectedType="string" expected="{{specialPrice}}" stepKey="assertProductPriceValuesAreEqual"/>
<assertEquals stepKey="assertProductPriceValuesAreEqual">
<actualResult type="const">$grabProductSpecialPrice</actualResult>
<expectedResult type="string">{{specialPrice}}</expectedResult>
</assertEquals>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
<!--Assert success message-->
<comment userInput="Assert success message" stepKey="assertSuccessMsg"/>
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage"/>
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage"/>
<assertEquals stepKey="assertSuccessMessage">
<actualResult type="const">($grabTextFromSuccessMessage)</actualResult>
<expectedResult type="string">You added product $$product.name$$ to the comparison list.</expectedResult>
</assertEquals>
<!--See product in the comparison list-->
<comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/>
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
Expand All @@ -83,7 +86,10 @@
<!--Assert success message-->
<comment userInput="Assert success message" stepKey="assertSuccessMsg2"/>
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage2"/>
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage2"/>
<assertEquals stepKey="assertSuccessMessage2">
<actualResult type="const">($grabTextFromSuccessMessage)</actualResult>
<expectedResult type="string">You added product $$product.name$$ to the comparison list.</expectedResult>
</assertEquals>
<!--Check that product displays on add to compare widget-->
<comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/>
<seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductFormFirstTime"/>
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSEOSection"/>
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabDuplicatedProductUrlKey"/>
<assertContains expected="$$createSimpleProduct.custom_attributes[url_key]$$" actual="$grabDuplicatedProductUrlKey" stepKey="assertDuplicatedProductUrlKey"/>
<assertContains expectedType="string" expected="-1" actual="$grabDuplicatedProductUrlKey" stepKey="assertDuplicatedProductUrlKey1"/>
<assertContains stepKey="assertDuplicatedProductUrlKey">
<actualResult type="const">$grabDuplicatedProductUrlKey</actualResult>
<expectedResult type="const">$$createSimpleProduct.custom_attributes[url_key]$$</expectedResult>
</assertContains>
<assertContains stepKey="assertDuplicatedProductUrlKey1">
<actualResult type="const">$grabDuplicatedProductUrlKey</actualResult>
<expectedResult type="string">-1</expectedResult>
</assertContains>
<!--Add duplicated product to the simple product-->
<comment userInput="Add duplicated product to the simple product" stepKey="commentAddProduct"/>
<amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToSimpleProductPage"/>
Expand All @@ -69,8 +75,14 @@
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openProductSEOSection"/>
<waitForElementVisible selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="waitForUrlKeyField"/>
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabSecondDuplicatedProductUrlKey"/>
<assertContains expected="$$createSimpleProduct.custom_attributes[url_key]$$" actual="$grabSecondDuplicatedProductUrlKey" stepKey="assertSecondDuplicatedProductUrlKey"/>
<assertContains expectedType="string" expected="-2" actual="$grabSecondDuplicatedProductUrlKey" stepKey="assertSecondDuplicatedProductUrlKey1"/>
<assertContains stepKey="assertSecondDuplicatedProductUrlKey">
<actualResult type="const">$grabSecondDuplicatedProductUrlKey</actualResult>
<expectedResult type="const">$$createSimpleProduct.custom_attributes[url_key]$$</expectedResult>
</assertContains>
<assertContains stepKey="assertSecondDuplicatedProductUrlKey1">
<actualResult type="const">$grabSecondDuplicatedProductUrlKey</actualResult>
<expectedResult type="string">-2</expectedResult>
</assertContains>
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" visible="false" stepKey="openProductRUSSection1"/>
<waitForElementVisible selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" stepKey="waitForSelectedProductSku"/>
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeRelatedProductForDuplicated"/>
Expand Down
61 changes: 32 additions & 29 deletions app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,34 +70,37 @@
<seeOptionIsSelected selector="{{CategoryDesignSection.LayoutDropdown}}" userInput="2 columns with right bar" stepKey="see2ColumnsSelected" />
</test>
<test name="AdminCategoryFormDisplaySettingsUIValidationTest">
<annotations>
<features value="Catalog"/>
<stories value="Default layout configuration MAGETWO-88793"/>
<title value="Category should not be saved once layered navigation price step field is left empty"/>
<description value="Once the Config setting is unchecked Category should not be saved with layered navigation price field left empty"/>
<severity value="AVERAGE"/>
<testCaseId value="MAGETWO-95797"/>
<group value="category"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="enterCategoryName"/>
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="clickOnDisplaySettingsTab"/>
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.filterPriceRangeUseConfig}}" stepKey="wait"/>
<scrollTo selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" stepKey="scrollToLayeredNavigationField"/>
<uncheckOption selector="{{CategoryDisplaySettingsSection.filterPriceRangeUseConfig}}" stepKey="uncheckConfigSetting"/>
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
<see selector="{{AdminCategoryBasicFieldSection.FieldError('uid')}}" userInput="This is a required field." stepKey="seeErrorMessage"/>
<!-- Verify that the Layered navigation price step field has the required indicator -->
<comment userInput="Check if Layered navigation price field has required indicator icon" stepKey="comment" />
<executeJS function="{{CategoryDisplaySettingsSection.RequiredFieldIndicator('filter_price_range')}}" stepKey="getRequiredFieldIndicator"/>
<assertEquals expected='"*"' expectedType="string" actualType="variable" actual="getRequiredFieldIndicator" message="pass" stepKey="assertRequiredFieldIndicator1"/>
<annotations>
<features value="Catalog"/>
<stories value="Default layout configuration MAGETWO-88793"/>
<title value="Category should not be saved once layered navigation price step field is left empty"/>
<description value="Once the Config setting is unchecked Category should not be saved with layered navigation price field left empty"/>
<severity value="AVERAGE"/>
<testCaseId value="MAGETWO-95797"/>
<group value="category"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="enterCategoryName"/>
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="clickOnDisplaySettingsTab"/>
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.filterPriceRangeUseConfig}}" stepKey="wait"/>
<scrollTo selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" stepKey="scrollToLayeredNavigationField"/>
<uncheckOption selector="{{CategoryDisplaySettingsSection.filterPriceRangeUseConfig}}" stepKey="uncheckConfigSetting"/>
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
<see selector="{{AdminCategoryBasicFieldSection.FieldError('uid')}}" userInput="This is a required field." stepKey="seeErrorMessage"/>
<!-- Verify that the Layered navigation price step field has the required indicator -->
<comment userInput="Check if Layered navigation price field has required indicator icon" stepKey="comment" />
<executeJS function="{{CategoryDisplaySettingsSection.RequiredFieldIndicator('filter_price_range')}}" stepKey="getRequiredFieldIndicator"/>
<assertEquals message="pass" stepKey="assertRequiredFieldIndicator1">
<actualResult type="variable">getRequiredFieldIndicator</actualResult>
<expectedResult type="string">"*"</expectedResult>
</assertEquals>
</test>
</tests>
Loading

0 comments on commit 85738a1

Please sign in to comment.