Commit e4409858 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa/split-quarantined-test-that-does-too-much' into 'master'

Split quarantined test that does too much into smaller and more isolated test cases

Closes gitlab-org/quality/staging#19

See merge request gitlab-org/gitlab-ee!14259
parents 0f2a38a7 d6440782
...@@ -10,6 +10,9 @@ module QA ...@@ -10,6 +10,9 @@ module QA
QA::Resource::Group.fabricate! QA::Resource::Group.fabricate!
end end
attribute :id
attribute :iid
def fabricate! def fabricate!
group.visit! group.visit!
...@@ -24,6 +27,26 @@ module QA ...@@ -24,6 +27,26 @@ module QA
end end
end end
end end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
"#{group.web_url}/-/epics/#{iid}"
end
def api_get_path
"/groups/#{group.id}/epics/#{id}"
end
def api_post_path
"/groups/#{group.id}/epics"
end
def api_post_body
{
title: title
}
end
end end
end end
end end
......
# frozen_string_literal: true
module QA
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/19
context 'Plan', :quarantine do
describe 'Epics Creation' do
before(:all) do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
end
it 'user creates, edits, deletes epic' do
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'Issue for epics tests'
issue.labels = []
end
epic = EE::Resource::Epic.fabricate_via_browser_ui! do |epic|
epic.group = issue.project.group
epic.title = 'My First Epic'
end
expect(page).to have_content('My First Epic')
# Edit Epics
EE::Page::Group::Epic::Show.act { click_edit_button }
EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.set_description('My Edited Epic Description')
edit_page.set_title('My Edited Epic')
edit_page.save_changes
expect(edit_page).to have_content('My Edited Epic')
end
# Add/Remove Issues to/from Epics
EE::Page::Group::Epic::Show.perform do |show_page|
show_page.add_issue_to_epic(issue.web_url)
expect(show_page).to have_content('added issue')
expect(show_page).to have_content('My Edited Epic')
show_page.remove_issue_from_epic
expect(show_page).to have_content('removed issue')
end
# Comment on Epics
EE::Page::Group::Epic::Show.act { add_comment_to_epic('My Epic Comments') }
expect(page).to have_content('My Epic Comments')
# Add Issue to Epic using quick actions
issue.visit!
Page::Project::Issue::Show.perform do |show_page|
show_page.wait_for_related_issues_to_load
show_page.comment("/epic #{epic.web_url}")
show_page.comment("/remove_epic")
expect(show_page).to have_content('removed from epic')
end
epic.visit!
expect(page).to have_content('added issue', count: 2)
expect(page).to have_content('removed issue', count: 2)
# Close Epic
EE::Page::Group::Epic::Show.act { close_reopen_epic }
expect(page).to have_content('Closed')
# Reopen Epic
EE::Page::Group::Epic::Show.act { close_reopen_epic }
expect(page).to have_content('Open')
# Delete Epics
EE::Page::Group::Epic::Show.act { click_edit_button }
EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.delete_epic
expect(edit_page).to have_content('The epic was successfully deleted')
end
end
end
end
end
# frozen_string_literal: true
module QA
context 'Plan' do
describe 'Epics Management' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
it 'creates, edits, and deletes an epic' do
epic_title = 'Epic created via GUI'
epic = EE::Resource::Epic.fabricate_via_browser_ui! do |epic|
epic.title = epic_title
end
expect(page).to have_content(epic_title)
EE::Page::Group::Epic::Show.perform(&:click_edit_button)
EE::Page::Group::Epic::Edit.perform do |edit_page|
edited_title = 'Epic edited via GUI'
edit_page.set_title(edited_title)
edit_page.save_changes
expect(edit_page).to have_content(edited_title)
end
epic.visit!
EE::Page::Group::Epic::Show.perform(&:click_edit_button)
EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.delete_epic
expect(edit_page).to have_content('The epic was successfully deleted')
end
end
context 'Resources created via API' do
let(:issue) { create_issue_resource }
let(:epic) { create_epic_resource(issue.project.group) }
it 'adds/removes issue to/from epic' do
epic.visit!
EE::Page::Group::Epic::Show.perform do |show_page|
show_page.add_issue_to_epic(issue.web_url)
expect(show_page).to have_content('added issue')
show_page.remove_issue_from_epic
expect(show_page).to have_content('removed issue')
end
end
it 'comments on epic', :quarantine do
epic.visit!
comment = 'My Epic Comment'
EE::Page::Group::Epic::Show.perform do |show_page|
show_page.add_comment_to_epic(comment)
end
expect(page).to have_content(comment)
end
it 'closes and reopens an epic' do
epic.visit!
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
expect(page).to have_content('Closed')
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
expect(page).to have_content('Open')
end
it 'adds/removes issue to/from epic using quick actions', :quarantine do
issue.visit!
Page::Project::Issue::Show.perform do |show_page|
show_page.wait_for_related_issues_to_load
show_page.comment("/epic #{issue.project.group.web_url}/-/epics/#{epic.iid}")
expect(show_page).to have_content('added to epic')
show_page.comment("/remove_epic")
expect(show_page).to have_content('removed from epic')
end
epic.visit!
expect(page).to have_content('added issue')
expect(page).to have_content('removed issue')
end
def create_issue_resource
Resource::Issue.fabricate_via_api! do |issue|
issue.labels = ''
issue.title = 'Issue created via API'
end
end
def create_epic_resource(group)
EE::Resource::Epic.fabricate_via_api! do |epic|
epic.group = group
epic.title = 'Epic created via API'
end
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment