Commit 0e48348b authored by Andrejs Cunskis's avatar Andrejs Cunskis Committed by Mark Lapierre

E2E: Update bulk group import via api spec

parent 22cf4a79
......@@ -35,10 +35,7 @@ module QA
end
def fabricate_via_api!
response = post(Runtime::API::Request.new(api_client, api_post_path).url, api_post_body)
@import_id = parse_body(response)[:id]
"#{gitlab_address}/#{full_path}"
resource_web_url(api_post)
end
def api_post_path
......@@ -71,6 +68,18 @@ module QA
parse_body(response)[:status]
end
private
def transform_api_resource(api_resource)
return api_resource if api_resource[:web_url]
# override transformation only for /bulk_imports endpoint which doesn't have web_url in response and
# ignore others so import_id is not overwritten incorrectly
api_resource[:web_url] = "#{gitlab_address}/#{full_path}"
api_resource[:import_id] = api_resource[:id]
api_resource
end
end
end
end
......@@ -78,20 +78,16 @@ module QA
'imports group with subgroups and labels',
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1871'
) do
Page::Group::BulkImport.perform do |import_page|
imported_group
expect { imported_group.import_status }.to(
eventually_eq('finished').within(max_duration: 300, sleep_interval: 2)
)
expect { imported_group.import_status }.to(
eventually_eq('finished').within(max_duration: 300, sleep_interval: 2)
)
aggregate_failures do
expect(imported_group.reload!).to eq(source_group)
expect(imported_group.labels).to include(*source_group.labels)
aggregate_failures do
expect(imported_group.reload!).to eq(source_group)
expect(imported_group.labels).to include(*source_group.labels)
expect(imported_subgroup.reload!).to eq(subgroup)
expect(imported_subgroup.labels).to include(*subgroup.labels)
end
expect(imported_subgroup.reload!).to eq(subgroup)
expect(imported_subgroup.labels).to include(*subgroup.labels)
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