Skip to content

Commit 813f911

Browse files
committed
MAGETWO-80498: Implement Step 7 of B2C Admin scenario "Admin uses grid"
1 parent efc42a8 commit 813f911

25 files changed

+564
-57
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Test/EndToEndB2CAdminTest.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1010
<test name="EndToEndB2CAdminTest">
11+
<after>
12+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProduct">
13+
<argument name="product" value="BundleProduct"/>
14+
</actionGroup>
15+
</after>
16+
1117
<!--Create Bundle Product-->
1218
<amOnPage url="{{AdminProductIndexPage}}" stepKey="visitAdminProductPageBundle" after="viewVirtualProductInGrid"/>
1319
<waitForPageLoad stepKey="waitForProductPageLoadBundle" after="visitAdminProductPageBundle"/>
@@ -35,9 +41,6 @@
3541
<argument name="product" value="BundleProduct"/>
3642
</actionGroup>
3743

38-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
39-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProduct" after="deleteVirtualProduct">
40-
<argument name="product" value="BundleProduct"/>
41-
</actionGroup>
44+
4245
</test>
4346
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/AdminProductActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@
5959
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
6060
<attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile"/>
6161
<waitForAjaxLoad stepKey="waitForAjaxUpload"/>
62+
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
6263
</actionGroup>
6364
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
1111
<!--Reset the product grid to the default view-->
1212
<actionGroup name="resetProductGridToDefaultView">
13+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
1314
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
1415
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
1516
<waitForPageLoad stepKey="waitForProductGridLoad"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="AdminProductGridSection">
1212
<element name="loadingMask" type="text" selector=".admin__data-grid-loading-mask[data-component*='product_listing']"/>
1313
<element name="columnHeader" type="button" selector="//div[@data-role='grid-wrapper']//table[contains(@class, 'data-grid')]/thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/>
14+
<element name="column" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true"/>
1415
<element name="productGridElement1" type="input" selector="#addselector" />
1516
<element name="productGridElement2" type="text" selector="#addselector" />
1617
<element name="productGridRows" type="text" selector="table.data-grid tr.data-row"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/EndToEndB2CAdminTest.xml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,22 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-87014"/>
1919
</annotations>
20-
<before>
21-
<!--Login to Admin Area-->
22-
<actionGroup ref="LoginActionGroup" stepKey="loginToAdminArea"/>
23-
</before>
2420
<after>
25-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
21+
<!--Clean up categories-->
22+
<actionGroup ref="DeleteCategory" stepKey="cleanSimpleSubCategory">
23+
<argument name="categoryEntity" value="SimpleSubCategory"/>
24+
</actionGroup>
25+
26+
<!--Clean up products-->
27+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct">
28+
<argument name="product" value="SimpleProduct"/>
29+
</actionGroup>
30+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct">
31+
<argument name="product" value="VirtualProduct"/>
32+
</actionGroup>
2633
</after>
34+
<!--Login to Admin Area-->
35+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/>
2736

2837
<!--Admin creates product-->
2938
<!--Create Simple Product-->
@@ -118,9 +127,9 @@
118127
<!--Filter by status-->
119128
<actionGroup ref="filterProductGridByEnabledStatus" stepKey="filterGridByEnabledProducts"/>
120129
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,20]" stepKey="seeEnabledProductsNotEmpty"/>
121-
<see selector="{{AdminProductGridSection.productGridCell('1', 'Status')}}" userInput="Enabled" stepKey="seeFirstRowIsEnabledProduct"/>
130+
<see selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="seeOnlyEnabledProducts"/>
122131
<actionGroup ref="filterProductGridByDisabledStatus" stepKey="filterGridByDisabledProducts"/>
123-
<seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="0" stepKey="seeDisabledProductsIsEmpty"/>
132+
<dontSee selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="dontSeeEnabledProducts"/>
124133

