summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalmyr Lima <walmyr@gitlab.com>2019-07-18 17:13:02 +0200
committerWalmyr Lima <walmyr@gitlab.com>2019-07-19 13:34:04 +0200
commitd375e834c91659416d5644eb4c008b00d4914ccb (patch)
treec30229f3b43997d84fbfb1c09ddfc7d349ffcbd4
parent9967b2d1ee3644ed22fb441cc754f4e6764a7718 (diff)
downloadgitlab-ce-qa/refactor-e2e-test.tar.gz
Refactor collapse comments end-to-end testqa/refactor-e2e-test
To: - Better separate scopes (pre-conditions on before, tests on it) - Remove unnecessary expectation - Replace other unnecessary expectations by page.assert_text - Move variables closer to where they're used
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb23
1 files changed, 12 insertions, 11 deletions
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
index 2101311f065..e8fdffeeeab 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
@@ -3,31 +3,32 @@
module QA
context 'Plan' do
describe 'collapse comments in issue discussions' do
- let(:issue_title) { 'issue title' }
+ let(:my_first_reply) { 'My first reply' }
- it 'user collapses reply for comments in an issue' do
+ before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
issue = Resource::Issue.fabricate_via_api! do |issue|
- issue.title = issue_title
+ issue.title = 'issue title'
end
issue.visit!
- expect(page).to have_content(issue_title)
-
Page::Project::Issue::Show.perform do |show_page|
- my_first_discussion = "My first discussion"
- my_first_reply = "My First Reply"
- one_reply = "1 reply"
+ my_first_discussion = 'My first discussion'
show_page.select_all_activities_filter
show_page.start_discussion(my_first_discussion)
- expect(show_page).to have_content(my_first_discussion)
-
+ page.assert_text(my_first_discussion)
show_page.reply_to_discussion(my_first_reply)
- expect(show_page).to have_content(my_first_reply)
+ page.assert_text(my_first_reply)
+ end
+ end
+
+ it 'user collapses and expands reply for comments in an issue' do
+ Page::Project::Issue::Show.perform do |show_page|
+ one_reply = "1 reply"
show_page.collapse_replies
expect(show_page).to have_content(one_reply)