Commit e80ede56 authored by Anastasia McDonald's avatar Anastasia McDonald

Remove projects directly under the sandbox group after tests

See https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/722
parent 0be059c2
......@@ -19,7 +19,7 @@
= render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project
.home-panel-metadata.d-flex.flex-wrap.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal
- if can?(current_user, :read_project, @project)
%span.text-secondary{ itemprop: 'identifier' }
%span.text-secondary{ itemprop: 'identifier', data: { qa_selector: 'project_id_content' } }
= s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id }
- if current_user
%span.access-request-links.gl-ml-3
......
......@@ -34,6 +34,7 @@ module QA
view 'app/views/projects/_home_panel.html.haml' do
element :forked_from_link
element :project_name_content
element :project_id_content
end
view 'app/views/projects/_files.html.haml' do
......@@ -157,6 +158,10 @@ module QA
find_element(:project_name_content).text
end
def project_id
find_element(:project_id_content).text.delete('Project ID: ')
end
def switch_to_branch(branch_name)
find_element(:branches_select).click
......
......@@ -200,6 +200,10 @@ module QA
post_body
end
def api_delete_path
"/projects/#{id}"
end
def change_repository_storage(new_storage)
put_body = { repository_storage: new_storage }
response = put Runtime::API::Request.new(api_client, api_put_path).url, put_body
......
......@@ -4,6 +4,8 @@ require 'securerandom'
module QA
RSpec.describe 'Manage' do
describe 'Project templates' do
include Support::Api
before(:all) do
@files = [
{
......@@ -163,12 +165,18 @@ module QA
Page::Project::Show.perform do |project|
project.wait_for_import_success
@project_id = project.project_id
@files.each do |file|
expect(project).to have_file(file[:name])
end
end
end
after do
api_client = Runtime::API::Client.new(:gitlab)
delete Runtime::API::Request.new(api_client, "/projects/#{@project_id}").url
end
end
def create_project_using_template(project_name:, namespace:, template_name:)
......
......@@ -30,6 +30,7 @@ module QA
after do
group_or_project.remove_member(approver)
approver.remove_via_api!
project.remove_via_api!
end
context 'and the code owner is the root group' 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