Skip to content

Commit

Permalink
[8.11] [Event annotations] expand and stabilize listing page tests (#…
Browse files Browse the repository at this point in the history
…168139) (#168477)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[Event annotations] expand and stabilize listing page tests
(#168139)](#168139)

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

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

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-10T13:57:52Z","message":"[Event
annotations] expand and stabilize listing page tests (#168139)\n\n##
Summary\r\n\r\nFix #167434 (reenables embeddable test)\r\nFix
https://github.com/elastic/kibana/issues/168281\r\n\r\nFlaky test runner
(100
times):\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3417\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"3131bc228124e8641dca52508cffd91c14290564","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","backport:prev-minor","v8.12.0"],"number":168139,"url":"https://github.com/elastic/kibana/pull/168139","mergeCommit":{"message":"[Event
annotations] expand and stabilize listing page tests (#168139)\n\n##
Summary\r\n\r\nFix #167434 (reenables embeddable test)\r\nFix
https://github.com/elastic/kibana/issues/168281\r\n\r\nFlaky test runner
(100
times):\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3417\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"3131bc228124e8641dca52508cffd91c14290564"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/168139","number":168139,"mergeCommit":{"message":"[Event
annotations] expand and stabilize listing page tests (#168139)\n\n##
Summary\r\n\r\nFix #167434 (reenables embeddable test)\r\nFix
https://github.com/elastic/kibana/issues/168281\r\n\r\nFlaky test runner
(100
times):\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3417\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"3131bc228124e8641dca52508cffd91c14290564"}}]}]
BACKPORT-->

Co-authored-by: Drew Tate <[email protected]>
  • Loading branch information
kibanamachine and drewdaemon authored Oct 10, 2023
1 parent 81daa75 commit 14e9682
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 2 deletions.
35 changes: 33 additions & 2 deletions test/functional/apps/visualize/group3/_annotation_listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'annotationEditor']);
const listingTable = getService('listingTable');
const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects');
const find = getService('find');
const retry = getService('retry');
const log = getService('log');
Expand All @@ -32,6 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

await PageObjects.visualize.gotoVisualizationLandingPage();
await PageObjects.visualize.selectAnnotationsTab();
await listingTable.waitUntilTableIsLoaded();
});

after(async function () {
Expand Down Expand Up @@ -156,7 +158,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});

describe.skip('data view switching', () => {
describe('data view switching', () => {
it('recovers from missing data view', async () => {
await listingTable.clickItemLink('eventAnnotation', 'missing data view');

Expand All @@ -175,7 +177,36 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.annotationEditor.saveGroup();
});

it('recovers from missing field in data view', () => {});
it('recovers from missing field in data view', async () => {
const assertShowingMissingFieldError = async (yes: boolean) => {
const [failureExists, canvasExists] = await Promise.all([
testSubjects.exists('embeddable-lens-failure'),
find.existsByCssSelector('canvas', 1000),
]);
expect(failureExists).to.be(yes);
expect(canvasExists).to.be(!yes);
};

await listingTable.clickItemLink('eventAnnotation', 'Group with additional fields');

await assertShowingMissingFieldError(false);

await retry.try(async () => {
await PageObjects.annotationEditor.editGroupMetadata({
dataView: 'Data view without fields',
});

await assertShowingMissingFieldError(true);
});

await retry.try(async () => {
await PageObjects.annotationEditor.editGroupMetadata({
dataView: 'logs*',
});

await assertShowingMissingFieldError(false);
});
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@
"version": "WzIyNywxXQ=="
}

{
"attributes": {
"fieldAttrs": "{}",
"fieldFormatMap": "{}",
"fields": "[]",
"name": "Data view without fields",
"runtimeFieldMap": "{}",
"sourceFilters": "[]",
"timeFieldName": "timestamp",
"title": "kibana_sample_data_logs",
"typeMeta": "{}"
},
"coreMigrationVersion": "8.8.0",
"created_at": "2023-09-07T17:23:20.906Z",
"id": "data-view-without-fields",
"managed": false,
"references": [],
"type": "index-pattern",
"typeMigrationVersion": "8.0.0",
"updated_at": "2023-09-11T15:50:59.227Z",
"version": "WzIyNywxXQ=="
}

{
"attributes": {
"fieldAttrs": "{}",
Expand All @@ -44,6 +67,44 @@
"version": "WzIyNywxXQ=="
}

{
"attributes": {
"annotations": [
{
"extraFields": [
"@message.raw"
],
"icon": "triangle",
"id": "3d28ce7e-fc5e-409b-aea3-4d9e15010843",
"key": {
"type": "point_in_time"
},
"label": "Event",
"timeField": "@timestamp",
"type": "query"
}
],
"dataViewSpec": null,
"description": "",
"ignoreGlobalFilters": true,
"title": "Group with additional fields"
},
"coreMigrationVersion": "8.8.0",
"created_at": "2023-10-06T17:15:58.790Z",
"id": "12371e00-5174-11ee-a5c4-7dce2e3293a7",
"managed": false,
"references": [
{
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"name": "event-annotation-group_dataView-ref-90943e30-9a47-11e8-b64d-95841ca0b247",
"type": "index-pattern"
}
],
"type": "event-annotation-group",
"updated_at": "2023-10-06T17:17:05.384Z",
"version": "WzE4MywxXQ=="
}

{
"attributes": {
"annotations": [
Expand Down

0 comments on commit 14e9682

Please sign in to comment.