Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automated_testing_kit
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automated_testing_kit
Commits
003e84e6
Commit
003e84e6
authored
8 months ago
by
ilyaukin
Browse files
Options
Downloads
Patches
Plain Diff
Handle responsive design in the search test.
parent
1939bb16
No related branches found
No related tags found
1 merge request
!20
Handle responsive design in the search test.
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
playwright/e2e/atk_search/atk_search.spec.js
+14
-2
14 additions, 2 deletions
playwright/e2e/atk_search/atk_search.spec.js
with
14 additions
and
2 deletions
playwright/e2e/atk_search/atk_search.spec.js
+
14
−
2
View file @
003e84e6
...
...
@@ -35,7 +35,7 @@ test.describe('Search tests.', () => {
await
page
.
goto
(
baseUrl
);
for
(
let
item
of
searchData
.
simple
)
{
await
page
.
getByLabel
(
'
Search
Form
'
).
click
(
);
await
open
SearchForm
(
page
);
const
keyInput
=
page
.
getByRole
(
"
searchbox
"
,
{
name
:
"
Search
"
});
await
keyInput
.
fill
(
item
.
keyword
);
await
keyInput
.
press
(
"
Enter
"
);
...
...
@@ -95,7 +95,7 @@ test.describe('Search tests.', () => {
test
(
'
(ATK-PW-1162) Search by a keyword: empty input @ATK-PW-1162 @search @content @empty
'
,
async
({
page
})
=>
{
await
page
.
goto
(
baseUrl
);
await
page
.
getByLabel
(
'
Search
Form
'
).
click
(
);
await
open
SearchForm
(
page
);
const
searchInput
=
page
.
getByRole
(
"
searchbox
"
,
{
name
:
"
Search
"
});
await
expect
(
searchInput
).
toHaveAttribute
(
'
placeholder
'
,
'
Search by keyword or phrase.
'
);
});
...
...
@@ -115,6 +115,18 @@ test.describe('Search tests.', () => {
await
expect
(
page
.
getByText
(
"
Enter some keywords.
"
)).
toBeVisible
();
});
async
function
openSearchForm
(
page
)
{
// Handle "responsive design". If "Search form" isn't visible,
// have to click main menu button first.
let
searchForm
=
page
.
getByLabel
(
'
Search Form
'
);
await
searchForm
.
waitFor
();
if
(
!
(
await
searchForm
.
isVisible
()))
{
await
page
.
getByLabel
(
'
Main Menu
'
).
click
();
}
await
searchForm
.
click
();
}
async
function
checkResult
(
page
,
item
)
{
const
resultLocatorList
=
await
page
.
locator
(
'
.search-result__title
'
).
all
();
const
resultList
=
[];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment