Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unskip add runtime field test #118303

Merged
merged 4 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/functional/apps/management/_runtime_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['settings']);
const testSubjects = getService('testSubjects');

// FLAKY: https://github.com/elastic/kibana/issues/95376
describe.skip('runtime fields', function () {
describe('runtime fields', function () {
this.tags(['skipFirefox']);

before(async function () {
Expand Down Expand Up @@ -60,7 +59,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.filterField(fieldName);
await testSubjects.click('editFieldFormat');
await PageObjects.settings.setFieldType('Long');
await PageObjects.settings.changeFieldScript('emit(6);');
await PageObjects.settings.setFieldScript('emit(6);');
await testSubjects.find('changeWarning');
await PageObjects.settings.clickSaveField();
await PageObjects.settings.confirmSave();
Expand Down
20 changes: 3 additions & 17 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,23 +618,9 @@ export class SettingsPageObject extends FtrService {

async setFieldScript(script: string) {
this.log.debug('set script = ' + script);
const valueRow = await this.toggleRow('valueRow');
const getMonacoTextArea = async () => (await valueRow.findAllByCssSelector('textarea'))[0];
this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea()));
const monacoTextArea = await getMonacoTextArea();
await monacoTextArea.focus();
this.browser.pressKeys(script);
}

async changeFieldScript(script: string) {
this.log.debug('set script = ' + script);
const valueRow = await this.testSubjects.find('valueRow');
const getMonacoTextArea = async () => (await valueRow.findAllByCssSelector('textarea'))[0];
this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea()));
const monacoTextArea = await getMonacoTextArea();
await monacoTextArea.focus();
this.browser.pressKeys(this.browser.keys.DELETE.repeat(30));
this.browser.pressKeys(script);
await this.toggleRow('valueRow');
await this.monacoEditor.waitCodeEditorReady('valueRow');
await this.monacoEditor.setCodeEditorValue(script);
}

async clickAddScriptedField() {
Expand Down
7 changes: 6 additions & 1 deletion test/functional/services/monaco_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export class MonacoEditorService extends FtrService {
private readonly browser = this.ctx.getService('browser');
private readonly testSubjects = this.ctx.getService('testSubjects');

public async waitCodeEditorReady(containerTestSubjId: string) {
const editorContainer = await this.testSubjects.find(containerTestSubjId);
await editorContainer.findByCssSelector('textarea');
}

public async getCodeEditorValue(nthIndex: number = 0) {
let values: string[] = [];

Expand All @@ -31,7 +36,7 @@ export class MonacoEditorService extends FtrService {
public async typeCodeEditorValue(value: string, testSubjId: string) {
const editor = await this.testSubjects.find(testSubjId);
const textarea = await editor.findByCssSelector('textarea');
textarea.type(value);
await textarea.type(value);
}

public async setCodeEditorValue(value: string, nthIndex = 0) {
Expand Down