Commit f9eab328 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Populate the fingerprint by known title

Without this, if we have more than one deploy key, it would be
ambiguous.
parent 353c5782
...@@ -4,15 +4,15 @@ module QA ...@@ -4,15 +4,15 @@ module QA
class DeployKey < Factory::Base class DeployKey < Factory::Base
attr_accessor :title, :key attr_accessor :title, :key
product :title do product :fingerprint do |resource|
Page::Project::Settings::Repository.act do Page::Project::Settings::Repository.act do
expand_deploy_keys(&:key_title) expand_deploy_keys do |key|
end key_offset = key.key_titles.index do |title|
end title.text == resource.title
end
product :fingerprint do key.key_fingerprints[key_offset].text
Page::Project::Settings::Repository.act do end
expand_deploy_keys(&:key_fingerprint)
end end
end end
......
...@@ -64,6 +64,10 @@ module QA ...@@ -64,6 +64,10 @@ module QA
find(element_selector_css(name)) find(element_selector_css(name))
end end
def all_element(name)
all(element_selector_css(name))
end
def click_element(name) def click_element(name)
find_element(name).click find_element(name).click
end end
......
...@@ -42,6 +42,18 @@ module QA ...@@ -42,6 +42,18 @@ module QA
end end
end end
def key_titles
within_project_deploy_keys do
all_element(:key_title)
end
end
def key_fingerprints
within_project_deploy_keys do
all_element(:key_fingerprint)
end
end
private private
def within_project_deploy_keys def within_project_deploy_keys
......
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