Fix/markdown functional tests (#46216)

* [page_objects/visual_builder_page] improve text area input clearing and typing value

* run ciGroup6 15x times

* Revert "run ciGroup6 15x times"

This reverts commit d94491769b.
This commit is contained in:
Dmitry Lemeshko 2019-09-20 19:36:05 +02:00 committed by GitHub
parent 8d95e88a61
commit 3f83251a20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View file

@ -38,8 +38,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});
}
// FLAKY: https://github.com/elastic/kibana/issues/46085
describe.skip('visual builder', function describeIndexTests() {
describe('visual builder', function describeIndexTests() {
describe('markdown', () => {
before(async () => {
await visualBuilder.resetPage();

View file

@ -107,18 +107,26 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
public async enterMarkdown(markdown: string) {
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
await this.clearMarkdown();
await input.type(markdown);
await input.type(markdown, { charByChar: true });
await PageObjects.visualize.waitForVisualizationRenderingStabilized();
}
public async clearMarkdown() {
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
// click for switching context(fix for "should render first table variable" test)
// see _tsvb_markdown.js
// Since we use ACE editor and that isn't really storing its value inside
// a textarea we must really select all text and remove it, and cannot use
// clearValue().
await input.clearValueWithKeyboard();
await retry.waitForWithTimeout('text area is cleared', 20000, async () => {
const editor = await testSubjects.find('codeEditorContainer');
const $ = await editor.parseDomContent();
const value = $('.ace_line').text();
if (value.length > 0) {
log.debug('Clearing text area input');
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
await input.clearValueWithKeyboard();
}
return value.length === 0;
});
}
public async getMarkdownText(): Promise<string> {