Skip to content

Commit

Permalink
[8.13] [Discover] Unskip runtime field tests (#179627) (#179812)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.13`:
- [[Discover] Unskip runtime field tests
(#179627)](#179627)

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

### 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":"2024-03-31T18:22:32Z","message":"[Discover]
Unskip runtime field tests (#179627)\n\n- Closes
https://github.com/elastic/kibana/issues/179297\r\n- Closes
https://github.com/elastic/kibana/issues/179310\r\n\r\n90x\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5582","sha":"cd9a0c294d34052df3659882d33fd6dd480788d0","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","Team:DataDiscovery","backport:prev-minor","v8.14.0"],"number":179627,"url":"https://github.com/elastic/kibana/pull/179627","mergeCommit":{"message":"[Discover]
Unskip runtime field tests (#179627)\n\n- Closes
https://github.com/elastic/kibana/issues/179297\r\n- Closes
https://github.com/elastic/kibana/issues/179310\r\n\r\n90x\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5582","sha":"cd9a0c294d34052df3659882d33fd6dd480788d0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/179627","number":179627,"mergeCommit":{"message":"[Discover]
Unskip runtime field tests (#179627)\n\n- Closes
https://github.com/elastic/kibana/issues/179297\r\n- Closes
https://github.com/elastic/kibana/issues/179310\r\n\r\n90x\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5582","sha":"cd9a0c294d34052df3659882d33fd6dd480788d0"}}]}]
BACKPORT-->
  • Loading branch information
jughosta authored Apr 2, 2024
1 parent 5d0cb6d commit 597ea09
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/functional/apps/discover/group4/_runtime_fields_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await fieldEditor.enableValue();
await fieldEditor.typeScript("emit('abc')");
await fieldEditor.save();
await fieldEditor.waitUntilClosed();
await PageObjects.header.waitUntilLoadingHasFinished();
};

Expand All @@ -51,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async () => {
await security.testUser.restoreDefaults();
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.savedObjects.clean({ types: ['saved-search'] });
await kibanaServer.savedObjects.cleanStandardList();
});

it('allows adding custom label to existing fields', async function () {
Expand All @@ -60,18 +61,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await fieldEditor.enableCustomLabel();
await fieldEditor.setCustomLabel(customLabel);
await fieldEditor.save();
await fieldEditor.waitUntilClosed();
await PageObjects.header.waitUntilLoadingHasFinished();
expect((await PageObjects.unifiedFieldList.getAllFieldNames()).includes(customLabel)).to.be(
true
);
await PageObjects.unifiedFieldList.clickFieldListItemAdd('bytes');
expect(await PageObjects.discover.getDocHeader()).to.have.string(customLabel);
});

it('allows creation of a new field', async function () {
const field = '_runtimefield';
await createRuntimeField(field);
await retry.waitForWithTimeout('fieldNames to include runtimefield', 5000, async () => {

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitForDocTableLoadingComplete();
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();

await retry.waitFor('fieldNames to include runtimefield', async () => {
const fieldNames = await PageObjects.unifiedFieldList.getAllFieldNames();
return fieldNames.includes(field);
});
Expand All @@ -85,8 +91,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await fieldEditor.setName(newFieldName, true);
await fieldEditor.save();
await fieldEditor.confirmSave();
await fieldEditor.waitUntilClosed();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitForDocTableLoadingComplete();
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();

await retry.waitForWithTimeout('fieldNames to include edits', 5000, async () => {
const fieldNames = await PageObjects.unifiedFieldList.getAllFieldNames();
Expand Down

0 comments on commit 597ea09

Please sign in to comment.