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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
784eb9a4
Commit
784eb9a4
authored
Feb 07, 2019
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for login page to load at the beginning of QA suite
parent
2cea4fd0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
qa/qa/page/main/login.rb
qa/qa/page/main/login.rb
+3
-11
qa/spec/spec_helper.rb
qa/spec/spec_helper.rb
+12
-0
No files found.
qa/qa/page/main/login.rb
View file @
784eb9a4
...
...
@@ -40,16 +40,8 @@ module QA
element
:login_page
end
def
initialize
# The login page is usually the entry point for all the scenarios so
# we need to wait for the instance to start. That said, in some cases
# we are already logged-in so we check both cases here.
# Check if we're already logged in first. If we don't then we have to
# wait 10 seconds for the check for the login page to fail every time
# we use this class when we're already logged in (E.g., whenever we
# create a personal access token to use for API access).
wait
(
max:
500
)
do
Page
::
Main
::
Menu
.
act
{
has_personal_area?
(
wait:
0
)
}
||
def
page_loaded?
wait
(
max:
60
)
do
has_element?
(
:login_page
)
end
end
...
...
qa/spec/spec_helper.rb
View file @
784eb9a4
...
...
@@ -3,6 +3,18 @@ require_relative '../qa'
Dir
[
::
File
.
join
(
__dir__
,
'support'
,
'**'
,
'*.rb'
)].
each
{
|
f
|
require
f
}
RSpec
.
configure
do
|
config
|
ServerNotRespondingError
=
Class
.
new
(
RuntimeError
)
# The login page could take some time to load the first time it is visited.
# We visit the login page and wait for it to properly load only once at the beginning of the suite.
config
.
before
(
:suite
)
do
QA
::
Runtime
::
Browser
.
visit
(
:gitlab
,
QA
::
Page
::
Main
::
Login
)
unless
QA
::
Page
::
Main
::
Login
.
perform
(
&
:page_loaded?
)
raise
ServerNotRespondingError
,
"Login page did not load at
#{
QA
::
Page
::
Main
::
Login
.
perform
(
&
:current_url
)
}
"
end
end
config
.
before
do
|
example
|
QA
::
Runtime
::
Logger
.
debug
(
"Starting test:
#{
example
.
full_description
}
"
)
if
QA
::
Runtime
::
Env
.
debug?
...
...
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