|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests |
| 10 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 11 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 12 | + <test name="StorefrontConfigurableSingleOptionNoAsLowAsLabelTest"> |
| 13 | + <annotations> |
| 14 | + <features value="ConfigurableProduct"/> |
| 15 | + <stories value="Price label visibility"/> |
| 16 | + <title value="Customer should not see As low as label for Configurable Product with single option"/> |
| 17 | + <description value="Create configurable with a single associated simple at $500 and assert PDP and PLP show $500 without the As low as label"/> |
| 18 | + <severity value="MAJOR"/> |
| 19 | + <testCaseId value="AC-15443"/> |
| 20 | + <group value="ConfigurableProduct"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Precondition 1: Create customer --> |
| 24 | + <createData entity="Simple_US_Customer_NY" stepKey="customer"/> |
| 25 | + <!-- Create category for configurable product --> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 27 | + <!-- Step 1,2: Create configurable product with single option --> |
| 28 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 29 | + <requiredEntity createDataKey="createCategory"/> |
| 30 | + </createData> |
| 31 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 32 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption"> |
| 33 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 34 | + </createData> |
| 35 | + <createData entity="AddToDefaultSet" stepKey="addProductToAttributeSet"> |
| 36 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 37 | + </createData> |
| 38 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption"> |
| 39 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 40 | + </getData> |
| 41 | + <!-- Create one child product for configurable product and set price 500 --> |
| 42 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct"> |
| 43 | + <field key="price">500</field> |
| 44 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 45 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 46 | + </createData> |
| 47 | + <createData entity="ConfigurableProductOneOption" stepKey="createConfigProductOption"> |
| 48 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 49 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 50 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 51 | + </createData> |
| 52 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> |
| 53 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 54 | + <requiredEntity createDataKey="createConfigChildProduct"/> |
| 55 | + </createData> |
| 56 | + </before> |
| 57 | + <after> |
| 58 | + <!-- Logout from storefront, delete customer, delete category, product --> |
| 59 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 60 | + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> |
| 61 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 62 | + <deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/> |
| 63 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 64 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 65 | + </after> |
| 66 | + <!-- Login into storefront --> |
| 67 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront"> |
| 68 | + <argument name="Customer" value="$customer$"/> |
| 69 | + </actionGroup> |
| 70 | + <!-- Step 3: Open category page (plp) and assert price and absence of as low as label --> |
| 71 | + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> |
| 72 | + <argument name="categoryName" value="$$createCategory.name$$"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="StorefrontAssertProductPriceAndPriceLabelIsNotPresentOnCategoryPageActionGroup" stepKey="assertPlpPriceNoLabel"> |
| 75 | + <argument name="productName" value="$$createConfigProduct.name$$"/> |
| 76 | + <argument name="price" value="$$createConfigChildProduct.price$$"/> |
| 77 | + <argument name="priceLabel" value="As low as"/> |
| 78 | + </actionGroup> |
| 79 | + <!-- Step 4: Open pdp and assert price 500.00 and absence of as low as label --> |
| 80 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openPDP"> |
| 81 | + <argument name="product" value="$createConfigProduct$"/> |
| 82 | + </actionGroup> |
| 83 | + <waitForElementNotVisible selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeAsLowAsLabelOnPDP"/> |
| 84 | + <waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct.price$$" stepKey="assertProductPrice"/> |
| 85 | + </test> |
| 86 | +</tests> |
0 commit comments