[Event annotation] stabilize library editing tests (#170784)

## Summary

Fix https://github.com/elastic/kibana/issues/170568

Flaky test runner (x200):
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3949

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Drew Tate 2023-11-09 06:13:09 -07:00 committed by GitHub
parent 6bb46fd8cb
commit 99aa3f81e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -121,8 +121,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await listingTable.expectItemsCount('eventAnnotation', 1);
});
// FLAKY: https://github.com/elastic/kibana/issues/170568
describe.skip('individual annotations', () => {
describe('individual annotations', () => {
it('edits an existing annotation', async function () {
await listingTable.clickItemLink('eventAnnotation', 'edited title');
expect(await PageObjects.annotationEditor.getAnnotationCount()).to.be(1);

View file

@ -10,6 +10,7 @@ import { FtrService } from '../ftr_provider_context';
export class AnnotationEditorPageObject extends FtrService {
private readonly testSubjects = this.ctx.getService('testSubjects');
private readonly find = this.ctx.getService('find');
private readonly retry = this.ctx.getService('retry');
/**
@ -56,12 +57,20 @@ export class AnnotationEditorPageObject extends FtrService {
const queryInput = await this.testSubjects.find('annotation-query-based-query-input');
await queryInput.type(config.query);
await this.testSubjects.setValue('lnsXYThickness', '' + config.lineThickness);
const titles = await this.find.allByCssSelector(
'.euiFlyout h3.lnsDimensionEditorSection__heading'
);
const lastTitle = titles[titles.length - 1];
await lastTitle.click(); // close query input pop-up
await lastTitle.focus(); // scroll down to the bottom of the section
await this.testSubjects.setValue(
'euiColorPickerAnchor indexPattern-dimension-colorPicker',
config.color
);
await lastTitle.click(); // close color picker pop-up
await this.testSubjects.setValue('lnsXYThickness', '' + config.lineThickness);
await this.retry.waitFor('annotation editor UI to close', async () => {
await this.testSubjects.click('backToGroupSettings');