forked from mage-os/mageos-magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEndToEndB2CAdminTest.xml
More file actions
268 lines (256 loc) · 18.9 KB
/
EndToEndB2CAdminTest.xml
File metadata and controls
268 lines (256 loc) · 18.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?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="EndToEndB2CAdminTest">
<annotations>
<features value="End to End scenarios"/>
<stories value="B2C admin - MAGETWO-75412"/>
<group value="e2e"/>
<title value="Pass End to End B2C Admin scenario"/>
<description value="Admin creates products, creates and manages categories, creates promotions, creates an order, processes an order, processes a return, uses admin grids"/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-87014"/>
<group value="pr_exclude"/>
</annotations>
<before>
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
</after>
<!--Login to Admin Area-->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/>
<!--Admin creates product-->
<!--Create Simple Product-->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageSimple"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<actionGroup ref="CheckRequiredFieldsInProductFormActionGroup" stepKey="checkRequiredFieldsProductSimple"/>
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillSimpleProductMain">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple">
<argument name="image" value="ProductImage"/>
</actionGroup>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/>
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackToGridSimple"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<grabAttributeFrom selector="{{AdminProductGridSection.productThumbnail('1')}}" userInput="src" stepKey="getSimpleProductThumbnail"/>
<assertNotRegExp stepKey="simpleThumbnailIsNotDefault">
<actualResult type="const">$getSimpleProductThumbnail</actualResult>
<expectedResult type="const">'/placeholder\/thumbnail\.jpg/'</expectedResult>
</assertNotRegExp>
<actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="seeSimpleProductInGrid">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<!--Create Virtual Product-->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageVirtual"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateVirtualProduct">
<argument name="product" value="VirtualProduct"/>
</actionGroup>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{VirtualProduct.sku}}" stepKey="fillVirtualName"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{VirtualProduct.name}}" stepKey="fillVirtualSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{VirtualProduct.price}}" stepKey="fillVirtualPrice"/>
<actionGroup ref="AdminFillProductQtyOnProductFormActionGroup" stepKey="fillVirtualQty">
<argument name="productQty" value="{{VirtualProduct.quantity}}"/>
</actionGroup>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveVirtualProduct"/>
<actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewVirtualProductInGrid">
<argument name="product" value="VirtualProduct"/>
</actionGroup>
<!--Admin uses product grid-->
<!--Start with default view-->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageGrid"/>
<!--Search by keyword-->
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
<actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="useKeywordSearchSimpleProduct">
<argument name="keyword" value="SimpleProduct.name"/>
</actionGroup>
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnlyOneProductInGrid"/>
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeOnlySimpleProductInGrid">
<argument name="row" value="1"/>
<argument name="column" value="Name"/>
<argument name="value" value="{{SimpleProduct.name}}"/>
</actionGroup>
<!--Paging works-->
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultPagination"/>
<comment userInput="Admin uses paging on product grid" stepKey="usePagingProductGridComment"/>
<click selector="{{AdminProductGridPaginationSection.perPageDropdown}}" stepKey="clickProductPerPageDropdown"/>
<click selector="{{AdminProductGridPaginationSection.perPageOption('50')}}" stepKey="selectProductsPerPage"/>
<waitForLoadingMaskToDisappear stepKey="waitForProductGridLoad50PerPage"/>
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[5,50]" stepKey="see50ProductsInGrid"/>
<click selector="{{AdminProductGridPaginationSection.perPageDropdown}}" stepKey="clickProductPerPageDropdownCustom"/>
<click selector="{{AdminProductGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/>
<fillField selector="{{AdminProductGridPaginationSection.perPageInput}}" userInput="5" stepKey="fillCustomPerPage"/>
<click selector="{{AdminProductGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/>
<waitForPageLoad stepKey="waitForPageRefreshCustomPerPage"/>
<seeInField selector="{{AdminProductGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstProductPage"/>
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="5" stepKey="seeProductsOnFirstPage"/>
<click selector="{{AdminProductGridPaginationSection.nextPage}}" stepKey="clickNextProductPage"/>
<seeInField selector="{{AdminProductGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondProductPage"/>
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,5]" stepKey="seeProductsOnSecondPage"/>
<!--Filtering works (by Name, By Price, by Status)-->
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultFiltering"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridByGroupedSku">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOneMatchingSkuInProductGrid"/>
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductInFilteredGridSku">
<argument name="row" value="1"/>
<argument name="column" value="SKU"/>
<argument name="value" value="{{GroupedProduct.sku}}"/>
</actionGroup>
<!--Filter by price-->
<actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPrice">
<argument name="filter" value="PriceFilterRange"/>
</actionGroup>
<click selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="clickPriceHeaderToSortAscForFilter"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" stepKey="getMinimumPriceInGrid"/>
<click selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="clickPriceHeaderToSortDescForFilter"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" stepKey="getMaximumPriceInGrid"/>
<assertRegExp stepKey="assertMinimumPriceIsCorrect">
<actualResult type="const">$getMinimumPriceInGrid</actualResult>
<expectedResult type="const">'/\$[0-9]{2}\.[0-9]{2}/'</expectedResult>
</assertRegExp>
<assertRegExp stepKey="assertMaximumPriceIsCorrect">
<actualResult type="const">$getMaximumPriceInGrid</actualResult>
<expectedResult type="const">'/\$[0-9]{2}\.[0-9]{2}/'</expectedResult>
</assertRegExp>
<assertLessThan stepKey="checkPriceSortCorrect">
<actualResult type="const">$getMinimumPriceInGrid</actualResult>
<expectedResult type="const">$getMaximumPriceInGrid</expectedResult>
</assertLessThan>
<!--Filter by status-->
<actionGroup ref="FilterProductGridByEnabledStatusActionGroup" stepKey="filterGridByEnabledProducts"/>
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,20]" stepKey="seeEnabledProductsNotEmpty"/>
<see selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="seeOnlyEnabledProducts"/>
<actionGroup ref="FilterProductGridByDisabledStatusActionGroup" stepKey="filterGridByDisabledProducts"/>
<dontSee selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="dontSeeEnabledProducts"/>
<!--Sorting works (By Price, by ID)-->
<!--By Price-->
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultSortingPrice"/>
<!--Filter by price so grid contains prices that we can compare correctly-->
<actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPriceForCompare">
<argument name="filter" value="PriceFilterRange"/>
</actionGroup>
<!--Sort Ascending-->
<click selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="clickPriceHeaderToSortAsc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" stepKey="getFirstPriceSortAsc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'Price')}}" stepKey="getSecondPriceSortAsc"/>
<assertLessThanOrEqual stepKey="checkPriceAscSortCorrect">
<actualResult type="const">$getFirstPriceSortAsc</actualResult>
<expectedResult type="const">$getSecondPriceSortAsc</expectedResult>
</assertLessThanOrEqual>
<!--Sort Descending-->
<click selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="clickPriceHeaderToSortDesc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" stepKey="getFirstPriceSortDesc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'Price')}}" stepKey="getSecondPriceSortDesc"/>
<assertGreaterThanOrEqual stepKey="checkPriceDescSortCorrect">
<actualResult type="const">$getFirstPriceSortDesc</actualResult>
<expectedResult type="const">$getSecondPriceSortDesc</expectedResult>
</assertGreaterThanOrEqual>
<!--By Product ID-->
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultSortingId"/>
<!--Sort Ascending-->
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'ID')}}" stepKey="getFirstProductIdSortAsc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'ID')}}" stepKey="getSecondProductIdSortAsc"/>
<assertLessThan stepKey="checkProductIdAscSortCorrect">
<actualResult type="const">$getFirstProductIdSortAsc</actualResult>
<expectedResult type="const">$getSecondProductIdSortAsc</expectedResult>
</assertLessThan>
<!--Sort Descending-->
<click selector="{{AdminProductGridSection.columnHeader('ID')}}" stepKey="clickIdHeaderToSortDesc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'ID')}}" stepKey="getFirstProductIdSortDesc"/>
<grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'ID')}}" stepKey="getSecondProductIdSortDesc"/>
<assertGreaterThan stepKey="checkProductIdDescSortCorrect">
<actualResult type="const">$getFirstProductIdSortDesc</actualResult>
<expectedResult type="const">$getSecondProductIdSortDesc</expectedResult>
</assertGreaterThan>
<!--Adding column works-->
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultColumns"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownToReset"/>
<click selector="{{AdminProductGridFilterSection.resetGridColumns}}" stepKey="resetProductGridColumns"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownAfterReset"/>
<!--Remove Price column-->
<seeElement selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="seeProductPriceColumn"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdown"/>
<uncheckOption selector="{{AdminProductGridFilterSection.viewColumnOption('Price')}}" stepKey="hidePriceColumn"/>
<dontSeeElement selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="dontSeeProductPriceColumn"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdown"/>
<!--Add Weight column-->
<dontSeeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="dontSeeWeightColumn"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownWeight"/>
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Weight')}}" stepKey="showWeightColumn"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownWeight"/>
<seeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="seeWeightColumn"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridToCheckWeightColumn">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeCorrectProductWeightInGrid">
<argument name="row" value="1"/>
<argument name="column" value="Weight"/>
<argument name="value" value="{{SimpleProduct.weight}}"/>
</actionGroup>
<!--END Admin uses product grid-->
<!--Admin creates category-->
<comment userInput="Admin creates category." stepKey="adminCreatesCategoryComment" before="navigateToCategoryPage"/>
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage"/>
<!--Create category under Default Category-->
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="clickDefaultCategory"/>
<actionGroup ref="CheckCategoryNameIsRequiredFieldActionGroup" stepKey="checkCategoryNameIsRequired"/>
<actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory">
<argument name="categoryEntity" value="_defaultCategory"/>
</actionGroup>
<!--Create category under newly created category-->
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="clickCreatedCategoryInTree"/>
<actionGroup ref="CreateCategoryActionGroup" stepKey="createSubCategory">
<argument name="categoryEntity" value="SimpleSubCategory"/>
</actionGroup>
<!--Admin moves category-->
<comment userInput="Admin moves category." stepKey="adminMovesCategoryComment" before="onCategoryPageToMoveCategory"/>
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryPageToMoveCategory"/>
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandTree"/>
<dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}"
selector2="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}"
stepKey="dragAndDropCategory"/>
<waitForPageLoad time="30" stepKey="waitForMoveConfirmation"/>
<see selector="{{AdminCategoryModalSection.title}}" userInput="Warning Message" stepKey="seeMoveConfirmationModal"/>
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkConfirmMove"/>
<waitForPageLoad time="30" stepKey="waitForMove"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeCategoryMoveSuccessMessage"/>
<seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTreeUnderRoot(SimpleSubCategory.name)}}" stepKey="seeSubcategoryIsUnderDefault"/>
<!--Admin deletes category-->
<comment userInput="Admin deletes category" stepKey="deleteCategoryComment"/>
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryPageToDeleteCategory"/>
<actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="cleanSimpleSubCategory">
<argument name="categoryName" value="SimpleSubCategory"/>
</actionGroup>
<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory">
<argument name="categoryEntity" value="_defaultCategory"/>
</actionGroup>
<!--@TODO Move cleanup to "after" when MQE-830 is resolved-->
<!--Clean up categories-->
<comment userInput="Clean up categories" stepKey="cleanupCategoriesComment"/>
<!--Clean up products-->
<comment userInput="Clean up simple product" stepKey="cleanUpSimpleProduct"/>
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<comment userInput="Clean up virtual product" stepKey="cleanUpVirtualProduct"/>
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct">
<argument name="product" value="VirtualProduct"/>
</actionGroup>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/>
</test>
</tests>