Skip to content

Commit 4dfb76b

Browse files
committed
BGDIINF_SB-2958 : add 3d load tests
1 parent 7b7aa0c commit 4dfb76b

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

src/modules/map/components/cesium/CesiumMap.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div id="cesium" ref="map"></div>
2+
<div id="cesium" ref="map" data-cy="cesium"></div>
33
<slot />
44
</template>
55
<script>

src/modules/map/components/openlayers/OpenLayersMap.vue

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<div
44
id="ol-map"
55
ref="map"
6+
data-cy="ol-map"
67
@touchstart.passive="onTouchStart"
78
@touchmove.passive="clearLongPressTimer"
89
@touchend.passive="clearLongPressTimer"

tests/e2e-cypress/integration/3d/transitionTo3d.cy.js

+25
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,29 @@ describe('Testing transitioning between 2D and 3D', () => {
4545
})
4646
})
4747
})
48+
context('3D load', () => {
49+
it('base layer load', () => {
50+
cy.goToMapView()
51+
// fixtures/256.jpeg will be fetched
52+
cy.intercept('**/ch.swisstopo.swisstlm3d-karte-farbe.3d/**').as('baseLayer')
53+
cy.get('[data-cy="3d-button"]').click()
54+
cy.get('[data-cy="cesium"]').should('be.visible')
55+
cy.get('[data-cy="ol-map"]').should('not.exist')
56+
cy.wait('@baseLayer').its('response.statusCode').should('eq', 200)
57+
})
58+
it('load with correct position', () => {
59+
cy.goToMapView('en', {
60+
lat: 46.980721,
61+
lon: 7.532844,
62+
z: 9.666,
63+
})
64+
cy.get('[data-cy="3d-button"]').click()
65+
cy.readWindowValue('cesiumViewer').then((viewer) => {
66+
const cameraPosition = viewer.camera.positionCartographic
67+
expect(cameraPosition.longitude).to.eq(0.13147292983909972)
68+
expect(cameraPosition.latitude).to.eq(0.819968266410843)
69+
expect(cameraPosition.height).to.eq(36434.03514736528)
70+
})
71+
})
72+
})
4873
})

0 commit comments

Comments
 (0)