Commit 68fbe9c8 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-shl-fix-group-audit-logs-e2e-tests' into 'master'

Fix group_audit_logs_1_spec e2e test failures on staging

Closes #34237

See merge request gitlab-org/gitlab!19077
parents 2b075638 d2e1a5ee
...@@ -14,8 +14,7 @@ module QA ...@@ -14,8 +14,7 @@ module QA
describe 'Group audit logs' do describe 'Group audit logs' do
before(:all) do before(:all) do
sign_in @group = Resource::Group.fabricate_via_api! do |resource|
@group = Resource::Group.fabricate_via_browser_ui! do |resource|
resource.path = "test-group-#{SecureRandom.hex(8)}" resource.path = "test-group-#{SecureRandom.hex(8)}"
end end
end end
...@@ -31,7 +30,7 @@ module QA ...@@ -31,7 +30,7 @@ module QA
context 'Add group' do context 'Add group' do
before do before do
sign_in sign_in
@group.visit! Resource::Group.fabricate_via_browser_ui!.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item) Page::Group::Menu.perform(&:click_group_general_settings_item)
end end
...@@ -40,7 +39,7 @@ module QA ...@@ -40,7 +39,7 @@ module QA
context 'Change repository size limit' do context 'Change repository size limit' do
before do before do
sign_in sign_in(as_admin: true)
@group.visit! @group.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item) Page::Group::Menu.perform(&:click_group_general_settings_item)
Page::Group::Settings::General.perform do |settings| Page::Group::Settings::General.perform do |settings|
...@@ -109,10 +108,12 @@ module QA ...@@ -109,10 +108,12 @@ module QA
end end
end end
def sign_in def sign_in(as_admin: false)
unless Page::Main::Menu.perform { |p| p.has_personal_area?(wait: 0) } unless Page::Main::Menu.perform(&:signed_in?)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform do |login|
as_admin ? login.sign_in_using_admin_credentials : login.sign_in_using_credentials
end
end end
end 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