|
20 | 20 | <before>
|
21 | 21 | <!-- Step1: Login as Admin -->
|
22 | 22 | <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
|
23 |
| - |
24 | 23 | <!-- Disable all sources and delete any pre-existing stocks -->
|
25 | 24 | <actionGroup ref="DisableAllSourcesActionGroup" stepKey="DisableAllSources"/>
|
26 | 25 | <actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock">
|
27 | 26 | <argument name="stockName" value="{{_defaultStock.name}}"/>
|
28 | 27 | <argument name="websiteName" value="{{_defaultWebsite.name}}"/>
|
29 | 28 | </actionGroup>
|
30 |
| - <magentoCLI stepKey="reindexBefore" command="indexer:reindex"/> |
31 |
| - <magentoCLI stepKey="flushCacheBefore" command="cache:flush"/> |
32 |
| - |
33 | 29 | <magentoCLI command="config:set cataloginventory/options/stock_threshold_qty 5" stepKey="setStockThresholdValueTo5"/>
|
34 |
| - <magentoCLI command="indexer:reindex" stepKey="reindex1"/> |
35 |
| - <magentoCLI command="cache:flush" stepKey="flushCache1"/> |
| 30 | + <magentoCLI stepKey="reindexPostSettingTheMainWebsiteToDefaultStock" command="indexer:reindex"/> |
| 31 | + <magentoCLI stepKey="flushCachePostSettingTheMainWebsiteToDefaultStock" command="cache:flush"/> |
36 | 32 | </before>
|
37 | 33 | <after>
|
38 | 34 | <deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
|
|
44 | 40 | <argument name="stockName" value="{{_defaultStock.name}}"/>
|
45 | 41 | <argument name="websiteName" value="{{_defaultWebsite.name}}"/>
|
46 | 42 | </actionGroup>
|
47 |
| - |
48 | 43 | <deleteData createDataKey="createStock" stepKey="deleteStock"/>
|
49 |
| - <magentoCLI stepKey="reindexAfter" command="indexer:reindex"/> |
50 |
| - <magentoCLI stepKey="flushCacheAfter" command="cache:flush"/> |
51 | 44 | <magentoCLI command="config:set {{CatalogInventoryOptionsOnlyXleftThreshold.path}} {{CatalogInventoryOptionsOnlyXleftThreshold.value}}" stepKey="removedStockThresholdQty"/>
|
| 45 | + <magentoCLI stepKey="reindexAfterDeletingTheStock" command="indexer:reindex"/> |
| 46 | + <magentoCLI stepKey="flushCacheAfterDeletingTheStock" command="cache:flush"/> |
52 | 47 | </after>
|
53 | 48 |
|
54 | 49 | <!-- Step2: Create the Subcategory -->
|
55 | 50 | <createData entity="_defaultCategory" stepKey="createCategory"/>
|
56 |
| - |
57 | 51 | <!-- Step3: Create the Source and the Stock -->
|
58 | 52 | <createData entity="BasicMsiStockWithMainWebsite1" stepKey="createStock"/>
|
59 | 53 | <createData entity="FullSource1" stepKey="createSource"/>
|
60 | 54 | <createData entity="SourceStockLinked1" stepKey="stockSourceLink">
|
61 | 55 | <requiredEntity createDataKey="createSource"/>
|
62 | 56 | <requiredEntity createDataKey="createStock"/>
|
63 | 57 | </createData>
|
64 |
| - |
65 |
| - <!-- Step8: Create the Simple Product --> |
| 58 | + <!-- Create and Update the product as per the test case --> |
66 | 59 | <createData entity="ApiSimpleProduct" stepKey="createProduct">
|
67 | 60 | <requiredEntity createDataKey="createCategory"/>
|
68 | 61 | </createData>
|
69 |
| - |
70 |
| - <!-- Update the product as per the test case --> |
71 | 62 | <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForCreatedProduct">
|
72 | 63 | <argument name="product" value="$$createProduct$$"/>
|
73 | 64 | </actionGroup>
|
74 | 65 | <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
|
75 | 66 | <argument name="product" value="$$createProduct$$"/>
|
76 | 67 | </actionGroup>
|
77 |
| - |
78 | 68 | <fillField userInput="10" selector="{{AdminProductFormSection.productPrice}}" stepKey="updatePriceTo10"/>
|
79 | 69 | <fillField userInput="1" selector="{{AdminProductFormSection.productWeight}}" stepKey="updateWeight"/>
|
80 | 70 | <conditionalClick selector="{{AdminProductFormConfigurationsSection.unAssignSource('Default Source')}}" dependentSelector="{{AdminProductFormConfigurationsSection.unAssignSource('Default Source')}}" visible="true" stepKey="unAssignDefaultSource"/>
|
|
88 | 78 | <fillField userInput="2" selector="{{AdminProductFormSection.assignedSourcesQty}}" stepKey="setQtyForAssignedSources"/>
|
89 | 79 | <click selector="{{AdminProductFormSection.save}}" stepKey="clickOnSaveButton"/>
|
90 | 80 | <see userInput="You saved the product." stepKey="saveSuccessfulForManageStockAsYes"/>
|
91 |
| - |
92 |
| - <magentoCLI stepKey="reindexForAssignedSources" command="indexer:reindex"/> |
93 |
| - <magentoCLI stepKey="flushCacheForAssignedSources" command="cache:flush"/> |
94 |
| - |
| 81 | + <magentoCLI stepKey="reindexPostAssigningTheSource" command="indexer:reindex"/> |
| 82 | + <magentoCLI stepKey="flushCachePostAssigningTheSource" command="cache:flush"/> |
95 | 83 | <!-- Verify with Manage Stock set as Yes for the product -->
|
96 | 84 | <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
|
97 | 85 | <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
|
98 | 86 | </actionGroup>
|
99 | 87 | <see selector=".availability.only" userInput="Only 2 left" stepKey="seeCurrentProductQuantity2"/>
|
100 |
| - |
101 | 88 | <!-- Update the Manage Stock as No for the product -->
|
102 | 89 | <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForCreatedProductForManageStockAsNo">
|
103 | 90 | <argument name="product" value="$$createProduct$$"/>
|
|
115 | 102 | <see userInput="You saved the product." stepKey="saveSuccessfulForManageStockAsNo"/>
|
116 | 103 | <magentoCLI stepKey="reindexForSettingManageStockAsNo" command="indexer:reindex"/>
|
117 | 104 | <magentoCLI stepKey="flushCacheForSettingManageStockAsNo" command="cache:flush"/>
|
118 |
| - |
119 | 105 | <!-- Verify with Manage Stock set as No for the product -->
|
120 | 106 | <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPageOnStorefrontForManageStockAsNo">
|
121 | 107 | <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
|
122 | 108 | </actionGroup>
|
123 | 109 | <dontSee selector=".availability.only" userInput="Only 2 left" stepKey="ShouldNotSeeCurrentProductQuantity"/>
|
| 110 | + |
124 | 111 | </test>
|
125 | 112 | </tests>
|
0 commit comments