[maps] fix x-pack/test/functional/apps/maps/documents_source/top_hits.js test (#122276) (#122286)

* [maps] fix x-pack/test/functional/apps/maps/documents_source/top_hits·js test

* eslint

Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
This commit is contained in:
Kibana Machine 2022-01-04 14:50:48 -05:00 committed by GitHub
parent fb2d461878
commit f882402f84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ export default function ({ getPageObjects, getService }) {
const inspector = getService('inspector');
const find = getService('find');
const security = getService('security');
const retry = getService('retry');
describe('geo top hits', () => {
describe('split on string field', () => {
@ -42,13 +43,22 @@ export default function ({ getPageObjects, getService }) {
describe('configuration', () => {
before(async () => {
await PageObjects.maps.openLayerPanel('logstash');
// Can not use testSubjects because data-test-subj is placed range input and number input
const sizeInput = await find.byCssSelector(
`input[data-test-subj="layerPanelTopHitsSize"][type='number']`
);
await sizeInput.click();
await sizeInput.clearValue();
await sizeInput.type('3');
await retry.try(async () => {
// Can not use testSubjects because data-test-subj is placed range input and number input
const sizeInput = await find.byCssSelector(
`input[data-test-subj="layerPanelTopHitsSize"][type='number']`
);
await sizeInput.click();
await sizeInput.clearValue();
await sizeInput.type('3');
const sizeValue = await sizeInput.getAttribute('value');
if (sizeValue !== '3') {
throw new Error('layerPanelTopHitsSize not set to 3');
}
});
await PageObjects.maps.waitForLayersToLoad();
});