Skip to content

Commit 0d002e3

Browse files
committed
Unfinished test. Not sure how to check element's css visibility.
1 parent 5021e2b commit 0d002e3

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="AdminHeaderSection">
1212
<element name="pageTitle" type="text" selector=".page-header h1.page-title"/>
1313
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
14+
<element name="globalSearchInput" type="text" selector="#search-global" />
1415
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
1516
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
1617
<!-- Used for page not found error -->
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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="AdminSearchHotkeyTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Search form hotkey in backend"/>
15+
<title value="Admin should be able focus on the search field with a hotkey"/>
16+
<description value="Admin should be able focus on the search field with a hotkey - forwardslash"/>
17+
<severity value="MINOR"/>
18+
<group value="backend"/>
19+
<group value="search"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
</after>
27+
28+
<pressKey selector="body" parameterArray="[/]" stepKey="pressForwardslashKey"/>
29+
<waitForElementVisible selector="{{AdminHeaderSection.globalSearchInput}}" stepKey="waitForGlobalSearchInput"/>
30+
<seeElement selector="{{AdminHeaderSection.globalSearchInput}}" stepKey="seeGlobalSearchInput"/>
31+
<seeInField userInput="" selector="{{AdminHeaderSection.globalSearchInput}}" stepKey="seeEmptyGlobalSearchInput"/>
32+
<pressKey selector="{{AdminHeaderSection.globalSearchInput}}" parameterArray="[/]" stepKey="pressForwardslashKeyAgain"/>
33+
<seeInField userInput="/" selector="{{AdminHeaderSection.globalSearchInput}}" stepKey="seeForwardSlashInGlobalSearchInput"/>
34+
</test>
35+
</tests>

0 commit comments

Comments
 (0)