Commit 78f32f6f authored by Andrejs Cunskis's avatar Andrejs Cunskis Committed by Mark Lapierre

E2E: Move label migration validation in to existing spec

parent 631c7c83
......@@ -52,6 +52,9 @@ module QA
# @param [String] gitlab_token
# @return [void]
def connect_gitlab_instance(gitlab_url, gitlab_token)
# Wait until element is present and refresh if not in case feature flag did not kick in
wait_until(max_duration: 10) { has_element?(:import_gitlab_url, wait: 1) }
set_gitlab_url(gitlab_url)
set_gitlab_token(gitlab_token)
......
......@@ -3,19 +3,20 @@
module QA
RSpec.describe 'Manage', :requires_admin do
describe 'Bulk group import' do
let!(:api_client) { Runtime::API::Client.as_admin }
let!(:admin_api_client) { Runtime::API::Client.as_admin }
let!(:user) do
Resource::User.fabricate_via_api! do |usr|
usr.api_client = api_client
usr.api_client = admin_api_client
usr.hard_delete_on_api_removal = true
end
end
let!(:personal_access_token) { Runtime::API::Client.new(user: user).personal_access_token }
let!(:api_client) { Runtime::API::Client.new(user: user) }
let!(:personal_access_token) { api_client.personal_access_token }
let!(:sandbox) do
Resource::Sandbox.fabricate_via_api! do |group|
group.api_client = api_client
group.api_client = admin_api_client
end
end
......@@ -61,7 +62,6 @@ module QA
before do
sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER)
source_group.add_member(user, Resource::Members::AccessLevel::MAINTAINER)
Flow::Login.sign_in(as: user)
Page::Main::Menu.new.go_to_import_group
......@@ -71,30 +71,13 @@ module QA
# Non blocking issues:
# https://gitlab.com/gitlab-org/gitlab/-/issues/331252
it(
'imports group with subgroups',
'imports group with subgroups and labels',
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1785',
quarantine: {
only: { job: 'relative_url' },
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/330344',
type: :bug
}
) do
Page::Group::BulkImport.perform do |import_page|
import_page.import_group(source_group.path, sandbox.path)
aggregate_failures do
expect(import_page).to have_imported_group(source_group.path, wait: 120)
expect { imported_group.reload! }.to eventually_eq(source_group).within(duration: 30)
expect { imported_subgroup.reload! }.to eventually_eq(subgroup).within(duration: 30)
end
end
end
it(
'imports group labels',
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1785',
quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/331704', type: :bug }
) do
Resource::GroupLabel.fabricate_via_api! do |label|
label.api_client = api_client
......@@ -113,6 +96,9 @@ module QA
aggregate_failures do
expect(import_page).to have_imported_group(source_group.path, wait: 120)
expect { imported_group.reload! }.to eventually_eq(source_group).within(duration: 10)
expect { imported_subgroup.reload! }.to eventually_eq(subgroup).within(duration: 10)
expect { imported_group.labels }.to eventually_include(*source_group.labels).within(duration: 10)
expect { imported_subgroup.labels }.to eventually_include(*subgroup.labels).within(duration: 10)
end
......@@ -121,7 +107,6 @@ module QA
after do
user.remove_via_api!
source_group.remove_via_api!
end
after(:all) do
......
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