ticket descriptor path updated
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-11-18 15:00:41 +01:00
parent 247ccc6ddc
commit 79ab228bca
3 changed files with 35 additions and 3 deletions

View File

@ -421,6 +421,10 @@ export default {
moreMenuRestoreTicket: '.vn-menu [name="restoreTicket"]', moreMenuRestoreTicket: '.vn-menu [name="restoreTicket"]',
moreMenuMakeInvoice: '.vn-menu [name="makeInvoice"]', moreMenuMakeInvoice: '.vn-menu [name="makeInvoice"]',
moreMenuChangeShippedHour: '.vn-menu [name="changeShipped"]', moreMenuChangeShippedHour: '.vn-menu [name="changeShipped"]',
moreMenuPaymentSMS: '.vn-menu [name="sendPaymentSms"]',
moreMenuSendImportSms: '.vn-menu [name="sendImportSms"]',
SMStext: 'textarea[name="message"]',
sendSMSbutton: 'button[response="accept"]',
changeShippedHourDialog: '.vn-dialog.shown', changeShippedHourDialog: '.vn-dialog.shown',
changeShippedHour: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newShipped"]', changeShippedHour: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newShipped"]',
addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr', addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr',

View File

@ -39,7 +39,7 @@ describe('Ticket descriptor path', () => {
expect(result).toContain('08:15'); expect(result).toContain('08:15');
}); });
it('should delete the ticket using the descriptor more menu', async() => { it('should delete the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket); await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog); await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
@ -64,7 +64,7 @@ describe('Ticket descriptor path', () => {
}); });
describe('Restore ticket', () => { describe('Restore ticket', () => {
it('should restore the ticket using the descriptor more menu', async() => { it('should restore the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuRestoreTicket); await page.waitToClick(selectors.ticketDescriptor.moreMenuRestoreTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog); await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
@ -148,7 +148,7 @@ describe('Ticket descriptor path', () => {
expect(result).toEqual('-'); expect(result).toEqual('-');
}); });
it('should invoice the ticket using the descriptor more menu', async() => { it('should invoice the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenuMakeInvoice); await page.waitToClick(selectors.ticketDescriptor.moreMenuMakeInvoice);
@ -165,4 +165,30 @@ describe('Ticket descriptor path', () => {
expect(result).toEqual('T4444445'); expect(result).toEqual('T4444445');
}); });
}); });
describe('SMS', () => {
it('should send the payment SMS using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenuPaymentSMS);
await page.waitForSelector(selectors.ticketDescriptor.SMStext);
await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 128);
await page.waitToClick(selectors.ticketDescriptor.sendSMSbutton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('SMS sent!');
});
it('should send the import SMS using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenuSendImportSms);
await page.waitForSelector(selectors.ticketDescriptor.SMStext);
await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 144);
await page.waitToClick(selectors.ticketDescriptor.sendSMSbutton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('SMS sent!');
});
});
}); });

View File

@ -46,11 +46,13 @@
</vn-item> </vn-item>
<vn-item <vn-item
ng-click="$ctrl.sendPaymentSms()" ng-click="$ctrl.sendPaymentSms()"
name="sendPaymentSms"
translate> translate>
SMS Pending payment SMS Pending payment
</vn-item> </vn-item>
<vn-item <vn-item
ng-click="$ctrl.sendImportSms()" ng-click="$ctrl.sendImportSms()"
name="sendImportSms"
translate> translate>
SMS Minimum import SMS Minimum import
</vn-item> </vn-item>