Commit be63a5e0 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-shl-unskip-audit-log-specs' into 'master'

Fix and un-skip LFS and 2FA audit log specs

Closes gitlab-org/quality/team-tasks#566 and gitlab-org/quality/team-tasks#567

See merge request gitlab-org/gitlab!39845
parents 0cb7e8cb 4d4ce680
......@@ -19,8 +19,7 @@ module QA
end
end
# Bug issue: https://gitlab.com/gitlab-org/gitlab/issues/14756
context 'Disable and Enable LFS', :skip do
context 'Disable and Enable LFS' do
before do
sign_in
@group.visit!
......@@ -31,10 +30,10 @@ module QA
Page::Group::Settings::General.perform(&:set_lfs_enabled)
end
it_behaves_like 'audit event', ["Changed lfs enabled from false to true", "Changed lfs enabled from true to false"]
it_behaves_like 'audit event', ["Changed lfs enabled from false to true", /Changed lfs enabled( from true)? to false/]
end
context 'Enable and disable LFS' do
context 'Enable and disable membership lock' do
before do
sign_in
@group.visit!
......@@ -62,20 +61,45 @@ module QA
it_behaves_like 'audit event', ["Changed request access enabled from true to false", "Changed request access enabled from false to true"]
end
# Bug issue: https://gitlab.com/gitlab-org/gitlab/issues/31764
context 'Enable and disable 2FA requirement', :skip do
context 'Enable and disable 2FA requirement', :requires_admin, :skip_live_env do
let!(:owner_user) do
Resource::User.fabricate_via_api!
end
let!(:owner_api_client) do
Runtime::API::Client.new(:gitlab, user: owner_user)
end
let!(:sandbox_group) do
Resource::Sandbox.fabricate! do |sandbox_group|
sandbox_group.path = "gitlab-qa-2fa-recovery-sandbox-group-#{SecureRandom.hex(4)}"
sandbox_group.api_client = owner_api_client
end
end
let!(:two_fa_group) do
QA::Resource::Group.fabricate_via_api! do |group|
group.sandbox = sandbox_group
group.api_client = owner_api_client
end
end
before do
sign_in
@group.visit!
sign_in(as: owner_user)
two_fa_group.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item)
Page::Group::Settings::General.perform(&:set_require_2fa_enabled)
Page::Profile::TwoFactorAuth.perform(&:click_configure_it_later_button)
@group.visit!
two_fa_group.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item)
Page::Group::Settings::General.perform(&:set_require_2fa_disabled)
end
after do
Page::Main::Menu.perform(&:sign_out_if_signed_in)
end
it_behaves_like 'audit event', ["Changed require two factor authentication from true to false", "Changed require two factor authentication from false to true"]
end
......@@ -93,11 +117,9 @@ module QA
end
end
def sign_in
unless Page::Main::Menu.perform { |p| p.has_personal_area?(wait: 0) }
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
def sign_in(as: nil)
Page::Main::Menu.perform(&:sign_out_if_signed_in)
Flow::Login.sign_in(as: as)
end
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