[pageObjects/visualize] use testSubjects.setValue() to avoid partial input (#29903) (#29904)

Fixes https://github.com/elastic/kibana/issues/29373
Fixes https://github.com/elastic/kibana/issues/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.
This commit is contained in:
Spencer 2019-02-02 16:22:02 -08:00 committed by GitHub
parent e433e80837
commit 7bd313786e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -400,8 +400,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() {