-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-8533: [MFTF] Refactoring of AdminUpdateSimpleProductWithRegula…
…rPriceInStockEnabledFlatTest #31221 - Merge Pull Request #31221 from AnnaAPak/magento2:ref-AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest - Merged commits: 1. fe6298b 2. e4fde6b 3. 1dd1046 4. 706e63d 5. f6db4a7
- Loading branch information
Showing
9 changed files
with
274 additions
and
2 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...de/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?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="AdminAssignTwoCategoriesToProductActionGroup" extends="AdminAssignCategoryToProductAndSaveActionGroup"> | ||
<annotations> | ||
<description>Extends AdminAssignCategoryToProductAndSaveActionGroup + assigns the second category and prevents product saving (the Product Edit page should be opened in Admin prior this check).</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="categoryTwoName" type="string"/> | ||
</arguments> | ||
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown2" after="waitForApplyCategory"/> | ||
<checkOption selector="{{AdminProductFormSection.selectCategory(categoryTwoName)}}" stepKey="selectCategoryTwo"/> | ||
<click selector="{{AdminProductFormSection.done}}" stepKey="clickDone2"/> | ||
<waitForPageLoad stepKey="waitForApplyCategoryTwo"/> | ||
<remove keyForRemoval="clickSave"/> | ||
<remove keyForRemoval="waitForSavingProduct"/> | ||
<remove keyForRemoval="seeSuccessMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?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="AdminFillMainProductFormActionGroup" extends="FillMainProductFormActionGroup"> | ||
<annotations> | ||
<description>Extends FillMainProductFormActionGroup with filling the next fields: Tax Class, Visibility, SEO->URL </description> | ||
</annotations> | ||
|
||
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="selectProductTaxClass"/> | ||
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="selectVisibility"/> | ||
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> | ||
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="fillUrlKey"/> | ||
</actionGroup> | ||
</actionGroups> |
23 changes: 23 additions & 0 deletions
23
...ode/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="AssertAdminManageStockOnEditPageActionGroup"> | ||
<annotations> | ||
<description>Check if manageStock value is correct | ||
(the Product Edit page->Advanced Inventory section should be opened in Admin prior this check).</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="manageStock" type="string"/> | ||
</arguments> | ||
|
||
<see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="seeManageStock"/> | ||
|
||
</actionGroup> | ||
</actionGroups> |
33 changes: 33 additions & 0 deletions
33
...ode/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?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="AssertAdminProductInfoOnEditPageActionGroup"> | ||
<annotations> | ||
<description>Validates next fields on the Product Edit Page: | ||
name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="product" type="entity"/> | ||
</arguments> | ||
<waitForPageLoad stepKey="waitForProductToLoad"/> | ||
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="seeProductName"/> | ||
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSku"/> | ||
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="seeProductPrice"/> | ||
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="seeProductQuantity"/> | ||
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="seeProductStockStatus"/> | ||
<seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="seeProductTaxClass"/> | ||
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="seeSimpleProductWeight"/> | ||
<seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{product.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> | ||
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="seeVisibility"/> | ||
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> | ||
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> | ||
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="seeUrlKey"/> | ||
</actionGroup> | ||
</actionGroups> |
22 changes: 22 additions & 0 deletions
22
...gento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?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="AssertAdminProductIsAssignedToCategoryActionGroup"> | ||
<annotations> | ||
<description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="categoryName" type="string"/> | ||
</arguments> | ||
|
||
<seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/> | ||
|
||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
...alog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?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="AssertStorefrontProductStockStatusOnProductPageActionGroup"> | ||
<annotations> | ||
<description>Validates that the provided Product Stock Status is present and correct | ||
(the Product Detail page should be opened on Storefront prior this check)</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="productStockStatus" type="string"/> | ||
</arguments> | ||
|
||
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
.../Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest"> | ||
<annotations> | ||
<stories value="Update Simple Product"/> | ||
<title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/> | ||
<description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/> | ||
<testCaseId value="MC-10818"/> | ||
<severity value="CRITICAL"/> | ||
<group value="catalog"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
<magentoCLI stepKey="setFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 1"/> | ||
<createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> | ||
<createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> | ||
<requiredEntity createDataKey="initialCategoryEntity"/> | ||
</createData> | ||
<createData entity="SimpleSubCategory" stepKey="categoryEntity"/> | ||
</before> | ||
<after> | ||
<deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> | ||
<deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> | ||
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> | ||
<argument name="sku" value="{{simpleProductEnabledFlat.sku}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
<magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> | ||
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> | ||
<argument name="product" value="$$initialSimpleProduct$$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> | ||
<actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> | ||
<argument name="value" value="No"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> | ||
|
||
<actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> | ||
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/> | ||
<argument name="categoryTwoName" value="$$categoryEntity.name$$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> | ||
<argument name="product" value="simpleProductEnabledFlat"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> | ||
|
||
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> | ||
|
||
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> | ||
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> | ||
<argument name="product" value="simpleProductEnabledFlat"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> | ||
<actionGroup ref="AssertAdminManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> | ||
<argument name="manageStock" value="No"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> | ||
|
||
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> | ||
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> | ||
<argument name="categoryName" value="$$categoryEntity.name$$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertAdminProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> | ||
<argument name="product" value="simpleProductEnabledFlat"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> | ||
<argument name="category" value="$categoryEntity$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> | ||
<argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> | ||
<argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> | ||
<argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> | ||
<argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> | ||
<argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> | ||
<argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> | ||
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> | ||
<argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> | ||
<argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> | ||
<argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> | ||
</actionGroup> | ||
|
||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters