Skip to content

Commit

Permalink
MC-4389: Convert UpdateVirtualProductEntityTest to MFTF
Browse files Browse the repository at this point in the history
  • Loading branch information
sapanathakur committed Jan 23, 2019
1 parent cd1a39f commit 0126afd
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 75 deletions.
74 changes: 73 additions & 1 deletion app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="type_id">virtual</data>
</entity>
<entity name="updateRegularPriceVirtualProductOutOfStock" type="product">
<entity name="updateVirtualProductRegularPrice99OutOfStock" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">99.99</data>
Expand Down Expand Up @@ -624,4 +624,76 @@
<data key="filename">magento3</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="updateVirtualProductRegularPrice" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">99.99</data>
<data key="productTaxClass">None</data>
<data key="quantity">999</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="visibility">Catalog</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="type_id">virtual</data>
</entity>
<entity name="updateVirtualProductRegularPrice5OutOfStock" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">5.00</data>
<data key="productTaxClass">None</data>
<data key="status">Out of Stock</data>
<data key="storefrontStatus">OUT OF STOCK</data>
<data key="visibility">Catalog</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="type_id">virtual</data>
</entity>
<entity name="updateVirtualProductSpecialPrice" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">120.00</data>
<data key="productTaxClass">Taxable Goods</data>
<data key="quantity">999</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="visibility">Catalog, Search</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="special_price">45.00</data>
<data key="type_id">virtual</data>
</entity>
<entity name="updateVirtualProductSpecialPriceOutOfStock" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">99.99</data>
<data key="productTaxClass">None</data>
<data key="status">Out of Stock</data>
<data key="storefrontStatus">OUT OF STOCK</data>
<data key="visibility">Catalog, Search</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="special_price">45.00</data>
<data key="type_id">virtual</data>
</entity>
<entity name="updateVirtualProductTierPriceInStock" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">145.00</data>
<data key="productTaxClass">Taxable Goods</data>
<data key="quantity">999</data>
<data key="status">In Stock</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="visibility">Catalog, Search</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="type_id">virtual</data>
</entity>
<entity name="updateVirtualTierPriceOutOfStock" type="product">
<data key="name" unique="suffix">VirtualProduct</data>
<data key="sku" unique="suffix">virtual_sku</data>
<data key="price">185.00</data>
<data key="productTaxClass">None</data>
<data key="quantity">999</data>
<data key="status">Out of Stock</data>
<data key="storefrontStatus">OUT OF STOCK</data>
<data key="visibility">Catalog, Search</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="type_id">virtual</data>
</entity>
</entities>
2 changes: 2 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<data key="code">second_store_view</data>
</entity>
<entity name="tierPriceOnVirtualProduct" type="data">
<data key="website">All Websites [USD]</data>
<data key="customer_group">ALL GROUPS</data>
<data key="price">90.00</data>
<data key="qty">2</data>
</entity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
<element name="categoryImage" type="text" selector=".category-image"/>
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
<element name="asLowAs" type="input" selector="//*[@class='price-box price-final_price']/a/span[@class='price-container price-final_price tax weee']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
<waitForPageLoad stepKey="waitUntilProductIsOpened"/>

<!-- Update virtual product with regular price(out of stock) -->
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.price}}" stepKey="fillProductPrice"/>
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.productTaxClass}}" stepKey="selectProductStockClass"/>
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.status}}" stepKey="selectStockStatusInStock"/>
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.visibility}}" stepKey="selectVisibility"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.price}}" stepKey="fillProductPrice"/>
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.productTaxClass}}" stepKey="selectProductStockClass"/>
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.status}}" stepKey="selectStockStatusInStock"/>
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.visibility}}" stepKey="selectVisibility"/>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.urlKey}}" stepKey="fillUrlKey"/>
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.urlKey}}" stepKey="fillUrlKey"/>
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSaveButton"/>
<waitForPageLoad stepKey="waitForVirtualProductSaved"/>
Expand All @@ -63,37 +63,37 @@
<waitForPageLoad stepKey="waitForProductCatalogPageToLoad"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.name}}" stepKey="fillVirtualProductNameInNameFilter"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.sku}}" stepKey="fillVirtualProductSku"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="fillVirtualProductNameInNameFilter"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="fillVirtualProductSku"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedVirtualProductVisibleInGrid"/>
<waitForPageLoad stepKey="waitUntilVirtualProductPageIsOpened"/>

<!-- Verify customer see updated virtual product with regular price(out of stock) in the product form page -->
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.name}}" stepKey="seeProductName"/>
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.sku}}" stepKey="seeProductSku"/>
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.price}}" stepKey="seeProductPrice"/>
<seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.productTaxClass}}" stepKey="seeProductTaxClass"/>
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.status}}" stepKey="seeProductStockStatus"/>
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.visibility}}" stepKey="seeVisibility"/>
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="seeProductName"/>
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="seeProductSku"/>
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.price}}" stepKey="seeProductPrice"/>
<seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.productTaxClass}}" stepKey="seeProductTaxClass"/>
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.status}}" stepKey="seeProductStockStatus"/>
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.visibility}}" stepKey="seeVisibility"/>
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/>
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.urlKey}}" stepKey="seeUrlKey"/>
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.urlKey}}" stepKey="seeUrlKey"/>

<!--Verify customer see updated virtual product with regular price(out of stock) on product storefront page -->
<amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPriceOutOfStock.urlKey)}}" stepKey="goToProductPage"/>
<amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice5OutOfStock.urlKey)}}" stepKey="goToProductPage"/>
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{updateVirtualProductRegularPriceOutOfStock.sku}}" stepKey="seeVirtualProductSku"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.sku}}" stepKey="seeVirtualProductSku"/>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
<assertEquals stepKey="assertStockAvailableOnProductPage">
<expectedResult type="string">{{updateVirtualProductRegularPriceOutOfStock.storefrontStatus}}</expectedResult>
<expectedResult type="string">{{updateVirtualProductRegularPrice5OutOfStock.storefrontStatus}}</expectedResult>
<actualResult type="variable">productStockAvailableStatus</actualResult>
</assertEquals>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
<assertEquals stepKey="assertOldPriceTextOnProductPage">
<expectedResult type="string">${{updateVirtualProductRegularPriceOutOfStock.price}}</expectedResult>
<expectedResult type="string">${{updateVirtualProductRegularPrice5OutOfStock.price}}</expectedResult>
<actualResult type="variable">productPriceAmount</actualResult>
</assertEquals>
</test>
Expand Down
Loading

0 comments on commit 0126afd

Please sign in to comment.