Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.16] un-skip maps/feature_controls/maps_spaces.ts functional test (#113656) #115871

Merged
merged 2 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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