Commit 5d43c09d authored by Dan Davison's avatar Dan Davison Committed by Ramya Authappan

Refactor ambiguous page-object names

Remove Rubocop disable statements
parent e36c32c4
......@@ -86,13 +86,13 @@ module QA
project.visit!
Page::Project::Menu.perform(&:go_to_members_settings)
Page::Project::Settings::Members.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
page.invite_group(@group.path)
Page::Project::Settings::Members.perform do |members|
members.invite_group(@group.path)
end
Page::Project::Menu.perform(&:go_to_members_settings)
Page::Project::Settings::Members.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
page.remove_group(@group.path)
Page::Project::Settings::Members.perform do |members|
members.remove_group(@group.path)
end
@group.visit!
......
......@@ -68,10 +68,10 @@ module QA
Page::Group::Menu.perform(&:go_to_ldap_sync_settings)
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
EE::Page::Group::Settings::LDAPSync.perform do |settings|
settings.set_sync_method('LDAP Group cn')
settings.set_group_cn('Engineering')
settings.click_add_sync_button
end
Page::Group::Menu.perform(&:click_group_members_item)
......@@ -118,9 +118,9 @@ module QA
Page::Group::Menu.perform(&:go_to_ldap_sync_settings)
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
EE::Page::Group::Settings::LDAPSync.perform do |settings|
settings.set_user_filter('(&(objectClass=person)(cn=HR*))')
settings.click_add_sync_button
end
Page::Group::Menu.perform(&:click_group_members_item)
......@@ -171,10 +171,10 @@ module QA
end
def verify_users_synced(expected_users)
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?
EE::Page::Group::Members.perform do |members|
members.click_sync_now
users_synchronised = members.retry_until(reload: true) do
expected_users.map { |user| members.has_content?(user) }.all?
end
expect(users_synchronised).to be_truthy
end
......
......@@ -40,8 +40,8 @@ module QA
@project.visit!
Page::Project::Menu.perform(&:go_to_members_settings)
Page::Project::Settings::Members.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
page.add_member(user.username)
Page::Project::Settings::Members.perform do |members|
members.add_member(user.username)
end
end
......
......@@ -115,8 +115,8 @@ 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| # rubocop:disable QA/AmbiguousPageObjectName
page.click_group @project.group.path
Page::Dashboard::Groups.perform do |groups|
groups.click_group @project.group.path
end
Page::Group::Menu.perform(&:click_group_security_link)
......@@ -144,8 +144,8 @@ module QA
it 'displays the Dependency List' do
Page::Project::Menu.perform(&:click_on_dependency_list)
EE::Page::Project::Secure::DependencyList.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
expect(page).to have_dependency_count_of number_of_dependencies_in_fixture
EE::Page::Project::Secure::DependencyList.perform do |dependency_list|
expect(dependency_list).to have_dependency_count_of number_of_dependencies_in_fixture
end
end
end
......
......@@ -32,9 +32,9 @@ module QA
token_name = 'api-test-token'
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)
Page::Profile::PersonalAccessTokens.perform do |tokens_page|
while tokens_page.has_token_row_for_name?(token_name)
tokens_page.revoke_first_token_with_name(token_name)
print "\e[32m.\e[0m"
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment