diff options
Diffstat (limited to 'qa/qa/page/file/form.rb')
-rw-r--r-- | qa/qa/page/file/form.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/qa/qa/page/file/form.rb b/qa/qa/page/file/form.rb index 2e0f8c59213..d0113d66dec 100644 --- a/qa/qa/page/file/form.rb +++ b/qa/qa/page/file/form.rb @@ -15,7 +15,6 @@ module QA end view 'app/views/projects/blob/_template_selectors.html.haml' do - element :template_type_dropdown element :gitignore_dropdown element :gitlab_ci_yml_dropdown element :dockerfile_dropdown @@ -23,13 +22,20 @@ module QA end def add_name(name) - fill_element(:file_name_field, with: name) + fill_element(:file_name_field, name) end - def select_template(template_type, template) - click_element :template_type_dropdown - click_link template_type + def add_custom_name(template_name) + case template_name + # Name has to be exactly LICENSE for template-type-dropdown to appear + when 'LICENSE' + add_name(template_name.to_s) + else + add_name("#{SecureRandom.hex(8)}/#{template_name}") + end + end + def select_template(template_type, template) case template_type when '.gitignore' click_element :gitignore_dropdown |