#1450 e2e ticket.weekly
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-08-21 12:23:01 +02:00
parent 6bc92b6ba7
commit 5a380ae1d3
2 changed files with 22 additions and 7 deletions

View File

@ -326,15 +326,19 @@ export default {
advancedSearchInvoiceOut: 'vn-ticket-index vn-searchbar vn-ticket-search-panel vn-textfield[model="filter.refFk"] input',
newTicketButton: 'vn-ticket-index > a',
searchResult: 'vn-ticket-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr',
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)',
searchTicketInput: `vn-ticket-index ${components.vnTextfield}`,
searchWeeklyTicketInput: `vn-ticket-weekly-index ${components.vnTextfield}`,
searchWeeklyClearInput: 'vn-ticket-weekly-index vn-searchbar i[class="material-icons clear"]',
advancedSearchButton: 'vn-ticket-index vn-searchbar > vn-popover vn-ticket-search-panel vn-submit[label="Search"] input',
searchButton: 'vn-ticket-index vn-searchbar vn-icon[icon="search"]',
searchWeeklyButton: 'vn-ticket-weekly-index vn-searchbar vn-icon[icon="search"]',
moreMenu: 'vn-ticket-index vn-icon-menu[vn-id="more-button"] > div > vn-icon',
moreMenuWeeklyTickets: 'vn-ticket-index vn-icon-menu vn-drop-down > vn-popover li:nth-child(2)',
sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6) vn-autocomplete[field="weekly.weekDay"] input',
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
sixthWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(6) vn-icon-button[icon="delete"]',
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
acceptDeleteTurn: 'vn-ticket-weekly-index > vn-confirm[vn-id="deleteWeekly"] button[response="ACCEPT"]'
},
createTicketView: {

View File

@ -9,7 +9,7 @@ describe('Ticket descriptor path', () => {
.loginAndModule('employee', 'ticket');
});
it('should count the mount of tickets in the turns section', async() => {
it('should count the amount of tickets in the turns section', async() => {
const result = await nightmare
.waitToClick(selectors.ticketsIndex.moreMenu)
.waitToClick(selectors.ticketsIndex.moreMenuWeeklyTickets)
@ -32,7 +32,7 @@ describe('Ticket descriptor path', () => {
it('should search for the ticket 11', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:11')
.write(selectors.ticketsIndex.searchTicketInput, 11)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -92,7 +92,7 @@ describe('Ticket descriptor path', () => {
it('should now search for the ticket 11', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:11')
.write(selectors.ticketsIndex.searchTicketInput, 11)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -139,11 +139,19 @@ describe('Ticket descriptor path', () => {
expect(result).toEqual('Saturday');
});
// Test #1450 here
it('should now search for the weekly ticket 11', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchWeeklyTicketInput, 11)
.waitToClick(selectors.ticketsIndex.searchWeeklyButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 1)
.countElement(selectors.ticketsIndex.searchWeeklyResult);
expect(result).toEqual(1);
});
it('should delete the weekly ticket 11', async() => {
const result = await nightmare
.waitToClick(selectors.ticketsIndex.sixthWeeklyTicketDeleteIcon)
.waitToClick(selectors.ticketsIndex.firstWeeklyTicketDeleteIcon)
.waitToClick(selectors.ticketsIndex.acceptDeleteTurn)
.waitForLastSnackbar();
@ -152,7 +160,10 @@ describe('Ticket descriptor path', () => {
it('should confirm the sixth weekly ticket was deleted', async() => {
const result = await nightmare
.countElement(selectors.ticketsIndex.weeklyTicket);
.waitToClick('vn-ticket-weekly-index vn-searchbar i[class="material-icons clear"]')
.waitToClick(selectors.ticketsIndex.searchWeeklyButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 5)
.countElement(selectors.ticketsIndex.searchWeeklyResult);
expect(result).toEqual(5);
});