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