Skip to content

Commit 33b92f6

Browse files
author
Stanislav Idolov
authored
Merge pull request #2196 from magento-borg/MAGETWO-75412-b2c-admin
[borg] MAGETWO-75412: End-to-end automation: B2C admin
2 parents 152b5ee + 9447e9f commit 33b92f6

File tree

109 files changed

+2287
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2287
-163
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminConfirmationModalSection">
12+
<element name="title" type="text" selector="aside.confirm .modal-title"/>
13+
<element name="message" type="text" selector="aside.confirm .modal-content"/>
14+
<element name="cancel" type="button" selector="aside.confirm .modal-footer button.action-dismiss" timeout="30"/>
15+
<element name="ok" type="button" selector="aside.confirm .modal-footer button.action-accept" timeout="60"/>
16+
</section>
17+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Backend/Section/AdminMessagesSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../../../../magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminMessagesSection">
12-
<element name="test" type="input" selector=".test"/>
12+
<element name="success" type="text" selector="#messages div.message-success"/>
1313
</section>
1414
</sections>

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1010
<test name="EndToEndB2CAdminTest">
1111
<!--Create Bundle Product-->
12-
<amOnPage url="{{AdminProductIndexPage}}" stepKey="visitAdminProductPageBundle" after="viewVirtualProductInGrid"/>
12+
<amOnPage url="{{AdminProductIndexPage}}" stepKey="visitAdminProductPageBundle" after="seeSimpleProductInGrid"/>
1313
<waitForPageLoad stepKey="waitForProductPageLoadBundle" after="visitAdminProductPageBundle"/>
1414
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct" after="waitForProductPageLoadBundle">
1515
<argument name="product" value="BundleProduct"/>
@@ -32,11 +32,12 @@
3232
<fillField selector="{{AdminProductFormBundleSection.firstProductQuantity}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty" after="clickAddSelectedBundleProducts"/>
3333
<actionGroup ref="saveProductForm" stepKey="saveBundleProduct" after="fillProductDefaultQty"/>
3434
<actionGroup ref="viewBundleProductInAdminGrid" stepKey="viewBundleProductInGrid" after="saveBundleProduct">
35-
<argument name="product" value="BundleProduct"/>
35+
<argument name="product" value="BundleProduct"/>
3636
</actionGroup>
3737

