Skip to content
代码片段 群组 项目
提交 38b3b8dd 编辑于 作者: Shinya Maeda's avatar Shinya Maeda
浏览文件

Merge branch '365774-improve-slow-tests' into 'master'

Improve slow tests in incident_issue_spec

See merge request gitlab-org/gitlab!93351
No related branches found
No related tags found
无相关合并请求
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
project.add_developer(user) project.add_developer(user)
sign_in(user) sign_in(user)
visit project_issue_path(project, incident) visit project_issues_incident_path(project, incident)
wait_for_requests wait_for_requests
end end
...@@ -49,72 +49,32 @@ ...@@ -49,72 +49,32 @@
expect(incident_tabs).to have_content('Original alert: #1') expect(incident_tabs).to have_content('Original alert: #1')
end end
aggregate_failures 'shows the Alert details tab' do aggregate_failures 'when on summary tab (default tab)' do
click_link 'Alert details'
expect(incident_tabs).to have_content('"title": "Alert title"')
expect(incident_tabs).to have_content('"yet.another": 73')
end
end
end
context 'when on summary tab' do
before do
click_link 'Summary'
end
it 'shows the summary tab with all components' do
page.within('.issuable-details') do
hidden_items = find_all('.js-issue-widgets') hidden_items = find_all('.js-issue-widgets')
# Linked Issues/MRs and comment box # Linked Issues/MRs and comment box
expect(hidden_items.count).to eq(2) expect(hidden_items.count).to eq(2)
expect(hidden_items).to all(be_visible) expect(hidden_items).to all(be_visible)
end
end
it 'shows the edit title and description button' do
edit_button = find_all('[aria-label="Edit title and description"]')
expect(edit_button).to all(be_visible)
end
end
context 'when on alert details tab' do
before do
click_link 'Alert details'
end
it 'does not show the linked issues and notes/comment components' do
page.within('.issuable-details') do
hidden_items = find_all('.js-issue-widgets')
# Linked Issues/MRs and comment box are hidden on page edit_button = find_all('[aria-label="Edit title and description"]')
expect(hidden_items.count).to eq(0) expect(edit_button).to all(be_visible)
end end
end
it 'does not show the edit title and description button' do aggregate_failures 'shows the Alert details tab' do
edit_button = find_all('[aria-label="Edit title and description"]') click_link 'Alert details'
expect(edit_button.count).to eq(0)
end
end
context 'when on timeline events tab from incident route' do expect(incident_tabs).to have_content('"title": "Alert title"')
before do expect(incident_tabs).to have_content('"yet.another": 73')
visit project_issues_incident_path(project, incident)
wait_for_requests
click_link 'Timeline'
end
it 'does not show the linked issues and notes/comment components' do # does not show the linked issues and notes/comment components' do
page.within('.issuable-details') do
hidden_items = find_all('.js-issue-widgets') hidden_items = find_all('.js-issue-widgets')
# Linked Issues/MRs and comment box are hidden on page # Linked Issues/MRs and comment box are hidden on page
expect(hidden_items.count).to eq(0) expect(hidden_items.count).to eq(0)
# does not show the edit title and description button
edit_button = find_all('[aria-label="Edit title and description"]')
expect(edit_button.count).to eq(0)
end end
end end
end end
...@@ -126,7 +86,7 @@ ...@@ -126,7 +86,7 @@
click_link 'Timeline' click_link 'Timeline'
end end
it 'does not show the linked issues and notes/comment commponents' do it 'does not show the linked issues and notes/comment components' do
page.within('.issuable-details') do page.within('.issuable-details') do
hidden_items = find_all('.js-issue-widgets') hidden_items = find_all('.js-issue-widgets')
...@@ -140,7 +100,7 @@ ...@@ -140,7 +100,7 @@
before do before do
stub_feature_flags(incident_timeline: false) stub_feature_flags(incident_timeline: false)
visit project_issue_path(project, incident) visit project_issues_incident_path(project, incident)
wait_for_requests wait_for_requests
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册