[Lens] Fixes flakiness in editing pre-existing runtime field (#108653)

* [Lens] Fixes flakiness in editing pre-existing runtime field

* Field editor changes

* Unskip test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Stratoula Kalafateli 2021-08-17 12:11:05 +03:00 committed by GitHub
parent ae947ceda9
commit 99e33215fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -12,8 +12,11 @@ export class FieldEditorService extends FtrService {
private readonly browser = this.ctx.getService('browser');
private readonly testSubjects = this.ctx.getService('testSubjects');
public async setName(name: string) {
await this.testSubjects.setValue('nameField > input', name);
public async setName(name: string, clearFirst = false, typeCharByChar = false) {
await this.testSubjects.setValue('nameField > input', name, {
clearWithKeyboard: clearFirst,
typeCharByChar,
});
}
public async enableCustomLabel() {
await this.testSubjects.setEuiSwitch('customLabelRow > toggle', 'check');

View file

@ -14,8 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const fieldEditor = getService('fieldEditor');
const retry = getService('retry');
// FLAKY: https://github.com/elastic/kibana/issues/95614
describe.skip('lens runtime fields', () => {
describe('lens runtime fields', () => {
it('should be able to add runtime field and use it', async () => {
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVisType('lens');
@ -49,7 +48,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should able to edit field', async () => {
await PageObjects.lens.clickField('runtimefield');
await PageObjects.lens.editField();
await fieldEditor.setName('runtimefield2');
await fieldEditor.setName('runtimefield2', true, true);
await fieldEditor.save();
await fieldEditor.confirmSave();
await PageObjects.lens.searchField('runtime');