diff --git a/proxy/test/ui/cypress/e2e/home.cy.js b/proxy/test/ui/cypress/e2e/home.cy.js index 3c8c286c..cf917987 100644 --- a/proxy/test/ui/cypress/e2e/home.cy.js +++ b/proxy/test/ui/cypress/e2e/home.cy.js @@ -3,7 +3,7 @@ * but there is no wait to make cypress wait for map load events. */ describe('home page', () => { - it('switching layers', () => { + it('switching layers (light mode)', () => { cy.visit('/#view=9.88/52.5134/13.4024&') cy.contains('Infrastructure').click() @@ -46,6 +46,60 @@ describe('home page', () => { cy.screenshot() }) + it('switching layers (dark mode)', () => { + cy.visit('/#view=9.88/52.5134/13.4024&') + + cy.get('.maplibregl-ctrl-configuration').click() + cy.contains('Map configuration').should('be.visible') + cy.get('label').contains('Dark').click() + + cy.screenshot() + + cy.get('button.btn-close').click() + cy.contains('Map configuration').should('not.be.visible') + + cy.screenshot() + + cy.contains('Infrastructure').click() + cy.url().should('include', 'style=standard') + + cy.wait(3000) + cy.screenshot() + + cy.contains('Speed').click() + cy.url().should('include', 'style=speed') + + cy.wait(3000) + cy.screenshot() + + cy.contains('Train protection').click() + cy.url().should('include', 'style=signals') + + cy.wait(3000) + cy.screenshot() + + cy.contains('Electrification').click() + cy.url().should('include', 'style=electrification') + + cy.wait(3000) + cy.screenshot() + + cy.contains('Gauge').click() + cy.url().should('include', 'style=gauge') + + cy.wait(3000) + cy.screenshot() + + cy.contains('Loading gauge').click() + cy.url().should('include', 'style=loading_gauge') + + cy.contains('Track class').click() + cy.url().should('include', 'style=track_class') + + cy.wait(3000) + cy.screenshot() + }) + it('legend', () => { cy.visit('/#view=9.88/52.5134/13.4024&') @@ -91,7 +145,7 @@ describe('home page', () => { cy.get('.maplibregl-ctrl-configuration').click() - cy.wait(3000) + cy.contains('Map configuration').should('be.visible') cy.screenshot() }) })