Skip to content

Commit

Permalink
[DOCS] Automate maintenance window screenshot (elastic#157816)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored May 23, 2023
1 parent 8761e50 commit 877e2ac
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export const CreateMaintenanceWindowForm = React.memo<CreateMaintenanceWindowFor
responsive={false}
>
<EuiFlexItem grow={false}>
<EuiButtonEmpty onClick={onCancel} size="s">
<EuiButtonEmpty onClick={onCancel} size="s" data-test-subj="cancelMaintenanceWindow">
{i18n.CANCEL}
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down
3 changes: 3 additions & 0 deletions x-pack/test/functional/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ export default async function ({ readConfigFile }) {
triggersActions: {
pathname: '/app/management/insightsAndAlerting/triggersActions',
},
maintenanceWindows: {
pathname: '/app/management/insightsAndAlerting/maintenanceWindows',
},
},

// choose where screenshots should be saved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default function ({ getPageObject, getService, loadTestFile }: FtrProvide
loadTestFile(require.resolve('./stack_alerting'));
loadTestFile(require.resolve('./stack_cases'));
loadTestFile(require.resolve('./stack_connectors'));
loadTestFile(require.resolve('./maintenance_windows'));
loadTestFile(require.resolve('./observability_cases'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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 find = getService('find');
const pageObjects = getPageObjects(['common', 'header']);
const screenshotDirectories = ['response_ops_docs', 'maintenance_windows'];
const testSubjects = getService('testSubjects');

describe('create maintenance window', function () {
it('create 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 commonScreenshots.takeScreenshot(
'create-maintenance-window',
screenshotDirectories,
1400,
1024
);
const cancelButton = await testSubjects.find('cancelMaintenanceWindow');
await cancelButton.click();
});
});
}
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('maintenance windows', function () {
loadTestFile(require.resolve('./create_window'));
});
}

0 comments on commit 877e2ac

Please sign in to comment.