This commit is contained in:
parent
7fef6dc2b0
commit
a1fd5a01a7
|
@ -105,7 +105,7 @@ let actions = {
|
|||
|
||||
clearTextarea: async function(selector) {
|
||||
await this.wait(selector);
|
||||
await this.input.evaluate(inputSelector => {
|
||||
await this.evaluate(inputSelector => {
|
||||
return document.querySelector(inputSelector).value = '';
|
||||
}, selector);
|
||||
},
|
||||
|
@ -252,7 +252,7 @@ let actions = {
|
|||
},
|
||||
|
||||
waitForNumberOfElements: async function(selector, count) {
|
||||
return await this.wait((selector, count) => {
|
||||
return await this.waitForFunction((selector, count) => {
|
||||
return document.querySelectorAll(selector).length === count;
|
||||
}, {}, selector, count);
|
||||
},
|
||||
|
@ -336,12 +336,14 @@ let actions = {
|
|||
await this.write('vn-searchbar', searchValue);
|
||||
await this.waitToClick('vn-searchbar vn-icon[icon="search"]');
|
||||
await this.waitForNumberOfElements('.search-result', 1);
|
||||
|
||||
return await this.waitToClick('ui-view vn-card a');
|
||||
await this.waitFor(1000);
|
||||
await this.evaluate(() => {
|
||||
return document.querySelector('.search-result').click();
|
||||
});
|
||||
},
|
||||
|
||||
accessToSection: async function(sectionRoute) {
|
||||
await this.wait(`vn-left-menu`);
|
||||
await this.waitForSelector(`vn-left-menu`, {visible: true});
|
||||
let nested = await this.evaluate(sectionRoute => {
|
||||
return document.querySelector(`vn-left-menu li li > a[ui-sref="${sectionRoute}"]`) != null;
|
||||
}, sectionRoute);
|
||||
|
|
|
@ -113,7 +113,9 @@ describe('Client create path', async() => {
|
|||
});
|
||||
|
||||
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.accessToSearchResult('Carol Danvers');
|
||||
await page.waitForURL('#!/client/114/summary');
|
||||
const url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/client/114/summary');
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Item Edit basic data path', () => {
|
|||
});
|
||||
|
||||
it(`should check the descritor edit button is visible for buyer`, async() => {
|
||||
await page.waitFor(selectors.itemDescriptor.editButton, {visible: true});
|
||||
await page.waitForSelector(selectors.itemDescriptor.editButton, {visible: true});
|
||||
});
|
||||
|
||||
it(`should edit the item basic data`, async() => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
import selectors from '../../../helpers/selectors.js';
|
||||
import getBrowser from '../../../helpers/puppeteer';
|
||||
|
||||
describe('Ticket List sale path', () => {
|
||||
let browser;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import selectors from '../../../helpers/selectors.js';
|
||||
import createNightmare from '../../../helpers/nightmare';
|
||||
import getBrowser from '../../../helpers/puppeteer';
|
||||
|
||||
// #1632 [e2e] ticket.sale - Transferir líneas
|
||||
xdescribe('Ticket Edit sale path', () => {
|
||||
|
@ -9,9 +9,9 @@ xdescribe('Ticket Edit sale path', () => {
|
|||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
.loginAndModule('salesPerson', 'ticket')
|
||||
.accessToSearchResult(16)
|
||||
.accessToSection('ticket.card.sale');
|
||||
await page.loginAndModule('salesPerson', 'ticket');
|
||||
await page.accessToSearchResult(16);
|
||||
await page.accessToSection('ticket.card.sale');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
|
|
|
@ -19,8 +19,9 @@ describe('Ticket Create new tracking state path', () => {
|
|||
});
|
||||
|
||||
it('should access to the create state view by clicking the create floating button', async() => {
|
||||
await page.clickIfVisible(selectors.ticketTracking.createStateButton);
|
||||
await page.wait(selectors.createStateView.stateAutocomplete);
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
||||
await page.waitForSelector(selectors.createStateView.stateAutocomplete, {visible: true});
|
||||
let url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toContain('tracking/edit');
|
||||
|
|
|
@ -20,7 +20,7 @@ describe('Claim edit basic data path', () => {
|
|||
it(`should edit claim state and observation fields`, async() => {
|
||||
await page.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado');
|
||||
await page.clearTextarea(selectors.claimBasicData.observationInput);
|
||||
await page.write(selectors.claimBasicData.observationInput, 'edited observation');
|
||||
await page.type(selectors.claimBasicData.observationInput, 'edited observation');
|
||||
await page.waitToClick(selectors.claimBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -52,7 +52,7 @@ describe('Claim edit basic data path', () => {
|
|||
it(`should edit the claim to leave it untainted`, async() => {
|
||||
await page.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente');
|
||||
await page.clearTextarea(selectors.claimBasicData.observationInput);
|
||||
await page.write(selectors.claimBasicData.observationInput, 'Observation one');
|
||||
await page.type(selectors.claimBasicData.observationInput, 'Observation one');
|
||||
await page.waitToClick(selectors.claimBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
|
|
@ -32,16 +32,17 @@ describe('Claim action path', () => {
|
|||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
// #2036 claim.action destinatario
|
||||
it('should edit the second line destination field', async() => {
|
||||
await page.autocompleteSearch(selectors.claimAction.secondLineDestination, 'Bueno');
|
||||
const result = await page.waitForLastSnackbar();
|
||||
// const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
// expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it('should delete the first line', async() => {
|
||||
await page.waitToClick(selectors.claimAction.firstDeleteLine);
|
||||
await page.waitForLastSnackbar();
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ import getBrowser from '../../helpers/puppeteer';
|
|||
describe('claim Summary path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
const claimId = 4;
|
||||
const claimId = '4';
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
|
@ -59,10 +59,10 @@ describe('claim Summary path', () => {
|
|||
});
|
||||
|
||||
it(`should check the url for the item diary link of the descriptor is for the right item id`, async() => {
|
||||
const exists = await page.exists(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton);
|
||||
await page.waitForSelector(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton, {visible: true});
|
||||
|
||||
expect(exists).toBeTruthy();
|
||||
await nightmare.mousedown('.vn-popover.shown');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.waitFor(1000);
|
||||
});
|
||||
|
||||
it('should display the claim development details', async() => {
|
||||
|
@ -73,22 +73,22 @@ describe('claim Summary path', () => {
|
|||
|
||||
it(`should click on the first development worker making the worker descriptor visible`, async() => {
|
||||
await page.waitToClick(selectors.claimSummary.firstDevelopmentWorker);
|
||||
await page.wait(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton);
|
||||
|
||||
const visible = await page.isVisible(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton);
|
||||
|
||||
expect(visible).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should check the url for the go to clientlink of the descriptor is for the right client id`, async() => {
|
||||
const exists = await page.exists(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton);
|
||||
await page.waitForSelector(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton, {visible: true});
|
||||
|
||||
expect(exists).toBeTruthy();
|
||||
await nightmare.mousedown('.vn-popover.shown');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.waitFor(1000);
|
||||
});
|
||||
|
||||
it(`should click on the first action ticket ID making the ticket descriptor visible`, async() => {
|
||||
await page.waitToClick(selectors.claimSummary.firstActionTicketId);
|
||||
await page.wait(selectors.claimSummary.firstActionTicketDescriptor);
|
||||
await page.waitForSelector(selectors.claimSummary.firstActionTicketDescriptor);
|
||||
const visible = await page.isVisible(selectors.claimSummary.firstActionTicketDescriptor);
|
||||
|
||||
expect(visible).toBeTruthy();
|
||||
|
|
|
@ -15,7 +15,7 @@ describe('claim Descriptor path', () => {
|
|||
await browser.close();
|
||||
});
|
||||
|
||||
it('should navigate to the target claim summary section', async() => {
|
||||
it('should now navigate to the target claim summary section', async() => {
|
||||
await page.loginAndModule('employee', 'claim');
|
||||
await page.accessToSearchResult(claimId);
|
||||
await page.waitForURL('/summary');
|
||||
|
@ -25,10 +25,9 @@ describe('claim Descriptor path', () => {
|
|||
});
|
||||
|
||||
it(`should not be able to see the delete claim button of the descriptor more menu`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.claimDescriptor.moreMenu);
|
||||
const exists = await page.exists(selectors.claimDescriptor.moreMenuDeleteClaim);
|
||||
|
||||
expect(exists).toBeFalsy();
|
||||
await page.waitForSelector(selectors.claimDescriptor.moreMenuDeleteClaim, {hidden: true});
|
||||
});
|
||||
|
||||
it(`should log in as salesAssistant and navigate to the target claim`, async() => {
|
||||
|
@ -42,10 +41,7 @@ describe('claim Descriptor path', () => {
|
|||
|
||||
it(`should be able to see the delete claim button of the descriptor more menu`, async() => {
|
||||
await page.waitToClick(selectors.claimDescriptor.moreMenu);
|
||||
await page.wait(selectors.claimDescriptor.moreMenuDeleteClaim);
|
||||
const exists = await page.exists(selectors.claimDescriptor.moreMenuDeleteClaim);
|
||||
|
||||
expect(exists).toBeTruthy();
|
||||
await page.waitForSelector(selectors.claimDescriptor.moreMenuDeleteClaim, {visible: true});
|
||||
});
|
||||
|
||||
it(`should delete the claim`, async() => {
|
||||
|
|
|
@ -32,21 +32,22 @@ describe('Order edit basic data path', () => {
|
|||
|
||||
describe('when order with rows', () => {
|
||||
it('should now navigate to order index', async() => {
|
||||
const orderId = 16;
|
||||
const orderId = '16';
|
||||
|
||||
await page.waitToClick(selectors.orderDescriptor.returnToModuleIndexButton);
|
||||
await page.waitToClick(selectors.orderDescriptor.acceptNavigationButton);
|
||||
await page.wait(selectors.ordersIndex.createOrderButton);
|
||||
await page.waitForContentLoaded();
|
||||
await page.accessToSearchResult(orderId);
|
||||
await page.accessToSection('order.card.basicData');
|
||||
await page.wait(selectors.orderBasicData.observationInput);
|
||||
await page.waitForSelector(selectors.orderBasicData.observationInput, {visible: true});
|
||||
await page.waitForURL('basic-data');
|
||||
const url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual(`#!/order/${orderId}/basic-data`);
|
||||
});
|
||||
|
||||
it('should not be able to change anything', async() => {
|
||||
await page.write(selectors.orderBasicData.observationInput, 'observation');
|
||||
await page.type(selectors.orderBasicData.observationInput, 'observation');
|
||||
await page.waitToClick(selectors.orderBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -58,6 +59,7 @@ describe('Order edit basic data path', () => {
|
|||
it('should navigate to the order index and click the new order button', async() => {
|
||||
await page.waitToClick(selectors.globalItems.returnToModuleIndexButton);
|
||||
await page.waitToClick(selectors.orderBasicData.acceptButton);
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ordersIndex.createOrderButton);
|
||||
await page.waitForURL('#!/order/create');
|
||||
const url = await page.parsedUrl();
|
||||
|
@ -68,7 +70,7 @@ describe('Order edit basic data path', () => {
|
|||
it('should now create a new one', async() => {
|
||||
await page.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Jessica Jones');
|
||||
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
|
||||
await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'inhouse pickup');
|
||||
await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'Other agency');
|
||||
await page.waitToClick(selectors.createOrderView.createButton);
|
||||
await page.waitForURL('/catalog');
|
||||
const url = await page.parsedUrl();
|
||||
|
@ -88,7 +90,7 @@ describe('Order edit basic data path', () => {
|
|||
await page.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark');
|
||||
await page.autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark');
|
||||
await page.autocompleteSearch(selectors.orderBasicData.agencyAutocomplete, 'Silla247');
|
||||
await page.write(selectors.orderBasicData.observationInput, 'my observation');
|
||||
await page.type(selectors.orderBasicData.observationInput, 'my observation');
|
||||
await page.waitToClick(selectors.orderBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ describe('Order catalog', () => {
|
|||
|
||||
await page.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Tony Stark');
|
||||
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
|
||||
await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'inhouse pickup');
|
||||
await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'Other agency');
|
||||
await page.waitToClick(selectors.createOrderView.createButton);
|
||||
await page.waitForURL('/catalog');
|
||||
const url = await page.parsedUrl();
|
||||
|
|
|
@ -25,8 +25,8 @@ describe('Route basic Data path', () => {
|
|||
await page.write(selectors.routeBasicData.kmStartInput, '1');
|
||||
await page.clearInput(selectors.routeBasicData.kmEndInput);
|
||||
await page.write(selectors.routeBasicData.kmEndInput, '2');
|
||||
await page.write(selectors.routeBasicData.startedHourInput, '0800');
|
||||
await page.write(selectors.routeBasicData.finishedHourInput, '1230');
|
||||
await page.type(`${selectors.routeBasicData.startedHourInput} input`, '0800');
|
||||
await page.type(`${selectors.routeBasicData.finishedHourInput} input`, '1230');
|
||||
await page.waitToClick(selectors.routeBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -48,13 +48,13 @@ describe('Route basic Data path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the km start was edited', async() => {
|
||||
const kmStart = await page.waitToGetProperty(selectors.routeBasicData.kmStartInput, 'value');
|
||||
const kmStart = await page.waitToGetProperty(`${selectors.routeBasicData.kmStartInput} input`, 'value');
|
||||
|
||||
expect(kmStart).toEqual('1');
|
||||
});
|
||||
|
||||
it('should confirm the km end was edited', async() => {
|
||||
const kmEnd = await page.waitToGetProperty(selectors.routeBasicData.kmEndInput, 'value');
|
||||
const kmEnd = await page.waitToGetProperty(`${selectors.routeBasicData.kmEndInput} input`, 'value');
|
||||
|
||||
expect(kmEnd).toEqual('2');
|
||||
});
|
||||
|
|
|
@ -5,17 +5,17 @@ describe('InvoiceOut descriptor path', () => {
|
|||
let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('administrative', 'ticket');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
describe('as Administrative', () => {
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('administrative', 'ticket');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should search for tickets with an specific invoiceOut', async() => {
|
||||
await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton);
|
||||
await page.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222');
|
||||
|
@ -88,6 +88,7 @@ describe('InvoiceOut descriptor path', () => {
|
|||
});
|
||||
|
||||
it('should search for tickets with an specific invoiceOut to find no results', async() => {
|
||||
await page.waitFor(2000);
|
||||
await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton);
|
||||
await page.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222');
|
||||
await page.waitToClick(selectors.ticketsIndex.advancedSearchButton);
|
||||
|
@ -108,6 +109,7 @@ describe('InvoiceOut descriptor path', () => {
|
|||
});
|
||||
|
||||
it(`should search and access to the invoiceOut summary`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.accessToSearchResult('T1111111');
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
|
@ -150,7 +152,7 @@ describe('InvoiceOut descriptor path', () => {
|
|||
});
|
||||
|
||||
describe('as salesPerson', () => {
|
||||
beforeAll(async() => {
|
||||
it(`should log in as salesPerson then go to the target invoiceOut summary`, async() => {
|
||||
await page.loginAndModule('salesPerson', 'invoiceOut');
|
||||
await page.accessToSearchResult('A1111111');
|
||||
});
|
||||
|
@ -158,15 +160,11 @@ describe('InvoiceOut descriptor path', () => {
|
|||
it(`should check the salesPerson role doens't see the book option in the more menu`, async() => {
|
||||
await page.waitToClick(selectors.invoiceOutDescriptor.moreMenu);
|
||||
await page.wait(selectors.invoiceOutDescriptor.moreMenuShowInvoiceOutPdf);
|
||||
const result = await page.exists(selectors.invoiceOutDescriptor.moreMenuBookInvoiceOut);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
await page.waitForSelector(selectors.invoiceOutDescriptor.moreMenuBookInvoiceOut, {hidden: true});
|
||||
});
|
||||
|
||||
it(`should check the salesPerson role doens't see the delete option in the more menu`, async() => {
|
||||
const result = await page.exists(selectors.invoiceOutDescriptor.moreMenuDeleteInvoiceOut);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
await page.waitForSelector(selectors.invoiceOutDescriptor.moreMenuDeleteInvoiceOut, {hidden: true});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
10
gulpfile.js
10
gulpfile.js
|
@ -217,11 +217,11 @@ function e2eSingleRun() {
|
|||
`${__dirname}/e2e/paths/03*/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/paths/04*/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/paths/05*/*[sS]pec.js`,
|
||||
// `${__dirname}/e2e/paths/06*/*[sS]pec.js`,
|
||||
// `${__dirname}/e2e/paths/07*/*[sS]pec.js`,
|
||||
// `${__dirname}/e2e/paths/08*/*[sS]pec.js`,
|
||||
// `${__dirname}/e2e/paths/09*/*[sS]pec.js`,
|
||||
// `${__dirname}/e2e/paths/**/*[sS]pec.js`
|
||||
`${__dirname}/e2e/paths/06*/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/paths/07*/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/paths/08*/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/paths/09*/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/paths/**/*[sS]pec.js`
|
||||
];
|
||||
|
||||
return gulp.src(specFiles).pipe(jasmine({
|
||||
|
|
|
@ -24,7 +24,7 @@ describe('order new()', () => {
|
|||
expect(error).toEqual(new UserError(`You can't create an order for a inactive client`));
|
||||
});
|
||||
|
||||
it('should create a new order a user when all conditions are met', async() => {
|
||||
it('should now create a new order when all conditions are met', async() => {
|
||||
let landed = new Date();
|
||||
let addressFk = 121;
|
||||
let agencyModeFk = 1;
|
||||
|
|
Loading…
Reference in New Issue