Skip to content

Commit

Permalink
[pageObjects/visualize] use testSubjects.setValue() to avoid partial …
Browse files Browse the repository at this point in the history
…input (#29903)

Fixes #29373
Fixes #29833

This flaky test is caused by the filter input box not being filled in completely. I was able to reproduce this once locally, but only after running the tests a couple times. To fix this I tried switching to the `testSubjects.setValue()` function, which focuses the input and clears its value before attempting to type into the field. This seems to have a higher success rate as I was able to run the test 40 times after making the change without a failure.
  • Loading branch information
Spencer authored Feb 2, 2019
1 parent 61f9993 commit 32190e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
* @param {*} aggregationId the ID if the aggregation. On Tests, it start at from 2
*/
async setFilterAggregationValue(filterValue, filterIndex = 0, aggregationId = 2) {
const inputField = await testSubjects.find(`visEditorFilterInput_${aggregationId}_${filterIndex}`);
await inputField.type(filterValue);
await testSubjects.setValue(`visEditorFilterInput_${aggregationId}_${filterIndex}`, filterValue);
}

async addNewFilterAggregation() {
Expand Down

0 comments on commit 32190e3

Please sign in to comment.