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

PB-995 : add import KML in 3D test through the import popup #1201

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function onToggleImportFile() {
movable
initial-position="top-left"
wide
data-cy="import-window"
@close="onToggleImportFile"
>
<ImportFile />
Expand Down
27 changes: 27 additions & 0 deletions tests/cypress/tests-e2e/importToolFile.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,33 @@ describe('The Import File Tool', () => {
cy.get('[data-cy="import-file-load-button"]:visible').click()
cy.wait(['@headKmlNoCORS', '@proxyfiedKmlNoCORS'])
cy.readStoreValue('state.layers.activeLayers').should('have.length', 2)

cy.log('switching to 3D and checking that online file is correctly loaded on 3D viewer')
cy.get('[data-cy="import-window"] [data-cy="window-close"]').click()
// 2 warnings to remove before being able to see the 3D button (on mobile)
cy.get('[data-cy="warning-window-close"]').click({ force: true })
cy.get('[data-cy="warning-window-close"]').click({ force: true })
cy.get('[data-cy="3d-button"]:visible').click()
cy.waitUntilCesiumTilesLoaded()
cy.readWindowValue('cesiumViewer').should((viewer) => {
expect(viewer.scene.primitives.length).to.eq(
4,
'should have 1 primitive (KML file) on top of labels and buildings primitives'
)
})

cy.log('adding a local KML file while being in the 3D viewer')
cy.openMenuIfMobile()
cy.get('[data-cy="menu-tray-tool-section"]:visible').click()
cy.get('[data-cy="menu-advanced-tools-import-file"]:visible').click()
cy.get('[data-cy="import-file-local-btn"]').click()
cy.get('[data-cy="file-input"]').selectFile('@lineAccrossEuFixture', {
force: true,
})
cy.get('[data-cy="import-file-load-button"]:visible').click()
cy.readWindowValue('cesiumViewer').should((viewer) => {
expect(viewer.dataSources.length).to.eq(1, 'should have 1 date source (KML files)')
})
})
it('Import KML file error handling', () => {
const outOfBoundKMLFile = 'import-tool/paris.kml'
Expand Down
Loading