forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Automate case and server log connector screenshots in serverle…
…ss Observability project (elastic#167709)
- Loading branch information
Showing
11 changed files
with
212 additions
and
10 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
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
21 changes: 21 additions & 0 deletions
21
x-pack/test_serverless/functional/test_suites/observability/config.screenshots.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,21 @@ | ||
/* | ||
* 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 { createTestConfig } from '../../config.base'; | ||
|
||
const enabledActionTypes = ['.index', '.server-log']; | ||
|
||
export default createTestConfig({ | ||
serverlessProject: 'oblt', | ||
testFiles: [require.resolve('./screenshot_creation')], | ||
kbnServerArgs: [`--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`], | ||
junit: { | ||
reportName: 'Serverless Observability Screenshot Creation', | ||
}, | ||
|
||
esServerArgs: ['xpack.ml.ad.enabled=false', 'xpack.ml.dfa.enabled=false'], | ||
}); |
14 changes: 14 additions & 0 deletions
14
x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/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('Screenshots - serverless observability UI', function () { | ||
loadTestFile(require.resolve('./response_ops_docs')); | ||
}); | ||
} |
20 changes: 20 additions & 0 deletions
20
...functional/test_suites/observability/screenshot_creation/response_ops_docs/cases/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,20 @@ | ||
/* | ||
* 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, getService }: FtrProviderContext) { | ||
const browser = getService('browser'); | ||
|
||
describe('observability cases', function () { | ||
before(async () => { | ||
await browser.setWindowSize(1920, 1080); | ||
}); | ||
|
||
loadTestFile(require.resolve('./list_view')); | ||
}); | ||
} |
63 changes: 63 additions & 0 deletions
63
...tional/test_suites/observability/screenshot_creation/response_ops_docs/cases/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,63 @@ | ||
/* | ||
* 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 { OBSERVABILITY_OWNER } from '@kbn/cases-plugin/common'; | ||
import { FtrProviderContext } from '../../../../../ftr_provider_context'; | ||
import { navigateToCasesApp } from '../../../../../../shared/lib/cases'; | ||
|
||
export default function ({ getPageObject, getPageObjects, getService }: FtrProviderContext) { | ||
const pageObjects = getPageObjects(['common', 'header', 'svlCommonPage']); | ||
const svlCases = getService('svlCases'); | ||
const svlCommonScreenshots = getService('svlCommonScreenshots'); | ||
const screenshotDirectories = ['response_ops_docs', 'observability_cases']; | ||
const owner = OBSERVABILITY_OWNER; | ||
|
||
describe('list view', function () { | ||
before(async () => { | ||
await svlCases.api.createCase( | ||
svlCases.api.getPostCaseRequest(owner, { | ||
title: 'Metrics inventory', | ||
tags: ['IBM resilient'], | ||
description: 'Test.', | ||
owner, | ||
}) | ||
); | ||
|
||
await svlCases.api.createCase( | ||
svlCases.api.getPostCaseRequest(owner, { | ||
title: 'Logs threshold', | ||
tags: ['jira'], | ||
description: 'Test.', | ||
owner, | ||
}) | ||
); | ||
|
||
await svlCases.api.createCase( | ||
svlCases.api.getPostCaseRequest(owner, { | ||
title: 'Monitor uptime', | ||
tags: ['swimlane'], | ||
description: 'Test.', | ||
owner, | ||
}) | ||
); | ||
}); | ||
|
||
after(async () => { | ||
await svlCases.api.deleteAllCaseItems(); | ||
await pageObjects.svlCommonPage.forceLogout(); | ||
}); | ||
|
||
beforeEach(async () => { | ||
await pageObjects.svlCommonPage.login(); | ||
}); | ||
|
||
it('cases list screenshot', async () => { | ||
await navigateToCasesApp(getPageObject, getService, owner); | ||
await svlCommonScreenshots.takeScreenshot('cases', screenshotDirectories, 1700, 1024); | ||
}); | ||
}); | ||
} |
20 changes: 20 additions & 0 deletions
20
...ional/test_suites/observability/screenshot_creation/response_ops_docs/connectors/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,20 @@ | ||
/* | ||
* 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, getService }: FtrProviderContext) { | ||
const browser = getService('browser'); | ||
|
||
describe('observability connectors', function () { | ||
before(async () => { | ||
await browser.setWindowSize(1920, 1080); | ||
}); | ||
|
||
loadTestFile(require.resolve('./server_log_connector')); | ||
}); | ||
} |
39 changes: 39 additions & 0 deletions
39
...es/observability/screenshot_creation/response_ops_docs/connectors/server_log_connector.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,39 @@ | ||
/* | ||
* 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 svlCommonScreenshots = getService('svlCommonScreenshots'); | ||
const screenshotDirectories = ['response_ops_docs', 'observability_connectors']; | ||
const pageObjects = getPageObjects(['common', 'header', 'svlCommonPage']); | ||
const testSubjects = getService('testSubjects'); | ||
|
||
describe('server log connector', function () { | ||
beforeEach(async () => { | ||
await pageObjects.svlCommonPage.login(); | ||
}); | ||
|
||
after(async () => { | ||
await pageObjects.svlCommonPage.forceLogout(); | ||
}); | ||
|
||
it('server log connector screenshots', async () => { | ||
await pageObjects.common.navigateToApp('connectors'); | ||
await pageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.click('createFirstActionButton'); | ||
await testSubjects.click(`.server-log-card`); | ||
await testSubjects.setValue('nameInput', 'Server log test connector'); | ||
await svlCommonScreenshots.takeScreenshot('serverlog-connector', screenshotDirectories); | ||
const saveTestButton = await testSubjects.find('create-connector-flyout-save-test-btn'); | ||
await saveTestButton.click(); | ||
await svlCommonScreenshots.takeScreenshot('serverlog-params-test', screenshotDirectories); | ||
const flyOutCancelButton = await testSubjects.find('euiFlyoutCloseButton'); | ||
await flyOutCancelButton.click(); | ||
}); | ||
}); | ||
} |
31 changes: 31 additions & 0 deletions
31
...rless/functional/test_suites/observability/screenshot_creation/response_ops_docs/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,31 @@ | ||
/* | ||
* 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, loadTestFile }: FtrProviderContext) { | ||
const browser = getService('browser'); | ||
const ml = getService('ml'); | ||
|
||
describe('response ops docs', function () { | ||
this.tags(['responseOps']); | ||
|
||
before(async () => { | ||
await ml.testResources.setKibanaTimeZoneToUTC(); | ||
await ml.testResources.disableKibanaAnnouncements(); | ||
await browser.setWindowSize(1920, 1080); | ||
}); | ||
|
||
after(async () => { | ||
await ml.testResources.resetKibanaTimeZone(); | ||
await ml.testResources.resetKibanaAnnouncements(); | ||
}); | ||
|
||
loadTestFile(require.resolve('./cases')); | ||
loadTestFile(require.resolve('./connectors')); | ||
}); | ||
} |
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