diff options
author | Mark Lapierre <mlapierre@gitlab.com> | 2019-06-05 08:46:30 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-06-05 08:46:30 +0000 |
commit | 5cccf313c3f473cf7104ce846d6daed86cfeb392 (patch) | |
tree | 9701299c3333e3cda044b9ba65e888865e65b98c /qa/qa/page/project | |
parent | 765917dc088bee52a3f95d76fc7f32d408a2af20 (diff) | |
download | gitlab-ce-5cccf313c3f473cf7104ce846d6daed86cfeb392.tar.gz |
Fix Web IDE add template test
Wait for the new file modal to stop animating before clicking it
We now need to click the commit button 3 times:
1. To enter commit mode
2. To being staging changes
3. To submit the commit
Diffstat (limited to 'qa/qa/page/project')
-rw-r--r-- | qa/qa/page/project/new.rb | 5 | ||||
-rw-r--r-- | qa/qa/page/project/web_ide/edit.rb | 27 |
2 files changed, 29 insertions, 3 deletions
diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index 4f26ca5037c..defd85a5740 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -12,6 +12,7 @@ module QA end view 'app/views/projects/_new_project_fields.html.haml' do + element :initialize_with_readme_checkbox element :project_namespace_select element :project_namespace_field, 'namespaces_options' # rubocop:disable QA/ElementWithPattern element :project_name, 'text_field :name' # rubocop:disable QA/ElementWithPattern @@ -64,6 +65,10 @@ module QA def click_github_link click_link 'GitHub' end + + def enable_initialize_with_readme + check_element :initialize_with_readme_checkbox + end end end end diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb index ff7cc04e352..b5a36862389 100644 --- a/qa/qa/page/project/web_ide/edit.rb +++ b/qa/qa/page/project/web_ide/edit.rb @@ -7,6 +7,10 @@ module QA class Edit < Page::Base include Page::Component::DropdownFilter + view 'app/assets/javascripts/ide/components/activity_bar.vue' do + element :commit_mode_tab + end + view 'app/assets/javascripts/ide/components/ide_tree.vue' do element :new_file end @@ -17,6 +21,7 @@ module QA view 'app/assets/javascripts/ide/components/new_dropdown/modal.vue' do element :full_file_path + element :new_file_modal element :template_list end @@ -42,12 +47,19 @@ module QA def create_new_file_from_template(file_name, template) click_element :new_file + + # Wait for the modal animation to complete before clicking on the file name + wait_for_animated_element(:new_file_modal) + within_element(:template_list) do click_on file_name rescue Capybara::ElementNotFound raise ElementNotFound, %Q(Couldn't find file template named "#{file_name}". Please confirm that it is a valid option.) end + # Wait for the modal to fade out too + has_no_element?(:new_file_modal) + wait(reload: false) do within_element(:file_templates_bar) do click_element :file_template_dropdown @@ -63,10 +75,16 @@ module QA end def commit_changes + # Clicking :begin_commit_button the first time switches from the + # edit to the commit view + click_element :begin_commit_button + active_element? :commit_mode_tab + + # We need to click :begin_commit_button again click_element :begin_commit_button - # After clicking :begin_commit_button there is an animation that - # hides :begin_commit_button and shows :commit_button + # After clicking :begin_commit_button the 2nd time there is an + # animation that hides :begin_commit_button and shows :commit_button # # Wait for the animation to complete before clicking :commit_button # otherwise the click will quietly do nothing. @@ -75,7 +93,10 @@ module QA has_element?(:commit_button) end - # Retry the attempt to click :commit_button just in case part of the + # At this point we're ready to commit and the button should be + # labelled "Stage & Commit" + # + # Click :commit_button and keep retrying just in case part of the # animation is still in process even when the buttons have the # expected visibility. commit_success_msg_shown = retry_until do |