diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 15:09:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 15:09:20 +0300 |
commit | b84eeb256c4a780d902faee1f99ca9a711b3214a (patch) | |
tree | 32918aadbea9210eace50efbce9afbfb8cd3ba84 /spec/features | |
parent | 53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/merge_request/user_sees_merge_widget_spec.rb | 131 | ||||
-rw-r--r-- | spec/features/projects/settings/registry_settings_spec.rb | 12 |
2 files changed, 131 insertions, 12 deletions
diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index d12843d7150..94f57cdda74 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -699,6 +699,137 @@ describe 'Merge request > User sees merge widget', :js do end end + context 'when a new error exists' do + let(:base_reports) do + Gitlab::Ci::Reports::TestReports.new.tap do |reports| + reports.get_suite('rspec').add_test_case(create_test_case_rspec_success) + reports.get_suite('junit').add_test_case(create_test_case_java_success) + end + end + + let(:head_reports) do + Gitlab::Ci::Reports::TestReports.new.tap do |reports| + reports.get_suite('rspec').add_test_case(create_test_case_rspec_success) + reports.get_suite('junit').add_test_case(create_test_case_java_error) + end + end + + it 'shows test reports summary which includes the new error' do + within(".js-reports-container") do + click_button 'Expand' + + expect(page).to have_content('Test summary contained 1 failed/error test result out of 2 total tests') + within(".js-report-section-container") do + expect(page).to have_content('rspec found no changed test results out of 1 total test') + expect(page).to have_content('junit found 1 failed/error test result out of 1 total test') + expect(page).to have_content('New') + expect(page).to have_content('addTest') + end + end + end + + context 'when user clicks the new error' do + it 'shows the test report detail' do + within(".js-reports-container") do + click_button 'Expand' + + within(".js-report-section-container") do + click_button 'addTest' + + expect(page).to have_content('8.88') + end + end + end + end + end + + context 'when an existing error exists' do + let(:base_reports) do + Gitlab::Ci::Reports::TestReports.new.tap do |reports| + reports.get_suite('rspec').add_test_case(create_test_case_rspec_error) + reports.get_suite('junit').add_test_case(create_test_case_java_success) + end + end + + let(:head_reports) do + Gitlab::Ci::Reports::TestReports.new.tap do |reports| + reports.get_suite('rspec').add_test_case(create_test_case_rspec_error) + reports.get_suite('junit').add_test_case(create_test_case_java_success) + end + end + + it 'shows test reports summary which includes the existing error' do + within(".js-reports-container") do + click_button 'Expand' + + expect(page).to have_content('Test summary contained 1 failed/error test result out of 2 total tests') + within(".js-report-section-container") do + expect(page).to have_content('rspec found 1 failed/error test result out of 1 total test') + expect(page).to have_content('junit found no changed test results out of 1 total test') + expect(page).not_to have_content('New') + expect(page).to have_content('Test#sum when a is 4 and b is 4 returns summary') + end + end + end + + context 'when user clicks the existing error' do + it 'shows test report detail of it' do + within(".js-reports-container") do + click_button 'Expand' + + within(".js-report-section-container") do + click_button 'Test#sum when a is 4 and b is 4 returns summary' + + expect(page).to have_content('4.44') + end + end + end + end + end + + context 'when a resolved error exists' do + let(:base_reports) do + Gitlab::Ci::Reports::TestReports.new.tap do |reports| + reports.get_suite('rspec').add_test_case(create_test_case_rspec_success) + reports.get_suite('junit').add_test_case(create_test_case_java_error) + end + end + + let(:head_reports) do + Gitlab::Ci::Reports::TestReports.new.tap do |reports| + reports.get_suite('rspec').add_test_case(create_test_case_rspec_success) + reports.get_suite('junit').add_test_case(create_test_case_java_success) + end + end + + it 'shows test reports summary which includes the resolved error' do + within(".js-reports-container") do + click_button 'Expand' + + expect(page).to have_content('Test summary contained 1 fixed test result out of 2 total tests') + within(".js-report-section-container") do + expect(page).to have_content('rspec found no changed test results out of 1 total test') + expect(page).to have_content('junit found 1 fixed test result out of 1 total test') + expect(page).to have_content('addTest') + end + end + end + + context 'when user clicks the resolved error' do + it 'shows test report detail of it' do + within(".js-reports-container") do + click_button 'Expand' + + within(".js-report-section-container") do + click_button 'addTest' + + expect(page).to have_content('5.55') + end + end + end + end + end + context 'properly truncates the report' do let(:base_reports) do Gitlab::Ci::Reports::TestReports.new.tap do |reports| diff --git a/spec/features/projects/settings/registry_settings_spec.rb b/spec/features/projects/settings/registry_settings_spec.rb index 4c5bc290402..fc1a85c3efe 100644 --- a/spec/features/projects/settings/registry_settings_spec.rb +++ b/spec/features/projects/settings/registry_settings_spec.rb @@ -10,7 +10,6 @@ describe 'Project > Settings > CI/CD > Container registry tag expiration policy' before do sign_in(user) stub_container_registry_config(enabled: true) - stub_feature_flags(registry_retention_policies_settings: true) end context 'as owner' do @@ -63,15 +62,4 @@ describe 'Project > Settings > CI/CD > Container registry tag expiration policy' expect(page).not_to have_selector('#js-registry-policies') end end - - context 'when feature flag is disabled' do - before do - stub_feature_flags(registry_retention_policies_settings: false) - visit project_settings_ci_cd_path(project) - end - - it 'does not exists' do - expect(page).not_to have_selector('#js-registry-policies') - end - end end |