salix/e2e/paths/05-ticket-module/01_observations.spec.js

47 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-03-19 15:29:55 +00:00
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
2018-03-19 15:29:55 +00:00
2018-12-19 07:42:07 +00:00
describe('Ticket Create notes path', () => {
const nightmare = createNightmare();
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket')
2019-06-19 07:03:45 +00:00
.accessToSearchResult(1)
2018-12-19 07:42:07 +00:00
.accessToSection('ticket.card.observation');
});
2019-06-19 07:03:45 +00:00
it('should create a new note', async() => {
2018-12-19 07:42:07 +00:00
let result = await nightmare
.waitToClick(selectors.ticketNotes.addNoteButton)
2019-01-07 08:33:07 +00:00
.autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one')
2019-01-23 14:33:25 +00:00
.write(selectors.ticketNotes.firstDescriptionInput, 'description')
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.ticketNotes.submitNotesButton)
2018-12-19 07:42:07 +00:00
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
2019-06-19 07:03:45 +00:00
it('should confirm the note is the expected one', async() => {
2019-01-07 08:33:07 +00:00
let result = await nightmare
.reloadSection('ticket.card.observation')
2019-01-07 08:33:07 +00:00
.waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value');
2018-12-19 07:42:07 +00:00
2019-01-07 08:33:07 +00:00
expect(result).toEqual('observation one');
2018-12-19 07:42:07 +00:00
let firstDescription = await nightmare
.waitToGetProperty(selectors.ticketNotes.firstDescriptionInput, 'value');
expect(firstDescription).toEqual('description');
2018-03-19 15:29:55 +00:00
});
2019-06-19 07:03:45 +00:00
it('should delete the note', async() => {
let result = await nightmare
.waitToClick(selectors.ticketNotes.firstNoteRemoveButton)
.waitToClick(selectors.ticketNotes.submitNotesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
2018-03-19 15:29:55 +00:00
});