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
class DeployKey < Factory::Base
attr_accessor :title, :key
product :title do
product :fingerprint do |resource|
Page::Project::Settings::Repository.act do
expand_deploy_keys(&:key_title)
end
end
expand_deploy_keys do |key|
key_offset = key.key_titles.index do |title|
title.text == resource.title
end
product :fingerprint do
Page::Project::Settings::Repository.act do
expand_deploy_keys(&:key_fingerprint)
key.key_fingerprints[key_offset].text
end
end
end
......
......@@ -64,6 +64,10 @@ module QA
find(element_selector_css(name))
end
def all_element(name)
all(element_selector_css(name))
end
def click_element(name)
find_element(name).click
end
......
......@@ -42,6 +42,18 @@ module QA
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
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