|
8 | 8 |
|
9 | 9 | <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
10 | 10 | xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
|
11 |
| - <test name="AdminValidateSpecialPricePercentageSymbolInCatalogProductGridTest"> |
| 11 | + <test name="AdminBundleProductPriceSymbolValidationInGridTest"> |
12 | 12 | <annotations>
|
13 | 13 | <features value="Bundle"/>
|
14 | 14 | <stories value="Bundle Products Special Price Column in admin Grid should have % sign not currency sign"/>
|
|
20 | 20 | <group value="Bundle"/>
|
21 | 21 | </annotations>
|
22 | 22 | <before>
|
| 23 | + <!-- Create a simple product --> |
23 | 24 | <createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
|
24 |
| - <!--Admin login--> |
25 |
| - <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> |
| 25 | + <!-- Admin login --> |
| 26 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> |
26 | 27 | </before>
|
27 | 28 | <after>
|
28 |
| - <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 29 | + <!-- Navigate to catalog product index page --> |
29 | 30 | <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
|
| 31 | + <!-- Clear all the search filter --> |
| 32 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> |
| 33 | + <!-- Set product grid to default columns --> |
| 34 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultColumns"/> |
| 35 | + <!-- Open the column dropdown to reset the default columns from the catalog product grid --> |
| 36 | + <actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdownToReset"/> |
| 37 | + <actionGroup ref="ResetAdminProductGridColumnsActionGroup" stepKey="resetProductGridColumns"/> |
| 38 | + <actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdownAfterReset"/> |
| 39 | + <!-- Delete all the products from the catalog product grid --> |
30 | 40 | <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/>
|
31 |
| - <!--Logging out--> |
| 41 | + <!-- Logging out --> |
32 | 42 | <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
|
33 | 43 | </after>
|
34 |
| - <!--Go to bundle product creation page--> |
35 |
| - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> |
36 |
| - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> |
| 44 | + <!-- Go to bundle product creation page --> |
| 45 | + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewBundleProductPage"> |
| 46 | + <argument name="productType" value="{{BundleProduct.type}}"/> |
| 47 | + <argument name="attributeSetId" value="{{BundleProduct.set}}"/> |
| 48 | + </actionGroup> |
| 49 | + <!-- Sets the provided Special Price on the Admin Product creation/edit page. --> |
37 | 50 | <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice">
|
38 | 51 | <argument name="price" value="{{SimpleProductWithSpecialPrice.special_price}}"/>
|
39 | 52 | </actionGroup>
|
40 |
| - <!-- Add single bundle item --> |
41 |
| - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> |
42 |
| - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> |
43 |
| - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> |
44 |
| - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/> |
45 |
| - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> |
46 |
| - <actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/> |
47 |
| - <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> |
48 |
| - <argument name="product" value="$$simpleProduct1$$"/> |
| 53 | + <!-- Add the bundle option to the product --> |
| 54 | + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption"> |
| 55 | + <argument name="x" value="0"/> |
| 56 | + <argument name="n" value="1"/> |
| 57 | + <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> |
| 58 | + <argument name="prodTwoSku" value=""/> |
| 59 | + <argument name="optionTitle" value="{{BundleProduct.optionTitle1}}"/> |
| 60 | + <argument name="inputType" value="{{BundleProduct.optionInputType1}}"/> |
49 | 61 | </actionGroup>
|
50 |
| - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> |
51 |
| - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> |
52 |
| - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> |
53 |
| - |
54 |
| - <!--Create a bundle product with ancillary data--> |
| 62 | + <!-- Add the default attribute value for the bundle product creation page--> |
55 | 63 | <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProduct">
|
56 | 64 | <argument name="bundleProduct" value="BundleProduct"/>
|
57 | 65 | </actionGroup>
|
| 66 | + <!-- Save the bundle product --> |
| 67 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> |
58 | 68 |
|
59 |
| - <!--save the product/published by default--> |
60 |
| - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/> |
61 |
| - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/> |
| 69 | + <!-- Navigate to catalog product grid page --> |
62 | 70 | <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
|
63 | 71 |
|
64 |
| - <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownToReset"/> |
65 |
| - <click selector="{{AdminProductGridFilterSection.resetGridColumns}}" stepKey="resetProductGridColumns"/> |
66 |
| - <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownAfterReset"/> |
67 |
| - |
68 |
| - <!--Reload the catalog product page --> |
69 |
| - <reloadPage stepKey="reloadCatalogProductPage"/> |
70 |
| - <waitForPageLoad stepKey="waitForPageLoaded"/> |
| 72 | + <!-- Set product grid to default columns --> |
| 73 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultColumns"/> |
| 74 | + <!-- Open the column dropdown to reset the default columns from the catalog product grid --> |
| 75 | + <actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openToResetColumnsDropdown"/> |
| 76 | + <actionGroup ref="ResetAdminProductGridColumnsActionGroup" stepKey="resetAdminProductGridColumns"/> |
| 77 | + <actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdownAfterReset"/> |
71 | 78 |
|
72 |
| - <!--Add Special Price column--> |
| 79 | + <!-- Check the special price attribute column is present or not --> |
73 | 80 | <dontSeeElement selector="{{AdminProductGridSection.columnHeader('Special Price')}}" stepKey="dontSeeSpecialPriceColumn"/>
|
74 |
| - <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownSpecialPrice"/> |
75 |
| - <checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Special Price')}}" stepKey="showSpecialPriceColumn"/> |
76 |
| - <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownSpecialPrice"/> |
| 81 | + <!-- Open the column dropdown to add the special price from the catalog product grid --> |
| 82 | + <actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdownSpecialPrice"/> |
| 83 | + <actionGroup ref="CheckAdminProductGridColumnOptionActionGroup" stepKey="checkSpecialPriceOption"> |
| 84 | + <argument name="optionName" value="Special Price"/> |
| 85 | + </actionGroup> |
| 86 | + <actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="closeColumnsDropdownSpecialPrice"/> |
77 | 87 |
|
| 88 | + <!-- Search the created bundle product with sku --> |
78 | 89 | <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterBundleProductGridBySku">
|
79 | 90 | <argument name="sku" value="{{BundleProduct.sku}}"/>
|
80 | 91 | </actionGroup>
|
81 | 92 |
|
| 93 | + <!-- Check the special price column are present in catalog product grid --> |
82 | 94 | <seeElement selector="{{AdminProductGridSection.columnHeader('Special Price')}}" stepKey="seeSpecialPriceColumn"/>
|
| 95 | + <!-- Grab the special price value from the catalog product grid --> |
83 | 96 | <grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'Special Price')}}" stepKey="getSpecialPrice"/>
|
84 | 97 |
|
85 |
| - <assertStringContainsString stepKey="assertSpecialPricePercentageSymbol"> |
86 |
| - <expectedResult type="string">%</expectedResult> |
87 |
| - <actualResult type="variable">$getSpecialPrice</actualResult> |
88 |
| - </assertStringContainsString> |
| 98 | + <!-- Asserting with the special price value contains the percentage value --> |
| 99 | + <actionGroup ref="AdminAssertSpecialPriceAttributeValueOnProductGridPageActionGroup" stepKey="assertSpecialPricePercentageSymbol"> |
| 100 | + <argument name="expectedValue" value="90.00%"/> |
| 101 | + <argument name="actualValue" value="$getSpecialPrice"/> |
| 102 | + </actionGroup> |
89 | 103 | </test>
|
90 | 104 | </tests>
|
0 commit comments