[9.0] [Uptime] Unskip flaky Overview Page tests (#214807) (#214973)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Uptime] Unskip flaky Overview Page tests
(#214807)](https://github.com/elastic/kibana/pull/214807)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Justin
Kambic","email":"jk@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T12:39:58Z","message":"[Uptime]
Unskip flaky Overview Page tests (#214807)\n\n## Summary\n\nResolves
#57737.\nResolves
[#89072](https://github.com/elastic/kibana/issues/89072).\n\n40/40
\n[run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051)\non
Flaky Test Runner.\n\n- [Example
#57737\nsuccess](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051#0195a4d4-f2d0-4be4-a91d-6b0d4b6ba84d/240-1226)\n-
[Example
#89072\nsuccess](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051#0195a4d4-f2d0-4be4-a91d-6b0d4b6ba84d/240-1231)\n\nUsing
the page elements manually on the test server version of Kibana, I\ncan
click through and execute all these tests by hand. However, for
some\nreason web driver does not click the elements and make the
desired\nthings happen.\n\nAll of the behaviors we are testing are
configurable via the URL params,\nso I'm relying on the URL to set the
app state to the expected\nconditions to verify the app is working.
These page elements are also\ntested via unit-level tests, so I don't
think we are losing any\npractical coverage for this
soon-to-be-deprecated code.\n\nAdditionally, I removed the code in the
`beforeEach` hook that utilizes\nthe date picker to set the default
start/end range fields. This takes\n_forever_, and our tests don't need
to test that `SuperDatePicker` is\ndoing its job (again, our
implementation has unit tests to verify the\ncorrect callbacks are
provided and that they handle the input criteria).\nInstead we simply
`navigateToApp` with the default parameters specified\nin the URL
search.","sha":"a412a05ddf233b6115a20460e18e802e4517cba0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0"],"title":"[Uptime]
Unskip flaky Overview Page
tests","number":214807,"url":"https://github.com/elastic/kibana/pull/214807","mergeCommit":{"message":"[Uptime]
Unskip flaky Overview Page tests (#214807)\n\n## Summary\n\nResolves
#57737.\nResolves
[#89072](https://github.com/elastic/kibana/issues/89072).\n\n40/40
\n[run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051)\non
Flaky Test Runner.\n\n- [Example
#57737\nsuccess](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051#0195a4d4-f2d0-4be4-a91d-6b0d4b6ba84d/240-1226)\n-
[Example
#89072\nsuccess](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051#0195a4d4-f2d0-4be4-a91d-6b0d4b6ba84d/240-1231)\n\nUsing
the page elements manually on the test server version of Kibana, I\ncan
click through and execute all these tests by hand. However, for
some\nreason web driver does not click the elements and make the
desired\nthings happen.\n\nAll of the behaviors we are testing are
configurable via the URL params,\nso I'm relying on the URL to set the
app state to the expected\nconditions to verify the app is working.
These page elements are also\ntested via unit-level tests, so I don't
think we are losing any\npractical coverage for this
soon-to-be-deprecated code.\n\nAdditionally, I removed the code in the
`beforeEach` hook that utilizes\nthe date picker to set the default
start/end range fields. This takes\n_forever_, and our tests don't need
to test that `SuperDatePicker` is\ndoing its job (again, our
implementation has unit tests to verify the\ncorrect callbacks are
provided and that they handle the input criteria).\nInstead we simply
`navigateToApp` with the default parameters specified\nin the URL
search.","sha":"a412a05ddf233b6115a20460e18e802e4517cba0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214807","number":214807,"mergeCommit":{"message":"[Uptime]
Unskip flaky Overview Page tests (#214807)\n\n## Summary\n\nResolves
#57737.\nResolves
[#89072](https://github.com/elastic/kibana/issues/89072).\n\n40/40
\n[run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051)\non
Flaky Test Runner.\n\n- [Example
#57737\nsuccess](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051#0195a4d4-f2d0-4be4-a91d-6b0d4b6ba84d/240-1226)\n-
[Example
#89072\nsuccess](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8051#0195a4d4-f2d0-4be4-a91d-6b0d4b6ba84d/240-1231)\n\nUsing
the page elements manually on the test server version of Kibana, I\ncan
click through and execute all these tests by hand. However, for
some\nreason web driver does not click the elements and make the
desired\nthings happen.\n\nAll of the behaviors we are testing are
configurable via the URL params,\nso I'm relying on the URL to set the
app state to the expected\nconditions to verify the app is working.
These page elements are also\ntested via unit-level tests, so I don't
think we are losing any\npractical coverage for this
soon-to-be-deprecated code.\n\nAdditionally, I removed the code in the
`beforeEach` hook that utilizes\nthe date picker to set the default
start/end range fields. This takes\n_forever_, and our tests don't need
to test that `SuperDatePicker` is\ndoing its job (again, our
implementation has unit tests to verify the\ncorrect callbacks are
provided and that they handle the input criteria).\nInstead we simply
`navigateToApp` with the default parameters specified\nin the URL
search.","sha":"a412a05ddf233b6115a20460e18e802e4517cba0"}}]}]
BACKPORT-->

Co-authored-by: Justin Kambic <jk@elastic.co>
This commit is contained in:
Kibana Machine 2025-03-18 15:47:04 +01:00 committed by GitHub
parent 1101afbf99
commit 426bf5c7e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export const UPTIME_HEARTBEAT_DATA = 'x-pack/test/functional/es_archives/uptime/full_heartbeat';
const DEFAULT_NAVIGATION_SEARCH = `dateRangeEnd=2019-09-11T19:40:08.078Z&dateRangeStart=2019-09-10T12:40:08.078Z`;
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const { uptime, common } = getPageObjects(['uptime', 'common']);
@ -17,29 +18,21 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
// FLAKY: https://github.com/elastic/kibana/issues/57737
describe.skip('overview page', function () {
const DEFAULT_DATE_START = 'Sep 10, 2019 @ 12:40:08.078';
const DEFAULT_DATE_END = 'Sep 11, 2019 @ 19:40:08.078';
describe('overview page', function () {
before(async () => {
await esArchiver.loadIfNeeded(UPTIME_HEARTBEAT_DATA);
});
beforeEach(async () => {
await uptime.goToRoot();
await uptime.setDateRange(DEFAULT_DATE_START, DEFAULT_DATE_END);
await common.navigateToApp('uptime', {
search: DEFAULT_NAVIGATION_SEARCH,
});
await uptime.resetFilters();
});
it('loads and displays uptime data based on date range', async () => {
await uptime.goToUptimeOverviewAndLoadData(
DEFAULT_DATE_START,
DEFAULT_DATE_END,
'monitor-page-link-0000-intermittent'
);
});
it('loads and displays uptime data based on date range', () =>
uptime.pageHasExpectedIds(['0000-intermittent']));
it('applies filters for multiple fields', async () => {
await uptime.selectFilterItems({
@ -62,38 +55,36 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
it('pagination is cleared when filter criteria changes', async () => {
await uptime.changePage('next');
await retry.try(async () => {
await uptime.pageHasExpectedIds([
'0010-down',
'0011-up',
'0012-up',
'0013-up',
'0014-up',
'0015-intermittent',
'0016-up',
'0017-up',
'0018-up',
'0019-up',
]);
await common.navigateToApp('uptime', {
search: `${DEFAULT_NAVIGATION_SEARCH}&pagination={"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0009-up"}}`,
});
await uptime.pageHasExpectedIds([
'0010-down',
'0011-up',
'0012-up',
'0013-up',
'0014-up',
'0015-intermittent',
'0016-up',
'0017-up',
'0018-up',
'0019-up',
]);
// there should now be pagination data in the URL
await uptime.pageUrlContains('pagination');
await uptime.setStatusFilter('up');
await retry.try(async () => {
await uptime.pageHasExpectedIds([
'0000-intermittent',
'0001-up',
'0002-up',
'0003-up',
'0004-up',
'0005-up',
'0006-up',
'0007-up',
'0008-up',
'0009-up',
]);
});
await uptime.pageHasExpectedIds([
'0000-intermittent',
'0001-up',
'0002-up',
'0003-up',
'0004-up',
'0005-up',
'0006-up',
'0007-up',
'0008-up',
'0009-up',
]);
// ensure that pagination is removed from the URL
await uptime.pageUrlContains('pagination', false);
});