29 lines
946 B
JavaScript
29 lines
946 B
JavaScript
describe('Vehicle Notes', () => {
|
|
const selectors = {
|
|
addNoteInput: 'Add note here..._input',
|
|
saveNoteBtn: 'saveNote',
|
|
deleteNoteBtn: '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).should('be.visible').type(newNoteText);
|
|
cy.dataCy(selectors.saveNoteBtn).click();
|
|
cy.validateContent(selectors.noteCard, newNoteText);
|
|
});
|
|
|
|
it('Should delete note', () => {
|
|
cy.dataCy(selectors.deleteNoteBtn).first().should('be.visible').click();
|
|
cy.get(selectors.noteCard).first().should('have.text', noteText);
|
|
});
|
|
});
|