Commit 16f380e3 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'qa-shl-improve-instance-audit-log-spec-name' into 'master'

Shorter and clearer descriptions for audit event e2e specs

See merge request gitlab-org/gitlab!27877
parents 5ab115e9 e0609750
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/issues/36817', type: :bug } do context 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/30226', type: :bug } do
describe 'Merge request rebasing' do describe 'Merge request rebasing' do
it 'user rebases source branch of merge request' do it 'user rebases source branch of merge request' do
Flow::Login.sign_in Flow::Login.sign_in
......
...@@ -7,8 +7,8 @@ module QA ...@@ -7,8 +7,8 @@ module QA
let(:api_client) { Runtime::API::Client.new(:gitlab) } let(:api_client) { Runtime::API::Client.new(:gitlab) }
shared_examples 'group audit event logs' do |expected_events| shared_examples 'audit event' do |expected_events|
it 'logs audit events' do it 'logs audit events for UI operations' do
wait_for_audit_events(expected_events, group) wait_for_audit_events(expected_events, group)
Page::Group::Menu.perform(&:go_to_audit_events_settings) Page::Group::Menu.perform(&:go_to_audit_events_settings)
...@@ -24,7 +24,7 @@ module QA ...@@ -24,7 +24,7 @@ module QA
end end
end end
describe 'Group audit logs' do describe 'Group' do
before(:all) do before(:all) do
@group = Resource::Group.fabricate_via_api! do |resource| @group = Resource::Group.fabricate_via_api! do |resource|
resource.path = "test-group-#{SecureRandom.hex(8)}" resource.path = "test-group-#{SecureRandom.hex(8)}"
...@@ -56,7 +56,7 @@ module QA ...@@ -56,7 +56,7 @@ module QA
Page::Group::Menu.perform(&:click_group_general_settings_item) Page::Group::Menu.perform(&:click_group_general_settings_item)
end end
it_behaves_like 'group audit event logs', ['Add group'] do it_behaves_like 'audit event', ['Add group'] do
let(:group) do let(:group) do
Resource::Group.fabricate_via_api! do |group| Resource::Group.fabricate_via_api! do |group|
group.name = group_name group.name = group_name
...@@ -75,7 +75,7 @@ module QA ...@@ -75,7 +75,7 @@ module QA
settings.click_save_name_visibility_settings_button settings.click_save_name_visibility_settings_button
end end
end end
it_behaves_like 'group audit event logs', ['Change repository size limit'] it_behaves_like 'audit event', ['Change repository size limit']
end end
context 'Update group name' do context 'Update group name' do
...@@ -90,7 +90,7 @@ module QA ...@@ -90,7 +90,7 @@ module QA
end end
end end
it_behaves_like 'group audit event logs', ['Change name'] it_behaves_like 'audit event', ['Change name']
end end
context 'Add user, change access level, remove user' do context 'Add user, change access level, remove user' do
...@@ -105,7 +105,7 @@ module QA ...@@ -105,7 +105,7 @@ module QA
end end
end end
it_behaves_like 'group audit event logs', ['Add user access as guest', 'Change access level', 'Remove user access'] it_behaves_like 'audit event', ['Add user access as guest', 'Change access level', 'Remove user access']
end end
context 'Add and remove project access' do context 'Add and remove project access' do
...@@ -126,7 +126,7 @@ module QA ...@@ -126,7 +126,7 @@ module QA
@group.visit! @group.visit!
end end
it_behaves_like 'group audit event logs', ['Add project access', 'Remove project access'] it_behaves_like 'audit event', ['Add project access', 'Remove project access']
end end
end end
......
...@@ -3,8 +3,8 @@ require 'securerandom' ...@@ -3,8 +3,8 @@ require 'securerandom'
module QA module QA
context 'Manage' do context 'Manage' do
shared_examples 'group audit event logs' do |expected_events| shared_examples 'audit event' do |expected_events|
it 'logs audit events' do it 'logs audit events for UI operations' do
Page::Group::Menu.perform(&:go_to_audit_events_settings) Page::Group::Menu.perform(&:go_to_audit_events_settings)
expected_events.each do |expected_event| expected_events.each do |expected_event|
expect(page).to have_text(expected_event) expect(page).to have_text(expected_event)
...@@ -12,7 +12,7 @@ module QA ...@@ -12,7 +12,7 @@ module QA
end end
end end
describe 'Group audit logs' do describe 'Group' do
before(:all) do before(:all) do
@group = Resource::Group.fabricate_via_api! do |resource| @group = Resource::Group.fabricate_via_api! do |resource|
resource.path = "test-group-#{SecureRandom.hex(8)}" resource.path = "test-group-#{SecureRandom.hex(8)}"
...@@ -31,7 +31,7 @@ module QA ...@@ -31,7 +31,7 @@ module QA
Page::Group::Settings::General.perform(&:set_lfs_enabled) Page::Group::Settings::General.perform(&:set_lfs_enabled)
end end
it_behaves_like 'group audit event logs', ["Change lfs enabled from false to true", "Change lfs enabled from true to false"] it_behaves_like 'audit event', ["Change lfs enabled from false to true", "Change lfs enabled from true to false"]
end end
context 'Enable and disable LFS' do context 'Enable and disable LFS' do
...@@ -45,7 +45,7 @@ module QA ...@@ -45,7 +45,7 @@ module QA
Page::Group::Settings::General.perform(&:set_membership_lock_disabled) Page::Group::Settings::General.perform(&:set_membership_lock_disabled)
end end
it_behaves_like 'group audit event logs', ["Change membership lock from true to false", "Change membership lock from false to true"] it_behaves_like 'audit event', ["Change membership lock from true to false", "Change membership lock from false to true"]
end end
context 'Enable and disable allow user request access' do context 'Enable and disable allow user request access' do
...@@ -59,7 +59,7 @@ module QA ...@@ -59,7 +59,7 @@ module QA
Page::Group::Settings::General.perform(&:toggle_request_access) Page::Group::Settings::General.perform(&:toggle_request_access)
end end
it_behaves_like 'group audit event logs', ["Change request access enabled from true to false", "Change request access enabled from false to true"] it_behaves_like 'audit event', ["Change request access enabled from true to false", "Change request access enabled from false to true"]
end end
# Bug issue: https://gitlab.com/gitlab-org/gitlab/issues/31764 # Bug issue: https://gitlab.com/gitlab-org/gitlab/issues/31764
...@@ -76,7 +76,7 @@ module QA ...@@ -76,7 +76,7 @@ module QA
Page::Group::Settings::General.perform(&:set_require_2fa_disabled) Page::Group::Settings::General.perform(&:set_require_2fa_disabled)
end end
it_behaves_like 'group audit event logs', ["Change require two factor authentication from true to false", "Change require two factor authentication from false to true"] it_behaves_like 'audit event', ["Change require two factor authentication from true to false", "Change require two factor authentication from false to true"]
end end
context 'Change project creation level' do context 'Change project creation level' do
...@@ -89,7 +89,7 @@ module QA ...@@ -89,7 +89,7 @@ module QA
end end
end end
it_behaves_like 'group audit event logs', ["Change project creation level"] it_behaves_like 'audit event', ["Change project creation level"]
end end
end end
......
...@@ -3,7 +3,7 @@ require 'securerandom' ...@@ -3,7 +3,7 @@ require 'securerandom'
module QA module QA
context 'Manage' do context 'Manage' do
shared_examples 'instance audit event logs' do |expected_events| shared_examples 'audit event' do |expected_events|
it 'logs audit events for UI operations' do it 'logs audit events for UI operations' do
sign_in sign_in
...@@ -17,7 +17,7 @@ module QA ...@@ -17,7 +17,7 @@ module QA
end end
end end
describe 'Instance audit logs', :requires_admin do describe 'Instance', :requires_admin do
context 'Failed sign in' do context 'Failed sign in' do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
sign_in sign_in
end end
it_behaves_like 'instance audit event logs', ["Failed to login with STANDARD authentication"] it_behaves_like 'audit event', ["Failed to login with STANDARD authentication"]
end end
context 'Successful sign in' do context 'Successful sign in' do
...@@ -40,18 +40,18 @@ module QA ...@@ -40,18 +40,18 @@ module QA
sign_in sign_in
end end
it_behaves_like 'instance audit event logs', ["Signed in with STANDARD authentication"] it_behaves_like 'audit event', ["Signed in with STANDARD authentication"]
end end
context 'Add SSH key' do context 'Add SSH key' do
before do before do
sign_in sign_in
Resource::SSHKey.fabricate_via_browser_ui! do |resource| Resource::SSHKey.fabricate_via_browser_ui! do |resource|
resource.title = "key for instance audit event logs test #{Time.now.to_f}" resource.title = "key for audit event test #{Time.now.to_f}"
end end
end end
it_behaves_like 'instance audit event logs', ["Added SSH key"] it_behaves_like 'audit event', ["Added SSH key"]
end end
context 'Add and delete email' do context 'Add and delete email' do
...@@ -66,7 +66,7 @@ module QA ...@@ -66,7 +66,7 @@ module QA
end end
end end
it_behaves_like 'instance audit event logs', ["Added email", "Removed email"] it_behaves_like 'audit event', ["Added email", "Removed email"]
end end
context 'Change password', :skip_signup_disabled do context 'Change password', :skip_signup_disabled do
...@@ -89,7 +89,7 @@ module QA ...@@ -89,7 +89,7 @@ module QA
sign_in sign_in
end end
it_behaves_like 'instance audit event logs', ["Changed password"] it_behaves_like 'audit event', ["Changed password"]
end end
context 'Start and stop user impersonation' do context 'Start and stop user impersonation' do
...@@ -108,7 +108,7 @@ module QA ...@@ -108,7 +108,7 @@ module QA
Page::Main::Menu.perform(&:click_stop_impersonation_link) Page::Main::Menu.perform(&:click_stop_impersonation_link)
end end
it_behaves_like 'instance audit event logs', ["Started Impersonation", "Stopped Impersonation"] it_behaves_like 'audit event', ["Started Impersonation", "Stopped Impersonation"]
end end
def sign_in def sign_in
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module QA module QA
context 'Manage' do context 'Manage' do
shared_examples 'project audit event logs' do |expected_events| shared_examples 'audit event' do |expected_events|
it 'logs audit events for UI operations' do it 'logs audit events for UI operations' do
Page::Project::Menu.perform(&:go_to_audit_events_settings) Page::Project::Menu.perform(&:go_to_audit_events_settings)
expected_events.each do |expected_event| expected_events.each do |expected_event|
...@@ -11,7 +11,7 @@ module QA ...@@ -11,7 +11,7 @@ module QA
end end
end end
describe 'Project audit logs' do describe 'Project' do
let(:project) do let(:project) do
Resource::Project.fabricate_via_api! do |project| Resource::Project.fabricate_via_api! do |project|
project.name = 'awesome-project' project.name = 'awesome-project'
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
project.initialize_with_readme = true project.initialize_with_readme = true
end.visit! end.visit!
end end
it_behaves_like 'project audit event logs', ["Add project"] it_behaves_like 'audit event', ["Add project"]
end end
context "Add user access as guest" do context "Add user access as guest" do
...@@ -45,7 +45,7 @@ module QA ...@@ -45,7 +45,7 @@ module QA
end end
end end
it_behaves_like 'project audit event logs', ["Add user access as guest"] it_behaves_like 'audit event', ["Add user access as guest"]
end end
context "Add deploy key" do context "Add deploy key" do
...@@ -61,7 +61,7 @@ module QA ...@@ -61,7 +61,7 @@ module QA
end end
end end
it_behaves_like 'project audit event logs', ["Add deploy key"] it_behaves_like 'audit event', ["Add deploy key"]
end end
context "Change visibility" do context "Change visibility" do
...@@ -77,7 +77,7 @@ module QA ...@@ -77,7 +77,7 @@ module QA
end end
end end
it_behaves_like 'project audit event logs', ["Change visibility from public to internal"] it_behaves_like 'audit event', ["Change visibility from public to internal"]
end end
context "Export file download", quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/issues/202249', type: :bug } do context "Export file download", quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/issues/202249', type: :bug } do
...@@ -94,7 +94,7 @@ module QA ...@@ -94,7 +94,7 @@ module QA
end end
end end
it_behaves_like 'project audit event logs', ["Export file download started"] it_behaves_like 'audit event', ["Export file download started"]
end end
context "Project archive and unarchive" do context "Project archive and unarchive" do
...@@ -114,7 +114,7 @@ module QA ...@@ -114,7 +114,7 @@ module QA
end end
end end
it_behaves_like 'project audit event logs', ["Project archived", "Project unarchived"] it_behaves_like 'audit event', ["Project archived", "Project unarchived"]
end end
def sign_in def sign_in
......
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