Skip to content

Commit

Permalink
Test for bug elastic#33251
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza Katz committed Apr 8, 2019
1 parent 3db22a4 commit 26caeca
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/functional/apps/management/_scripted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,33 @@ export default function ({ getService, getPageObjects }) {
});
});


describe.only('testing regression for issue #33251', function describeIndexTests() {
const scriptedPainlessFieldName = 'ram_Pain_reg';

it('should create and edit scripted field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
await PageObjects.settings.clickScriptedFieldsTab();
await log.debug('add scripted field');
const script = `1`;
await PageObjects.settings.addScriptedField(scriptedPainlessFieldName, 'painless', 'number', null, '1', script);
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
});

for (let i = 0; i < 3; i++) {
await PageObjects.settings.editScriptedField(scriptedPainlessFieldName);
const fieldSaveButton = await testSubjects.exists('fieldSaveButton');
expect(fieldSaveButton).to.be(true);
await PageObjects.settings.clickSaveScriptedField();
}
});
});


describe('creating and using Painless numeric scripted fields', function describeIndexTests() {
const scriptedPainlessFieldName = 'ram_Pain1';

Expand Down
5 changes: 5 additions & 0 deletions test/functional/page_objects/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
await testSubjects.click('tab-sourceFilters');
}

async editScriptedField(name) {
await this.filterField(name);
await find.clickByCssSelector('.euiTableRowCell--hasActions button:first-child');
}

async addScriptedField(name, language, type, format, popularity, script) {
await this.clickAddScriptedField();
await this.setScriptedFieldName(name);
Expand Down

0 comments on commit 26caeca

Please sign in to comment.