add e2e testing

This commit is contained in:
Yannick 2025-04-28 09:36:16 +02:00
parent 0eb262b4f8
commit 14bca7e9e3
3 changed files with 18 additions and 6 deletions

View file

@ -1,7 +1,19 @@
describe('template spec', () => { describe('template spec', () => {
it('passes', () => { it('passes', () => {
cy.viewport(1920, 1080)
cy.visit('https://www.berufsbildung-vs.ch/') cy.visit('https://www.berufsbildung-vs.ch/')
cy.get('.nav-link').contains('Berufslehre').click() cy.get('#nav-21').find('a[href="https://www.berufsbildung-vs.ch/berufslehre"]').click()
cy.get('#listing_search_input_49').type('Informatik')
cy.get('input[type="submit"][name="submitter"]').click()
const informatikElement = cy.get('.listing-entry-inline').contains('Informatiker/in EFZ (EMVs)').parents('.listing-entry-inline')
informatikElement.invoke('css', 'background-color', 'yellow')
informatikElement.should('exist')
informatikElement.click()
// the element after <h3>Übersicht 4-jährige Ausbildung</h3> should contain an element with class="resource picture picture_content"
cy.get('h3:contains("Übersicht 4-jährige Ausbildung")').next().find('.resource.picture.picture_content').find('img').should('exist')
cy.contains('Voraussetzungen').should('exist')
cy.contains('Anmeldung').should('exist')
cy.contains('Schnuppertage').should('exist')
}) })
}) })

View file

@ -9,7 +9,7 @@
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"cypress": "^14.3.0", "cypress": "^14.3.2",
"mocha": "^11.1.0" "mocha": "^11.1.0"
} }
}, },
@ -901,9 +901,9 @@
} }
}, },
"node_modules/cypress": { "node_modules/cypress": {
"version": "14.3.0", "version": "14.3.2",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-14.3.0.tgz", "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.3.2.tgz",
"integrity": "sha512-rRfPl9Z0/CczuYybBEoLbDVuT1OGkhYaJ0+urRCshgiDRz6QnoA0KQIQnPx7MJ3zy+VCsbUU1pV74n+6cbJEdg==", "integrity": "sha512-n+yGD2ZFFKgy7I3YtVpZ7BcFYrrDMcKj713eOZdtxPttpBjCyw/R8dLlFSsJPouneGN7A/HOSRyPJ5+3/gKDoA==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",

View file

@ -10,7 +10,7 @@
"license": "ISC", "license": "ISC",
"description": "", "description": "",
"devDependencies": { "devDependencies": {
"cypress": "^14.3.0", "cypress": "^14.3.2",
"mocha": "^11.1.0" "mocha": "^11.1.0"
} }
} }