wait and waitFor are now deprecated. Test refactor
This commit is contained in:
parent
609098b751
commit
6b0f1544a4
|
@ -45,7 +45,7 @@ describe('Login path', async() => {
|
|||
describe('Successful login', async() => {
|
||||
it('should log in and go to home state', async() => {
|
||||
await page.doLogin('employee');
|
||||
await page.waitFor('vn-home');
|
||||
await page.waitForSelector('vn-home');
|
||||
const state = await page.getState();
|
||||
|
||||
expect(state).toBe('home');
|
||||
|
@ -58,7 +58,7 @@ describe('Login path', async() => {
|
|||
|
||||
await page.waitToClick(selectors.globalItems.userMenuButton);
|
||||
await page.waitToClick(selectors.globalItems.logoutButton);
|
||||
await page.waitFor('vn-login');
|
||||
await page.waitForSelector('vn-login');
|
||||
const state = await page.getState();
|
||||
|
||||
expect(state).toBe('login');
|
||||
|
|
|
@ -124,9 +124,9 @@ describe('Client create path', () => {
|
|||
|
||||
it('should click on the Clients button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||
await page.wait(selectors.clientsIndex.createClientButton);
|
||||
await page.waitForSelector(selectors.clientsIndex.createClientButton);
|
||||
await page.waitForState('client.index');
|
||||
});
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ describe('Client Edit basicData path', () => {
|
|||
|
||||
describe('as employee', () => {
|
||||
it('should not be able to change the salesPerson', async() => {
|
||||
await page.wait(selectors.clientBasicData.name);
|
||||
await page.waitForSelector(selectors.clientBasicData.name);
|
||||
const result = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, `${selectors.clientBasicData.salesPerson} input`);
|
||||
|
|
|
@ -40,7 +40,7 @@ describe('Client Edit fiscalData path', () => {
|
|||
});
|
||||
|
||||
it('should not be able to edit the verified data checkbox', async() => {
|
||||
await page.wait(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
await page.waitForSelector(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
const result = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
|
@ -55,7 +55,7 @@ describe('Client Edit fiscalData path', () => {
|
|||
});
|
||||
|
||||
it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.waitForSelector(selectors.clientFiscalData.socialName);
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'SMASH');
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalId);
|
||||
|
@ -159,7 +159,7 @@ describe('Client Edit fiscalData path', () => {
|
|||
});
|
||||
|
||||
it('should propagate the Equalization tax changes', async() => {
|
||||
await page.waitFor(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitToClick(selectors.globalItems.acceptButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Client Add address path', () => {
|
|||
});
|
||||
|
||||
it(`should click on the add new address button to access to the new address form`, async() => {
|
||||
await page.waitFor(500);
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitToClick(selectors.clientAddresses.createAddress);
|
||||
await page.waitForState('client.card.address.create');
|
||||
});
|
||||
|
@ -81,7 +81,7 @@ describe('Client Add address path', () => {
|
|||
});
|
||||
|
||||
it(`should confirm the new address exists and it's the default one`, async() => {
|
||||
await page.waitFor(2000); // needs more than a single second to load the section
|
||||
await page.waitForTimeout(2000); // needs more than a single second to load the section
|
||||
const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
|
||||
|
||||
expect(result).toContain('320 Park Avenue New York');
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('Client Add notes path', () => {
|
|||
});
|
||||
|
||||
it(`should create a note`, async() => {
|
||||
await page.waitFor(selectors.clientNotes.note);
|
||||
await page.waitForSelector(selectors.clientNotes.note);
|
||||
await page.type(`${selectors.clientNotes.note} textarea`, 'Meeting with Black Widow 21st 9am');
|
||||
await page.waitToClick(selectors.clientNotes.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
|
|
@ -18,15 +18,15 @@ describe('Client lock verified data path', () => {
|
|||
|
||||
describe('as salesPerson', () => {
|
||||
it('should confirm verified data button is disabled for salesPerson', async() => {
|
||||
await page.wait(200);
|
||||
await page.wait(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
await page.waitForTimeout(200);
|
||||
await page.waitForSelector(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
const result = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should edit the social name', async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.waitForSelector(selectors.clientFiscalData.socialName);
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'Captain America Civil War');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
|
@ -75,7 +75,7 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should again edit the social name', async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.waitForSelector(selectors.clientFiscalData.socialName);
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'Ant man and the Wasp');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
|
@ -161,7 +161,7 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the form is enabled for salesPerson', async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.waitForSelector(selectors.clientFiscalData.socialName);
|
||||
const result = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, 'vn-textfield[ng-model="$ctrl.client.socialName"] > div');
|
||||
|
|
|
@ -113,9 +113,9 @@ describe('Client balance path', () => {
|
|||
it('should now click on the Clients button of the top bar menu', async() => {
|
||||
await page.login('employee');
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||
await page.wait(selectors.clientsIndex.createClientButton);
|
||||
await page.waitForSelector(selectors.clientsIndex.createClientButton);
|
||||
await page.waitForState('client.index');
|
||||
});
|
||||
|
||||
|
@ -125,6 +125,6 @@ describe('Client balance path', () => {
|
|||
});
|
||||
|
||||
it('should not be able to click the new payment button as it isnt present', async() => {
|
||||
await page.waitFor(selectors.clientBalance.newPaymentButton, {hidden: true});
|
||||
await page.waitForSelector(selectors.clientBalance.newPaymentButton, {hidden: true});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -52,7 +52,7 @@ describe('User config', () => {
|
|||
|
||||
it('should open the user config form to check the settings', async() => {
|
||||
await page.waitToClick(selectors.globalItems.userMenuButton);
|
||||
await page.waitFor(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
let expectedLocalWarehouse = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ describe('Client web Payment', () => {
|
|||
|
||||
describe('as employee', () => {
|
||||
it('should not be able to confirm payments', async() => {
|
||||
await page.waitFor(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
|
||||
await page.waitForSelector(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -31,7 +31,7 @@ describe('Client web Payment', () => {
|
|||
|
||||
it('should be able to confirm payments', async() => {
|
||||
await page.waitToClick(selectors.webPayment.confirmFirstPaymentButton);
|
||||
await page.waitFor(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
|
||||
await page.waitForSelector(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -28,7 +28,7 @@ describe('Client contacts', () => {
|
|||
});
|
||||
|
||||
it('should delete de contact', async() => {
|
||||
await page.waitFor(3000);
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitToClick(selectors.clientContacts.deleteFirstPhone);
|
||||
await page.waitToClick(selectors.clientContacts.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
|
|
@ -26,33 +26,33 @@ describe('Worker calendar path', () => {
|
|||
|
||||
it('should set two days as holidays on the calendar and check the total holidays increased by 1.5', async() => {
|
||||
await page.waitToClick(selectors.workerCalendar.holidays);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.absence);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.marchTwentyThird);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.halfHoliday);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayFourth);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.furlough);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayTwelfth);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayThirteenth);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayFourteenth);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.halfFurlough);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayEighth);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
|
||||
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||
|
||||
|
@ -68,33 +68,33 @@ describe('Worker calendar path', () => {
|
|||
});
|
||||
|
||||
it('should undo what was done here', async() => {
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.holidays);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.absence);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.marchTwentyThird);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.halfHoliday);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayFourth);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.furlough);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayTwelfth);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayThirteenth);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayFourteenth);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.halfFurlough);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.mayEighth);
|
||||
});
|
||||
|
||||
|
@ -113,9 +113,9 @@ describe('Worker calendar path', () => {
|
|||
});
|
||||
|
||||
it('should make a futile attempt to add holidays', async() => {
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.holidays);
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
|
||||
});
|
||||
|
||||
|
@ -131,7 +131,7 @@ describe('Worker calendar path', () => {
|
|||
|
||||
await page.autocompleteSearch(selectors.workerCalendar.year, lastYear);
|
||||
|
||||
await page.waitFor(reasonableTimeBetweenClicks);
|
||||
await page.waitForTimeout(reasonableTimeBetweenClicks);
|
||||
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
|
||||
|
||||
expect(result).toContain(' 0 ');
|
||||
|
|
|
@ -46,7 +46,7 @@ describe('Item Edit basic data path', () => {
|
|||
await page.write(selectors.itemBasicData.newIntrastatId, '588420239');
|
||||
await page.write(selectors.itemBasicData.newIntrastatDescription, 'Tropical Flowers');
|
||||
await page.waitToClick(selectors.itemBasicData.acceptIntrastatButton); // this popover obscures the rest of the form for aprox 2 seconds
|
||||
await page.waitFor(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
|
||||
let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ describe('Item create tags path', () => {
|
|||
|
||||
it(`should confirm the fourth row data is the expected one`, async() => {
|
||||
await page.reloadSection('item.card.tags');
|
||||
await page.wait('vn-item-tags');
|
||||
await page.waitForSelector('vn-item-tags');
|
||||
let result = await page.waitToGetProperty(selectors.itemTags.fourthTag, 'value');
|
||||
|
||||
expect(result).toEqual('Ancho de la base');
|
||||
|
|
|
@ -77,7 +77,7 @@ describe('Item Create/Clone path', () => {
|
|||
xdescribe('clone', () => {
|
||||
it('should return to the items index by clicking the return to items button', async() => {
|
||||
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
||||
await page.wait(selectors.itemsIndex.createItemButton);
|
||||
await page.waitForSelector(selectors.itemsIndex.createItemButton);
|
||||
await page.waitForState('item.index');
|
||||
});
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ describe('Item regularize path', () => {
|
|||
|
||||
it('should click on the Tickets button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await Promise.all([
|
||||
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
|
||||
page.waitToClick(selectors.globalItems.ticketsButton)
|
||||
|
@ -96,7 +96,7 @@ describe('Item regularize path', () => {
|
|||
|
||||
it('should now click on the Items button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.itemsButton);
|
||||
await page.waitForState('item.index');
|
||||
});
|
||||
|
@ -119,7 +119,7 @@ describe('Item regularize path', () => {
|
|||
|
||||
it('should again click on the Tickets button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await Promise.all([
|
||||
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
|
||||
page.waitToClick(selectors.globalItems.ticketsButton)
|
||||
|
|
|
@ -43,7 +43,7 @@ describe('Item index path', () => {
|
|||
await page.waitToClick(selectors.itemsIndex.firstSearchResult);
|
||||
await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton);
|
||||
await page.waitToClick(selectors.globalItems.searchButton);
|
||||
await page.wait(selectors.itemsIndex.searchResult);
|
||||
await page.waitForSelector(selectors.itemsIndex.searchResult);
|
||||
await page.waitImgLoad(selectors.itemsIndex.firstItemImage);
|
||||
const imageVisible = await page.isVisible(selectors.itemsIndex.firstItemImageTd);
|
||||
|
||||
|
@ -55,7 +55,7 @@ describe('Item index path', () => {
|
|||
});
|
||||
|
||||
it('should mark all unchecked boxes to leave the index as it was', async() => {
|
||||
await page.waitFor(500); // otherwise the snackbar doesnt appear some times.
|
||||
await page.waitForTimeout(500); // otherwise the snackbar doesnt appear some times.
|
||||
await page.waitToClick(selectors.itemsIndex.fieldsToShowButton);
|
||||
await page.waitToClick(selectors.itemsIndex.idCheckbox);
|
||||
await page.waitToClick(selectors.itemsIndex.stemsCheckbox);
|
||||
|
@ -77,7 +77,7 @@ describe('Item index path', () => {
|
|||
await page.waitToClick(selectors.itemsIndex.firstSearchResult);
|
||||
await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton);
|
||||
await page.waitToClick(selectors.globalItems.searchButton);
|
||||
await page.wait(selectors.itemsIndex.searchResult);
|
||||
await page.waitForSelector(selectors.itemsIndex.searchResult);
|
||||
const idVisible = await page.isVisible(selectors.itemsIndex.firstItemId);
|
||||
|
||||
expect(idVisible).toBeTruthy();
|
||||
|
|
|
@ -39,7 +39,7 @@ describe('Item log path', () => {
|
|||
|
||||
it('should return to the items index by clicking the return to items button', async() => {
|
||||
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
||||
await page.wait(selectors.itemsIndex.createItemButton);
|
||||
await page.waitForSelector(selectors.itemsIndex.createItemButton);
|
||||
await page.waitForState('item.index');
|
||||
});
|
||||
|
||||
|
@ -49,7 +49,7 @@ describe('Item log path', () => {
|
|||
});
|
||||
|
||||
it(`should confirm the log is showing 5 entries`, async() => {
|
||||
await page.wait(selectors.itemLog.anyLineCreated);
|
||||
await page.waitForSelector(selectors.itemLog.anyLineCreated);
|
||||
const anyLineCreatedCount = await page.countElement(selectors.itemLog.anyLineCreated);
|
||||
|
||||
expect(anyLineCreatedCount).toEqual(5);
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Item descriptor path', () => {
|
|||
});
|
||||
|
||||
it('should check the descriptor inactive icon is dark as the item is active', async() => {
|
||||
await page.wait(selectors.itemDescriptor.inactiveIcon);
|
||||
await page.waitForSelector(selectors.itemDescriptor.inactiveIcon);
|
||||
await page.waitForClassNotPresent(selectors.itemDescriptor.inactiveIcon, 'bright');
|
||||
const darkIcon = await page.isVisible(selectors.itemDescriptor.inactiveIcon);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
it('should navigate to the tickets index', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForState('ticket.index');
|
||||
});
|
||||
|
@ -128,7 +128,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
it('should return to ticket sales section', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.accessToSearchResult('16');
|
||||
await page.accessToSection('ticket.card.sale');
|
||||
|
@ -143,9 +143,9 @@ describe('Ticket Edit sale path', () => {
|
|||
});
|
||||
|
||||
it('should remove 1 from the first sale quantity', async() => {
|
||||
await page.waitFor(500);
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitToClick(selectors.ticketSales.firstSaleQuantityCell);
|
||||
await page.waitFor(selectors.ticketSales.firstSaleQuantity);
|
||||
await page.waitForSelector(selectors.ticketSales.firstSaleQuantity);
|
||||
await page.type(selectors.ticketSales.firstSaleQuantity, '9\u000d');
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -154,7 +154,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
it('should update the price', async() => {
|
||||
await page.waitToClick(selectors.ticketSales.firstSalePrice);
|
||||
await page.waitFor(selectors.ticketSales.firstSalePriceInput);
|
||||
await page.waitForSelector(selectors.ticketSales.firstSalePriceInput);
|
||||
await page.type(selectors.ticketSales.firstSalePriceInput, '5\u000d');
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -175,7 +175,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
it('should update the discount', async() => {
|
||||
await page.waitToClick(selectors.ticketSales.firstSaleDiscount);
|
||||
await page.waitFor(selectors.ticketSales.firstSaleDiscountInput);
|
||||
await page.waitForSelector(selectors.ticketSales.firstSaleDiscountInput);
|
||||
await page.type(selectors.ticketSales.firstSaleDiscountInput, '50\u000d');
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -205,7 +205,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
it('should click on the Claims button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.claimsButton);
|
||||
await page.waitForState('claim.index');
|
||||
});
|
||||
|
@ -217,7 +217,7 @@ describe('Ticket Edit sale path', () => {
|
|||
|
||||
it('should click the Tickets button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForState('ticket.index');
|
||||
});
|
||||
|
@ -225,16 +225,16 @@ describe('Ticket Edit sale path', () => {
|
|||
it('should search for a ticket then access to the sales section', async() => {
|
||||
await page.accessToSearchResult('16');
|
||||
await page.accessToSection('ticket.card.sale');
|
||||
await page.wait(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
||||
it('should select the third sale and delete it', async() => {
|
||||
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
|
||||
await page.wait(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
|
||||
await page.wait(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.waitToClick(selectors.globalItems.acceptButton);
|
||||
await page.wait(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.waitForSpinnerLoad();
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -260,7 +260,7 @@ describe('Ticket Edit sale path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the transfered line is the correct one', async() => {
|
||||
await page.wait(selectors.ticketSales.secondSaleText);
|
||||
await page.waitForSelector(selectors.ticketSales.secondSaleText);
|
||||
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleText, 'innerText');
|
||||
|
||||
expect(result).toContain(`Melee weapon heavy shield`);
|
||||
|
@ -279,7 +279,7 @@ describe('Ticket Edit sale path', () => {
|
|||
});
|
||||
|
||||
it(`should confirm the original ticket has still three lines`, async() => {
|
||||
await page.wait(selectors.ticketSales.saleLine);
|
||||
await page.waitForSelector(selectors.ticketSales.saleLine);
|
||||
const result = await page.countElement(selectors.ticketSales.saleLine);
|
||||
|
||||
expect(result).toEqual(3);
|
||||
|
|
|
@ -48,13 +48,13 @@ describe('Ticket Create new tracking state path', () => {
|
|||
});
|
||||
|
||||
it('should now access to the create state view by clicking the create floating button', async() => {
|
||||
await page.waitFor('.vn-popup', {hidden: true});
|
||||
await page.waitForSelector('.vn-popup', {hidden: true});
|
||||
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
||||
await page.waitForState('ticket.card.tracking.edit');
|
||||
});
|
||||
|
||||
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
|
||||
await page.waitFor(1500);
|
||||
await page.waitForTimeout(1500);
|
||||
await page.autocompleteSearch(selectors.createStateView.state, 'Encajado');
|
||||
await page.waitToClick(selectors.createStateView.saveStateButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
|
|
@ -34,7 +34,7 @@ describe('Ticket Edit basic data path', () => {
|
|||
|
||||
it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => {
|
||||
await page.waitForSpinnerLoad();
|
||||
await page.wait(selectors.ticketBasicData.zone);
|
||||
await page.waitForSelector(selectors.ticketBasicData.zone);
|
||||
const disabled = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, `${selectors.ticketBasicData.zone} input`);
|
||||
|
@ -51,7 +51,7 @@ describe('Ticket Edit basic data path', () => {
|
|||
|
||||
it(`should edit the ticket agency then check there are no zones for it`, async() => {
|
||||
await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Super-Man delivery');
|
||||
await page.waitFor(1000);
|
||||
await page.waitForTimeout(1000);
|
||||
let emptyZone = await page
|
||||
.expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
it('should again click on the Tickets button of the top bar menu', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForState('ticket.index');
|
||||
});
|
||||
|
@ -52,7 +52,7 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
it('should click on the Tickets button of the top bar menu once more', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForState('ticket.index');
|
||||
});
|
||||
|
@ -73,7 +73,7 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
it('should click on the Tickets button of the top bar menu once again', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForState('ticket.index');
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ describe('Ticket purchase request path', () => {
|
|||
});
|
||||
|
||||
it('should add a new request', async() => {
|
||||
await page.waitFor(500);
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitToClick(selectors.ticketRequests.addRequestButton);
|
||||
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
|
||||
await page.write(selectors.ticketRequests.quantity, '9');
|
||||
|
@ -72,7 +72,7 @@ describe('Ticket purchase request path', () => {
|
|||
|
||||
it('should check the request was deleted', async() => {
|
||||
await page.reloadSection('ticket.card.request.index');
|
||||
await page.wait(selectors.ticketRequests.addRequestButton);
|
||||
await page.waitForSelector(selectors.ticketRequests.addRequestButton);
|
||||
await page.waitForSelector(selectors.ticketRequests.thirdDescription, {hidden: true});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -92,7 +92,7 @@ describe('Ticket descriptor path', () => {
|
|||
});
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenuAddStowaway);
|
||||
await page.wait(selectors.ticketDescriptor.addStowawayDialogFirstTicket);
|
||||
await page.waitForSelector(selectors.ticketDescriptor.addStowawayDialogFirstTicket);
|
||||
const isVisible = await page.isVisible(selectors.ticketDescriptor.addStowawayDialogFirstTicket);
|
||||
|
||||
expect(isVisible).toBeTruthy();
|
||||
|
|
|
@ -22,7 +22,7 @@ describe('Ticket services path', () => {
|
|||
it('should find the add descripton button disabled for this user role', async() => {
|
||||
await page.waitForClassPresent(selectors.ticketService.firstAddServiceTypeButton, 'disabled');
|
||||
await page.waitToClick(selectors.ticketService.addServiceButton);
|
||||
await page.wait(selectors.ticketService.firstAddServiceTypeButton);
|
||||
await page.waitForSelector(selectors.ticketService.firstAddServiceTypeButton);
|
||||
const result = await page.isDisabled(selectors.ticketService.firstAddServiceTypeButton);
|
||||
|
||||
expect(result).toBe(true);
|
||||
|
@ -63,7 +63,7 @@ describe('Ticket services path', () => {
|
|||
|
||||
it('should click on the add new service type to open the dialog', async() => {
|
||||
await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton);
|
||||
await page.wait('.vn-dialog.shown');
|
||||
await page.waitForSelector('.vn-dialog.shown');
|
||||
const result = await page.isVisible(selectors.ticketService.newServiceTypeName);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
|
|
|
@ -42,7 +42,7 @@ describe('Ticket create path', () => {
|
|||
|
||||
it('should again open the new ticket form', async() => {
|
||||
await page.waitToClick(selectors.globalItems.returnToModuleIndexButton);
|
||||
await page.waitFor(500);
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
|
||||
await page.waitForState('ticket.create');
|
||||
});
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('Claim edit basic data path', () => {
|
|||
|
||||
it('should confirm the claim state was edited', async() => {
|
||||
await page.reloadSection('claim.card.basicData');
|
||||
await page.wait(selectors.claimBasicData.claimState);
|
||||
await page.waitForSelector(selectors.claimBasicData.claimState);
|
||||
const result = await page.waitToGetProperty(selectors.claimBasicData.claimState, 'value');
|
||||
|
||||
expect(result).toEqual('Gestionado');
|
||||
|
|
|
@ -106,7 +106,7 @@ xdescribe('Claim detail', () => {
|
|||
|
||||
it('should navigate back to claim.detail to confirm the claim contains now two items', async() => {
|
||||
await page.accessToSection('claim.card.detail');
|
||||
await page.wait(selectors.claimDetail.claimDetailLine);
|
||||
await page.waitForSelector(selectors.claimDetail.claimDetailLine);
|
||||
const result = await page.countElement(selectors.claimDetail.claimDetailLine);
|
||||
|
||||
expect(result).toEqual(2);
|
||||
|
|
|
@ -27,7 +27,7 @@ describe('Claim action path', () => {
|
|||
it('should import the second importable ticket', async() => {
|
||||
// the animation adding the header element for the claimed total
|
||||
// obscures somehow other elements for about 2 seconds
|
||||
await page.waitFor(3000);
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitToClick(selectors.claimAction.importTicketButton);
|
||||
await page.waitToClick(selectors.claimAction.secondImportableTicket);
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Order summary path', () => {
|
|||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('employee', 'order');
|
||||
await page.waitFor(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.accessToSearchResult('16');
|
||||
});
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Route create path', () => {
|
|||
|
||||
describe('as employee', () => {
|
||||
it('should click on the add new route button and open the creation form', async() => {
|
||||
await page.waitFor(500);
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
|
||||
await page.waitForState('route.create');
|
||||
});
|
||||
|
|
|
@ -26,9 +26,9 @@ describe('InvoiceOut descriptor path', () => {
|
|||
|
||||
it('should navigate to the invoiceOut index', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.invoiceOutButton);
|
||||
await page.wait(selectors.invoiceOutIndex.topbarSearch);
|
||||
await page.waitForSelector(selectors.invoiceOutIndex.topbarSearch);
|
||||
await page.waitForState('invoiceOut.index');
|
||||
});
|
||||
|
||||
|
@ -59,7 +59,7 @@ describe('InvoiceOut descriptor path', () => {
|
|||
|
||||
it('should navigate to the ticket index', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForState('ticket.index');
|
||||
});
|
||||
|
@ -73,7 +73,7 @@ describe('InvoiceOut descriptor path', () => {
|
|||
|
||||
it('should now navigate to the invoiceOut index', async() => {
|
||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.invoiceOutButton);
|
||||
await page.waitForState('invoiceOut.index');
|
||||
});
|
||||
|
@ -126,7 +126,7 @@ 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);
|
||||
await page.waitForSelector(selectors.invoiceOutDescriptor.moreMenuShowInvoiceOutPdf);
|
||||
await page.waitForSelector(selectors.invoiceOutDescriptor.moreMenuBookInvoiceOut, {hidden: true});
|
||||
});
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ describe('Travel basic data path', () => {
|
|||
it('should now edit the whole form then save', async() => {
|
||||
await page.clearInput(selectors.travelBasicDada.reference);
|
||||
await page.write(selectors.travelBasicDada.reference, 'new reference!');
|
||||
await page.waitFor(2000);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.autocompleteSearch(selectors.travelBasicDada.agency, 'Entanglement');
|
||||
await page.autocompleteSearch(selectors.travelBasicDada.outputWarehouse, 'Warehouse Three');
|
||||
await page.autocompleteSearch(selectors.travelBasicDada.inputWarehouse, 'Warehouse Four');
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Entry lastest buys path', () => {
|
|||
|
||||
it('should access the latest buys seccion and search not seeing the edit buys button yet', async() => {
|
||||
await page.waitToClick(selectors.entryLatestBuys.latestBuysSectionButton);
|
||||
await page.waitFor(250);
|
||||
await page.waitForTimeout(250);
|
||||
await page.waitToClick(selectors.globalItems.searchButton);
|
||||
await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: false});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue