diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /qa/qa/page/dashboard/snippet/edit.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'qa/qa/page/dashboard/snippet/edit.rb')
-rw-r--r-- | qa/qa/page/dashboard/snippet/edit.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/qa/qa/page/dashboard/snippet/edit.rb b/qa/qa/page/dashboard/snippet/edit.rb index 37c0747aea4..40add146e97 100644 --- a/qa/qa/page/dashboard/snippet/edit.rb +++ b/qa/qa/page/dashboard/snippet/edit.rb @@ -9,6 +9,15 @@ module QA element :submit_button, required: true end + view 'app/assets/javascripts/snippets/components/snippet_blob_edit.vue' do + element :file_name_field + element :file_holder_container + end + + view 'app/assets/javascripts/blob/components/blob_edit_header.vue' do + element :delete_file_button + end + def add_to_file_content(content) text_area.set content text_area.has_text?(content) # wait for changes to take effect @@ -18,7 +27,38 @@ module QA choose(visibility_type) end + def click_add_file + click_element(:add_file_button) + end + + def fill_file_name(name, file_number = nil) + if file_number + within_element_by_index(:file_holder_container, file_number - 1) do + fill_element(:file_name_field, name) + end + else + fill_element(:file_name_field, name) + end + end + + def fill_file_content(content, file_number = nil) + if file_number + within_element_by_index(:file_holder_container, file_number - 1) do + text_area.set(content) + end + else + text_area.set(content) + end + end + + def click_delete_file(file_number) + within_element_by_index(:file_holder_container, file_number - 1) do + click_element(:delete_file_button) + end + end + def save_changes + wait_until(reload: false) { !find_element(:submit_button).disabled? } click_element(:submit_button, Page::Dashboard::Snippet::Show) end |