diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx index b4b82b7f692b9..e4e03e9453f7a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx @@ -48,7 +48,7 @@ export const AdvancedPolicyForms = React.memo(() => { /> - + {AdvancedPolicySchema.map((advancedField, index) => { const configPath = advancedField.key.split('.'); return ( @@ -114,7 +114,12 @@ const PolicyAdvanced = React.memo( } > - + ); diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index f032416d2e7bb..b3c130ea1e5dc 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -52,6 +52,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { policyInfo.packagePolicy.name ); }); + + it('and the show advanced settings button is clicked', async () => { + await testSubjects.missingOrFail('advancedPolicyPanel'); + + let advancedPolicyButton = await pageObjects.policy.findAdvancedPolicyButton(); + await advancedPolicyButton.click(); + + await testSubjects.existOrFail('advancedPolicyPanel'); + + advancedPolicyButton = await pageObjects.policy.findAdvancedPolicyButton(); + await advancedPolicyButton.click(); + await testSubjects.missingOrFail('advancedPolicyPanel'); + }); }); describe('and the save button is clicked', () => { @@ -98,7 +111,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { pageObjects.endpointPageUtils.clickOnEuiCheckbox('policyLinuxEvent_file'), pageObjects.endpointPageUtils.clickOnEuiCheckbox('policyMacEvent_file'), ]); + + const advancedPolicyButton = await pageObjects.policy.findAdvancedPolicyButton(); + await advancedPolicyButton.click(); + + const advancedPolicyField = await pageObjects.policy.findAdvancedPolicyField(); + await advancedPolicyField.clearValue(); + await advancedPolicyField.click(); + await advancedPolicyField.type('true'); await pageObjects.policy.confirmAndSave(); + await testSubjects.existOrFail('policyDetailsSuccessMessage'); const agentFullPolicy = await policyTestResources.getFullAgentPolicy( @@ -191,6 +213,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { linux: { events: { file: false, network: true, process: true }, logging: { file: 'info' }, + advanced: { agent: { connection_delay: 'true' } }, }, mac: { events: { file: false, network: true, process: true }, diff --git a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts index 92571e5c27566..8bfbdc32452ee 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts @@ -77,6 +77,22 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr return await testSubjects.find('policyDetailsCancelButton'); }, + /** + * Finds and returns the Advanced Policy Show/Hide Button + */ + async findAdvancedPolicyButton() { + await this.ensureIsOnDetailsPage(); + return await testSubjects.find('advancedPolicyButton'); + }, + + /** + * Finds and returns the linux connection_delay Advanced Policy field + */ + async findAdvancedPolicyField() { + await this.ensureIsOnDetailsPage(); + return await testSubjects.find('linux.advanced.agent.connection_delay'); + }, + /** * ensures that the Details Page is the currently display view */