summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qa/qa/specs/features/project/deploy_key_clone_spec.rb38
1 files changed, 11 insertions, 27 deletions
diff --git a/qa/qa/specs/features/project/deploy_key_clone_spec.rb b/qa/qa/specs/features/project/deploy_key_clone_spec.rb
index 9b4897a1f96..19d3c83758a 100644
--- a/qa/qa/specs/features/project/deploy_key_clone_spec.rb
+++ b/qa/qa/specs/features/project/deploy_key_clone_spec.rb
@@ -11,38 +11,41 @@ module QA
end
end
- def fabricate_runner
+ after do
+ Service::Runner.new(runner_name).remove!
+ end
+
+ scenario 'user sets up a deploy key to clone code using pipelines' do
+ Runtime::Browser.visit(:gitlab, Page::Main::Login)
+ Page::Main::Login.act { sign_in_using_credentials }
+
Factory::Resource::Runner.fabricate! do |resource|
resource.project = project
resource.name = runner_name
resource.tags = %w[qa docker]
resource.image = 'gitlab/gitlab-runner:ubuntu'
end
- end
- def fabricate_deploy_key
Factory::Resource::DeployKey.fabricate! do |resource|
resource.project = project
resource.title = 'deploy key title'
resource.key = key.public_key
end
- end
- def fabricate_secret_variable
Factory::Resource::SecretVariable.fabricate! do |resource|
resource.project = project
resource.key = 'DEPLOY_KEY'
resource.value = key.to_pem
end
- end
- def fabricate_gitlab_ci
+ project.visit!
+
repository_uri = Page::Project::Show.act do
choose_repository_clone_ssh
repository_location_uri
end
- <<~YAML
+ gitlab_ci = <<~YAML
cat-config:
script:
- mkdir -p ~/.ssh
@@ -55,33 +58,14 @@ module QA
- qa
- docker
YAML
- end
- def fabricate_push(gitlab_ci)
Factory::Repository::Push.fabricate! do |resource|
resource.project = project
resource.file_name = '.gitlab-ci.yml'
resource.commit_message = 'Add .gitlab-ci.yml'
resource.file_content = gitlab_ci
end
- end
-
- after do
- Service::Runner.new(runner_name).remove!
- end
-
- scenario 'user sets up a deploy key to clone code using pipelines' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- fabricate_runner
- fabricate_deploy_key
- fabricate_secret_variable
-
- project.visit!
- gitlab_ci = fabricate_gitlab_ci
- fabricate_push(gitlab_ci)
sha1sum = Digest::SHA1.hexdigest(gitlab_ci)
Page::Project::Show.act { wait_for_push }