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
6a2a9b1c
Commit
6a2a9b1c
authored
Jul 21, 2020
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include finished_loading? in wait_for_requests
Also remove now unnecessary finished_loading?
parent
76ddb27a
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
45 additions
and
32 deletions
+45
-32
qa/qa/ee/page/merge_request/show.rb
qa/qa/ee/page/merge_request/show.rb
+0
-1
qa/qa/page/base.rb
qa/qa/page/base.rb
+1
-10
qa/qa/page/component/new_snippet.rb
qa/qa/page/component/new_snippet.rb
+0
-2
qa/qa/page/component/snippet.rb
qa/qa/page/component/snippet.rb
+0
-10
qa/qa/page/merge_request/show.rb
qa/qa/page/merge_request/show.rb
+1
-1
qa/qa/page/project/operations/kubernetes/show.rb
qa/qa/page/project/operations/kubernetes/show.rb
+1
-1
qa/qa/page/project/snippet/new.rb
qa/qa/page/project/snippet/new.rb
+1
-0
qa/qa/page/project/web_ide/edit.rb
qa/qa/page/project/web_ide/edit.rb
+0
-1
qa/qa/page/settings/common.rb
qa/qa/page/settings/common.rb
+0
-1
qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
...ecs/features/browser_ui/2_plan/issue/create_issue_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/3_create/contribution_analytics_spec.rb
...res/ee/browser_ui/3_create/contribution_analytics_spec.rb
+1
-1
qa/qa/support/page/logging.rb
qa/qa/support/page/logging.rb
+1
-1
qa/qa/support/wait_for_requests.rb
qa/qa/support/wait_for_requests.rb
+11
-2
qa/spec/support/wait_for_requests_spec.rb
qa/spec/support/wait_for_requests_spec.rb
+27
-0
No files found.
qa/qa/ee/page/merge_request/show.rb
View file @
6a2a9b1c
...
...
@@ -178,7 +178,6 @@ module QA
def
has_vulnerability_report?
(
timeout:
60
)
wait_until
(
reload:
true
,
max_duration:
timeout
,
sleep_interval:
1
)
do
finished_loading?
has_element?
(
:vulnerability_report_grouped
,
wait:
10
)
end
find_element
(
:vulnerability_report_grouped
).
has_no_content?
(
"is loading"
)
...
...
qa/qa/page/base.rb
View file @
6a2a9b1c
...
...
@@ -169,7 +169,7 @@ module QA
end
def
has_element?
(
name
,
**
kwargs
)
wait_for_requests
wait_for_requests
(
skip_finished_loading_check:
!!
kwargs
.
delete
(
:skip_finished_loading_check
))
disabled
=
kwargs
.
delete
(
:disabled
)
...
...
@@ -209,15 +209,6 @@ module QA
has_text?
(
text
.
gsub
(
/\s+/
,
" "
),
wait:
wait
)
end
def
finished_loading?
wait_for_requests
# The number of selectors should be able to be reduced after
# migration to the new spinner is complete.
# https://gitlab.com/groups/gitlab-org/-/epics/956
has_no_css?
(
'.gl-spinner, .fa-spinner, .spinner'
,
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
end
def
finished_loading_block?
wait_for_requests
...
...
qa/qa/page/component/new_snippet.rb
View file @
6a2a9b1c
...
...
@@ -55,12 +55,10 @@ module QA
end
def
fill_file_name
(
name
)
finished_loading?
fill_element
:file_name_field
,
name
end
def
fill_file_content
(
content
)
finished_loading?
text_area
.
set
content
end
...
...
qa/qa/page/component/snippet.rb
View file @
6a2a9b1c
...
...
@@ -100,19 +100,16 @@ module QA
end
def
has_file_content?
(
file_content
)
finished_loading?
within_element
(
:file_content
)
do
has_text?
(
file_content
)
end
end
def
click_edit_button
finished_loading?
click_element
(
:snippet_action_button
,
action:
'Edit'
)
end
def
click_delete_button
finished_loading?
click_element
(
:snippet_action_button
,
action:
'Delete'
)
click_element
(
:delete_snippet_button
)
# wait for the page to reload after deletion
...
...
@@ -123,32 +120,27 @@ module QA
end
def
get_repository_uri_http
finished_loading?
click_element
(
:clone_button
)
Git
::
Location
.
new
(
find_element
(
:copy_http_url_button
)[
'data-clipboard-text'
]).
uri
.
to_s
end
def
get_repository_uri_ssh
finished_loading?
click_element
(
:clone_button
)
Git
::
Location
.
new
(
find_element
(
:copy_ssh_url_button
)[
'data-clipboard-text'
]).
uri
.
to_s
end
def
add_comment
(
comment
)
finished_loading?
fill_element
(
:note_field
,
comment
)
click_element
(
:comment_button
)
end
def
has_comment_author?
(
author_username
)
finished_loading?
within_element
(
:note_author_content
)
do
has_text?
(
'@'
+
author_username
)
end
end
def
has_comment_content?
(
comment_content
)
finished_loading?
within_element
(
:note_content
)
do
has_text?
(
comment_content
)
end
...
...
@@ -161,14 +153,12 @@ module QA
end
def
edit_comment
(
comment
)
finished_loading?
click_element
(
:edit_comment_button
)
fill_element
(
:edit_note_field
,
comment
)
click_element
(
:save_comment_button
)
end
def
delete_comment
(
comment
)
finished_loading?
click_element
(
:more_actions_dropdown
)
accept_alert
do
click_element
(
:delete_comment_button
)
...
...
qa/qa/page/merge_request/show.rb
View file @
6a2a9b1c
...
...
@@ -275,7 +275,7 @@ module QA
end
def
wait_for_loading
finished_loading?
&&
has_no_element?
(
:skeleton_note
)
has_no_element?
(
:skeleton_note
)
end
def
click_open_in_web_ide
...
...
qa/qa/page/project/operations/kubernetes/show.rb
View file @
6a2a9b1c
...
...
@@ -56,7 +56,7 @@ module QA
def
await_installed
(
application_name
)
within_element
(
application_name
)
do
has_element?
(
:uninstall_button
,
application:
application_name
,
wait:
300
)
has_element?
(
:uninstall_button
,
application:
application_name
,
wait:
300
,
skip_finished_loading_check:
true
)
end
end
...
...
qa/qa/page/project/snippet/new.rb
View file @
6a2a9b1c
...
...
@@ -14,6 +14,7 @@ module QA
def
click_create_first_snippet
finished_loading?
# The svg takes a fraction of a second to load after which the
# "New snippet" button shifts up a bit. This can cause
# webdriver to miss the hit so we wait for the svg to load before
...
...
qa/qa/page/project/web_ide/edit.rb
View file @
6a2a9b1c
...
...
@@ -136,7 +136,6 @@ module QA
end
def
create_first_file
(
file_name
)
finished_loading?
click_element
(
:first_file_button
,
Page
::
Component
::
WebIDE
::
Modal
::
CreateNewFile
)
fill_element
(
:file_name_field
,
file_name
)
click_button
(
'Create file'
)
...
...
qa/qa/page/settings/common.rb
View file @
6a2a9b1c
...
...
@@ -14,7 +14,6 @@ module QA
click_button
'Expand'
unless
has_css?
(
'button'
,
text:
'Collapse'
,
wait:
1
)
has_content?
(
'Collapse'
)
finished_loading?
end
yield
if
block_given?
...
...
qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
View file @
6a2a9b1c
...
...
@@ -19,7 +19,7 @@ module QA
end
end
it
'closes an issue'
do
it
'closes an issue'
,
quarantine:
{
issue:
'https://gitlab.com/gitlab-org/gitlab/-/issues/225303'
,
type: :bug
}
do
closed_issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue_page
|
...
...
qa/qa/specs/features/ee/browser_ui/3_create/contribution_analytics_spec.rb
View file @
6a2a9b1c
...
...
@@ -41,7 +41,7 @@ module QA
Page
::
Group
::
Menu
.
perform
(
&
:click_contribution_analytics_item
)
end
it
'tests contributions'
do
it
'tests contributions'
,
quarantine:
{
issue:
'https://gitlab.com/gitlab-org/gitlab/-/issues/225303'
,
type: :bug
}
do
EE
::
Page
::
Group
::
ContributionAnalytics
.
perform
do
|
contribution_analytics
|
expect
(
contribution_analytics
).
to
have_push_element
(
'3 pushes, more than 4.0 commits by 1 person contributors.'
)
expect
(
contribution_analytics
).
to
have_mr_element
(
'1 created, 1 merged.'
)
...
...
qa/qa/support/page/logging.rb
View file @
6a2a9b1c
...
...
@@ -120,7 +120,7 @@ module QA
found
end
def
finished_loading?
def
finished_loading?
(
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
log
(
'waiting for loading to complete...'
)
now
=
Time
.
now
...
...
qa/qa/support/wait_for_requests.rb
View file @
6a2a9b1c
...
...
@@ -5,9 +5,11 @@ module QA
module
WaitForRequests
module_function
def
wait_for_requests
DEFAULT_MAX_WAIT_TIME
=
60
def
wait_for_requests
(
skip_finished_loading_check:
false
)
Waiter
.
wait_until
(
log:
false
)
do
finished_all_ajax_requests?
&&
finished_all_axios_requests?
finished_all_ajax_requests?
&&
finished_all_axios_requests?
&&
(
!
skip_finished_loading_check
?
finished_loading?
(
wait:
1
)
:
true
)
end
end
...
...
@@ -20,6 +22,13 @@ module QA
Capybara
.
page
.
evaluate_script
(
'jQuery.active'
).
zero?
end
def
finished_loading?
(
wait:
DEFAULT_MAX_WAIT_TIME
)
# The number of selectors should be able to be reduced after
# migration to the new spinner is complete.
# https://gitlab.com/groups/gitlab-org/-/epics/956
Capybara
.
page
.
has_no_css?
(
'.gl-spinner, .fa-spinner, .spinner'
,
wait:
wait
)
end
end
end
end
qa/spec/support/wait_for_requests_spec.rb
0 → 100644
View file @
6a2a9b1c
# frozen_string_literal: true
describe
QA
::
Support
::
WaitForRequests
do
describe
'.wait_for_requests'
do
before
do
allow
(
subject
).
to
receive
(
:finished_all_axios_requests?
).
and_return
(
true
)
allow
(
subject
).
to
receive
(
:finished_all_ajax_requests?
).
and_return
(
true
)
allow
(
subject
).
to
receive
(
:finished_loading?
).
and_return
(
true
)
end
context
'when skip_finished_loading_check is defaulted to false'
do
it
'calls finished_loading?'
do
expect
(
subject
).
to
receive
(
:finished_loading?
).
with
(
hash_including
(
wait:
1
))
subject
.
wait_for_requests
end
end
context
'when skip_finished_loading_check is true'
do
it
'does not call finished_loading?'
do
expect
(
subject
).
not_to
receive
(
:finished_loading?
)
subject
.
wait_for_requests
(
skip_finished_loading_check:
true
)
end
end
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