[8.12] [RAM][[Maintenance Window][DOCS] Maintenance window scoped query automated screenshots (#174315) (#174872)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[RAM][[Maintenance Window][DOCS] Maintenance window scoped query
automated screenshots
(#174315)](https://github.com/elastic/kibana/pull/174315)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2024-01-15T21:22:33Z","message":"[RAM][[Maintenance
Window][DOCS] Maintenance window scoped query automated screenshots
(#174315)","sha":"02ea9192f7181e7054266462be1273ab1431abaf","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Feature:Alerting/RulesManagement","v8.12.1","v8.13.0"],"number":174315,"url":"https://github.com/elastic/kibana/pull/174315","mergeCommit":{"message":"[RAM][[Maintenance
Window][DOCS] Maintenance window scoped query automated screenshots
(#174315)","sha":"02ea9192f7181e7054266462be1273ab1431abaf"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/174315","number":174315,"mergeCommit":{"message":"[RAM][[Maintenance
Window][DOCS] Maintenance window scoped query automated screenshots
(#174315)","sha":"02ea9192f7181e7054266462be1273ab1431abaf"}}]}]
BACKPORT-->
This commit is contained in:
Lisa Cawley 2024-01-15 17:06:29 -08:00 committed by GitHub
parent 81ca1e2c78
commit 7dc77912e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 105 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Before After
Before After

View file

@ -25,7 +25,7 @@ When the alert recovers, there are no notifications--even if the recovery occurs
To use maintenance windows, you must have the appropriate {subscriptions}[subscription] and {kib} feature privileges.
- To have full access to maintenance windows, you must have `All` privileges for the *Management > Maintenance Windows* feature.
- To have view-only access to maintenance windows, you must have `Read` privileges for the **Management > Maintenance Windows* feature.
- To have view-only access to maintenance windows, you must have `Read` privileges for the *Management > Maintenance Windows* feature.
For more details, refer to <<kibana-privileges>>.
@ -46,6 +46,18 @@ By default, maintenance windows affect all categories of rules.
The category-specific maintenance window options alter this behavior.
For the definitive list of rule types in each category, refer to the <<list-rule-types-api,get rule types API>>.
If you turn on *Filter alerts*, you can use KQL to filter the alerts affected by the maintenance window:
[role="screenshot"]
image::images/create-maintenance-window-filter.png[The Create Maintenance Window user interface in {kib} with alert filters turned on]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
[NOTE]
====
* You can select only a single category when you turn on filters.
* Some rules are not affected by maintenance window filters because their alerts do not contain requisite data. In particular, <<kibana-alerts,{stack-monitor-app}>>, <<geo-alerting,tracking containment>>, {ml-docs}/ml-configuring-alerts.html[{anomaly-jobs} health], and {ref}/transform-alerts.html[transform health] rules are not affected by the filters.
====
A maintenance window can have any one of the following statuses:
- `Upcoming`: It will run at the scheduled date and time.

View file

@ -26,7 +26,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'create-maintenance-window',
screenshotDirectories,
1400,
1024
1600
);
const filterAlerts = await find.byCssSelector(
'[data-test-subj="maintenanceWindowScopedQuerySwitch"] .euiSwitch__button'
);
await filterAlerts.click();
await commonScreenshots.takeScreenshot(
'create-maintenance-window-filter',
screenshotDirectories,
1400,
1600
);
const cancelButton = await testSubjects.find('cancelMaintenanceWindow');
await cancelButton.click();

View file

@ -100,6 +100,9 @@ export function createTestConfig(options: CreateTestConfigOptions) {
pathname: '/app/discover',
hash: '/context',
},
maintenanceWindows: {
pathname: '/app/management/insightsAndAlerting/maintenanceWindows',
},
},
// choose where screenshots should be saved
screenshots: {

View file

@ -27,5 +27,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./cases'));
loadTestFile(require.resolve('./connectors'));
loadTestFile(require.resolve('./maintenance_windows'));
});
}

View file

@ -0,0 +1,57 @@
/*
* 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 ({ getPageObjects, getService }: FtrProviderContext) {
const pageObjects = getPageObjects(['common', 'header', 'svlCommonPage']);
const svlCommonScreenshots = getService('svlCommonScreenshots');
const screenshotDirectories = ['response_ops_docs', 'observability_maintenace_windows'];
const find = getService('find');
const testSubjects = getService('testSubjects');
describe('create window', function () {
beforeEach(async () => {
await pageObjects.svlCommonPage.login();
});
after(async () => {
await pageObjects.svlCommonPage.forceLogout();
});
it('create maintenance window screenshot', async () => {
await pageObjects.common.navigateToApp('maintenanceWindows');
await pageObjects.header.waitUntilLoadingHasFinished();
const createButton = await find.byCssSelector(
'[data-test-subj="mw-empty-prompt"] .euiButton'
);
await createButton.click();
await svlCommonScreenshots.takeScreenshot(
'create-maintenance-window',
screenshotDirectories,
1400,
1600
);
const filterAlerts = await find.byCssSelector(
'[data-test-subj="maintenanceWindowScopedQuerySwitch"] .euiSwitch__button'
);
await filterAlerts.click();
const radioGroup = await testSubjects.find('maintenanceWindowCategorySelectionRadioGroup');
const label = await radioGroup.findByCssSelector(`label[for="observability"]`);
await label.click();
await testSubjects.setValue('queryInput', 'kibana.alert.rule.name: custom-threshold-rule-1');
await svlCommonScreenshots.takeScreenshot(
'create-maintenance-window-filter',
screenshotDirectories,
1400,
1600
);
const cancelButton = await testSubjects.find('cancelMaintenanceWindow');
await cancelButton.click();
});
});
}

View file

@ -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 maintenance windows', function () {
before(async () => {
await browser.setWindowSize(1920, 1080);
});
loadTestFile(require.resolve('./create_window'));
});
}