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
1fec44af
Commit
1fec44af
authored
Sep 13, 2019
by
Dan Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rubocop disable statements to existing offenders
Disable QA/AmbiguousPageObjectName cop for all offenses under QA
parent
6bd8a2e1
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
156 additions
and
53 deletions
+156
-53
qa/qa/ee/resource/epic.rb
qa/qa/ee/resource/epic.rb
+1
-1
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/resource/deploy_token.rb
qa/qa/resource/deploy_token.rb
+2
-2
qa/qa/resource/file.rb
qa/qa/resource/file.rb
+1
-1
qa/qa/resource/fork.rb
qa/qa/resource/fork.rb
+1
-1
qa/qa/resource/issue.rb
qa/qa/resource/issue.rb
+1
-1
qa/qa/resource/kubernetes_cluster.rb
qa/qa/resource/kubernetes_cluster.rb
+2
-2
qa/qa/resource/label.rb
qa/qa/resource/label.rb
+1
-1
qa/qa/resource/personal_access_token.rb
qa/qa/resource/personal_access_token.rb
+1
-1
qa/qa/resource/project.rb
qa/qa/resource/project.rb
+3
-3
qa/qa/resource/project_imported_from_github.rb
qa/qa/resource/project_imported_from_github.rb
+3
-3
qa/qa/resource/project_milestone.rb
qa/qa/resource/project_milestone.rb
+1
-1
qa/qa/resource/sandbox.rb
qa/qa/resource/sandbox.rb
+4
-4
qa/qa/resource/snippet.rb
qa/qa/resource/snippet.rb
+1
-1
qa/qa/resource/ssh_key.rb
qa/qa/resource/ssh_key.rb
+1
-1
qa/qa/specs/features/browser_ui/1_manage/group/create_group_with_mattermost_team_spec.rb
.../1_manage/group/create_group_with_mattermost_team_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb
..._ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb
...es/browser_ui/1_manage/project/add_project_member_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb
...es/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb
.../browser_ui/3_create/repository/add_file_template_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb
.../3_create/repository/user_views_commit_diff_patch_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb
...res/browser_ui/3_create/web_ide/add_file_template_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb
...wser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.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_audit_logs_1_spec.rb
...s/ee/browser_ui/1_manage/group/group_audit_logs_1_spec.rb
+2
-2
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_ldap_sync_spec.rb
...ures/ee/browser_ui/1_manage/group/group_ldap_sync_spec.rb
+3
-3
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
+3
-3
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_audit_logs_spec.rb
...ee/browser_ui/1_manage/project/project_audit_logs_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb
.../ee/browser_ui/1_manage/project/project_templates_spec.rb
+7
-7
qa/qa/specs/features/ee/browser_ui/secure/security_reports_spec.rb
...cs/features/ee/browser_ui/secure/security_reports_spec.rb
+2
-2
qa/qa/tools/revoke_all_personal_access_tokens.rb
qa/qa/tools/revoke_all_personal_access_tokens.rb
+1
-1
rubocop/cop/qa/ambiguous_page_object_name.rb
rubocop/cop/qa/ambiguous_page_object_name.rb
+48
-0
rubocop/rubocop.rb
rubocop/rubocop.rb
+1
-0
spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb
spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb
+54
-0
No files found.
qa/qa/ee/resource/epic.rb
View file @
1fec44af
...
...
@@ -29,7 +29,7 @@ module QA
QA
::
Page
::
Group
::
Menu
.
perform
(
&
:click_group_epics_link
)
QA
::
EE
::
Page
::
Group
::
Epic
::
Index
.
perform
do
|
page
|
QA
::
EE
::
Page
::
Group
::
Epic
::
Index
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_new_epic
page
.
set_title
(
@title
)
page
.
create_new_epic
...
...
qa/qa/ee/resource/geo/node.rb
View file @
1fec44af
...
...
@@ -14,7 +14,7 @@ module QA
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:click_geo_menu_link
)
EE
::
Page
::
Admin
::
Geo
::
Nodes
::
Show
.
perform
(
&
:new_node!
)
EE
::
Page
::
Admin
::
Geo
::
Nodes
::
New
.
perform
do
|
page
|
EE
::
Page
::
Admin
::
Geo
::
Nodes
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
raise
ArgumentError
if
@name
.
nil?
||
@address
.
nil?
page
.
set_node_name
(
@name
)
...
...
qa/qa/ee/resource/license.rb
View file @
1fec44af
...
...
@@ -9,7 +9,7 @@ module QA
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:click_admin_area
)
QA
::
Page
::
Admin
::
Menu
.
perform
(
&
:click_license_menu_link
)
EE
::
Page
::
Admin
::
License
.
perform
do
|
page
|
EE
::
Page
::
Admin
::
License
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_new_license
(
license
)
unless
page
.
license?
end
...
...
qa/qa/resource/deploy_token.rb
View file @
1fec44af
...
...
@@ -6,7 +6,7 @@ module QA
attr_accessor
:name
,
:expires_at
attribute
:username
do
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
expand_deploy_tokens
do
|
token
|
token
.
token_username
end
...
...
@@ -14,7 +14,7 @@ module QA
end
attribute
:password
do
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
expand_deploy_tokens
do
|
token
|
token
.
token_password
end
...
...
qa/qa/resource/file.rb
View file @
1fec44af
...
...
@@ -27,7 +27,7 @@ module QA
Page
::
Project
::
Show
.
perform
(
&
:create_first_new_file!
)
Page
::
File
::
Form
.
perform
do
|
page
|
Page
::
File
::
Form
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_name
(
@name
)
page
.
add_content
(
@content
)
page
.
add_commit_message
(
@commit_message
)
...
...
qa/qa/resource/fork.rb
View file @
1fec44af
...
...
@@ -41,7 +41,7 @@ module QA
fork_new
.
choose_namespace
(
user
.
name
)
end
Page
::
Layout
::
Banner
.
perform
do
|
page
|
Page
::
Layout
::
Banner
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
has_notice?
(
'The project was successfully forked.'
)
end
...
...
qa/qa/resource/issue.rb
View file @
1fec44af
...
...
@@ -25,7 +25,7 @@ module QA
Page
::
Project
::
Show
.
perform
(
&
:go_to_new_issue
)
Page
::
Project
::
Issue
::
New
.
perform
do
|
page
|
Page
::
Project
::
Issue
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_title
(
@title
)
page
.
add_description
(
@description
)
page
.
create_new_issue
...
...
qa/qa/resource/kubernetes_cluster.rb
View file @
1fec44af
...
...
@@ -24,7 +24,7 @@ module QA
Page
::
Project
::
Operations
::
Kubernetes
::
Add
.
perform
(
&
:add_existing_cluster
)
Page
::
Project
::
Operations
::
Kubernetes
::
AddExisting
.
perform
do
|
page
|
Page
::
Project
::
Operations
::
Kubernetes
::
AddExisting
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
set_cluster_name
(
@cluster
.
cluster_name
)
page
.
set_api_url
(
@cluster
.
api_url
)
page
.
set_ca_certificate
(
@cluster
.
ca_certificate
)
...
...
@@ -34,7 +34,7 @@ module QA
end
if
@install_helm_tiller
Page
::
Project
::
Operations
::
Kubernetes
::
Show
.
perform
do
|
page
|
Page
::
Project
::
Operations
::
Kubernetes
::
Show
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
# We must wait a few seconds for permissions to be set up correctly for new cluster
sleep
10
...
...
qa/qa/resource/label.rb
View file @
1fec44af
...
...
@@ -28,7 +28,7 @@ module QA
Page
::
Project
::
Menu
.
perform
(
&
:go_to_labels
)
Page
::
Label
::
Index
.
perform
(
&
:click_new_label_button
)
Page
::
Label
::
New
.
perform
do
|
page
|
Page
::
Label
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
fill_title
(
@title
)
page
.
fill_description
(
@description
)
page
.
fill_color
(
@color
)
...
...
qa/qa/resource/personal_access_token.rb
View file @
1fec44af
...
...
@@ -16,7 +16,7 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:click_settings_link
)
Page
::
Profile
::
Menu
.
perform
(
&
:click_access_tokens
)
Page
::
Profile
::
PersonalAccessTokens
.
perform
do
|
page
|
Page
::
Profile
::
PersonalAccessTokens
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
fill_token_name
(
name
||
'api-test-token'
)
page
.
check_api
page
.
click_create_token_button
...
...
qa/qa/resource/project.rb
View file @
1fec44af
...
...
@@ -30,13 +30,13 @@ module QA
end
attribute
:repository_ssh_location
do
Page
::
Project
::
Show
.
perform
do
|
page
|
Page
::
Project
::
Show
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
repository_clone_ssh_location
end
end
attribute
:repository_http_location
do
Page
::
Project
::
Show
.
perform
do
|
page
|
Page
::
Project
::
Show
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
repository_clone_http_location
end
end
...
...
@@ -59,7 +59,7 @@ module QA
Page
::
Group
::
Show
.
perform
(
&
:go_to_new_project
)
end
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
choose_test_namespace
page
.
choose_name
(
@name
)
page
.
add_description
(
@description
)
...
...
qa/qa/resource/project_imported_from_github.rb
View file @
1fec44af
...
...
@@ -17,15 +17,15 @@ module QA
Page
::
Group
::
Show
.
perform
(
&
:go_to_new_project
)
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_import_project
end
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_github_link
end
Page
::
Project
::
Import
::
Github
.
perform
do
|
page
|
Page
::
Project
::
Import
::
Github
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_personal_access_token
(
@personal_access_token
)
page
.
list_repos
page
.
import!
(
@github_repository_path
,
@name
)
...
...
qa/qa/resource/project_milestone.rb
View file @
1fec44af
...
...
@@ -18,7 +18,7 @@ module QA
def
fabricate!
project
.
visit!
Page
::
Project
::
Menu
.
perform
do
|
page
|
Page
::
Project
::
Menu
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_issues
page
.
click_milestones
end
...
...
qa/qa/resource/sandbox.rb
View file @
1fec44af
...
...
@@ -18,11 +18,11 @@ module QA
def
fabricate!
Page
::
Main
::
Menu
.
perform
(
&
:go_to_groups
)
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
if
page
.
has_group?
(
path
)
page
.
click_group
(
path
)
Page
::
Dashboard
::
Groups
.
perform
do
|
groups_
page
|
if
groups_
page
.
has_group?
(
path
)
groups_
page
.
click_group
(
path
)
else
page
.
click_new_group
groups_
page
.
click_new_group
Page
::
Group
::
New
.
perform
do
|
group
|
group
.
set_path
(
path
)
...
...
qa/qa/resource/snippet.rb
View file @
1fec44af
...
...
@@ -16,7 +16,7 @@ module QA
def
fabricate!
Page
::
Dashboard
::
Snippet
::
Index
.
perform
(
&
:go_to_new_snippet_page
)
Page
::
Dashboard
::
Snippet
::
New
.
perform
do
|
page
|
Page
::
Dashboard
::
Snippet
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
fill_title
(
@title
)
page
.
fill_description
(
@description
)
page
.
set_visibility
(
@visibility
)
...
...
qa/qa/resource/ssh_key.rb
View file @
1fec44af
...
...
@@ -17,7 +17,7 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:click_settings_link
)
Page
::
Profile
::
Menu
.
perform
(
&
:click_ssh_keys
)
Page
::
Profile
::
SSHKeys
.
perform
do
|
page
|
Page
::
Profile
::
SSHKeys
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_key
(
public_key
,
title
)
end
end
...
...
qa/qa/specs/features/browser_ui/1_manage/group/create_group_with_mattermost_team_spec.rb
View file @
1fec44af
...
...
@@ -8,7 +8,7 @@ module QA
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:go_to_groups
)
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_new_group
expect
(
page
).
to
have_content
(
...
...
qa/qa/specs/features/browser_ui/1_manage/login/log_into_mattermost_via_gitlab_spec.rb
View file @
1fec44af
...
...
@@ -11,7 +11,7 @@ module QA
Runtime
::
Browser
.
visit
(
:mattermost
,
Page
::
Mattermost
::
Login
)
Page
::
Mattermost
::
Login
.
perform
(
&
:sign_in_using_oauth
)
Page
::
Mattermost
::
Main
.
perform
do
|
page
|
Page
::
Mattermost
::
Main
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
expect
(
page
).
to
have_content
(
/(Welcome to: Mattermost|Logout GitLab Mattermost)/
)
end
end
...
...
qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb
View file @
1fec44af
...
...
@@ -15,7 +15,7 @@ module QA
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_members_settings
)
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_member
(
user
.
username
)
end
...
...
qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb
View file @
1fec44af
...
...
@@ -30,7 +30,7 @@ module QA
project
.
visit!
Page
::
Project
::
Show
.
perform
(
&
:go_to_members_settings
)
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_member
(
user
.
username
)
end
...
...
qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb
View file @
1fec44af
...
...
@@ -57,7 +57,7 @@ module QA
@project
.
visit!
Page
::
Project
::
Show
.
perform
(
&
:create_new_file!
)
Page
::
File
::
Form
.
perform
do
|
page
|
Page
::
File
::
Form
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
select_template
template
[
:file_name
],
template
[
:name
]
end
...
...
qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb
View file @
1fec44af
...
...
@@ -35,7 +35,7 @@ module QA
def
view_commit
@project
.
visit!
Page
::
Project
::
Show
.
perform
do
|
page
|
Page
::
Project
::
Show
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_commit
(
@commit_message
)
end
end
...
...
qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb
View file @
1fec44af
...
...
@@ -57,7 +57,7 @@ module QA
@project
.
visit!
Page
::
Project
::
Show
.
perform
(
&
:open_web_ide!
)
Page
::
Project
::
WebIDE
::
Edit
.
perform
do
|
page
|
Page
::
Project
::
WebIDE
::
Edit
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
create_new_file_from_template
template
[
:file_name
],
template
[
:name
]
expect
(
page
.
has_file?
(
template
[
:file_name
])).
to
be_truthy
...
...
qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb
View file @
1fec44af
...
...
@@ -16,7 +16,7 @@ module QA
validate_content
(
'My First Wiki Content'
)
Page
::
Project
::
Wiki
::
Edit
.
perform
(
&
:click_edit
)
Page
::
Project
::
Wiki
::
New
.
perform
do
|
page
|
Page
::
Project
::
Wiki
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
set_content
(
"My Second Wiki Content"
)
page
.
save_changes
end
...
...
qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb
View file @
1fec44af
...
...
@@ -23,7 +23,7 @@ module QA
issue
.
title
=
'Performance bar test'
end
Page
::
Layout
::
PerformanceBar
.
perform
do
|
page
|
Page
::
Layout
::
PerformanceBar
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
expect
(
page
).
to
have_performance_bar
expect
(
page
).
to
have_detailed_metrics
expect
(
page
).
to
have_request_for
(
'realtime_changes'
)
# Always requested on issue pages
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_audit_logs_1_spec.rb
View file @
1fec44af
...
...
@@ -93,12 +93,12 @@ module QA
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_members_settings
)
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
invite_group
(
@group
.
path
)
end
Page
::
Project
::
Menu
.
perform
(
&
:go_to_members_settings
)
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
remove_group
(
@group
.
path
)
end
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_ldap_sync_spec.rb
View file @
1fec44af
...
...
@@ -68,7 +68,7 @@ module QA
Page
::
Group
::
Menu
.
perform
(
&
:go_to_ldap_sync_settings
)
EE
::
Page
::
Group
::
Settings
::
LDAPSync
.
perform
do
|
page
|
EE
::
Page
::
Group
::
Settings
::
LDAPSync
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
set_sync_method
(
'LDAP Group cn'
)
page
.
set_group_cn
(
'Engineering'
)
page
.
click_add_sync_button
...
...
@@ -118,7 +118,7 @@ module QA
Page
::
Group
::
Menu
.
perform
(
&
:go_to_ldap_sync_settings
)
EE
::
Page
::
Group
::
Settings
::
LDAPSync
.
perform
do
|
page
|
EE
::
Page
::
Group
::
Settings
::
LDAPSync
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
set_user_filter
(
'(&(objectClass=person)(cn=HR*))'
)
page
.
click_add_sync_button
end
...
...
@@ -171,7 +171,7 @@ module QA
end
def
verify_users_synced
(
expected_users
)
EE
::
Page
::
Group
::
Members
.
perform
do
|
page
|
EE
::
Page
::
Group
::
Members
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_sync_now
users_synchronised
=
page
.
retry_until
(
reload:
true
)
do
expected_users
.
map
{
|
user
|
page
.
has_content?
(
user
)
}.
all?
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_saml_sso_spec.rb
View file @
1fec44af
...
...
@@ -23,7 +23,7 @@ module QA
it
'User logs in to group with SAML SSO'
do
Page
::
Group
::
Menu
.
perform
(
&
:go_to_saml_sso_group_settings
)
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
perform
do
|
page
|
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
set_id_provider_sso_url
(
QA
::
EE
::
Runtime
::
Saml
.
idp_sso_url
)
page
.
set_cert_fingerprint
(
QA
::
EE
::
Runtime
::
Saml
.
idp_certificate_fingerprint
)
page
.
click_save_changes
...
...
@@ -47,7 +47,7 @@ module QA
it
'Lets group admin test settings'
do
Page
::
Group
::
Menu
.
perform
(
&
:go_to_saml_sso_group_settings
)
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
perform
do
|
page
|
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
set_id_provider_sso_url
(
QA
::
EE
::
Runtime
::
Saml
.
idp_sso_url
)
page
.
set_cert_fingerprint
(
QA
::
EE
::
Runtime
::
Saml
.
idp_certificate_fingerprint
)
page
.
click_save_changes
...
...
@@ -86,7 +86,7 @@ module QA
Page
::
Group
::
Menu
.
perform
(
&
:go_to_saml_sso_group_settings
)
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
perform
do
|
page
|
EE
::
Page
::
Group
::
Settings
::
SamlSSO
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
enforce_sso
page
.
set_id_provider_sso_url
(
QA
::
EE
::
Runtime
::
Saml
.
idp_sso_url
)
page
.
set_cert_fingerprint
(
QA
::
EE
::
Runtime
::
Saml
.
idp_certificate_fingerprint
)
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_audit_logs_spec.rb
View file @
1fec44af
...
...
@@ -38,7 +38,7 @@ module QA
@project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_members_settings
)
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Members
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
add_member
(
user
.
username
)
end
end
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb
View file @
1fec44af
...
...
@@ -56,7 +56,7 @@ module QA
@group
.
visit!
Page
::
Group
::
Show
.
perform
(
&
:go_to_new_project
)
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_create_from_template_tab
expect
(
page
).
to
have_text
(
built_in
)
...
...
@@ -86,13 +86,13 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:click_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_template_settings
)
Page
::
Admin
::
Settings
::
Templates
.
perform
do
|
page
|
Page
::
Admin
::
Settings
::
Templates
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
choose_custom_project_template
(
"
#{
@template_container_group_name
}
"
)
end
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_template_settings
)
Page
::
Admin
::
Settings
::
Templates
.
perform
do
|
page
|
Page
::
Admin
::
Settings
::
Templates
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
expect
(
page
.
current_custom_project_template
).
to
include
@template_container_group_name
end
...
...
@@ -105,7 +105,7 @@ module QA
end
it
'successfully imports the project using template'
do
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
expect
(
page
.
instance_template_tab_badge_text
).
to
eq
"1"
expect
(
page
).
to
have_text
(
@template_project
.
name
)
end
...
...
@@ -133,7 +133,7 @@ module QA
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
Page
::
Main
::
Menu
.
perform
(
&
:go_to_groups
)
Page
::
Dashboard
::
Groups
.
perform
{
|
page
|
page
.
click_group
(
Runtime
::
Namespace
.
sandbox_name
)
}
Page
::
Dashboard
::
Groups
.
perform
{
|
page
|
page
.
click_group
(
Runtime
::
Namespace
.
sandbox_name
)
}
# rubocop:disable QA/AmbiguousPageObjectName
Page
::
Project
::
Menu
.
perform
(
&
:click_settings
)
Page
::
Group
::
Settings
::
General
.
perform
do
|
settings
|
...
...
@@ -155,7 +155,7 @@ module QA
end
it
'successfully imports the project using template'
do
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
expect
(
page
.
group_template_tab_badge_text
).
to
eq
"1"
expect
(
page
).
to
have_text
(
@template_container_group_name
)
expect
(
page
).
to
have_text
(
@template_project
.
name
)
...
...
@@ -173,7 +173,7 @@ module QA
end
def
create_project_using_template
(
project_name
:,
namespace
:,
template_name
:)
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
use_template_for_project
(
template_name
)
page
.
choose_namespace
(
namespace
)
page
.
choose_name
(
"
#{
project_name
}
#{
SecureRandom
.
hex
(
8
)
}
"
)
...
...
qa/qa/specs/features/ee/browser_ui/secure/security_reports_spec.rb
View file @
1fec44af
...
...
@@ -95,7 +95,7 @@ module QA
it
'displays security reports in the group security dashboard'
do
Page
::
Main
::
Menu
.
perform
(
&
:go_to_groups
)
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
page
.
click_group
@project
.
group
.
path
end
Page
::
Group
::
Menu
.
perform
(
&
:click_group_security_link
)
...
...
@@ -120,7 +120,7 @@ module QA
it
'displays the Dependency List'
do
Page
::
Project
::
Menu
.
perform
(
&
:click_on_dependency_list
)
EE
::
Page
::
Project
::
Secure
::
DependencyList
.
perform
do
|
page
|
EE
::
Page
::
Project
::
Secure
::
DependencyList
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
expect
(
page
).
to
have_dependency_count_of
number_of_dependencies_in_fixture
end
end
...
...
qa/qa/tools/revoke_all_personal_access_tokens.rb
View file @
1fec44af
...
...
@@ -32,7 +32,7 @@ module QA
token_name
=
'api-test-token'
Page
::
Profile
::
PersonalAccessTokens
.
perform
do
|
page
|
Page
::
Profile
::
PersonalAccessTokens
.
perform
do
|
page
|
# rubocop:disable QA/AmbiguousPageObjectName
while
page
.
has_token_row_for_name?
(
token_name
)
page
.
revoke_first_token_with_name
(
token_name
)
print
"
\e
[32m.
\e
[0m"
...
...
rubocop/cop/qa/ambiguous_page_object_name.rb
0 → 100644
View file @
1fec44af
# frozen_string_literal: true
require_relative
'../../qa_helpers'
module
RuboCop
module
Cop
module
QA
# This cop checks for the usage of the ambiguous name "page"
#
# @example
#
# # bad
# Page::Object.perform do |page| do ...
# Page::Another.perform { |page| ... }
#
# # good
# Page::Object.perform do |object| do ...
# Page::Another.perform { |another| ... }
class
AmbiguousPageObjectName
<
RuboCop
::
Cop
::
Cop
include
QAHelpers
MESSAGE
=
"Don't use 'page' as a name for a Page Object. Use `%s` instead."
.
freeze
def_node_matcher
:ambiguous_page?
,
<<~
PATTERN
(block
(send
(const ...) :perform)
(args
(arg :page)) ...)
PATTERN
def
on_block
(
node
)
return
unless
in_qa_file?
(
node
)
return
unless
ambiguous_page?
(
node
)
add_offense
(
node
.
arguments
.
each_node
(
:arg
).
first
,
message:
MESSAGE
%
page_object_name
(
node
))
end
private
def
page_object_name
(
node
)
node
.
send_node
.
children
[
-
2
].
const_name
.
downcase
.
split
(
'::'
).
last
end
end
end
end
end
rubocop/rubocop.rb
View file @
1fec44af
...
...
@@ -36,6 +36,7 @@ require_relative 'cop/rspec/env_assignment'
require_relative
'cop/rspec/factories_in_migration_specs'
require_relative
'cop/rspec/top_level_describe_path'
require_relative
'cop/qa/element_with_pattern'
require_relative
'cop/qa/ambiguous_page_object_name'
require_relative
'cop/sidekiq_options_queue'
require_relative
'cop/scalability/file_uploads'
require_relative
'cop/destroy_all'
...
...
spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb
0 → 100644
View file @
1fec44af
# frozen_string_literal: true
require
'spec_helper'
require
'rubocop'
require
'rubocop/rspec/support'
require_relative
'../../../../rubocop/cop/qa/ambiguous_page_object_name'
describe
RuboCop
::
Cop
::
QA
::
AmbiguousPageObjectName
do
include
CopHelper
let
(
:source_file
)
{
'qa/page.rb'
}
subject
(
:cop
)
{
described_class
.
new
}
context
'in a QA file'
do
before
do
allow
(
cop
).
to
receive
(
:in_qa_file?
).
and_return
(
true
)
end
it
"registers an offense for pages named `page`"
do
expect_offense
(
<<-
RUBY
)
Page::Layout::Bar.perform do |page|
^^^^ Don't use 'page' as a name for a Page Object. Use `bar` instead.
expect(page).to have_performance_bar
expect(page).to have_detailed_metrics
end
RUBY
end
it
"doesnt offend if the page object is named otherwise"
do
expect_no_offenses
(
<<-
RUBY
)
Page::Object.perform do |obj|
obj.whatever
end
RUBY
end
end
context
'outside of a QA file'
do
before
do
allow
(
cop
).
to
receive
(
:in_qa_file?
).
and_return
(
false
)
end
it
"does not register an offense"
do
expect_no_offenses
(
<<-
RUBY
)
Page::Object.perform do |page|
page.do_something
end
RUBY
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