-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCS] Automate connector-listing.png #143605
Changes from all commits
8b48710
b0f0560
c3448c7
9199d38
56f118c
e82f35b
32c6e45
793e84d
9f8e499
6afe1af
4f4e759
62bb304
5ea0c84
f79c780
767f686
898721f
e883740
e821310
df955c6
701ef86
827e6a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export function ActionsAPIServiceProvider({ getService }: FtrProviderContext) { | ||
const kbnSupertest = getService('supertest'); | ||
|
||
return { | ||
async createConnector({ | ||
name, | ||
config, | ||
secrets, | ||
connectorTypeId, | ||
}: { | ||
name: string; | ||
config: Record<string, unknown>; | ||
secrets: Record<string, unknown>; | ||
connectorTypeId: string; | ||
}) { | ||
const { body: createdAction } = await kbnSupertest | ||
.post(`/api/actions/connector`) | ||
.set('kbn-xsrf', 'foo') | ||
.send({ | ||
name, | ||
config, | ||
secrets, | ||
connector_type_id: connectorTypeId, | ||
}) | ||
.expect(200); | ||
|
||
return createdAction; | ||
}, | ||
|
||
async deleteConnector(id: string) { | ||
return kbnSupertest | ||
.delete(`/api/actions/connector/${id}`) | ||
.set('kbn-xsrf', 'foo') | ||
.expect(204, ''); | ||
}, | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
import { SampleDataTestResourcesServiceProvider } from './test_resources'; | ||
|
||
export function SampleDataServiceProvider(context: FtrProviderContext) { | ||
return { | ||
testResources: SampleDataTestResourcesServiceProvider(context), | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export function SampleDataTestResourcesServiceProvider({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
|
||
return { | ||
async installKibanaSampleData(sampleDataId: 'ecommerce' | 'flights' | 'logs') { | ||
await supertest.post(`/api/sample_data/${sampleDataId}`).set('kbn-xsrf', 'true').expect(200); | ||
}, | ||
|
||
async removeKibanaSampleData(sampleDataId: 'ecommerce' | 'flights' | 'logs') { | ||
await supertest | ||
.delete(`/api/sample_data/${sampleDataId}`) | ||
.set('kbn-xsrf', 'true') | ||
.expect(204); | ||
}, | ||
|
||
async installAllKibanaSampleData() { | ||
await this.installKibanaSampleData('ecommerce'); | ||
await this.installKibanaSampleData('flights'); | ||
await this.installKibanaSampleData('logs'); | ||
}, | ||
|
||
async removeAllKibanaSampleData() { | ||
await this.removeKibanaSampleData('ecommerce'); | ||
await this.removeKibanaSampleData('flights'); | ||
await this.removeKibanaSampleData('logs'); | ||
}, | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ export default ({ getPageObjects, getPageObject, getService }: FtrProviderContex | |
const updatedConnectorName = `${connectorName}updated`; | ||
const createdAction = await createSlackConnector({ | ||
name: connectorName, | ||
supertest, | ||
getService, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following up from my previous comment about removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Fixed in bc960b34ee5c4c7b76fa0b8934a00725c4aca863 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry what I meant was that line 80 in this file is no longer needed either. |
||
}); | ||
objectRemover.add(createdAction.id, 'action', 'actions'); | ||
await browser.refresh(); | ||
|
@@ -176,7 +176,7 @@ export default ({ getPageObjects, getPageObject, getService }: FtrProviderContex | |
const connectorName = generateUniqueKey(); | ||
const createdAction = await createSlackConnector({ | ||
name: connectorName, | ||
supertest, | ||
getService, | ||
}); | ||
objectRemover.add(createdAction.id, 'action', 'actions'); | ||
await browser.refresh(); | ||
|
@@ -205,10 +205,10 @@ export default ({ getPageObjects, getPageObject, getService }: FtrProviderContex | |
|
||
it('should delete a connector', async () => { | ||
const connectorName = generateUniqueKey(); | ||
await createSlackConnector({ name: connectorName, supertest }); | ||
await createSlackConnector({ name: connectorName, getService }); | ||
const createdAction = await createSlackConnector({ | ||
name: generateUniqueKey(), | ||
supertest, | ||
getService, | ||
}); | ||
objectRemover.add(createdAction.id, 'action', 'actions'); | ||
await browser.refresh(); | ||
|
@@ -234,10 +234,10 @@ export default ({ getPageObjects, getPageObject, getService }: FtrProviderContex | |
|
||
it('should bulk delete connectors', async () => { | ||
const connectorName = generateUniqueKey(); | ||
await createSlackConnector({ name: connectorName, supertest }); | ||
await createSlackConnector({ name: connectorName, getService }); | ||
const createdAction = await createSlackConnector({ | ||
name: generateUniqueKey(), | ||
supertest, | ||
getService, | ||
}); | ||
objectRemover.add(createdAction.id, 'action', 'actions'); | ||
await browser.refresh(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import expect from '@kbn/expect'; | |
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
import { ObjectRemover } from '../../../lib/object_remover'; | ||
import { generateUniqueKey } from '../../../lib/get_test_data'; | ||
import { createConnector, getConnectorByName } from './utils'; | ||
import { getConnectorByName } from './utils'; | ||
import { | ||
tinesAgentWebhook, | ||
tinesStory1, | ||
|
@@ -267,12 +267,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
}); | ||
|
||
const createTinesConnector = async (name: string) => { | ||
return createConnector({ | ||
return actions.api.createConnector({ | ||
name, | ||
config: { url: simulatorUrl }, | ||
secrets: { email: '[email protected]', token: 'apiToken' }, | ||
connectorTypeId: '.tines', | ||
supertest, | ||
}); | ||
}; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