Skip to content

Commit

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

## Summary

Fix elastic#167434 (reenables embeddable test)
Fix elastic#168281

Flaky test runner (100 times):
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3417

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and dej611 committed Oct 17, 2023
1 parent 495fabf commit adb2f79
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 adb2f79

Please sign in to comment.