2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.shared_examples 'error tracking index page' do
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'renders the error index page', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-03-13 15:44:24 +05:30
|
|
|
within('div.js-title-container') do
|
|
|
|
expect(page).to have_content(project.namespace.name)
|
|
|
|
expect(page).to have_content(project.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
within('div.error-list') do
|
|
|
|
expect(page).to have_content('Open errors')
|
|
|
|
expect(page).to have_content('Events')
|
|
|
|
expect(page).to have_content('Users')
|
|
|
|
expect(page).to have_content('Last Seen')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'loads the error show page on click', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-03-13 15:44:24 +05:30
|
|
|
click_on issues_response[0]['title']
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
expect(page).to have_content('Error Details')
|
|
|
|
end
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'renders the error index data', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-03-13 15:44:24 +05:30
|
|
|
within('div.error-list') do
|
|
|
|
expect(page).to have_content(issues_response[0]['title'])
|
|
|
|
expect(page).to have_content(issues_response[0]['count'].to_s)
|
|
|
|
expect(page).to have_content(issues_response[0]['last_seen'])
|
|
|
|
expect(page).to have_content('1 year ago')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.shared_examples 'expanded stack trace context' do |selected_line: nil, expected_line: 1|
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'expands the stack trace context', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-03-13 15:44:24 +05:30
|
|
|
within('div.stacktrace') do
|
2020-11-24 15:15:51 +05:30
|
|
|
find("div.file-holder:nth-child(#{selected_line}) svg[data-testid='chevron-right-icon']").click if selected_line
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
expanded_line = find("div.file-holder:nth-child(#{expected_line})")
|
2020-11-24 15:15:51 +05:30
|
|
|
expect(expanded_line).to have_css('svg[data-testid="chevron-down-icon"]')
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
event_response['entries'][0]['data']['values'][0]['stacktrace']['frames'][-expected_line]['context'].each do |context|
|
|
|
|
expect(page).to have_content(context[0])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.shared_examples 'error tracking show page' do
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'renders the error details', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-04-08 14:13:33 +05:30
|
|
|
content = page.find(".content")
|
|
|
|
nav = page.find("nav.breadcrumbs")
|
|
|
|
header = page.find(".error-details-header")
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
release_short_version = issue_response['firstRelease']['shortVersion']
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(header).to have_content('1 month ago by raven.scripts.runner in main')
|
|
|
|
expect(content).to have_content(issue_response['metadata']['title'])
|
|
|
|
expect(content).to have_content('level: error')
|
|
|
|
expect(nav).to have_content('Error Details')
|
|
|
|
expect(content).to have_content('GitLab Issue: https://gitlab.com/gitlab-org/gitlab/issues/1')
|
|
|
|
expect(content).to have_content("Sentry event: https://sentrytest.gitlab.com/sentry-org/sentry-project/issues/#{issue_id}")
|
|
|
|
expect(content).to have_content("First seen: 1 year ago (#{formatted_issue_seen}) Release: #{release_short_version}")
|
|
|
|
expect(content).to have_content('Events: 1')
|
|
|
|
expect(content).to have_content('Users: 0')
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'renders the stack trace heading', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-03-13 15:44:24 +05:30
|
|
|
expect(page).to have_content('Stack trace')
|
|
|
|
end
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it 'renders the stack trace', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217810' } do
|
2020-03-13 15:44:24 +05:30
|
|
|
event_response['entries'][0]['data']['values'][0]['stacktrace']['frames'].each do |frame|
|
|
|
|
expect(frame['filename']).not_to be_nil
|
|
|
|
expect(page).to have_content(frame['filename'])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# The first line is expanded by default if no line is selected
|
|
|
|
it_behaves_like 'expanded stack trace context', selected_line: nil, expected_line: 1
|
|
|
|
it_behaves_like 'expanded stack trace context', selected_line: 8, expected_line: 8
|
|
|
|
end
|