Commit d2e1a5ee authored by Sanad Liaquat's avatar Sanad Liaquat

Fix e2e test failures on staging

Move UI related code out of before(:all) and use admin to log in
for changing repository size
parent 54bbaf83
......@@ -14,8 +14,7 @@ module QA
describe 'Group audit logs' do
before(:all) do
sign_in
@group = Resource::Group.fabricate_via_browser_ui! do |resource|
@group = Resource::Group.fabricate_via_api! do |resource|
resource.path = "test-group-#{SecureRandom.hex(8)}"
end
end
......@@ -31,7 +30,7 @@ module QA
context 'Add group' do
before do
sign_in
@group.visit!
Resource::Group.fabricate_via_browser_ui!.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item)
end
......@@ -40,7 +39,7 @@ module QA
context 'Change repository size limit' do
before do
sign_in
sign_in(as_admin: true)
@group.visit!
Page::Group::Menu.perform(&:click_group_general_settings_item)
Page::Group::Settings::General.perform do |settings|
......@@ -109,10 +108,12 @@ module QA
end
end
def sign_in
unless Page::Main::Menu.perform { |p| p.has_personal_area?(wait: 0) }
def sign_in(as_admin: false)
unless Page::Main::Menu.perform(&:signed_in?)
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
......
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