Skip to content

Commit

Permalink
un-skip maps/feature_controls/maps_spaces.ts functional test (#113656)
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmivkulkarni authored Oct 20, 2021
1 parent b879a9a commit e37c259
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
31 changes: 21 additions & 10 deletions x-pack/test/functional/apps/maps/feature_controls/maps_spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { APP_ID } from '../../../../../plugins/maps/common/constants';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const spacesService = getService('spaces');
const PageObjects = getPageObjects(['common', 'maps', 'security']);
const PageObjects = getPageObjects(['common', 'maps', 'security', 'header']);
const listingTable = getService('listingTable');
const appsMenu = getService('appsMenu');

// FLAKY: https://github.com/elastic/kibana/issues/38414
describe.skip('spaces feature controls', () => {
describe('spaces feature controls', () => {
before(async () => {
PageObjects.maps.setBasePath('/s/custom_space');
});
Expand Down Expand Up @@ -46,21 +47,31 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});

it(`allows a map to be created`, async () => {
await PageObjects.common.navigateToActualUrl('maps', '', {
await PageObjects.common.navigateToActualUrl(APP_ID, '/map', {
basePath: `/s/custom_space`,
ensureCurrentUrl: false,
ensureCurrentUrl: true,
shouldLoginIfPrompted: false,
});
await PageObjects.maps.waitForLayersToLoad();
await PageObjects.maps.saveMap('my test map');
});

it(`allows a map to be deleted`, async () => {
await PageObjects.common.navigateToActualUrl('maps', '', {
await PageObjects.common.navigateToActualUrl(APP_ID, '/', {
basePath: `/s/custom_space`,
ensureCurrentUrl: false,
ensureCurrentUrl: true,
shouldLoginIfPrompted: false,
});
await PageObjects.maps.deleteSavedMaps('my test map');

// Can not use maps.deleteSavedMaps because maps.deleteSavedMaps will
// navigate to default space if on list page check fails
await listingTable.searchForItemWithName('my test map');
await PageObjects.header.waitUntilLoadingHasFinished();
await listingTable.checkListingSelectAllCheckbox();
await listingTable.clickDeleteSelected();
await PageObjects.common.clickConfirmOnModal();
await PageObjects.header.waitUntilLoadingHasFinished();
await listingTable.expectItemsCount('map', 0);
});
});

Expand All @@ -78,9 +89,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});

it(`returns a 404`, async () => {
await PageObjects.common.navigateToActualUrl('maps', '', {
await PageObjects.common.navigateToActualUrl(APP_ID, '/', {
basePath: '/s/custom_space',
ensureCurrentUrl: false,
ensureCurrentUrl: true,
shouldLoginIfPrompted: false,
});
const messageText = await PageObjects.common.getJsonBodyText();
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/page_objects/gis_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export class GisPageObject extends FtrService {
await this.testSubjects.click('savedObjectTitle');
}
await this.testSubjects.clickWhenNotDisabled('confirmSaveSavedObjectButton');
await this.header.waitUntilLoadingHasFinished();
}

async clickSaveAndReturnButton() {
Expand Down

0 comments on commit e37c259

Please sign in to comment.