This commit is contained in:
parent
b3ade3c7f5
commit
bd76840cb3
|
@ -488,7 +488,14 @@ let actions = {
|
|||
})
|
||||
.then(done)
|
||||
.catch(done);
|
||||
}
|
||||
},
|
||||
|
||||
waitForSpinnerLoad: function(done) {
|
||||
let spinnerSelector = 'vn-spinner > div';
|
||||
this.waitForClassNotPresent(spinnerSelector, 'is-active')
|
||||
.then(done)
|
||||
.catch(done);
|
||||
},
|
||||
};
|
||||
|
||||
Object.keys(actions).forEach(function(name) {
|
||||
|
|
|
@ -300,12 +300,17 @@ export default {
|
|||
fifthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(5) > vn-td > vn-one:nth-child(3) > div span:nth-child(3)',
|
||||
},
|
||||
ticketSummary: {
|
||||
header: 'vn-ticket-summary > vn-card > div > h5',
|
||||
state: 'vn-ticket-summary vn-label-value[label="State"] > section > span',
|
||||
route: 'vn-ticket-summary vn-label-value[label="Route"] > section > span',
|
||||
total: 'vn-ticket-summary vn-one.taxes > p:nth-child(3) > strong',
|
||||
sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',
|
||||
firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span',
|
||||
popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]',
|
||||
firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(3)',
|
||||
firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)',
|
||||
invoiceOutRef: 'vn-ticket-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(6) > section > span'
|
||||
invoiceOutRef: 'vn-ticket-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(6) > section > span',
|
||||
setOk: 'vn-ticket-summary vn-button[label="SET OK"] > button'
|
||||
},
|
||||
ticketsIndex: {
|
||||
openAdvancedSearchButton: 'vn-ticket-index vn-searchbar t-right-icons > vn-icon[icon="keyboard_arrow_down"]',
|
||||
|
|
|
@ -23,7 +23,6 @@ describe('Ticket Edit basic data path', () => {
|
|||
|
||||
it(`should have a price diference`, async() => {
|
||||
const result = await nightmare
|
||||
.wait(1900)
|
||||
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
|
||||
|
||||
expect(result).toContain('-€184.25');
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import createNightmare from '../../helpers/nightmare';
|
||||
|
||||
describe('Ticket Summary path', () => {
|
||||
const nightmare = createNightmare();
|
||||
const ticketId = 20;
|
||||
|
||||
it('should navigate to the target ticket summary section', async() => {
|
||||
let url = await nightmare
|
||||
.loginAndModule('employee', 'ticket')
|
||||
.accessToSearchResult(ticketId)
|
||||
.waitForURL('/summary')
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
});
|
||||
|
||||
it(`should display details from the ticket and it's client on the top of the header`, async() => {
|
||||
let result = await nightmare
|
||||
.waitForSpinnerLoad()
|
||||
.waitToGetProperty(selectors.ticketSummary.header, 'innerText');
|
||||
|
||||
expect(result).toContain(`Ticket #${ticketId}`);
|
||||
expect(result).toContain('Bruce Banner (109)');
|
||||
expect(result).toContain('Somewhere in Thailand');
|
||||
});
|
||||
|
||||
it('should display ticket details', async() => {
|
||||
let result = await nightmare
|
||||
.waitToGetProperty(selectors.ticketSummary.state, 'innerText');
|
||||
|
||||
expect(result).toContain('Arreglar');
|
||||
});
|
||||
|
||||
it('should display delivery details', async() => {
|
||||
let result = await nightmare
|
||||
.waitToGetProperty(selectors.ticketSummary.route, 'innerText');
|
||||
|
||||
expect(result).toContain('3');
|
||||
});
|
||||
|
||||
it('should display the ticket total', async() => {
|
||||
let result = await nightmare
|
||||
.waitToGetProperty(selectors.ticketSummary.total, 'innerText');
|
||||
|
||||
expect(result).toContain('€155.54');
|
||||
});
|
||||
|
||||
it('should display the ticket line(s)', async() => {
|
||||
let result = await nightmare
|
||||
.waitToGetProperty(selectors.ticketSummary.firstSaleItemId, 'innerText');
|
||||
|
||||
expect(result).toContain('000002');
|
||||
});
|
||||
|
||||
it('should click on the SET OK button and throw a privileges error', async() => {
|
||||
let result = await nightmare
|
||||
.waitToClick(selectors.ticketSummary.setOk)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual(`You don't have enough privileges`);
|
||||
});
|
||||
|
||||
it('should log in as production then navigate to the summary of the same ticket', async() => {
|
||||
let url = await nightmare
|
||||
.loginAndModule('production', 'ticket')
|
||||
.accessToSearchResult(ticketId)
|
||||
.waitForURL('/summary')
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
});
|
||||
|
||||
it('should click on the SET OK button', async() => {
|
||||
let result = await nightmare
|
||||
.waitToClick(selectors.ticketSummary.setOk)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it('should confirm the ticket state was updated', async() => {
|
||||
let result = await nightmare
|
||||
.waitForSpinnerLoad()
|
||||
.waitToGetProperty(selectors.ticketSummary.state, 'innerText');
|
||||
|
||||
expect(result).toContain('OK');
|
||||
});
|
||||
});
|
|
@ -44,6 +44,7 @@ Price gap: Diferencia de precio
|
|||
Quantity: Cantidad
|
||||
Remove lines: Borrar lineas
|
||||
Route: Ruta
|
||||
SET OK: PONER OK
|
||||
Shipment: Salida
|
||||
Shipped: F. envío
|
||||
Some fields are invalid: Algunos campos no son válidos
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<h5 >Ticket #{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}} ({{$ctrl.summary.client.id}}) - {{$ctrl.summary.nickname}}
|
||||
<vn-button
|
||||
disabled="!$ctrl.isEditable"
|
||||
label="poner OK"
|
||||
label="SET OK"
|
||||
ng-click="$ctrl.setOkState()"
|
||||
vn-tooltip="Change ticket state to 'Ok'">
|
||||
</vn-button>
|
||||
|
|
Loading…
Reference in New Issue