[8.7] [Discover] Unskip flaky sidebar tests (#153525) (#153547)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Discover] Unskip flaky sidebar tests
(#153525)](https://github.com/elastic/kibana/pull/153525)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2023-03-23T13:47:16Z","message":"[Discover]
Unskip flaky sidebar tests (#153525)\n\nCloses
https://github.com/elastic/kibana/issues/146996\r\n\r\n250x\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2029","sha":"b0b50f2978ac5dc4bc3e9b15c4a1bd2b097af94c","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:DataDiscovery","backport:prev-minor","v8.8.0"],"number":153525,"url":"https://github.com/elastic/kibana/pull/153525","mergeCommit":{"message":"[Discover]
Unskip flaky sidebar tests (#153525)\n\nCloses
https://github.com/elastic/kibana/issues/146996\r\n\r\n250x\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2029","sha":"b0b50f2978ac5dc4bc3e9b15c4a1bd2b097af94c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/153525","number":153525,"mergeCommit":{"message":"[Discover]
Unskip flaky sidebar tests (#153525)\n\nCloses
https://github.com/elastic/kibana/issues/146996\r\n\r\n250x\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2029","sha":"b0b50f2978ac5dc4bc3e9b15c4a1bd2b097af94c"}}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
This commit is contained in:
Kibana Machine 2023-03-23 10:56:50 -04:00 committed by GitHub
parent cfdc7d2a83
commit 936f140b59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 6 deletions

View file

@ -87,6 +87,7 @@ enabled:
- test/functional/apps/discover/embeddable/config.ts
- test/functional/apps/discover/group1/config.ts
- test/functional/apps/discover/group2/config.ts
- test/functional/apps/discover/group3/config.ts
- test/functional/apps/getting_started/config.ts
- test/functional/apps/home/config.ts
- test/functional/apps/kibana_overview/config.ts

View file

@ -31,7 +31,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_field_data'));
loadTestFile(require.resolve('./_field_data_with_fields_api'));
loadTestFile(require.resolve('./_shared_links'));
loadTestFile(require.resolve('./_sidebar'));
loadTestFile(require.resolve('./_source_filters'));
loadTestFile(require.resolve('./_large_string'));
loadTestFile(require.resolve('./_greeting_screen'));

View file

@ -241,8 +241,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
PageObjects.discover.getSidebarSectionSelector('empty', true)
);
await emptySectionButton.scrollIntoViewIfNecessary();
availableFields = await PageObjects.discover.getSidebarSectionFieldNames('available');
expect(availableFields.length).to.be(53);
await retry.waitFor('list to update after scrolling', async () => {
availableFields = await PageObjects.discover.getSidebarSectionFieldNames('available');
return availableFields.length === 53;
});
expect(availableFields.join(', ')).to.be(
`${expectedInitialAvailableFields}, url, utc_time, xss`
);
@ -272,7 +276,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(await PageObjects.discover.doesSidebarShowFields()).to.be(true);
// Initial Available fields
let availableFields = await PageObjects.discover.getSidebarSectionFieldNames('available');
const availableFields = await PageObjects.discover.getSidebarSectionFieldNames('available');
expect(availableFields.length).to.be(50);
expect(
availableFields
@ -287,8 +291,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
PageObjects.discover.getSidebarSectionSelector('empty', true)
);
await emptySectionButton.scrollIntoViewIfNecessary();
availableFields = await PageObjects.discover.getSidebarSectionFieldNames('available');
expect(availableFields.length).to.be(53);
// Expand Empty section
await PageObjects.discover.toggleSidebarSection('empty');

View file

@ -0,0 +1,18 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
};
}

View file

@ -0,0 +1,25 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const browser = getService('browser');
describe('discover/group3', function () {
before(async function () {
await browser.setWindowSize(1300, 800);
});
after(async function unloadMakelogs() {
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
});
loadTestFile(require.resolve('./_sidebar'));
});
}