-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
15 changed files
with
207 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, ''); | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { ActionsAPIServiceProvider } from './api'; | ||
|
||
export function ActionsServiceProvider(context: FtrProviderContext) { | ||
return { | ||
api: ActionsAPIServiceProvider(context), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
}; | ||
} |
37 changes: 37 additions & 0 deletions
37
x-pack/test/functional/services/sample_data/test_resources.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
x-pack/test/screenshot_creation/apps/response_ops_docs/stack_alerting/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* 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 default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('stack alerting', function () { | ||
loadTestFile(require.resolve('./list_view')); | ||
}); | ||
} |
48 changes: 48 additions & 0 deletions
48
x-pack/test/screenshot_creation/apps/response_ops_docs/stack_alerting/list_view.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* 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 default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const commonScreenshots = getService('commonScreenshots'); | ||
const screenshotDirectories = ['response_ops_docs', 'stack_alerting']; | ||
const pageObjects = getPageObjects(['common', 'header']); | ||
const actions = getService('actions'); | ||
|
||
describe('list view', function () { | ||
let serverLogConnectorId: string; | ||
|
||
before(async () => { | ||
const connectorName = `server-log-connector`; | ||
({ id: serverLogConnectorId } = await createServerLogConnector(connectorName)); | ||
}); | ||
|
||
after(async () => { | ||
await actions.api.deleteConnector(serverLogConnectorId); | ||
}); | ||
|
||
it('connectors list screenshot', async () => { | ||
await pageObjects.common.navigateToApp('connectors'); | ||
await pageObjects.header.waitUntilLoadingHasFinished(); | ||
await commonScreenshots.takeScreenshot( | ||
'connector-listing', | ||
screenshotDirectories, | ||
1400, | ||
1024 | ||
); | ||
}); | ||
}); | ||
|
||
const createServerLogConnector = async (name: string) => { | ||
return actions.api.createConnector({ | ||
name, | ||
config: {}, | ||
secrets: {}, | ||
connectorTypeId: '.server-log', | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* 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 { pageObjects as xpackFunctionalPageObjects } from '../../functional/page_objects'; | ||
import { TriggersActionsPageProvider } from '../../functional_with_es_ssl/page_objects/triggers_actions_ui_page'; | ||
import { RuleDetailsPageProvider } from '../../functional_with_es_ssl/page_objects/rule_details'; | ||
|
||
export const pageObjects = { | ||
...xpackFunctionalPageObjects, | ||
triggersActionsUI: TriggersActionsPageProvider, | ||
ruleDetailsUI: RuleDetailsPageProvider, | ||
}; |