Skip to content

Commit

Permalink
refactored AdminValidateShippingTrackingNumberTest
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaAPak committed Jan 4, 2021
1 parent 661c15c commit 4fb3216
Show file tree
Hide file tree
Showing 25 changed files with 488 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@
<!-- Switch from default attribute set to new attribute set -->
<amOnPage url="{{AdminProductCreatePage.url('4', 'bundle')}}" stepKey="goToNewProductPage"/>
<waitForPageLoad stepKey="wait2"/>
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>

<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
<argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>

<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>

Expand All @@ -64,9 +68,11 @@
<click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>

<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet2"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{BundleProduct.defaultAttribute}}" stepKey="searchForAttrSet2"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet2"/>
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet2">
<argument name="attributeSet" value="{{BundleProduct.defaultAttribute}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet2"/>

<!--save the product/published by default-->
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@
<checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggleAgain"/>

<!--Apply Attribute Set-->
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabelTwo.label}}" stepKey="searchForAttrSet"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(ProductAttributeFrontendLabelTwo.label)}}" stepKey="selectAttrSet"/>
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
<argument name="attributeSet" value="{{ProductAttributeFrontendLabelTwo.label}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>

<!--Product name and SKU-->
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSelectAttributeSetOnEditProductPageActionGroup">
<annotations>
<description>Selects the specified value from the Attribute Set dropdown on the opened product edit page.</description>
</annotations>
<arguments>
<argument name="attributeSet" type="string"/>
</arguments>

<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="clickAttributeSetDropdown"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet}}" stepKey="searchForAttributeSet"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttributeSet"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontHoverProductOnCategoryPageActionGroup">
<annotations>
<description>Hover product on the Category page</description>
</annotations>

<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/>

</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<group value="Catalog"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="loginAsAdmin"/>
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/>
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
Expand All @@ -30,81 +30,100 @@
<requiredEntity createDataKey="category"/>
</createData>
</before>

<after>
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/>
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<deleteData createDataKey="product" stepKey="deleteProduct"/>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="logout"/>
</after>
<!--Open product page-->
<comment userInput="Open product page" stepKey="openProdPage"/>
<amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="goToSimpleProductPage"/>
<waitForPageLoad stepKey="waitForSimpleProductPage"/>
<!--'Add to compare' link is not available-->
<comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/>
<comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProdPage"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage"/>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="waitForSimpleProductPage">
<argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/>
</actionGroup>

<comment userInput="'Add to compare' link is not available | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCompareLinkAvailability"/>

<dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/>
<!--Turn on 'out on stock' config-->
<comment userInput="Turn on 'out of stock' config" stepKey="onOutOfStockConfig"/>

<comment userInput="Turn on 'out of stock' config | Comment is kept to preserve the step key for backward compatibility" stepKey="onOutOfStockConfig"/>
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/>
<!--Clear cache and reindex-->
<comment userInput="Clear cache and reindex" stepKey="cleanCache"/>

<comment userInput="Clear cache and reindex | Comment is kept to preserve the step key for backward compatibility" stepKey="cleanCache"/>
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
</actionGroup>
<argument name="indices" value=""/>
</actionGroup>
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<!--Open product page-->
<comment userInput="Open product page" stepKey="openProductPage"/>
<amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="goToSimpleProductPage2"/>
<waitForPageLoad stepKey="waitForSimpleProductPage2"/>
<!--Click on 'Add to Compare' link-->
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="seeAddToCompareLink"/>
<comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/>
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/>
<waitForPageLoad stepKey="waitForProdAddToCmpList"/>
<!--Assert success message-->
<comment userInput="Assert success message" stepKey="assertSuccessMsg"/>
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage"/>
<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"/>
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/>
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList"/>
<!--Go to Category page and delete product from comparison list-->
<comment userInput="Go to Category page and delete product from comparison list" stepKey="deleteProdFromCmpList"/>
<amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="onCategoryPage"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
<click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/>
<waitForPageLoad time="30" stepKey="waitForConfirmPageLoad"/>
<click selector="{{AdminDeleteRoleSection.confirm}}" stepKey="confirmProdDelate"/>
<waitForPageLoad time="30" stepKey="waitForConfirmLoad"/>
<!--Add product to compare list from Category page-->
<comment userInput="Add product to compare list fom Category page" stepKey="addToCmpFromCategPage"/>
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/>
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/>
<waitForPageLoad stepKey="waitProdAddingToCmpList"/>
<!--Assert success message-->
<comment userInput="Assert success message" stepKey="assertSuccessMsg2"/>
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage2"/>
<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"/>
<argument name="tags" value=""/>
</actionGroup>

<comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProductPage"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSimpleProductPage2"/>
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="seeAddToCompareLink">
<argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/>
</actionGroup>

<comment userInput="Click on 'Add to Compare' link | Comment is kept to preserve the step key for backward compatibility" stepKey="clickOnAddToCompareLink"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnAddToCompare"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProdAddToCmpList"/>
<comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage"/>

<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="assertSuccessMessage">
<argument name="productVar" value="$$product$$"/>
</actionGroup>

<comment userInput="See product in the comparison list | Comment is kept to preserve the step key for backward compatibility" stepKey="seeProductInComparisonList"/>

<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
<argument name="categoryName" value="$$category.name$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/>

<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList">
<argument name="productVar" value="$$product$$"/>
</actionGroup>

<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="deleteProdFromCmpList"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/>
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="waitForPageLoad1">
<argument name="categoryName" value="$$category.name$$"/>
</actionGroup>

<actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clickClearAll"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmPageLoad"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="confirmProdDelate"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmLoad"/>
<comment userInput="Add product to compare list fom Category page | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCmpFromCategPage"/>

<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverOverProduct"/>

<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickAddToCompare">
<argument name="productVar" value="$$product$$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitProdAddingToCmpList"/>
<comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/>

<comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/>
<seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/>
<!--See product in the compare page-->

<comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/>
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage2"/>
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad2"/>
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList2"/>
<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/>

<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2">
<argument name="productVar" value="$$product$$"/>
</actionGroup>

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>

<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
<argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>

<waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/>
</test>
Expand Down
Loading

0 comments on commit 4fb3216

Please sign in to comment.