Audit test coverage for Scan Result Policies
Scan Result Policies
Unit tests
Many and more are consistently added, not a priority for this task
Integration
Policy List
Location spec/frontend_integration/security_orchestration/policy_editor/policy_list_spec.js
Test scenario | Completed | Notes |
---|---|---|
List Scan Result Policies for Project | n | Missing test cases |
List Scan Result Policies for Group | n | Missing test cases |
List Scan Result Policies for Project and Group | n | |
See policy details in drawer for Project | n | |
See policy details in drawer for Group | n |
Policy Editor
Location spec/frontend_integration/security_orchestration/policy_editor/scan_result_spec.js
Test scenario | Completed | Notes |
---|---|---|
Create disabled Scan Result Policy | n | |
Create enabled Scan Result Policy with
|
n | |
Create enabled Scan Result Policy requiring approval from groups | n | |
Create enabled Scan Result Policy requiring approval from individuals | n | |
Create Scan Result Policy with with all types of approval settings | n | |
Test all cases with switching between |
n | |
Create scan result policy for a group with policy scope | n | |
Edit scan result policy for a group with policy scope | n |
Feature tests
Policy List
Location: ee/spec/features/groups/security/
ee/spec/features/projects/security/
Test scenario | Completed | Notes |
---|---|---|
Loading policy list for a group
|
n | |
Loading policy list for a project
|
n |
Policy Editor
Location: ee/spec/features/groups/security/
ee/spec/features/projects/security/
Test scenario | Completed | Notes |
---|---|---|
Create Scan result policy for a group with rules and approvals |
n | |
Create Scan result policy for a project with rules and approvals |
n | |
Edit existing result policy for a group with rules and approvals |
n | |
Edit existing result policy for a project with rules and approvals |
n | |
Switch between yaml and rule mode while adding rules and approvers | n | |
Create new and edit existing policy with all types of approval settings | n |
A potential policy editor feature test
describe 'scan result policy' do
before do
sign_in(owner)
stub_licensed_features(security_orchestration_policies: true)
visit(new_project_security_policy_path(project))
find_by_testid('select-policy-scan_result_policy').click
end
it "deletes the correct rule" do
click_button _('Select scan type')
select_listbox_item _('Security Scan')
click_button _('All severity levels')
select_listbox_item _('Low')
click_button _('Add rule')
page.within(find_by_testid('rule-1')) do
click_button _('Select scan type')
select_listbox_item _('Security Scan')
end
page.within(find_by_testid('rule-0')) do
click_button _('Remove')
end
page.within(find_by_testid('rule-0')) do
expect(page).to have_button _('All severity levels')
end
end
end
Implementation Plan
- Identify scenarios for tests (update the list above)
- Identify which types of tests we want for each scenario (update the list above)
- Verify which of these cases are completely covered by existing tests (update the list above)
- Create the tests
Edited by Alexander Turinske