Backport EE MR that improves end-to-end tests

https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14533
This commit is contained in:
Walmyr Lima 2019-07-03 19:12:41 +02:00
parent fb35a3b7f4
commit ee685e228a
3 changed files with 31 additions and 20 deletions

View file

@ -9,27 +9,33 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Resource::Issue.fabricate_via_browser_ui! do |issue|
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title
end
issue.visit!
expect(page).to have_content(issue_title)
Page::Project::Issue::Show.perform do |show_page|
show_page.select_all_activities_filter
show_page.start_discussion("My first discussion")
expect(show_page).to have_content("My first discussion")
my_first_discussion = "My first discussion"
my_first_reply = "My First Reply"
one_reply = "1 reply"
show_page.reply_to_discussion("My First Reply")
expect(show_page).to have_content("My First Reply")
show_page.select_all_activities_filter
show_page.start_discussion(my_first_discussion)
expect(show_page).to have_content(my_first_discussion)
show_page.reply_to_discussion(my_first_reply)
expect(show_page).to have_content(my_first_reply)
show_page.collapse_replies
expect(show_page).to have_content("1 reply")
expect(show_page).not_to have_content("My First Reply")
expect(show_page).to have_content(one_reply)
expect(show_page).not_to have_content(my_first_reply)
show_page.expand_replies
expect(show_page).to have_content("My First Reply")
expect(show_page).not_to have_content("1 reply")
expect(show_page).to have_content(my_first_reply)
expect(show_page).not_to have_content(one_reply)
end
end
end

View file

@ -9,28 +9,33 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
Resource::Issue.fabricate_via_browser_ui! do |issue|
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title
end
issue.visit!
expect(page).to have_content(issue_title)
Page::Project::Issue::Show.perform do |show_page|
show_page.comment('/confidential', filter: :comments_only)
show_page.comment('My own comment', filter: :comments_only)
my_own_comment = "My own comment"
made_the_issue_confidential = "made the issue confidential"
expect(show_page).not_to have_content("made the issue confidential")
expect(show_page).to have_content("My own comment")
show_page.comment('/confidential', filter: :comments_only)
show_page.comment(my_own_comment, filter: :comments_only)
expect(show_page).not_to have_content(made_the_issue_confidential)
expect(show_page).to have_content(my_own_comment)
show_page.select_all_activities_filter
expect(show_page).to have_content("made the issue confidential")
expect(show_page).to have_content("My own comment")
expect(show_page).to have_content(made_the_issue_confidential)
expect(show_page).to have_content(my_own_comment)
show_page.select_history_only_filter
expect(show_page).to have_content("made the issue confidential")
expect(show_page).not_to have_content("My own comment")
expect(show_page).to have_content(made_the_issue_confidential)
expect(show_page).not_to have_content(my_own_comment)
end
end
end

View file

@ -14,7 +14,7 @@ module QA
resource.description = 'project for issue suggestions'
end
Resource::Issue.fabricate_via_browser_ui! do |issue|
Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title
issue.project = project
end