Skip to content

Commit 1467c6e

Browse files
author
Gabriel Galvao da Gama
committed
Added mftf block test
1 parent 58158aa commit 1467c6e

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
<element name="idColumn" type="button" selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]"/>
1616
<element name="clearAll" type="button" selector="//div[@class='admin__data-grid-header']//button[contains(text(), 'Clear all')]"/>
1717
<element name="activeFilters" type="button" selector="//div[@class='admin__data-grid-header']//span[contains(text(), 'Active filters:')]" />
18+
<element name="activeFilterDiv" type="button" selector="(//div[contains(@class, 'admin__data-grid-filters-current') and contains(@class, '_show')])[1]"/>
1819
<element name="FilterBtn" type="input" selector="//button[text()='Filters']"/>
1920
<element name="URLKey" type="input" selector="//div[@class='admin__form-field-control']/input[@name='identifier']"/>
2021
<element name="ApplyFiltersBtn" type="button" selector="//span[text()='Apply Filters']"/>
22+
<element name="blockGridRowByTitle" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
23+
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
2124
</section>
2225
</sections>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCmsBlockGridUrlFilterApplierTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="Filter CMS block using GET URL parameter"/>
15+
<title value="Verify that filter is applied on block grid when filters parameter is set on url"/>
16+
<description value="Accessing block grid url with filters parameter"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="to-be-added"/>
19+
<group value="Cms"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<createData entity="Sales25offBlock" stepKey="createBlock"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="createBlock" stepKey="deletePage"/>
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
28+
</after>
29+
<amOnPage url="{{CmsBlocksPage.url}}?filters[title]=$$createBlock.title$$" stepKey="navigateToBlockGridWithFilters"/>
30+
<waitForPageLoad stepKey="waitForBlockGrid"/>
31+
<see selector="{{BlockPageActionsSection.blockGridRowByTitle($$createBlock.title$$)}}" userInput="$$createBlock.title$$" stepKey="seeBlock"/>
32+
<seeElement selector="{{BlockPageActionsSection.activeFilterDiv}}" stepKey="seeEnabledFilters"/>
33+
<see selector="{{BlockPageActionsSection.activeFilterDiv}}" userInput="Title: $$createBlock.title$$" stepKey="seeBlockTitleFilter"/>
34+
<click selector="{{BlockPageActionsSection.clearFilters}}" stepKey="clearFilters" />
35+
<waitForPageLoad stepKey="waitForClearFilter"/>
36+
</test>
37+
</tests>

0 commit comments

Comments
 (0)