diff options
Diffstat (limited to 'qa/qa/page/file')
-rw-r--r-- | qa/qa/page/file/shared/commit_message.rb | 8 | ||||
-rw-r--r-- | qa/qa/page/file/show.rb | 21 |
2 files changed, 29 insertions, 0 deletions
diff --git a/qa/qa/page/file/shared/commit_message.rb b/qa/qa/page/file/shared/commit_message.rb index 823ce7bf7f9..906f5f3581a 100644 --- a/qa/qa/page/file/shared/commit_message.rb +++ b/qa/qa/page/file/shared/commit_message.rb @@ -13,11 +13,19 @@ module QA base.view 'app/views/shared/_commit_message_container.html.haml' do element :commit_message, "text_area_tag 'commit_message'" # rubocop:disable QA/ElementWithPattern end + + base.view 'app/views/projects/commits/_commit.html.haml' do + element :commit_content + end end def add_commit_message(message) fill_in 'commit_message', with: message end + + def has_commit_message?(text) + has_element?(:commit_content, text: text) + end end end end diff --git a/qa/qa/page/file/show.rb b/qa/qa/page/file/show.rb index f5f44909f25..665b3c34dcc 100644 --- a/qa/qa/page/file/show.rb +++ b/qa/qa/page/file/show.rb @@ -7,16 +7,25 @@ module QA include Shared::CommitMessage include Project::SubMenus::Settings include Project::SubMenus::Common + include Layout::Flash view 'app/helpers/blob_helper.rb' do element :edit_button, "_('Edit')" # rubocop:disable QA/ElementWithPattern element :delete_button, '_("Delete")' # rubocop:disable QA/ElementWithPattern end + view 'app/views/projects/blob/_header_content.html.haml' do + element :file_name_content + end + view 'app/views/projects/blob/_remove.html.haml' do element :delete_file_button, "button_tag 'Delete file'" # rubocop:disable QA/ElementWithPattern end + view 'app/views/shared/_file_highlight.html.haml' do + element :file_content + end + def click_edit click_on 'Edit' end @@ -28,6 +37,18 @@ module QA def click_delete_file click_on 'Delete file' end + + def has_file?(name) + has_element?(:file_name_content, text: name) + end + + def has_no_file?(name) + has_no_element?(:file_name_content, text: name) + end + + def has_file_content?(text) + has_element?(:file_content, text: text) + end end end end |