Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7e5c1737
Commit
7e5c1737
authored
Sep 18, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wait_for_all_requests to search feature specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
9f3329c3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
spec/features/search/user_uses_header_search_field_spec.rb
spec/features/search/user_uses_header_search_field_spec.rb
+8
-18
spec/spec_helper.rb
spec/spec_helper.rb
+1
-1
spec/support/helpers/search_helpers.rb
spec/support/helpers/search_helpers.rb
+10
-0
No files found.
spec/features/search/user_uses_header_search_field_spec.rb
View file @
7e5c1737
...
...
@@ -30,6 +30,8 @@ RSpec.describe 'User uses header search field', :js do
before
do
find
(
'#search'
)
find
(
'body'
).
native
.
send_keys
(
's'
)
wait_for_all_requests
end
it
'shows the category search dropdown'
do
...
...
@@ -89,9 +91,7 @@ RSpec.describe 'User uses header search field', :js do
context
'when entering text into the search field'
do
it
'does not display the category search dropdown'
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
scope_name
.
first
(
4
))
end
fill_in_search
(
scope_name
.
first
(
4
))
expect
(
page
).
not_to
have_selector
(
'.dropdown-header'
,
text:
/
#{
scope_name
}
/i
)
end
...
...
@@ -105,9 +105,7 @@ RSpec.describe 'User uses header search field', :js do
end
it
'displays search options'
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
'test'
)
end
fill_in_search
(
'test'
)
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
))
end
...
...
@@ -140,9 +138,7 @@ RSpec.describe 'User uses header search field', :js do
end
it
'displays search options'
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
'test'
)
end
fill_in_search
(
'test'
)
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
))
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
,
group_id:
group
.
id
))
...
...
@@ -157,9 +153,7 @@ RSpec.describe 'User uses header search field', :js do
end
it
'displays search options'
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
'test'
)
end
fill_in_search
(
'test'
)
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
))
expect
(
page
).
not_to
have_selector
(
scoped_search_link
(
'test'
,
group_id:
project
.
namespace_id
))
...
...
@@ -182,9 +176,7 @@ RSpec.describe 'User uses header search field', :js do
end
it
'displays search options'
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
'test'
)
end
fill_in_search
(
'test'
)
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
))
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
,
group_id:
group
.
id
))
...
...
@@ -208,9 +200,7 @@ RSpec.describe 'User uses header search field', :js do
end
it
'displays search options'
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
'test'
)
end
fill_in_search
(
'test'
)
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
))
expect
(
page
).
to
have_selector
(
scoped_search_link
(
'test'
,
group_id:
subgroup
.
id
))
...
...
spec/spec_helper.rb
View file @
7e5c1737
...
...
@@ -124,6 +124,7 @@ RSpec.configure do |config|
config
.
include
LoginHelpers
,
type: :feature
config
.
include
SearchHelpers
,
type: :feature
config
.
include
WaitHelpers
,
type: :feature
config
.
include
WaitForRequests
,
type: :feature
config
.
include
EmailHelpers
,
:mailer
,
type: :mailer
config
.
include
Warden
::
Test
::
Helpers
,
type: :request
config
.
include
Gitlab
::
Routing
,
type: :routing
...
...
@@ -133,7 +134,6 @@ RSpec.configure do |config|
config
.
include
InputHelper
,
:js
config
.
include
SelectionHelper
,
:js
config
.
include
InspectRequests
,
:js
config
.
include
WaitForRequests
,
:js
config
.
include
LiveDebugger
,
:js
config
.
include
MigrationsHelpers
,
:migration
config
.
include
RedisHelpers
...
...
spec/support/helpers/search_helpers.rb
View file @
7e5c1737
# frozen_string_literal: true
module
SearchHelpers
def
fill_in_search
(
text
)
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
text
)
end
wait_for_all_requests
end
def
submit_search
(
query
,
scope:
nil
)
page
.
within
(
'.search-form, .search-page-form'
)
do
field
=
find_field
(
'search'
)
...
...
@@ -11,6 +19,8 @@ module SearchHelpers
else
click_button
(
'Search'
)
end
wait_for_all_requests
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment