diff options
author | Mark Lapierre <mlapierre@gitlab.com> | 2018-11-28 15:23:38 -0500 |
---|---|---|
committer | Mark Lapierre <mlapierre@gitlab.com> | 2018-12-10 13:10:12 -0500 |
commit | ed75b46cd9ae2fbc4dfd98447d659c771ddef23c (patch) | |
tree | 9a28632fdd55bfc727c23a8ba645b20062c75e3d /qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb | |
parent | c61c5cf2d973f9a9add71dbe876df42caa8e4bfe (diff) | |
download | gitlab-ce-ed75b46cd9ae2fbc4dfd98447d659c771ddef23c.tar.gz |
Update tests and Resources to use new file button
The 'Create new' dropdown is no longer available on a blank project
so use the 'New file' button instead.
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb')
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb index 297485dd81e..de5c535c757 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb @@ -7,7 +7,7 @@ module QA def login Runtime::Browser.visit(:gitlab, Page::Main::Login) - Page::Main::Login.act { sign_in_using_credentials } + Page::Main::Login.perform(&:sign_in_using_credentials) end before(:all) do @@ -18,7 +18,15 @@ module QA project.description = 'Add file templates via the Files view' end - Page::Main::Menu.act { sign_out } + # There's no 'New File' dropdown when the project is blank, so we first + # add a dummy file so that the dropdown will appear + Resource::File.fabricate! do |file| + file.project = @project + file.name = 'README.md' + file.content = '# Readme' + end + + Page::Main::Menu.perform(&:sign_out) end templates = [ @@ -55,7 +63,7 @@ module QA login @project.visit! - Page::Project::Show.act { create_new_file! } + Page::Project::Show.perform(&:create_new_file!) Page::File::Form.perform do |page| page.select_template template[:file_name], template[:name] end |