From 7670c24f0449cd446b16f93ea36a51f654dc1670 Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 3 Mar 2025 13:28:22 +0100 Subject: [PATCH] test: refs #8440 add Cypress integration tests for vehicle notes functionality --- .../route/vehicle/vehicleNotes.spec.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/cypress/integration/route/vehicle/vehicleNotes.spec.js diff --git a/test/cypress/integration/route/vehicle/vehicleNotes.spec.js b/test/cypress/integration/route/vehicle/vehicleNotes.spec.js new file mode 100644 index 000000000..05a379efd --- /dev/null +++ b/test/cypress/integration/route/vehicle/vehicleNotes.spec.js @@ -0,0 +1,28 @@ +describe('Vehicle Notes', () => { + const selectors = { + addNoteInput: 'Add note here..._input', + saveNoteBtn: 'saveNote', + deleteNoteBtn: '[data-cy="notesRemoveNoteBtn"]', + noteCard: '.column.full-width > :nth-child(1) > .q-card__section--vert', + }; + + const noteText = 'Golpe parachoques trasero'; + const newNoteText = 'probando'; + + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/route/vehicle/1/notes`); + }); + + it('Should add new note', () => { + cy.dataCy(selectors.addNoteInput).click().type(newNoteText); + cy.dataCy(selectors.saveNoteBtn).click(); + cy.validateContent(selectors.noteCard, newNoteText); + }); + + it('Should delete note', () => { + cy.get(selectors.deleteNoteBtn).first().click(); + cy.get(selectors.noteCard).first().should('have.text', noteText); + }); +});