summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNailia Iskhakova <niskhakova@gitlab.com>2019-08-29 01:28:43 +0300
committerNailia Iskhakova <niskhakova@gitlab.com>2019-08-29 01:36:53 +0300
commitc27b19d1f6ae6ae12eef449cccd11b871e6ff155 (patch)
treeaab827c370327fb948411aa3550188882e837640
parent0786307bc7a9f5a27a122c90fa8de1fd0fa07ee4 (diff)
downloadgitlab-ce-qa-close-issue-spec.tar.gz
Add content suffix and reopen button checkqa-close-issue-spec
Validate elements instead of content and add element type suffix
-rw-r--r--app/views/projects/commit/_commit_box.html.haml2
-rw-r--r--app/views/shared/issuable/_close_reopen_button.html.haml2
-rw-r--r--qa/qa/page/project/commit/show.rb4
-rw-r--r--qa/qa/page/project/issue/show.rb4
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb16
5 files changed, 17 insertions, 11 deletions
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index afd1e92c30b..6c77036a85b 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -5,7 +5,7 @@
= render partial: 'signature', object: @commit.signature
%strong
#{ s_('CommitBoxTitle|Commit') }
- %span.commit-sha{ data: { qa_selector: 'commit_sha' } }= @commit.short_id
+ %span.commit-sha{ data: { qa_selector: 'commit_sha_content' } }= @commit.short_id
= clipboard_button(text: @commit.id, title: _('Copy commit SHA to clipboard'))
%span.d-none.d-sm-inline= _('authored')
#{time_ago_with_tooltip(@commit.authored_date)}
diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml
index 4f6a71b6071..875cacd1f4f 100644
--- a/app/views/shared/issuable/_close_reopen_button.html.haml
+++ b/app/views/shared/issuable/_close_reopen_button.html.haml
@@ -9,7 +9,7 @@
class: "d-none d-sm-none d-md-block btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)}", title: "Close #{display_issuable_type}"
- if can_reopen
= link_to "Reopen #{display_issuable_type}", reopen_issuable_path(issuable), method: button_method,
- class: "d-none d-sm-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}", title: "Reopen #{display_issuable_type}"
+ class: "d-none d-sm-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}", title: "Reopen #{display_issuable_type}", data: { qa_selector: 'reopen_issue_button' }
- else
- if can_update && !are_close_and_open_buttons_hidden
= render 'shared/issuable/close_reopen_report_toggle', issuable: issuable
diff --git a/qa/qa/page/project/commit/show.rb b/qa/qa/page/project/commit/show.rb
index b3fa0c7ad4c..ba09dd1b92a 100644
--- a/qa/qa/page/project/commit/show.rb
+++ b/qa/qa/page/project/commit/show.rb
@@ -9,7 +9,7 @@ module QA
element :options_button
element :email_patches
element :plain_diff
- element :commit_sha
+ element :commit_sha_content
end
def select_email_patches
@@ -23,7 +23,7 @@ module QA
end
def commit_sha
- find_element(:commit_sha).text
+ find_element(:commit_sha_content).text
end
end
end
diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb
index 45dad9bc0ae..1402d935cc7 100644
--- a/qa/qa/page/project/issue/show.rb
+++ b/qa/qa/page/project/issue/show.rb
@@ -37,6 +37,10 @@ module QA
element :dropdown_menu_labels
end
+ view 'app/views/shared/issuable/_close_reopen_button.html.haml' do
+ element :reopen_issue_button
+ end
+
# Adds a comment to an issue
# attachment option should be an absolute path
def comment(text, attachment: nil, filter: :all_activities)
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
index 5ff61326b8f..7b6a3579af0 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
@@ -27,19 +27,21 @@ module QA
push_commit("#{commit_message} ##{@issue_id}", false)
@project.visit!
- Page::Project::Show.perform do |page|
- page.click_commit(commit_message)
+ Page::Project::Show.perform do |show|
+ show.click_commit(commit_message)
end
commit_sha = Page::Project::Commit::Show.perform(&:commit_sha)
Page::Project::Menu.perform(&:click_issues)
- Page::Project::Issue::Index.perform do |page|
- page.click_closed_issues_link
- page.click_issue_link(issue_title)
+ Page::Project::Issue::Index.perform do |index|
+ index.click_closed_issues_link
+ index.click_issue_link(issue_title)
end
- expect(page).to have_content("Reopen issue")
- expect(page).to have_content("@#{Runtime::User.username} closed via commit #{commit_sha}")
+ Page::Project::Issue::Show.perform do |show|
+ expect(show).to have_element(:reopen_issue_button)
+ expect(show).to have_content("closed via commit #{commit_sha}")
+ end
end
def push_commit(commit_message, new_branch = true)