Skip to content

Commit

Permalink
tests for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie committed Dec 7, 2024
1 parent 1bfbc76 commit 731b34e
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions proxy/test/ui/cypress/e2e/home.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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&')

Expand Down Expand Up @@ -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()
})
})

0 comments on commit 731b34e

Please sign in to comment.