Skip to content

Commit bdf9269

Browse files
authored
Merge pull request #2280 from magento-pangolin/MQE-727-MSI-PR
[pangolin] MQE-727: [MSI] Automate MSI Test Cases 1
2 parents fc5dd67 + d7d0dde commit bdf9269

8 files changed

+108
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
<section name="AdminProductFormActionSection">
1212
<element name="backButton" type="button" selector="#back" timeout="30"/>
1313
<element name="saveButton" type="button" selector="#save-button" timeout="30"/>
14+
<element name="saveArrow" type="button" selector="button[data-ui-id='save-button-dropdown']" timeout="10"/>
15+
<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>
1416
</section>
1517
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
1313
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
1414
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
15+
<element name="productWeight" type="input" selector=".admin__field[data-index=weight] input"/>
1516
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
1617
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
1718
<element name="productStockStatus" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]']"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Ui/ActionGroup/AdminDataGridFilterActionGroup.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<arguments>
1414
<argument name="keyword"/>
1515
</arguments>
16+
1617
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
18+
<waitForPageLoad stepKey="waitForPageLoad" time="5"/>
19+
1720
<fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/>
1821
<click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/>
1922
</actionGroup>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Ui/ActionGroup/AdminDataGridPaginationActionGroup.xml

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

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11-
1211
<actionGroup name="adminDataGridSelectPerPage">
1312
<arguments>
1413
<argument name="perPage"/>
@@ -28,5 +27,4 @@
2827
<click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/>
2928
<waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/>
3029
</actionGroup>
31-
3230
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminGridFilterSearchResultsByInput">
12+
<arguments>
13+
<argument name="selector"/>
14+
<argument name="value"/>
15+
</arguments>
16+
17+
<conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .admin__data-grid-filters-current._show" visible="true" stepKey="clearTheFiltersIfPresent"/>
18+
<waitForPageLoad stepKey="waitForPageLoad" time="5"/>
19+
20+
<click selector="{{AdminGridFilterControls.filters}}" stepKey="clickOnFilters1"/>
21+
<fillField userInput="{{value}}" selector="{{selector}}" stepKey="fillCodeField2"/>
22+
<click selector="{{AdminGridFilterControls.applyFilters}}" stepKey="clickOnApplyFilters1"/>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFormSaveAndClose">
12+
<click selector="{{AdminProductFormActionSection.saveArrow}}" stepKey="openSaveDropDown"/>
13+
<click selector="{{AdminProductFormActionSection.saveAndClose}}" stepKey="clickOnSaveAndClose"/>
14+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
15+
</actionGroup>
16+
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Ui/Section/AdminDataGridHeaderSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminDataGridHeaderSection">
1212
<!--Search by keyword element-->
13-
<element name="search" type="input" selector="#fulltext"/>
13+
<element name="search" type="input" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] input[placeholder='Search by keyword']"/>
1414
<element name="submitSearch" type="button" selector=".data-grid-search-control-wrap > button.action-submit" timeout="30"/>
1515
<!--Filters-->
1616
<element name="filters" type="button" selector="button[data-action='grid-filter-expand']" timeout="30"/>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
<!-- TODO: Search, Notifications, Admin Menu -->
12+
<section name="AdminGridMainControls">
13+
<element name="add" type="button" selector="#add" timeout="30"/>
14+
<element name="back" type="button" selector="#back" timeout="30"/>
15+
<element name="reset" type="button" selector="#reset" timeout="30"/>
16+
<element name="save" type="button" selector="#save-button" timeout="30"/>
17+
<element name="saveAndContinue" type="button" selector="#save-button" timeout="30"/>
18+
<element name="saveArrow" type="button" selector="button[data-ui-id='save-button-dropdown']" timeout="5"/>
19+
<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>
20+
<element name="saveAndNew" type="button" selector="span[title='Save &amp; New']" timeout="30"/>
21+
</section>
22+
<section name="AdminGridSearchBox">
23+
<element name="searchByKeyword" type="input" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] input[placeholder='Search by keyword']"/>
24+
<element name="search" type="button" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] input[placeholder='Search by keyword'] + .action-submit" timeout="30"/>
25+
</section>
26+
<section name="AdminGridFilterControls">
27+
<element name="filters" type="button" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] button[data-action='grid-filter-expand']" timeout="5"/>
28+
<element name="applyFilters" type="button" selector="button[data-action='grid-filter-apply']" timeout="30"/>
29+
<element name="cancel" type="button" selector="button[data-action='grid-filter-cancel']" timeout="30"/>
30+
<element name="clearAll" type="button" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] button[data-action='grid-filter-reset']" timeout="5"/>
31+
</section>
32+
<!-- TODO: "Default View" drop down menu -->
33+
<section name="AdminGridColumnsControls">
34+
<element name="columns" type="button" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .admin__data-grid-action-columns"/>
35+
36+
<element name="columnName" type="button" selector="//label[contains(text(), '{{var1}}')]" parameterized="true" timeout="1"/>
37+
38+
<element name="reset" type="button" selector="//div[@class='admin__action-dropdown-menu-footer']/div/button[contains(text(), 'Reset')]" timeout="5"/>
39+
<element name="cancel" type="button" selector="//div[@class='admin__action-dropdown-menu-footer']/div/button[contains(text(), 'Cancel')]" timeout="5"/>
40+
</section>
41+
<section name="AdminGridActionsMenu">
42+
<element name="dropDown" type="select" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .action-select" timeout="30"/>
43+
</section>
44+
<section name="AdminGridRowsPerPage">
45+
<element name="count" type="select" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .selectmenu-value input" timeout="30"/>
46+
</section>
47+
<!-- TODO: Pagination controls -->
48+
<section name="AdminGridHeaders">
49+
<element name="title" type="text" selector=".page-title-wrapper h1"/>
50+
<element name="headerByName" type="text" selector="//span[@class='data-grid-cell-content' and contains(text(), '{{var1}}')]/parent::*" parameterized="true"/>
51+
</section>
52+
<section name="AdminGridRow">
53+
<element name="rowOne" type="text" selector="tr[data-repeat-index='0']"/>
54+
<element name="rowByIndex" type="text" selector="tr[data-repeat-index='{{var1}}']" parameterized="true"/>
55+
56+
<element name="editByValue" type="button" selector="//a[ancestor::tr[contains(., '{{var1}}')]]" parameterized="true"/>
57+
58+
<element name="checkboxByValue" type="checkbox" selector="//input[ancestor::tr[contains(., '{{var1}}')]]" parameterized="true"/>
59+
<element name="checkboxByIndex" type="checkbox" selector=".data-row[data-repeat-index='{{var1}}'] .admin__control-checkbox" parameterized="true"/>
60+
</section>
61+
</sections>

0 commit comments

Comments
 (0)