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
8bee93b0
Commit
8bee93b0
authored
Dec 26, 2018
by
Mark Lapierre
Committed by
Ramya Authappan
Dec 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CE] Speed up login page usage
parent
fddb4746
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
12 deletions
+16
-12
app/views/layouts/devise.html.haml
app/views/layouts/devise.html.haml
+1
-1
qa/qa/page/base.rb
qa/qa/page/base.rb
+2
-2
qa/qa/page/main/login.rb
qa/qa/page/main/login.rb
+10
-2
qa/qa/page/main/menu.rb
qa/qa/page/main/menu.rb
+2
-6
qa/qa/support/page/logging.rb
qa/qa/support/page/logging.rb
+1
-1
No files found.
app/views/layouts/devise.html.haml
View file @
8bee93b0
!!! 5
!!! 5
%html
.devise-layout-html
{
class:
system_message_class
}
%html
.devise-layout-html
{
class:
system_message_class
}
=
render
"layouts/head"
=
render
"layouts/head"
%body
.ui-indigo.login-page.application.navless
{
data:
{
page:
body_data_page
}
}
%body
.ui-indigo.login-page.application.navless
.qa-login-page
{
data:
{
page:
body_data_page
}
}
.page-wrap
.page-wrap
=
render
"layouts/header/empty"
=
render
"layouts/header/empty"
.login-page-broadcast
.login-page-broadcast
...
...
qa/qa/page/base.rb
View file @
8bee93b0
...
@@ -108,8 +108,8 @@ module QA
...
@@ -108,8 +108,8 @@ module QA
element
.
select
value
.
to_s
.
capitalize
element
.
select
value
.
to_s
.
capitalize
end
end
def
has_element?
(
name
)
def
has_element?
(
name
,
wait:
Capybara
.
default_max_wait_time
)
has_css?
(
element_selector_css
(
name
))
has_css?
(
element_selector_css
(
name
)
,
wait:
wait
)
end
end
def
has_no_text?
(
text
)
def
has_no_text?
(
text
)
...
...
qa/qa/page/main/login.rb
View file @
8bee93b0
...
@@ -35,13 +35,21 @@ module QA
...
@@ -35,13 +35,21 @@ module QA
element
:saml_login_button
element
:saml_login_button
end
end
view
'app/views/layouts/devise.html.haml'
do
element
:login_page
end
def
initialize
def
initialize
# The login page is usually the entry point for all the scenarios so
# 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 need to wait for the instance to start. That said, in some cases
# we are already logged-in so we check both cases here.
# 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
wait
(
max:
500
)
do
has_css?
(
'.login-page'
)
||
Page
::
Main
::
Menu
.
act
{
has_personal_area?
(
wait:
0
)
}
||
Page
::
Main
::
Menu
.
act
{
has_personal_area?
(
wait:
0
)
}
has_element?
(
:login_page
)
end
end
end
end
...
...
qa/qa/page/main/menu.rb
View file @
8bee93b0
...
@@ -63,15 +63,11 @@ module QA
...
@@ -63,15 +63,11 @@ module QA
end
end
def
has_personal_area?
(
wait:
Capybara
.
default_max_wait_time
)
def
has_personal_area?
(
wait:
Capybara
.
default_max_wait_time
)
using_wait_time
(
wait
)
do
has_element?
(
:user_avatar
,
wait:
wait
)
page
.
has_selector?
(
element_selector_css
(
:user_avatar
))
end
end
end
def
has_admin_area_link?
(
wait:
Capybara
.
default_max_wait_time
)
def
has_admin_area_link?
(
wait:
Capybara
.
default_max_wait_time
)
using_wait_time
(
wait
)
do
has_element?
(
:admin_area_link
,
wait:
wait
)
page
.
has_selector?
(
element_selector_css
(
:admin_area_link
))
end
end
end
private
private
...
...
qa/qa/support/page/logging.rb
View file @
8bee93b0
...
@@ -77,7 +77,7 @@ module QA
...
@@ -77,7 +77,7 @@ module QA
super
super
end
end
def
has_element?
(
name
)
def
has_element?
(
name
,
wait:
Capybara
.
default_max_wait_time
)
found
=
super
found
=
super
log
(
"has_element? :
#{
name
}
returned
#{
found
}
"
)
log
(
"has_element? :
#{
name
}
returned
#{
found
}
"
)
...
...
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