125134
<!--Sorting works (By Price, by ID)-->
126135
<!--By Price-->
@@ -157,7 +166,7 @@
157166
<click selector="{{AdminProductGridFilterSection.resetGridColumns}}" stepKey="resetProductGridColumns"/>
158167
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownAfterReset"/>
159168
<!--Remove Price column-->
160-
<seeElement selector="{{AdminProductGridSection.columnHeader('Type')}}" stepKey="seeProductPriceColumn"/>
169+
<seeElement selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="seeProductPriceColumn"/>
161170
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdown"/>
162171
<uncheckOption selector="{{AdminProductGridFilterSection.viewColumnOption('Price')}}" stepKey="hidePriceColumn"/>
163172
<dontSeeElement selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="dontSeeProductPriceColumn"/>
@@ -166,8 +175,8 @@
166175
<dontSeeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="dontSeeWeightColumn"/>
167176
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownWeight"/>
168177
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Weight')}}" stepKey="showWeightColumn"/>
169-
<seeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="seeWeightColumn"/>
170178
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownWeight"/>
179+
<seeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="seeWeightColumn"/>
171180
<actionGroup ref="filterProductGridBySku" stepKey="filterProductGridToCheckWeightColumn">
172181
<argument name="product" value="SimpleProduct"/>
173182
</actionGroup>
@@ -212,20 +221,5 @@
212221
<actionGroup ref="DeleteCategory" stepKey="deleteCategory">
213222
<argument name="categoryEntity" value="_defaultCategory"/>
214223
</actionGroup>
215-
216-
<!--Clean up categories-->
217-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
218-
<actionGroup ref="DeleteCategory" stepKey="cleanSimpleSubCategory">
219-
<argument name="categoryEntity" value="SimpleSubCategory"/>
220-
</actionGroup>
221-
222-
<!--Clean up products-->
223-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
224-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct">
225-
<argument name="product" value="SimpleProduct"/>
226-
</actionGroup>
227-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct">
228-
<argument name="product" value="VirtualProduct"/>
229-
</actionGroup>
230224
</test>
231225
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Test/EndToEndB2CAdminTest.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1010
<test name="EndToEndB2CAdminTest">
11+
<after>
12+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct">
13+
<argument name="product" value="BaseConfigurableProduct"/>
14+
</actionGroup>
15+
</after>
16+
1117
<!--Create configurable product-->
1218
<amOnPage url="{{AdminProductIndexPage}}" stepKey="visitAdminProductPageConfigurable" after="seeSimpleProductInGrid"/>
1319
<waitForPageLoad stepKey="waitForProductPageLoadConfigurable" after="visitAdminProductPageConfigurable"/>
@@ -66,10 +72,5 @@
6672
<actionGroup ref="viewConfigurableProductInAdminGrid" stepKey="viewConfigurableProductInGrid" after="seeConfigurableSaveConfirmation">
6773
<argument name="product" value="BaseConfigurableProduct"/>
6874
</actionGroup>
69-
70-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
71-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct">
72-
<argument name="product" value="BaseConfigurableProduct"/>
73-
</actionGroup>
7475
</test>
7576
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Data/CustomerData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<data key="email" unique="prefix">John.Doe@example.com</data>
4040
<data key="firstname">John</data>
4141
<data key="lastname">Doe</data>
42+
<data key="fullname">John Doe</data>
4243
<data key="password">pwdTest123!</data>
4344
<data key="store_id">0</data>
4445
<data key="website_id">0</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Downloadable/Test/EndToEndB2CAdminTest.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1010
<test name="EndToEndB2CAdminTest">
11+
<after>
12+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteDownloadableProduct">
13+
<argument name="product" value="DownloadableProduct"/>
14+
</actionGroup>
15+
</after>
16+
1117
<!--Create Downloadable Product-->
1218
<amOnPage url="{{AdminProductIndexPage}}" stepKey="visitProductPageDownloadable" after="viewBundleProductInGrid"/>
1319
<waitForPageLoad stepKey="waitForProductPageLoadDownloadable" after="visitProductPageDownloadable"/>
@@ -49,10 +55,5 @@
4955
<actionGroup ref="viewProductInAdminGrid" stepKey="viewDownloadableProductInGrid" after="saveDownloadableProduct">
5056
<argument name="product" value="DownloadableProduct"/>
5157
</actionGroup>
52-
53-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
54-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteDownloadableProduct">
55-
<argument name="product" value="DownloadableProduct"/>
56-
</actionGroup>
5758
</test>
5859
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/GroupedProduct/Test/EndToEndB2CAdminTest.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1010
<test name="EndToEndB2CAdminTest">
11+
<after>
12+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteGroupedProduct">
13+
<argument name="product" value="GroupedProduct"/>
14+
</actionGroup>
15+
</after>
16+
1117
<!--Create Grouped Product-->
1218
<amOnPage url="{{AdminProductIndexPage}}" stepKey="visitAdminProductPageGrouped" after="viewConfigurableProductInGrid"/>
1319
<waitForPageLoad stepKey="waitForProductPageLoadGrouped" after="visitAdminProductPageGrouped"/>
@@ -32,10 +38,5 @@
3238
<actionGroup ref="viewGroupedProductInAdminGrid" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct">
3339
<argument name="product" value="GroupedProduct"/>
3440
</actionGroup>
35-
36-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
37-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteGroupedProduct">
38-
<argument name="product" value="GroupedProduct"/>
39-
</actionGroup>
4041
</test>
4142
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Sales/ActionGroup/AdminOrderGridActionGroup.xml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,44 @@
1919
</arguments>
2020
<amOnPage url="{{AdminOrdersPage}}" stepKey="navigateToOrderGridPage"/>
2121
<waitForPageLoad stepKey="waitForOrderGridLoad"/>
22-
<conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/>
23-
<click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/>
24-
<fillField selector="{{AdminOrdersGridSection.billToNameFilter}}" userInput="{{customer.lastname}}" stepKey="fillBillToNameFilter"/>
25-
<click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
22+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/>
23+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/>
24+
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/>
25+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
26+
</actionGroup>
27+
28+
<!--Filter order grid by order total range-->
29+
<actionGroup name="filterOrderGridByBaseTotalRange">
30+
<arguments>
31+
<argument name="from"/>
32+
<argument name="to"/>
33+
</arguments>
34+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/>
35+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/>
36+
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/>
37+
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/>
38+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/>
39+
</actionGroup>
40+
41+
<actionGroup name="filterOrderGridByPurchaseDate">
42+
<arguments>
43+
<argument name="from"/>
44+
<argument name="to"/>
45+
</arguments>
46+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/>
47+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/>
48+
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/>
49+
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/>
50+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/>
2651
</actionGroup>
2752

28-
<!--Reset order grid to default view-->
29-
<actionGroup name="resetOrderGridToDefault">
30-
<seeInCurrentUrl url="{{AdminOrdersPage}}" stepKey="onOrderGridPage"/>
31-
<click selector="{{AdminOrdersGridSection.viewBookmarkDropdown}}" stepKey="openViewBookmarkDropdown"/>
32-
<click selector="{{AdminOrdersGridSection.viewBookmark('Default View')}}" stepKey="selectDefaultView"/>
33-
<see selector="{{AdminOrdersGridSection.viewBookmarkDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
53+
<actionGroup name="filterOrderGridByStatus">
54+
<arguments>
55+
<argument name="status"/>
56+
</arguments>
57+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/>
58+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/>
59+
<selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/>
60+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/>
3461
</actionGroup>
3562
</actionGroups>

0 commit comments

Comments
 (0)