Fixing flaky maps test (#35176)

## Summary

fixes https://github.com/elastic/kibana/issues/35049
This commit is contained in:
Larry Gregory 2019-04-17 18:24:47 -04:00 committed by GitHub
parent 0ad9417adf
commit 6ee7d6d236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View file

@ -187,7 +187,7 @@ export async function cleanKibanaIndices({ client, stats, log, kibanaUrl }) {
bool: {
must_not: {
ids: {
type: 'doc',
type: '_doc',
values: ['space:default']
}
}

View file

@ -20,6 +20,13 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
describe('spaces feature controls', () => {
before(async () => {
await esArchiver.loadIfNeeded('maps/data');
await esArchiver.load('maps/kibana');
PageObjects.maps.setBasePath('/s/custom_space');
});
after(async () => {
await esArchiver.unload('maps/kibana');
PageObjects.maps.setBasePath('');
});
describe('space with no features disabled', () => {

View file

@ -19,6 +19,14 @@ export function GisPageProvider({ getService, getPageObjects }) {
class GisPage {
constructor() {
this.basePath = '';
}
setBasePath(basePath) {
this.basePath = basePath;
}
async setAbsoluteRange(start, end) {
await PageObjects.timePicker.setAbsoluteRange(start, end);
await this.waitForLayersToLoad();
@ -176,7 +184,7 @@ export function GisPageProvider({ getService, getPageObjects }) {
const onPage = await this.onMapListingPage();
if (!onPage) {
await retry.try(async () => {
await PageObjects.common.navigateToUrl('maps', '/');
await PageObjects.common.navigateToUrl('maps', '/', { basePath: this.basePath });
const onMapListingPage = await this.onMapListingPage();
if (!onMapListingPage) throw new Error('Not on map listing page.');
});