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 | |
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')
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb | 14 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb | 12 |
2 files changed, 16 insertions, 10 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 diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb index e7374377104..f176ec31abd 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/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 @@ -21,14 +21,14 @@ module QA # Add a file via the regular Files view because the Web IDE isn't # available unless there is a file present - Page::Project::Show.act { create_new_file! } + Page::Project::Show.perform(&:create_first_new_file!) Page::File::Form.perform do |page| page.add_name('dummy') page.add_content('Enable the Web IDE') page.commit_changes end - Page::Main::Menu.act { sign_out } + Page::Main::Menu.perform(&:sign_out) end templates = [ @@ -65,7 +65,7 @@ module QA login @project.visit! - Page::Project::Show.act { open_web_ide! } + Page::Project::Show.perform(&:open_web_ide!) Page::Project::WebIDE::Edit.perform do |page| page.create_new_file_from_template template[:file_name], template[:name] @@ -75,9 +75,7 @@ module QA expect(page).to have_button('Undo') expect(page).to have_content(content[0..100]) - Page::Project::WebIDE::Edit.perform do |page| - page.commit_changes - end + Page::Project::WebIDE::Edit.perform(&:commit_changes) expect(page).to have_content(template[:file_name]) expect(page).to have_content(content[0..100]) |