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
8a42ab0e
Commit
8a42ab0e
authored
Nov 19, 2019
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-authenticate admin if required
Update all tests to use the new go_to_admin_area method
parent
e495db2f
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
54 additions
and
20 deletions
+54
-20
app/views/admin/sessions/_new_base.html.haml
app/views/admin/sessions/_new_base.html.haml
+1
-1
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/ee/resource/geo/node.rb
qa/qa/ee/resource/geo/node.rb
+1
-1
qa/qa/ee/resource/license.rb
qa/qa/ee/resource/license.rb
+1
-1
qa/qa/ee/resource/settings/elasticsearch.rb
qa/qa/ee/resource/settings/elasticsearch.rb
+1
-1
qa/qa/page/admin/new_session.rb
qa/qa/page/admin/new_session.rb
+22
-0
qa/qa/page/base.rb
qa/qa/page/base.rb
+2
-2
qa/qa/page/main/menu.rb
qa/qa/page/main/menu.rb
+13
-2
qa/qa/resource/settings/hashed_storage.rb
qa/qa/resource/settings/hashed_storage.rb
+1
-1
qa/qa/runtime/api/client.rb
qa/qa/runtime/api/client.rb
+1
-1
qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb
...cs/features/browser_ui/non_devops/performance_bar_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_saml_sso_spec.rb
...tures/ee/browser_ui/1_manage/group/group_saml_sso_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/1_manage/instance/instance_audit_logs_spec.rb
.../browser_ui/1_manage/instance/instance_audit_logs_spec.rb
+2
-2
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb
.../ee/browser_ui/1_manage/project/project_templates_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/2_plan/custom_email/custom_email_spec.rb
...es/ee/browser_ui/2_plan/custom_email/custom_email_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb
.../browser_ui/3_create/jenkins/jenkins_build_status_spec.rb
+1
-1
qa/qa/support/page/logging.rb
qa/qa/support/page/logging.rb
+2
-2
qa/spec/page/logging_spec.rb
qa/spec/page/logging_spec.rb
+1
-1
No files found.
app/views/admin/sessions/_new_base.html.haml
View file @
8a42ab0e
...
...
@@ -4,4 +4,4 @@
=
password_field_tag
:password
,
nil
,
class:
'form-control'
,
required:
true
,
title:
_
(
'This field is required.'
),
data:
{
qa_selector:
'password_field'
}
.submit-container.move-submit-down
=
submit_tag
_
(
'Enter Admin Mode'
),
class:
'btn btn-success'
,
data:
{
qa_selector:
'
sign_in
_button'
}
=
submit_tag
_
(
'Enter Admin Mode'
),
class:
'btn btn-success'
,
data:
{
qa_selector:
'
enter_admin_mode
_button'
}
qa/qa.rb
View file @
8a42ab0e
...
...
@@ -331,6 +331,7 @@ module QA
module
Admin
autoload
:Menu
,
'qa/page/admin/menu'
autoload
:NewSession
,
'qa/page/admin/new_session'
module
Settings
autoload
:Repository
,
'qa/page/admin/settings/repository'
...
...
qa/qa/ee/resource/geo/node.rb
View file @
8a42ab0e
...
...
@@ -10,7 +10,7 @@ module QA
def
fabricate!
QA
::
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:click_geo_menu_link
)
EE
::
Page
::
Admin
::
Geo
::
Nodes
::
Show
.
perform
(
&
:new_node!
)
...
...
qa/qa/ee/resource/license.rb
View file @
8a42ab0e
...
...
@@ -6,7 +6,7 @@ module QA
class
License
<
QA
::
Resource
::
Base
def
fabricate!
(
license
)
QA
::
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_admin_credentials
)
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:click_license_menu_link
)
EE
::
Page
::
Admin
::
License
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
...
...
qa/qa/ee/resource/settings/elasticsearch.rb
View file @
8a42ab0e
...
...
@@ -16,7 +16,7 @@ module QA
end
def
fabricate!
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_integration_settings
)
QA
::
EE
::
Page
::
Admin
::
Settings
::
Integration
.
perform
do
|
integration
|
integration
.
expand_elasticsearch
do
|
es
|
...
...
qa/qa/page/admin/new_session.rb
0 → 100644
View file @
8a42ab0e
# frozen_string_literal: true
module
QA
module
Page
module
Admin
class
NewSession
<
Page
::
Base
view
'app/views/admin/sessions/_new_base.html.haml'
do
element
:enter_admin_mode_button
element
:password_field
end
def
set_password
(
password
)
fill_element
:password_field
,
password
end
def
click_enter_admin_mode
click_element
:enter_admin_mode_button
end
end
end
end
end
qa/qa/page/base.rb
View file @
8a42ab0e
...
...
@@ -125,8 +125,8 @@ module QA
has_no_css?
(
element_selector_css
(
name
,
kwargs
),
wait:
wait
,
text:
text
)
end
def
has_text?
(
text
)
page
.
has_text?
text
def
has_text?
(
text
,
wait:
Capybara
.
default_max_wait_time
)
page
.
has_text?
(
text
,
wait:
wait
)
end
def
has_no_text?
(
text
)
...
...
qa/qa/page/main/menu.rb
View file @
8a42ab0e
...
...
@@ -60,8 +60,15 @@ module QA
end
end
def
click_admin_area
within_top_menu
{
click_element
:admin_area_link
}
def
go_to_admin_area
click_admin_area
if
has_text?
(
'Enter Admin Mode'
,
wait:
1.0
)
Admin
::
NewSession
.
perform
do
|
new_session
|
new_session
.
set_password
(
Runtime
::
User
.
admin_password
)
new_session
.
click_enter_admin_mode
end
end
end
def
signed_in?
...
...
@@ -125,6 +132,10 @@ module QA
end
end
end
def
click_admin_area
within_top_menu
{
click_element
:admin_area_link
}
end
end
end
end
...
...
qa/qa/resource/settings/hashed_storage.rb
View file @
8a42ab0e
...
...
@@ -8,7 +8,7 @@ module QA
raise
ArgumentError
unless
traits
.
include?
(
:enabled
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_repository_settings
)
Page
::
Admin
::
Settings
::
Repository
.
perform
do
|
setting
|
...
...
qa/qa/runtime/api/client.rb
View file @
8a42ab0e
...
...
@@ -32,7 +32,7 @@ module QA
Runtime
::
Browser
.
visit
(
@address
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_admin_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_network_settings
)
Page
::
Admin
::
Settings
::
Network
.
perform
do
|
setting
|
...
...
qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb
View file @
8a42ab0e
...
...
@@ -6,7 +6,7 @@ module QA
before
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_admin_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_metrics_and_profiling_settings
)
Page
::
Admin
::
Settings
::
MetricsAndProfiling
.
perform
do
|
setting
|
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_saml_sso_spec.rb
View file @
8a42ab0e
...
...
@@ -267,7 +267,7 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:sign_out_if_signed_in
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_admin_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_users_overview
)
Page
::
Admin
::
Overview
::
Users
::
Index
.
perform
do
|
index
|
index
.
search_user
(
name
)
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/instance/instance_audit_logs_spec.rb
View file @
8a42ab0e
...
...
@@ -7,7 +7,7 @@ module QA
it
'logs audit events for UI operations'
do
sign_in
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_monitoring_audit_logs
)
EE
::
Page
::
Admin
::
Monitoring
::
AuditLog
.
perform
do
|
audit_log_page
|
expected_events
.
each
do
|
expected_event
|
...
...
@@ -96,7 +96,7 @@ module QA
before
do
sign_in
user
=
Resource
::
User
.
fabricate_or_use
(
Runtime
::
Env
.
gitlab_qa_username_1
,
Runtime
::
Env
.
gitlab_qa_password_1
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_users_overview
)
Page
::
Admin
::
Overview
::
Users
::
Index
.
perform
do
|
index
|
index
.
search_user
(
user
.
username
)
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb
View file @
8a42ab0e
...
...
@@ -71,7 +71,7 @@ module QA
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_admin_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_template_settings
)
EE
::
Page
::
Admin
::
Settings
::
Templates
.
perform
do
|
templates
|
...
...
qa/qa/specs/features/ee/browser_ui/2_plan/custom_email/custom_email_spec.rb
View file @
8a42ab0e
...
...
@@ -7,7 +7,7 @@ module QA
describe
'Custom email'
,
:requires_admin
do
before
do
Flow
::
Login
.
sign_in_as_admin
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_preferences_settings
)
end
...
...
qa/qa/specs/features/ee/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb
View file @
8a42ab0e
...
...
@@ -133,7 +133,7 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:sign_out_if_signed_in
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_admin_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:
click
_admin_area
)
Page
::
Main
::
Menu
.
perform
(
&
:
go_to
_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_network_settings
)
Page
::
Admin
::
Settings
::
Network
.
perform
do
|
network
|
...
...
qa/qa/support/page/logging.rb
View file @
8a42ab0e
...
...
@@ -99,10 +99,10 @@ module QA
found
end
def
has_text?
(
text
)
def
has_text?
(
text
,
**
kwargs
)
found
=
super
log
(
%Q{has_text?('
#{
text
}
') returned
#{
found
}
}
)
log
(
%Q{has_text?('
#{
text
}
'
, wait:
#{
kwargs
[
:wait
]
||
Capybara
.
default_max_wait_time
}
) returned
#{
found
}
}
)
found
end
...
...
qa/spec/page/logging_spec.rb
View file @
8a42ab0e
...
...
@@ -117,7 +117,7 @@ describe QA::Support::Page::Logging do
allow
(
page
).
to
receive
(
:has_text?
).
and_return
(
true
)
expect
{
subject
.
has_text?
'foo'
}
.
to
output
(
/has_text\?\('foo'\) returned true/
).
to_stdout_from_any_process
.
to
output
(
/has_text\?\('foo'
, wait:
#{
QA
::
Runtime
::
Browser
::
CAPYBARA_MAX_WAIT_TIME
}
\) returned true/
).
to_stdout_from_any_process
end
it
'logs has_no_text?'
do
...
...
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