38-
<!--TODO - Move to 'after' block when MQE-732 is fixed-->
39-
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProduct" after="deleteVirtualProduct">
38+
<!--@TODO Move cleanup to "after" when MQE-830 is resolved-->
39+
<comment userInput="Clean up bundle product" stepKey="cleanUpBundleProduct" after="deleteSimpleProduct"/>
40+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProduct" after="cleanUpBundleProduct">
4041
<argument name="product" value="BundleProduct"/>
4142
</actionGroup>
4243
</test>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
},
1313
"require": {
1414
"magento/magento2-functional-testing-framework": "1.0.0",
15+
"magento/magento2-functional-test-module-catalog": "100.0.0-dev",
1516
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
1617
},
1718
"suggest": {
1819
"magento/magento2-functional-test-module-backend": "100.0.0-dev",
19-
"magento/magento2-functional-test-module-catalog": "100.0.0-dev",
2020
"magento/magento2-functional-test-module-catalog-inventory": "100.0.0-dev",
2121
"magento/magento2-functional-test-module-catalog-rule": "100.0.0-dev",
2222
"magento/magento2-functional-test-module-checkout": "100.0.0-dev",

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<arguments>
1414
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
1515
</arguments>
16-
1716
<seeInCurrentUrl url="{{AdminCategoryPage}}" stepKey="seeOnCategoryPage"/>
1817
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
1918
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/>
@@ -31,7 +30,6 @@
3130
<arguments>
3231
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
3332
</arguments>
34-
3533
<amOnPage url="/{{categoryEntity.name_lwr}}.html" stepKey="goToCategoryFrontPage"/>
3634
<waitForPageLoad stepKey="waitForPageLoad1"/>
3735
<see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{categoryEntity.name_lwr}}" stepKey="assertCategoryOnStorefront"/>
@@ -43,13 +41,14 @@
4341
<arguments>
4442
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
4543
</arguments>
46-
<seeInCurrentUrl url="{{AdminCategoryPage}}" stepKey="seeOnCategoryPage"/>
44+
<amOnPage url="{{AdminCategoryPage}}" stepKey="goToCategoryPage"/>
45+
<waitForPageLoad time="60" stepKey="waitForCategoryPageLoad"/>
4746
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="clickCategoryLink"/>
4847
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/>
4948
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/>
5049
<see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/>
5150
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/>
52-
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
51+
<waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/>
5352
<see selector="You deleted the category." stepKey="seeDeleteSuccess"/>
5453
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/>
5554
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/>
@@ -70,7 +69,7 @@
7069
<argument name="Category"/>
7170
</arguments>
7271
<amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/>
73-
<waitForPageLoad stepKey="waitForPageLoad2"/>
72+
<waitForPageLoad stepKey="waitForPageLoad1"/>
7473
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(Category.Name)}}" stepKey="navigateToCreatedCategory" />
7574
<waitForPageLoad stepKey="waitForPageLoad2"/>
7675
<waitForLoadingMaskToDisappear stepKey="waitForSpinner" />

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@
5757
<argument name="image" defaultValue="ImageUpload"/>
5858
</arguments>
5959
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
60+
<waitForPageLoad time="30" stepKey="waitForPageRefresh"/>
61+
<waitForElementVisible selector="{{AdminProductImagesSection.imageUploadButton}}" stepKey="seeImageSectionIsReady"/>
6062
<attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile"/>
61-
<waitForAjaxLoad stepKey="waitForAjaxUpload"/>
63+
<waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/>
64+
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
6265
</actionGroup>
6366

6467
<!--Fill fields for simple product in a category in Admin-->

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

Lines changed: 13 additions & 2 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"/>
@@ -71,6 +72,16 @@
7172
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
7273
</actionGroup>
7374

75+
<!--Search product grid with keyword search-->
76+
<actionGroup name="searchProductGridByKeyword">
77+
<arguments>
78+
<argument name="keyword"/>
79+
</arguments>
80+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
81+
<fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/>
82+
<click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/>
83+
</actionGroup>
84+
7485
<!--Filter product grid by name, sku, and type; and see expected product-->
7586
<actionGroup name="viewProductInAdminGrid">
7687
<arguments>
@@ -96,7 +107,7 @@
96107
</arguments>
97108
<!--TODO use other action group for filtering grid when MQE-539 is implemented -->
98109
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
99-
<waitForPageLoad stepKey="waitForPageLoadInitial"/>
110+
<waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/>
100111
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
101112
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
102113
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
@@ -106,7 +117,7 @@
106117
<click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/>
107118
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
108119
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/>
109-
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForConfirmModal"/>
120+
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
110121
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
111122
</actionGroup>
112123

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<element name="title" type="text" selector=".modal-popup.confirm h1.modal-title"/>
1313
<element name="message" type="text" selector=".modal-popup.confirm div.modal-content"/>
1414
<element name="cancel" type="button" selector=".modal-popup.confirm button.action-dismiss"/>
15-
<element name="ok" type="button" selector=".modal-popup.confirm button.action-accept" timeout="30"/>
15+
<element name="ok" type="button" selector=".modal-popup.confirm button.action-accept" timeout="60"/>
1616
</section>
1717
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
<element name="priceFilterTo" type="input" selector="input.admin__control-text[name='price[to]']"/>
2929
<element name="typeFilter" type="select" selector="select.admin__control-select[name='type_id']"/>
3030
<element name="statusFilter" type="select" selector="select.admin__control-select[name='status']"/>
31+
<element name="keywordSearch" type="input" selector="input#fulltext"/>
32+
<element name="keywordSearchButton" type="button" selector=".data-grid-search-control-wrap button.action-submit" timeout="30"/>
3133
</section>
3234
</sections>

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"/>

0 commit comments

Comments
 (0)