diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts index d50d8548ed88c..3420e975afe91 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts @@ -111,10 +111,25 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it('should redirect user back to Policy List if Cancel button is clicked', async () => { await (await pageObjects.ingestManagerCreateDatasource.findCancelButton()).click(); + + // FIXME: need method to chec that is on policy list page. + }); + it('should redirect user back to Policy List if Back link is clicked', async () => { + await (await pageObjects.ingestManagerCreateDatasource.findBackLink()).click(); + // FIXME: need method to chec that is on policy list page. + // TODO test case + expect(true).to.be(false); + }); + it('should display custom endpoint configuration message', async () => { + await pageObjects.ingestManagerCreateDatasource.selectAgentConfig(); + const endpointConfig = await pageObjects.policy.findDatasourceEndpointCustomConfiguration(); + expect(endpointConfig).not.to.be(undefined); + }); + it('should redirect user back to Policy List after a successful save', async () => { + // TODO test case + expect(true).to.be(false); }); - it('should redirect user back to Policy List if Back link is clicked', async () => {}); - it('should redirect user back to Policy List after a successful save', async () => {}); }); }); } diff --git a/x-pack/test/security_solution_endpoint/page_objects/ingest_manager_create_datasource_page.ts b/x-pack/test/security_solution_endpoint/page_objects/ingest_manager_create_datasource_page.ts index e8b69921db88a..7072540c69e8a 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/ingest_manager_create_datasource_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/ingest_manager_create_datasource_page.ts @@ -8,6 +8,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export function IngestManagerCreateDatasource({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); + const find = getService('find'); return { /** @@ -31,13 +32,34 @@ export function IngestManagerCreateDatasource({ getService }: FtrProviderContext return await testSubjects.find('createDataSource_cancelBackLink'); }, - async selectAgentConfig(name?: string) {}, - /** * Finds and returns the save button on the sticky bottom bar */ async findDSaveButton() { return await testSubjects.find('createDatasourceSaveButton'); }, + + /** + * Selects an agent configuration on the form + * @param name + * Visual name of the configuration. if one is not provided, the first agent + * configuration on the list will be chosen + */ + async selectAgentConfig(name?: string) { + // if we have a name, then find the button with that `title` set. + if (name) { + // FIXME implement + } + // Else, just select the first agent configuration that is present + else { + await (await find.byCssSelector('button[]')).click(); + } + }, + + /** + * Set the name of the datasource on the input field + * @param name + */ + async setDatasourceName(name: string) {}, }; }