summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-04-17 22:18:14 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-04-17 22:18:14 +0800
commit4c86b4e2dc5a646de4f2ff6f05e17bac2a1e9124 (patch)
treece2bad3720b270de6c35282ca94b97046bd30f36 /qa
parent8d4ad0c7dbd5081a73af06d71d5dde9a7f3d3400 (diff)
downloadgitlab-ce-4c86b4e2dc5a646de4f2ff6f05e17bac2a1e9124.tar.gz
Properly fill variable pair to the last fields
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/factory/resource/secret_variable.rb3
-rw-r--r--qa/qa/page/project/settings/secret_variables.rb11
-rw-r--r--qa/qa/specs/features/project/deploy_key_clone_spec.rb4
3 files changed, 9 insertions, 9 deletions
diff --git a/qa/qa/factory/resource/secret_variable.rb b/qa/qa/factory/resource/secret_variable.rb
index c734d739b4a..12a830da116 100644
--- a/qa/qa/factory/resource/secret_variable.rb
+++ b/qa/qa/factory/resource/secret_variable.rb
@@ -16,8 +16,7 @@ module QA
Page::Project::Settings::CICD.perform do |setting|
setting.expand_secret_variables do |page|
- page.fill_variable_key(key)
- page.fill_variable_value(value)
+ page.fill_variable(key, value)
page.save_variables
end
diff --git a/qa/qa/page/project/settings/secret_variables.rb b/qa/qa/page/project/settings/secret_variables.rb
index c95c79f137d..89f1424a5fa 100644
--- a/qa/qa/page/project/settings/secret_variables.rb
+++ b/qa/qa/page/project/settings/secret_variables.rb
@@ -18,12 +18,11 @@ module QA
element :reveal_values, '.js-secret-value-reveal-button'
end
- def fill_variable_key(key)
- fill_in('Input variable key', with: key, match: :first)
- end
-
- def fill_variable_value(value)
- fill_in('Input variable value', with: value, match: :first)
+ def fill_variable(key, value)
+ all('.js-ci-variable-input-key')[-1].set(key)
+ # After we fill the key, JS would generate another field so
+ # we need to fill the one before last one instead of last one
+ all('.js-ci-variable-input-value')[-2].set(value)
end
def save_variables
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 1fb3e85a338..42588d1181d 100644
--- a/qa/qa/specs/features/project/deploy_key_clone_spec.rb
+++ b/qa/qa/specs/features/project/deploy_key_clone_spec.rb
@@ -65,7 +65,9 @@ module QA
- ssh-add -D
- echo "$#{deploy_key_name}" | ssh-add -
- git clone #{@repository_uri.git_uri}
- - sha1sum #{@project.name}/.gitlab-ci.yml
+ - cd #{@project.name}
+ - git checkout #{deploy_key_name}
+ - sha1sum .gitlab-ci.yml
tags:
- qa
- docker