summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 21:07:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 21:07:45 +0000
commit0b12a5312c9701fbfed25fbb334d47900ced736b (patch)
treea29a27e297134f573fd8e5c298d241f3156c207a /qa
parent92f95ccac81911d1fcc32e999a7f1ce04624a56c (diff)
downloadgitlab-ce-0b12a5312c9701fbfed25fbb334d47900ced736b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/project/settings/deploy_keys.rb16
-rw-r--r--qa/qa/page/project/settings/protected_branches.rb2
-rw-r--r--qa/qa/resource/deploy_key.rb4
-rw-r--r--qa/qa/resource/ssh_key.rb2
-rw-r--r--qa/qa/runtime/key/base.rb4
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb4
-rw-r--r--qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb4
7 files changed, 15 insertions, 21 deletions
diff --git a/qa/qa/page/project/settings/deploy_keys.rb b/qa/qa/page/project/settings/deploy_keys.rb
index 602bfc64710..12d7c0a396e 100644
--- a/qa/qa/page/project/settings/deploy_keys.rb
+++ b/qa/qa/page/project/settings/deploy_keys.rb
@@ -18,7 +18,7 @@ module QA
view 'app/assets/javascripts/deploy_keys/components/key.vue' do
element :key
element :key_title
- element :key_fingerprint
+ element :key_md5_fingerprint
end
def add_key
@@ -33,17 +33,17 @@ module QA
fill_in 'deploy_key_key', with: key
end
- def find_fingerprint(title)
+ def find_md5_fingerprint(title)
within_project_deploy_keys do
find_element(:key, text: title)
- .find(element_selector_css(:key_fingerprint)).text
+ .find(element_selector_css(:key_md5_fingerprint)).text.delete_prefix('MD5:')
end
end
- def has_key?(title, fingerprint)
+ def has_key?(title, md5_fingerprint)
within_project_deploy_keys do
find_element(:key, text: title)
- .has_css?(element_selector_css(:key_fingerprint), text: fingerprint)
+ .has_css?(element_selector_css(:key_md5_fingerprint), text: "MD5:#{md5_fingerprint}")
end
end
@@ -53,12 +53,6 @@ module QA
end
end
- def key_fingerprint
- within_project_deploy_keys do
- find_element(:key_fingerprint).text
- end
- end
-
private
def within_project_deploy_keys
diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb
index d1d2f302013..3f8aba78f44 100644
--- a/qa/qa/page/project/settings/protected_branches.rb
+++ b/qa/qa/page/project/settings/protected_branches.rb
@@ -61,7 +61,7 @@ module QA
end
# Click the select element again to close the dropdown
- click_element :protected_branch_select
+ click_element :"allowed_to_#{action}_select"
end
end
end
diff --git a/qa/qa/resource/deploy_key.rb b/qa/qa/resource/deploy_key.rb
index 869e2a71e47..26355729dab 100644
--- a/qa/qa/resource/deploy_key.rb
+++ b/qa/qa/resource/deploy_key.rb
@@ -5,10 +5,10 @@ module QA
class DeployKey < Base
attr_accessor :title, :key
- attribute :fingerprint do
+ attribute :md5_fingerprint do
Page::Project::Settings::Repository.perform do |setting|
setting.expand_deploy_keys do |key|
- key.find_fingerprint(title)
+ key.find_md5_fingerprint(title)
end
end
end
diff --git a/qa/qa/resource/ssh_key.rb b/qa/qa/resource/ssh_key.rb
index c140cb9ca62..22bdea424ca 100644
--- a/qa/qa/resource/ssh_key.rb
+++ b/qa/qa/resource/ssh_key.rb
@@ -7,7 +7,7 @@ module QA
attr_accessor :title
- def_delegators :key, :private_key, :public_key, :fingerprint
+ def_delegators :key, :private_key, :public_key, :md5_fingerprint
def key
@key ||= Runtime::Key::RSA.new
diff --git a/qa/qa/runtime/key/base.rb b/qa/qa/runtime/key/base.rb
index 1281eceaff0..72d1673438a 100644
--- a/qa/qa/runtime/key/base.rb
+++ b/qa/qa/runtime/key/base.rb
@@ -4,7 +4,7 @@ module QA
module Runtime
module Key
class Base
- attr_reader :name, :bits, :private_key, :public_key, :fingerprint
+ attr_reader :name, :bits, :private_key, :public_key, :md5_fingerprint
def initialize(name, bits)
@name = name
@@ -29,7 +29,7 @@ module QA
def populate_key_data(path)
@private_key = ::File.binread(path)
@public_key = ::File.binread("#{path}.pub")
- @fingerprint =
+ @md5_fingerprint =
`ssh-keygen -l -E md5 -f #{path} | cut -d' ' -f2 | cut -d: -f2-`.chomp
end
end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
index 474a7904fea..c3379d41ff2 100644
--- a/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
@@ -13,7 +13,7 @@ module QA
end
expect(page).to have_content("Title: #{key_title}")
- expect(page).to have_content(key.fingerprint)
+ expect(page).to have_content(key.md5_fingerprint)
Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys)
@@ -23,7 +23,7 @@ module QA
end
expect(page).not_to have_content("Title: #{key_title}")
- expect(page).not_to have_content(key.fingerprint)
+ expect(page).not_to have_content(key.md5_fingerprint)
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb
index 9c964c726f1..89aba112407 100644
--- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb
+++ b/qa/qa/specs/features/browser_ui/6_release/deploy_key/add_deploy_key_spec.rb
@@ -15,11 +15,11 @@ module QA
resource.key = deploy_key_value
end
- expect(deploy_key.fingerprint).to eq key.fingerprint
+ expect(deploy_key.md5_fingerprint).to eq key.md5_fingerprint
Page::Project::Settings::Repository.perform do |setting|
setting.expand_deploy_keys do |keys|
- expect(keys).to have_key(deploy_key_title, key.fingerprint)
+ expect(keys).to have_key(deploy_key_title, key.md5_fingerprint)
end
end
end