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

Fix upgrade maps smoke tests #128696

Merged
merged 4 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
34 changes: 34 additions & 0 deletions x-pack/test/functional/page_objects/gis_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,40 @@ export class GisPageObject extends FtrService {
await this.testSubjects.click('layerVisibilityToggleButton');
}

async toggleLayerVisibilityRoadMap() {
liza-mae marked this conversation as resolved.
Show resolved Hide resolved
const isRoadMapDesaturated = await this.testSubjects.exists(
'layerTocActionsPanelToggleButtonRoad_map_-_desaturated'
);
const isRoadMap = await this.testSubjects.exists('layerTocActionsPanelToggleButtonRoad_map');
if (!isRoadMapDesaturated && !isRoadMap) {
throw new Error('Layer road map not found');
}
if (isRoadMapDesaturated) {
await this.toggleLayerVisibility('Road map - desaturated');
}
if (isRoadMap) {
await this.toggleLayerVisibility('Road map');
}
}

async toggleLayerVisibilityTotalRequests() {
const isRequestByCountry = await this.testSubjects.exists(
'layerTocActionsPanelToggleButtonTotal_Requests_by_Country'
);
const isRequestByDestination = await this.testSubjects.exists(
'layerTocActionsPanelToggleButtonTotal_Requests_by_Destination'
);
if (!isRequestByCountry && !isRequestByDestination) {
throw new Error('Layer total requests not found');
}
if (isRequestByCountry) {
await this.toggleLayerVisibility('Total Requests by Country');
}
if (isRequestByDestination) {
await this.toggleLayerVisibility('Total Requests by Destination');
}
}

async openLegend() {
const isOpen = await this.testSubjects.exists('mapLayerTOC');
if (isOpen === false) {
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function ({
);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.maps.waitForLayersToLoad();
await PageObjects.maps.toggleLayerVisibility('Road map - desaturated');
await PageObjects.maps.toggleLayerVisibilityRoadMap();
await PageObjects.maps.toggleLayerVisibility('United Kingdom');
await PageObjects.maps.toggleLayerVisibility('France');
await PageObjects.maps.toggleLayerVisibility('United States');
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function ({
);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.maps.waitForLayersToLoad();
await PageObjects.maps.toggleLayerVisibility('Road map - desaturated');
await PageObjects.maps.toggleLayerVisibilityRoadMap();
await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
await PageObjects.maps.enterFullScreen();
await PageObjects.maps.closeLegend();
Expand All @@ -167,8 +167,8 @@ export default function ({
);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.maps.waitForLayersToLoad();
await PageObjects.maps.toggleLayerVisibility('Road map');
await PageObjects.maps.toggleLayerVisibility('Total Requests by Country');
await PageObjects.maps.toggleLayerVisibilityRoadMap();
await PageObjects.maps.toggleLayerVisibilityTotalRequests();
await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
await PageObjects.maps.enterFullScreen();
await PageObjects.maps.closeLegend();
Expand Down