add first e2e feature

This commit is contained in:
mahula 2025-03-03 13:52:47 +01:00
parent 588764cf8d
commit c7bff78f3b
3 changed files with 46 additions and 0 deletions

View File

@ -28,6 +28,7 @@ export default defineConfig({
specPattern: ['**/**/*.cy.{ts,tsx}'],
},
e2e: {
baseUrl: 'http://localhost:5173',
chromeWebSecurity: false,
retries: 0,
specPattern: 'features/**/*.feature',

View File

@ -0,0 +1,25 @@
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'
Given('I am on the map page', () => {
cy.visit('/')
})
Then('the map component should be present', () => {
cy.get('.leaflet-tile-container')
.should('exist')
.children('.leaflet-tile-loaded')
.should('have.length.greaterThan', 0)
.and('be.visible')
})
Then('the search input control should be present', () => {
cy.get('.tw-input').should('be.visible')
})
Then('the geolocation control should be present', () => {
cy.get('div.tw-card:nth-child(2) > div:nth-child(1)').should('be.visible')
})
Then('the layers control should be present', () => {
cy.get('div.tw-bg-base-100:nth-child(1)').should('be.visible')
})

20
features/Map.feature Normal file
View File

@ -0,0 +1,20 @@
Feature: Map
As a user
I want to have the leaflet map and its control elements available
To be able to interact with the map
Scenario: Map Component
Given I am on the map page
Then the map component should be present
Scenario: Search Control
Given I am on the map page
Then the search input control should be present
Scenario: Geolocation Control
Given I am on the map page
Then the geolocation control should be present
Scenario: Layers Control
Given I am on the map page
Then the layers control should be present