salix/e2e/paths/ticket-module/01_create_ticket_observatio...

41 lines
1.6 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')
.accessToSearchResult('id:1')
.accessToSection('ticket.card.observation');
});
2019-01-07 08:33:07 +00:00
it(`should click create a new note and delete a former one`, async() => {
2018-12-19 07:42:07 +00:00
let result = await nightmare
.waitToClick(selectors.ticketNotes.firstNoteRemoveButton)
.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-01-07 08:33:07 +00:00
it(`should confirm the note is the expected one`, async() => {
let result = await nightmare
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.ticketPackages.packagesButton)
2019-01-07 08:33:07 +00:00
.wait(selectors.ticketPackages.firstPackageAutocomplete)
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.ticketNotes.notesButton)
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
});
});