expectURL ext plus refactors
gitea/salix/1798-e2e-extensions This commit has test failures
Details
gitea/salix/1798-e2e-extensions This commit has test failures
Details
This commit is contained in:
parent
cbd43253e0
commit
6f2cd4b446
|
@ -13,8 +13,15 @@ let actions = {
|
||||||
return exists;
|
return exists;
|
||||||
},
|
},
|
||||||
|
|
||||||
parsedUrl: async function() {
|
expectURL: async function(expectedHash) {
|
||||||
return new URL(await this.url());
|
try {
|
||||||
|
await this.waitForFunction(expectedHash => {
|
||||||
|
return document.location.hash.includes(expectedHash);
|
||||||
|
}, {}, expectedHash);
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`failed to reach URL containing: ${expectedHash}`);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
waitUntilNotPresent: async function(selector) {
|
waitUntilNotPresent: async function(selector) {
|
||||||
|
@ -48,7 +55,7 @@ let actions = {
|
||||||
|
|
||||||
login: async function(userName) {
|
login: async function(userName) {
|
||||||
try {
|
try {
|
||||||
await this.waitForURL('#!/login');
|
await this.expectURL('#!/login');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await this.goto(`${defaultURL}/#!/login`);
|
await this.goto(`${defaultURL}/#!/login`);
|
||||||
let dialog = await this.evaluate(() => {
|
let dialog = await this.evaluate(() => {
|
||||||
|
@ -72,7 +79,7 @@ let actions = {
|
||||||
|
|
||||||
let selector = `vn-home a[ui-sref="${moduleName}.index"]`;
|
let selector = `vn-home a[ui-sref="${moduleName}.index"]`;
|
||||||
await this.waitToClick(selector);
|
await this.waitToClick(selector);
|
||||||
await this.waitForURL(snakeName);
|
await this.expectURL(snakeName);
|
||||||
},
|
},
|
||||||
|
|
||||||
loginAndModule: async function(userName, moduleName) {
|
loginAndModule: async function(userName, moduleName) {
|
||||||
|
@ -265,7 +272,7 @@ let actions = {
|
||||||
|
|
||||||
waitForNumberOfElements: async function(selector, count) {
|
waitForNumberOfElements: async function(selector, count) {
|
||||||
return await this.waitForFunction((selector, count) => {
|
return await this.waitForFunction((selector, count) => {
|
||||||
return document.querySelectorAll(selector).length === count;
|
return document.querySelectorAll(selector).length == count;
|
||||||
}, {}, selector, count);
|
}, {}, selector, count);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -286,8 +293,8 @@ let actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
waitForTextInElement: async function(selector, text) {
|
waitForTextInElement: async function(selector, text) {
|
||||||
await this.wait(selector);
|
await this.waitForSelector(selector);
|
||||||
return await this.wait((selector, text) => {
|
return await this.waitForFunction((selector, text) => {
|
||||||
return document.querySelector(selector).innerText.toLowerCase().includes(text.toLowerCase());
|
return document.querySelector(selector).innerText.toLowerCase().includes(text.toLowerCase());
|
||||||
}, {}, selector, text);
|
}, {}, selector, text);
|
||||||
},
|
},
|
||||||
|
@ -332,16 +339,6 @@ let actions = {
|
||||||
}, selector);
|
}, selector);
|
||||||
},
|
},
|
||||||
|
|
||||||
waitForURL: async function(hashURL) {
|
|
||||||
try {
|
|
||||||
await this.waitForFunction(expectedHash => {
|
|
||||||
return document.location.hash.includes(expectedHash);
|
|
||||||
}, {}, hashURL);
|
|
||||||
} catch (error) {
|
|
||||||
throw new Error(`failed to reach URL containing: ${hashURL}`);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
hideSnackbar: async function() {
|
hideSnackbar: async function() {
|
||||||
await this.waitToClick('#shapes .shown button');
|
await this.waitToClick('#shapes .shown button');
|
||||||
},
|
},
|
||||||
|
@ -460,7 +457,7 @@ let actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
isDisabled: async function(selector) {
|
isDisabled: async function(selector) {
|
||||||
await this.wait(selector);
|
await this.waitForSelector(selector);
|
||||||
return await this.evaluate(selector => {
|
return await this.evaluate(selector => {
|
||||||
let element = document.querySelector(selector);
|
let element = document.querySelector(selector);
|
||||||
return element.$ctrl.disabled;
|
return element.$ctrl.disabled;
|
||||||
|
|
|
@ -4,18 +4,25 @@ import {extendPage} from './extensions';
|
||||||
import {url as defaultURL} from './config';
|
import {url as defaultURL} from './config';
|
||||||
|
|
||||||
export async function getBrowser() {
|
export async function getBrowser() {
|
||||||
|
let headless = true;
|
||||||
const browser = await Puppeteer.launch({
|
const browser = await Puppeteer.launch({
|
||||||
args: [
|
args: [
|
||||||
'--no-sandbox',
|
'--no-sandbox',
|
||||||
`--window-size=${ 1920 },${ 1080 }`
|
`--window-size=${ 1920 },${ 1080 }`
|
||||||
],
|
],
|
||||||
defaultViewport: null,
|
defaultViewport: null,
|
||||||
headless: false,
|
headless: headless,
|
||||||
slowMo: 0, // slow down by ms
|
slowMo: 0, // slow down by ms
|
||||||
});
|
});
|
||||||
let page = (await browser.pages())[0];
|
let page = (await browser.pages())[0];
|
||||||
page = extendPage(page);
|
page = extendPage(page);
|
||||||
page.setDefaultTimeout(5000);
|
page.setDefaultTimeout(5000);
|
||||||
|
// if (headless) {
|
||||||
|
// await page.setExtraHTTPHeaders({
|
||||||
|
// 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8'
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// await page.setCacheEnabled(false);
|
||||||
await page.goto(defaultURL, {waitUntil: 'networkidle0'});
|
await page.goto(defaultURL, {waitUntil: 'networkidle0'});
|
||||||
return {page, close: browser.close.bind(browser)};
|
return {page, close: browser.close.bind(browser)};
|
||||||
}
|
}
|
||||||
|
|
|
@ -502,7 +502,7 @@ export default {
|
||||||
newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
|
newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
|
||||||
newServiceTypeExpense: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]',
|
newServiceTypeExpense: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]',
|
||||||
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
|
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
|
||||||
saveServiceButton: `button[type=submit]`,
|
saveServiceButton: 'button[type=submit]',
|
||||||
saveServiceTypeButton: '.vn-dialog.shown tpl-buttons > button'
|
saveServiceTypeButton: '.vn-dialog.shown tpl-buttons > button'
|
||||||
},
|
},
|
||||||
createStateView: {
|
createStateView: {
|
||||||
|
|
|
@ -36,8 +36,8 @@ describe('Login path', async() => {
|
||||||
it('should log in', async() => {
|
it('should log in', async() => {
|
||||||
await page.doLogin('employee', 'nightmare');
|
await page.doLogin('employee', 'nightmare');
|
||||||
await page.waitForNavigation();
|
await page.waitForNavigation();
|
||||||
let url = await page.parsedUrl();
|
let url = await page.expectURL('#!/');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,9 +26,9 @@ describe('Client create path', async() => {
|
||||||
it('should now access to the create client view by clicking the create-client floating button', async() => {
|
it('should now access to the create client view by clicking the create-client floating button', async() => {
|
||||||
await page.waitToClick(selectors.clientsIndex.createClientButton);
|
await page.waitToClick(selectors.clientsIndex.createClientButton);
|
||||||
await page.wait(selectors.createClientView.createButton);
|
await page.wait(selectors.createClientView.createButton);
|
||||||
const url = await page.parsedUrl();
|
let url = await page.expectURL('#!/client/create');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/client/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should receive an error when clicking the create button having all the form fields empty', async() => {
|
it('should receive an error when clicking the create button having all the form fields empty', async() => {
|
||||||
|
@ -107,17 +107,16 @@ describe('Client create path', async() => {
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||||
await page.wait(selectors.clientsIndex.createClientButton);
|
await page.wait(selectors.clientsIndex.createClientButton);
|
||||||
const url = await page.parsedUrl();
|
let url = await page.expectURL('#!/client/index');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/client/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
|
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.accessToSearchResult('Carol Danvers');
|
await page.accessToSearchResult('Carol Danvers');
|
||||||
await page.waitForURL('#!/client/114/summary');
|
let url = await page.expectURL('#!/client/114/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/client/114/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,10 +36,9 @@ describe('Client Edit fiscalData path', () => {
|
||||||
|
|
||||||
it(`should click on the fiscal data button`, async() => {
|
it(`should click on the fiscal data button`, async() => {
|
||||||
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
|
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
|
||||||
await page.waitForURL('fiscal-data');
|
let url = await page.expectURL('fiscal-data');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('fiscal-data');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not be able to edit the verified data checkbox', async() => {
|
it('should not be able to edit the verified data checkbox', async() => {
|
||||||
|
@ -123,10 +122,9 @@ describe('Client Edit fiscalData path', () => {
|
||||||
// confirm all addresses have now EQtax checked step 1
|
// confirm all addresses have now EQtax checked step 1
|
||||||
it(`should click on the addresses button to access to the client's addresses`, async() => {
|
it(`should click on the addresses button to access to the client's addresses`, async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.addressesButton);
|
await page.waitToClick(selectors.clientAddresses.addressesButton);
|
||||||
await page.waitForURL('/address/index');
|
let url = await page.expectURL('/address/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/address/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// confirm all addresses have now EQtax checked step 2
|
// confirm all addresses have now EQtax checked step 2
|
||||||
|
@ -260,10 +258,9 @@ describe('Client Edit fiscalData path', () => {
|
||||||
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
|
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
|
||||||
it(`should click on the addresses button to access to the client's addresses`, async() => {
|
it(`should click on the addresses button to access to the client's addresses`, async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.addressesButton);
|
await page.waitToClick(selectors.clientAddresses.addressesButton);
|
||||||
await page.waitForURL('/address/index');
|
let url = await page.expectURL('/address/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/address/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2
|
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('Client Add address path', () => {
|
||||||
|
|
||||||
it(`should click on the add new address button to access to the new address form`, async() => {
|
it(`should click on the add new address button to access to the new address form`, async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.createAddress);
|
await page.waitToClick(selectors.clientAddresses.createAddress);
|
||||||
await page.waitForURL('address/create');
|
let url = await page.expectURL('address/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('address/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
|
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
|
||||||
|
@ -87,10 +86,9 @@ describe('Client Add address path', () => {
|
||||||
it(`should click on the edit icon of the default address`, async() => {
|
it(`should click on the edit icon of the default address`, async() => {
|
||||||
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
|
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
|
||||||
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
||||||
await page.waitForURL('/edit');
|
let url = await page.expectURL('/edit');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/edit');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => {
|
it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => {
|
||||||
|
@ -105,9 +103,8 @@ describe('Client Add address path', () => {
|
||||||
it(`should go back to the addreses section by clicking the cancel button`, async() => {
|
it(`should go back to the addreses section by clicking the cancel button`, async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
|
await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
|
||||||
await page.waitToClick('.vn-confirm.shown button[response="accept"]');
|
await page.waitToClick('.vn-confirm.shown button[response="accept"]');
|
||||||
await page.waitForURL('address/index');
|
let url = await page.expectURL('address/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('address/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,10 +19,9 @@ describe('Client add address notes path', () => {
|
||||||
it(`should click on the edit icon of the default address`, async() => {
|
it(`should click on the edit icon of the default address`, async() => {
|
||||||
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street');
|
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street');
|
||||||
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
||||||
await page.waitForURL('/edit');
|
let url = await page.expectURL('/edit');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/edit');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not save a description without observation type', async() => {
|
it('should not save a description without observation type', async() => {
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('Client Add notes path', () => {
|
||||||
|
|
||||||
it(`should click on the add note button`, async() => {
|
it(`should click on the add note button`, async() => {
|
||||||
await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
|
await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
|
||||||
await page.waitForURL('/note/create');
|
let url = await page.expectURL('/note/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/note/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should create a note`, async() => {
|
it(`should create a note`, async() => {
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('Client Add credit path', () => {
|
||||||
|
|
||||||
it(`should click on the add credit button`, async() => {
|
it(`should click on the add credit button`, async() => {
|
||||||
await page.waitToClick(selectors.clientCredit.addCreditFloatButton);
|
await page.waitToClick(selectors.clientCredit.addCreditFloatButton);
|
||||||
await page.waitForURL('/credit/create');
|
let url = await page.expectURL('/credit/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/credit/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should edit the credit`, async() => {
|
it(`should edit the credit`, async() => {
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('Client Add greuge path', () => {
|
||||||
|
|
||||||
it(`should click on the add greuge button`, async() => {
|
it(`should click on the add greuge button`, async() => {
|
||||||
await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton);
|
await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton);
|
||||||
await page.waitForURL('greuge/create');
|
let url = await page.expectURL('greuge/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('greuge/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should receive an error if all fields are empty but date and type on submit`, async() => {
|
it(`should receive an error if all fields are empty but date and type on submit`, async() => {
|
||||||
|
|
|
@ -113,12 +113,12 @@ describe('Client lock verified data path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as salesAssistant', () => {
|
describe('as salesAssistant', () => {
|
||||||
beforeAll(async() => {
|
it('should log in as salesAssistant then get to the client fiscal data', async() => {
|
||||||
await page.forceReloadSection('client.card.fiscalData');
|
await page.forceReloadSection('client.card.fiscalData');
|
||||||
await page.loginAndModule('salesAssistant', 'client');
|
await page.loginAndModule('salesAssistant', 'client');
|
||||||
await page.accessToSearchResult('Hank Pym');
|
await page.accessToSearchResult('Hank Pym');
|
||||||
await page.accessToSection('client.card.fiscalData');
|
await page.accessToSection('client.card.fiscalData');
|
||||||
});
|
}, 20000);
|
||||||
|
|
||||||
it('should confirm verified data button is enabled for salesAssistant', async() => {
|
it('should confirm verified data button is enabled for salesAssistant', async() => {
|
||||||
const isDisabled = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
|
const isDisabled = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||||
|
|
|
@ -27,10 +27,9 @@ describe('Client log path', () => {
|
||||||
|
|
||||||
it('should navigate to the log section', async() => {
|
it('should navigate to the log section', async() => {
|
||||||
await page.waitToClick(selectors.clientLog.logButton);
|
await page.waitToClick(selectors.clientLog.logButton);
|
||||||
await page.waitForURL('log');
|
let url = await page.expectURL('log');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('log');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check the previous value of the last logged change', async() => {
|
it('should check the previous value of the last logged change', async() => {
|
||||||
|
|
|
@ -42,17 +42,14 @@ describe('Client balance path', () => {
|
||||||
it('should click the new payment button', async() => {
|
it('should click the new payment button', async() => {
|
||||||
await page.keyboard.press('Escape');
|
await page.keyboard.press('Escape');
|
||||||
await page.reloadSection('client.card.balance.index');
|
await page.reloadSection('client.card.balance.index');
|
||||||
await page.waitForURL('/balance');
|
let url = await page.expectURL('/balance');
|
||||||
|
|
||||||
let url = await page.parsedUrl();
|
expect(url).toBe(true);
|
||||||
|
|
||||||
expect(url.hash).toContain('/balance');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new payment that clears the debt', async() => {
|
it('should create a new payment that clears the debt', async() => {
|
||||||
await page.waitToClick(selectors.clientBalance.newPaymentButton);
|
await page.waitToClick(selectors.clientBalance.newPaymentButton);
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true});
|
|
||||||
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Pay on receipt');
|
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Pay on receipt');
|
||||||
await page.waitToClick(selectors.clientBalance.saveButton);
|
await page.waitToClick(selectors.clientBalance.saveButton);
|
||||||
let result = await page.waitForLastSnackbar();
|
let result = await page.waitForLastSnackbar();
|
||||||
|
@ -116,12 +113,13 @@ describe('Client balance path', () => {
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||||
await page.wait(selectors.clientsIndex.createClientButton);
|
await page.wait(selectors.clientsIndex.createClientButton);
|
||||||
let url = await page.parsedUrl();
|
let url = await page.expectURL('#!/client/index');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/client/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should now search for the user Petter Parker', async() => {
|
it('should now search for the user Petter Parker', async() => {
|
||||||
|
await page.waitForContentLoaded();
|
||||||
await page.write(selectors.clientsIndex.topbarSearch, 'Petter Parker');
|
await page.write(selectors.clientsIndex.topbarSearch, 'Petter Parker');
|
||||||
await page.waitToClick(selectors.clientsIndex.searchButton);
|
await page.waitToClick(selectors.clientsIndex.searchButton);
|
||||||
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1);
|
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1);
|
||||||
|
@ -135,10 +133,9 @@ describe('Client balance path', () => {
|
||||||
await page.waitToClick(selectors.clientsIndex.searchResult);
|
await page.waitToClick(selectors.clientsIndex.searchResult);
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.clientBalance.balanceButton);
|
await page.waitToClick(selectors.clientBalance.balanceButton);
|
||||||
await page.waitForURL('/balance');
|
let url = await page.expectURL('/balance');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/balance');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not be able to click the new payment button as it isnt present', async() => {
|
it('should not be able to click the new payment button as it isnt present', async() => {
|
||||||
|
|
|
@ -131,10 +131,9 @@ describe('Item summary path', () => {
|
||||||
|
|
||||||
it(`should navigate to the one of the items detailed section`, async() => {
|
it(`should navigate to the one of the items detailed section`, async() => {
|
||||||
await page.waitToClick(selectors.itemsIndex.searchResult);
|
await page.waitToClick(selectors.itemsIndex.searchResult);
|
||||||
await page.waitForURL('summary');
|
let url = await page.expectURL('summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the descritor edit button is not visible for employee`, async() => {
|
it(`should check the descritor edit button is not visible for employee`, async() => {
|
||||||
|
|
|
@ -27,27 +27,24 @@ describe('Item Create/Clone path', () => {
|
||||||
|
|
||||||
it('should access to the create item view by clicking the create floating button', async() => {
|
it('should access to the create item view by clicking the create floating button', async() => {
|
||||||
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
||||||
await page.wait(selectors.itemCreateView.createButton);
|
let url = await page.expectURL('#!/item/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/item/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return to the item index by clickig the cancel button', async() => {
|
it('should return to the item index by clickig the cancel button', async() => {
|
||||||
await page.waitToClick(selectors.itemCreateView.cancelButton);
|
await page.waitToClick(selectors.itemCreateView.cancelButton);
|
||||||
await page.wait(selectors.itemsIndex.createItemButton);
|
let url = await page.expectURL('#!/item/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/item/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should now access to the create item view by clicking the create floating button', async() => {
|
it('should now access to the create item view by clicking the create floating button', async() => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
||||||
await page.wait(selectors.itemCreateView.createButton);
|
let url = await page.expectURL('#!/item/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/item/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create the Infinity Gauntlet item', async() => {
|
it('should create the Infinity Gauntlet item', async() => {
|
||||||
|
@ -89,10 +86,9 @@ describe('Item Create/Clone path', () => {
|
||||||
it('should return to the items index by clicking the return to items button', async() => {
|
it('should return to the items index by clicking the return to items button', async() => {
|
||||||
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
||||||
await page.wait(selectors.itemsIndex.createItemButton);
|
await page.wait(selectors.itemsIndex.createItemButton);
|
||||||
await page.waitForURL('#!/item/index');
|
let url = await page.expectURL('#!/item/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('#!/item/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the item Infinity Gauntlet`, async() => {
|
it(`should search for the item Infinity Gauntlet`, async() => {
|
||||||
|
@ -109,10 +105,9 @@ describe('Item Create/Clone path', () => {
|
||||||
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet');
|
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet');
|
||||||
await page.waitToClick(selectors.itemsIndex.searchResultCloneButton);
|
await page.waitToClick(selectors.itemsIndex.searchResultCloneButton);
|
||||||
await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton);
|
await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton);
|
||||||
await page.waitForURL('tags');
|
let url = await page.expectURL('tags');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('tags');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for the item Infinity Gauntlet and find two', async() => {
|
it('should search for the item Infinity Gauntlet and find two', async() => {
|
||||||
|
|
|
@ -46,10 +46,9 @@ describe('Item regularize path', () => {
|
||||||
it(`should click on the search result to access to the item tax`, async() => {
|
it(`should click on the search result to access to the item tax`, async() => {
|
||||||
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
|
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
|
||||||
await page.waitToClick(selectors.itemsIndex.searchResult);
|
await page.waitToClick(selectors.itemsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
|
it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
|
||||||
|
@ -76,9 +75,9 @@ describe('Item regularize path', () => {
|
||||||
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
|
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
|
||||||
page.waitToClick(selectors.globalItems.ticketsButton)
|
page.waitToClick(selectors.globalItems.ticketsButton)
|
||||||
]);
|
]);
|
||||||
const url = await page.parsedUrl();
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should clear the user local settings now', async() => {
|
it('should clear the user local settings now', async() => {
|
||||||
|
@ -103,10 +102,9 @@ describe('Item regularize path', () => {
|
||||||
it(`should click on the search result to access to the ticket summary`, async() => {
|
it(`should click on the search result to access to the ticket summary`, async() => {
|
||||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing');
|
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing');
|
||||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the ticket sale quantity is showing a negative value`, async() => {
|
it(`should check the ticket sale quantity is showing a negative value`, async() => {
|
||||||
|
@ -128,10 +126,9 @@ describe('Item regularize path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.itemsButton);
|
await page.waitToClick(selectors.globalItems.itemsButton);
|
||||||
await page.wait(selectors.itemsIndex.topbarSearch);
|
let url = await page.expectURL('#!/item/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/item/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for the item once again', async() => {
|
it('should search for the item once again', async() => {
|
||||||
|
@ -147,10 +144,9 @@ describe('Item regularize path', () => {
|
||||||
it(`should click on the search result to access to the item tax`, async() => {
|
it(`should click on the search result to access to the item tax`, async() => {
|
||||||
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
|
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
|
||||||
await page.waitToClick(selectors.itemsIndex.searchResult);
|
await page.waitToClick(selectors.itemsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should regularize the item once more', async() => {
|
it('should regularize the item once more', async() => {
|
||||||
|
@ -172,9 +168,9 @@ describe('Item regularize path', () => {
|
||||||
page.waitToClick(selectors.globalItems.ticketsButton)
|
page.waitToClick(selectors.globalItems.ticketsButton)
|
||||||
]);
|
]);
|
||||||
await page.waitForTransitionEnd('vn-searchbar');
|
await page.waitForTransitionEnd('vn-searchbar');
|
||||||
const url = await page.parsedUrl();
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for the ticket with id 25 once again', async() => {
|
it('should search for the ticket with id 25 once again', async() => {
|
||||||
|
@ -189,10 +185,9 @@ describe('Item regularize path', () => {
|
||||||
it(`should now click on the search result to access to the ticket summary`, async() => {
|
it(`should now click on the search result to access to the ticket summary`, async() => {
|
||||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, '25');
|
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, '25');
|
||||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the ticket contains now two sales`, async() => {
|
it(`should check the ticket contains now two sales`, async() => {
|
||||||
|
|
|
@ -25,10 +25,9 @@ describe('Item log path', () => {
|
||||||
|
|
||||||
it('should access to the create item view by clicking the create floating button', async() => {
|
it('should access to the create item view by clicking the create floating button', async() => {
|
||||||
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
||||||
await page.wait(selectors.itemCreateView.createButton);
|
let url = await page.expectURL('#!/item/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/item/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create the Knowledge artifact item', async() => {
|
it('should create the Knowledge artifact item', async() => {
|
||||||
|
@ -45,19 +44,17 @@ describe('Item log path', () => {
|
||||||
it('should return to the items index by clicking the return to items button', async() => {
|
it('should return to the items index by clicking the return to items button', async() => {
|
||||||
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
||||||
await page.wait(selectors.itemsIndex.createItemButton);
|
await page.wait(selectors.itemsIndex.createItemButton);
|
||||||
await page.waitForURL('#!/item/index');
|
let url = await page.expectURL('#!/item/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('#!/item/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the created item and navigate to it's log section`, async() => {
|
it(`should search for the created item and navigate to it's log section`, async() => {
|
||||||
await page.accessToSearchResult('Knowledge artifact');
|
await page.accessToSearchResult('Knowledge artifact');
|
||||||
await page.accessToSection('item.card.log');
|
await page.accessToSection('item.card.log');
|
||||||
await page.waitForURL('/log');
|
let url = await page.expectURL('/log');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/log');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should confirm the log is showing 5 entries`, async() => {
|
it(`should confirm the log is showing 5 entries`, async() => {
|
||||||
|
|
|
@ -21,9 +21,9 @@ describe('Ticket Create new tracking state path', () => {
|
||||||
it('should access to the create state view by clicking the create floating button', async() => {
|
it('should access to the create state view by clicking the create floating button', async() => {
|
||||||
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
||||||
await page.waitForSelector(selectors.createStateView.state, {visible: true});
|
await page.waitForSelector(selectors.createStateView.state, {visible: true});
|
||||||
let url = await page.parsedUrl();
|
let url = await page.expectURL('tracking/edit');
|
||||||
|
|
||||||
expect(url.hash).toContain('tracking/edit');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should attempt create a new state but receive an error if state is empty`, async() => {
|
it(`should attempt create a new state but receive an error if state is empty`, async() => {
|
||||||
|
@ -51,10 +51,9 @@ describe('Ticket Create new tracking state path', () => {
|
||||||
|
|
||||||
it('should now access to the create state view by clicking the create floating button', async() => {
|
it('should now access to the create state view by clicking the create floating button', async() => {
|
||||||
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
||||||
await page.waitForURL('tracking/edit');
|
let url = await page.expectURL('tracking/edit');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('tracking/edit');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
|
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
|
||||||
|
|
|
@ -68,10 +68,9 @@ describe('Ticket Edit basic data path', () => {
|
||||||
|
|
||||||
it(`should click next`, async() => {
|
it(`should click next`, async() => {
|
||||||
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
|
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
|
||||||
await page.waitForURL('data/step-two');
|
let url = await page.expectURL('data/step-two');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('data/step-two');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have a price diference`, async() => {
|
it(`should have a price diference`, async() => {
|
||||||
|
@ -83,18 +82,16 @@ describe('Ticket Edit basic data path', () => {
|
||||||
|
|
||||||
it(`should then click next to move on to step three`, async() => {
|
it(`should then click next to move on to step three`, async() => {
|
||||||
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
|
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
|
||||||
await page.waitForURL('data/step-three');
|
let url = await page.expectURL('data/step-three');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('data/step-three');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should select a new reason for the changes made then click on finalize`, async() => {
|
it(`should select a new reason for the changes made then click on finalize`, async() => {
|
||||||
await page.autocompleteSearch(selectors.ticketBasicData.chargesReason, 'Cambiar los precios en el ticket');
|
await page.autocompleteSearch(selectors.ticketBasicData.chargesReason, 'Cambiar los precios en el ticket');
|
||||||
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
|
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
|
||||||
await page.waitForURL('summary');
|
let url = await page.expectURL('summary');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -42,11 +42,9 @@ describe('Ticket descriptor path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||||
await page.waitForContentLoaded();
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
|
|
||||||
const url = await page.parsedUrl();
|
expect(url).toBe(true);
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the ticket 11 was added to thursday', async() => {
|
it('should confirm the ticket 11 was added to thursday', async() => {
|
||||||
|
@ -60,11 +58,9 @@ describe('Ticket descriptor path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||||
await page.waitForURL('#!/ticket/index');
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
|
|
||||||
const url = await page.parsedUrl();
|
expect(url).toBe(true);
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should now search for the ticket 11', async() => {
|
it('should now search for the ticket 11', async() => {
|
||||||
|
@ -79,10 +75,9 @@ describe('Ticket descriptor path', () => {
|
||||||
|
|
||||||
it(`should click on the search result to access to the ticket`, async() => {
|
it(`should click on the search result to access to the ticket`, async() => {
|
||||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add the ticket to saturday turn using the descriptor more menu', async() => {
|
it('should add the ticket to saturday turn using the descriptor more menu', async() => {
|
||||||
|
@ -99,10 +94,9 @@ describe('Ticket descriptor path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||||
await page.wait(selectors.ticketsIndex.topbarSearch);
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the ticket 11 was added on saturday', async() => {
|
it('should confirm the ticket 11 was added on saturday', async() => {
|
||||||
|
|
|
@ -30,10 +30,9 @@ describe('Ticket purchase request path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have been redirected to the request index`, async() => {
|
it(`should have been redirected to the request index`, async() => {
|
||||||
await page.waitForURL('/request');
|
let url = await page.expectURL('/request');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/request');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should confirm the new request was added`, async() => {
|
it(`should confirm the new request was added`, async() => {
|
||||||
|
|
|
@ -28,20 +28,18 @@ xdescribe('Ticket diary path', () => {
|
||||||
it(`should click on the search result to access to the ticket summary`, async() => {
|
it(`should click on the search result to access to the ticket summary`, async() => {
|
||||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
|
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
|
||||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async() => {
|
it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async() => {
|
||||||
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
|
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
|
||||||
await page.waitForTransitionEnd('.vn-popover');
|
await page.waitForTransitionEnd('.vn-popover');
|
||||||
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
|
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
|
||||||
await page.waitForURL('/diary');
|
let url = await page.expectURL('/diary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/diary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the second line id is marked as message`, async() => {
|
it(`should check the second line id is marked as message`, async() => {
|
||||||
|
|
|
@ -28,10 +28,9 @@ describe('Ticket descriptor path', () => {
|
||||||
it(`should click on the search result to access to the ticket summary`, async() => {
|
it(`should click on the search result to access to the ticket summary`, async() => {
|
||||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Cerebro');
|
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Cerebro');
|
||||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should update the shipped hour using the descriptor menu`, async() => {
|
it(`should update the shipped hour using the descriptor menu`, async() => {
|
||||||
|
@ -62,9 +61,9 @@ describe('Ticket descriptor path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have been relocated to the ticket index', async() => {
|
it('should have been relocated to the ticket index', async() => {
|
||||||
const url = await page.parsedUrl();
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the deleted ticket and check it's date`, async() => {
|
it(`should search for the deleted ticket and check it's date`, async() => {
|
||||||
|
@ -92,10 +91,9 @@ describe('Ticket descriptor path', () => {
|
||||||
it(`should now click on the search result to access to the ticket summary`, async() => {
|
it(`should now click on the search result to access to the ticket summary`, async() => {
|
||||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Many Places');
|
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Many Places');
|
||||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open the add stowaway dialog', async() => {
|
it('should open the add stowaway dialog', async() => {
|
||||||
|
@ -126,10 +124,9 @@ describe('Ticket descriptor path', () => {
|
||||||
|
|
||||||
it(`should navigate back to the added ticket using the descriptors ship button`, async() => {
|
it(`should navigate back to the added ticket using the descriptors ship button`, async() => {
|
||||||
await page.waitToClick(selectors.ticketDescriptor.shipButton);
|
await page.waitToClick(selectors.ticketDescriptor.shipButton);
|
||||||
await page.waitForURL('#!/ticket/17/summary');
|
let url = await page.expectURL('#!/ticket/17/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('#!/ticket/17/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete the stowaway', async() => {
|
it('should delete the stowaway', async() => {
|
||||||
|
@ -153,10 +150,9 @@ describe('Ticket descriptor path', () => {
|
||||||
|
|
||||||
await page.loginAndModule('adminBoss', 'ticket');
|
await page.loginAndModule('adminBoss', 'ticket');
|
||||||
await page.accessToSearchResult(invoiceableTicketId);
|
await page.accessToSearchResult(invoiceableTicketId);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL(`ticket/${invoiceableTicketId}/summary`);
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain(`ticket/${invoiceableTicketId}/summary`);
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => {
|
it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => {
|
||||||
|
|
|
@ -44,10 +44,9 @@ describe('Ticket services path', () => {
|
||||||
await page.loginAndModule('administrative', 'ticket');
|
await page.loginAndModule('administrative', 'ticket');
|
||||||
await page.accessToSearchResult(editableTicketId);
|
await page.accessToSearchResult(editableTicketId);
|
||||||
await page.accessToSection('ticket.card.service');
|
await page.accessToSection('ticket.card.service');
|
||||||
await page.waitForURL('/service');
|
let url = await page.expectURL('/service');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/service');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should click on the add button to prepare the form to create a new service', async() => {
|
it('should click on the add button to prepare the form to create a new service', async() => {
|
||||||
|
@ -86,6 +85,7 @@ describe('Ticket services path', () => {
|
||||||
await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpense, 'Retencion');
|
await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpense, 'Retencion');
|
||||||
await page.waitToClick(selectors.ticketService.saveServiceTypeButton);
|
await page.waitToClick(selectors.ticketService.saveServiceTypeButton);
|
||||||
await page.write(selectors.ticketService.firstPrice, '999');
|
await page.write(selectors.ticketService.firstPrice, '999');
|
||||||
|
await page.waitFor(1000); // time needed for the button to be clickable
|
||||||
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
||||||
const result = await page.waitForLastSnackbar();
|
const result = await page.waitForLastSnackbar();
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ describe('Ticket services path', () => {
|
||||||
it('should delete the service', async() => {
|
it('should delete the service', async() => {
|
||||||
await page.waitToClick(selectors.ticketService.fistDeleteServiceButton);
|
await page.waitToClick(selectors.ticketService.fistDeleteServiceButton);
|
||||||
await page.waitForNumberOfElements(selectors.ticketService.serviceLine, 0);
|
await page.waitForNumberOfElements(selectors.ticketService.serviceLine, 0);
|
||||||
|
await page.waitFor(1000); // without this wait it fails to click the save button
|
||||||
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
||||||
const result = await page.waitForLastSnackbar();
|
const result = await page.waitForLastSnackbar();
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,9 @@ describe('Ticket create path', () => {
|
||||||
|
|
||||||
it('should open the new ticket form', async() => {
|
it('should open the new ticket form', async() => {
|
||||||
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
|
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
|
||||||
await page.wait(selectors.createTicketView.client);
|
let url = await page.expectURL('#!/ticket/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should succeed to create a ticket', async() => {
|
it('should succeed to create a ticket', async() => {
|
||||||
|
@ -36,9 +35,8 @@ describe('Ticket create path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check the url is now the summary of the ticket', async() => {
|
it('should check the url is now the summary of the ticket', async() => {
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,10 +20,9 @@ describe('Ticket create from client path', () => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.clientDescriptor.moreMenu);
|
await page.waitToClick(selectors.clientDescriptor.moreMenu);
|
||||||
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
|
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
|
||||||
await page.waitForURL('#!/ticket/create?clientFk=102');
|
let url = await page.expectURL('clientFk=102');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('clientFk=102');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check if the client details are the expected ones', async() => {
|
it('should check if the client details are the expected ones', async() => {
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('Ticket Summary path', () => {
|
||||||
it('should navigate to the target ticket summary section', async() => {
|
it('should navigate to the target ticket summary section', async() => {
|
||||||
await page.loginAndModule('employee', 'ticket');
|
await page.loginAndModule('employee', 'ticket');
|
||||||
await page.accessToSearchResult(ticketId);
|
await page.accessToSearchResult(ticketId);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should display details from the ticket and it's client on the top of the header`, async() => {
|
it(`should display details from the ticket and it's client on the top of the header`, async() => {
|
||||||
|
@ -76,10 +75,9 @@ describe('Ticket Summary path', () => {
|
||||||
it('should log in as production then navigate to the summary of the same ticket', async() => {
|
it('should log in as production then navigate to the summary of the same ticket', async() => {
|
||||||
await page.loginAndModule('production', 'ticket');
|
await page.loginAndModule('production', 'ticket');
|
||||||
await page.accessToSearchResult(ticketId);
|
await page.accessToSearchResult(ticketId);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
let url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should click on the SET OK button', async() => {
|
it('should click on the SET OK button', async() => {
|
||||||
|
|
|
@ -31,10 +31,9 @@ describe('Claim edit basic data path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have been redirected to the next section of claims as the role is salesAssistant`, async() => {
|
it(`should have been redirected to the next section of claims as the role is salesAssistant`, async() => {
|
||||||
await page.waitForURL('/detail');
|
let url = await page.expectURL('/detail');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/detail');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the claim state was edited', async() => {
|
it('should confirm the claim state was edited', async() => {
|
||||||
|
|
|
@ -32,10 +32,9 @@ describe('Claim development', () => {
|
||||||
}, 15000);
|
}, 15000);
|
||||||
|
|
||||||
it(`should redirect to the next section of claims as the role is salesAssistant`, async() => {
|
it(`should redirect to the next section of claims as the role is salesAssistant`, async() => {
|
||||||
await page.waitForURL('/action');
|
let url = await page.expectURL('/action');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/action');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should edit a development', async() => {
|
it('should edit a development', async() => {
|
||||||
|
|
|
@ -56,10 +56,9 @@ xdescribe('Claim detail', () => {
|
||||||
await page.loginAndModule('salesAssistant', 'claim');
|
await page.loginAndModule('salesAssistant', 'claim');
|
||||||
await page.accessToSearchResult('1');
|
await page.accessToSearchResult('1');
|
||||||
await page.accessToSection('claim.card.detail');
|
await page.accessToSection('claim.card.detail');
|
||||||
await page.waitForURL('/detail');
|
let url = await page.expectURL('/detail');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/detail');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should edit de second item claimed discount', async() => {
|
it('should edit de second item claimed discount', async() => {
|
||||||
|
@ -100,10 +99,9 @@ xdescribe('Claim detail', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have been redirected to the next section in claims`, async() => {
|
it(`should have been redirected to the next section in claims`, async() => {
|
||||||
await page.waitForURL('/development');
|
let url = await page.expectURL('development');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('development');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate back to claim.detail to confirm the claim contains now two items', async() => {
|
it('should navigate back to claim.detail to confirm the claim contains now two items', async() => {
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('claim Summary path', () => {
|
||||||
it('should navigate to the target claim summary section', async() => {
|
it('should navigate to the target claim summary section', async() => {
|
||||||
await page.loginAndModule('employee', 'claim');
|
await page.loginAndModule('employee', 'claim');
|
||||||
await page.accessToSearchResult(claimId);
|
await page.accessToSearchResult(claimId);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should display details from the claim and it's client on the top of the header`, async() => {
|
it(`should display details from the claim and it's client on the top of the header`, async() => {
|
||||||
|
|
|
@ -18,10 +18,9 @@ describe('claim Descriptor path', () => {
|
||||||
it('should now 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.loginAndModule('employee', 'claim');
|
||||||
await page.accessToSearchResult(claimId);
|
await page.accessToSearchResult(claimId);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should not be able to see the delete claim button of the descriptor more menu`, async() => {
|
it(`should not be able to see the delete claim button of the descriptor more menu`, async() => {
|
||||||
|
@ -33,10 +32,9 @@ describe('claim Descriptor path', () => {
|
||||||
it(`should log in as salesAssistant and navigate to the target claim`, async() => {
|
it(`should log in as salesAssistant and navigate to the target claim`, async() => {
|
||||||
await page.loginAndModule('salesAssistant', 'claim');
|
await page.loginAndModule('salesAssistant', 'claim');
|
||||||
await page.accessToSearchResult(claimId);
|
await page.accessToSearchResult(claimId);
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should be able to see the delete claim button of the descriptor more menu`, async() => {
|
it(`should be able to see the delete claim button of the descriptor more menu`, async() => {
|
||||||
|
@ -53,10 +51,9 @@ describe('claim Descriptor path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have been relocated to the claim index`, async() => {
|
it(`should have been relocated to the claim index`, async() => {
|
||||||
await page.waitForURL('/claim/index');
|
let url = await page.expectURL('/claim/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/claim/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the deleted claim to find no results`, async() => {
|
it(`should search for the deleted claim to find no results`, async() => {
|
||||||
|
|
|
@ -41,10 +41,9 @@ describe('Order edit basic data path', () => {
|
||||||
await page.accessToSection('order.card.basicData');
|
await page.accessToSection('order.card.basicData');
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitForSelector(selectors.orderBasicData.observation, {visible: true});
|
await page.waitForSelector(selectors.orderBasicData.observation, {visible: true});
|
||||||
await page.waitForURL('basic-data');
|
let url = await page.expectURL(`#!/order/${orderId}/basic-data`);
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual(`#!/order/${orderId}/basic-data`);
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not be able to change anything', async() => {
|
it('should not be able to change anything', async() => {
|
||||||
|
@ -63,10 +62,9 @@ describe('Order edit basic data path', () => {
|
||||||
await page.waitToClick(selectors.orderBasicData.acceptButton);
|
await page.waitToClick(selectors.orderBasicData.acceptButton);
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.ordersIndex.createOrderButton);
|
await page.waitToClick(selectors.ordersIndex.createOrderButton);
|
||||||
await page.waitForURL('#!/order/create');
|
let url = await page.expectURL('#!/order/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('#!/order/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should now create a new one', async() => {
|
it('should now create a new one', async() => {
|
||||||
|
@ -74,18 +72,16 @@ describe('Order edit basic data path', () => {
|
||||||
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
|
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
|
||||||
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
|
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
|
||||||
await page.waitToClick(selectors.createOrderView.createButton);
|
await page.waitToClick(selectors.createOrderView.createButton);
|
||||||
await page.waitForURL('/catalog');
|
let url = await page.expectURL('/catalog');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/catalog');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate to the basic data section of the new order', async() => {
|
it('should navigate to the basic data section of the new order', async() => {
|
||||||
await page.accessToSection('order.card.basicData');
|
await page.accessToSection('order.card.basicData');
|
||||||
await page.wait(selectors.orderBasicData.observation);
|
let url = await page.expectURL('/basic-data');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/basic-data');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to modify all the properties', async() => {
|
it('should be able to modify all the properties', async() => {
|
||||||
|
|
|
@ -17,10 +17,9 @@ describe('Order catalog', () => {
|
||||||
|
|
||||||
it('should open the create new order form', async() => {
|
it('should open the create new order form', async() => {
|
||||||
await page.waitToClick(selectors.ordersIndex.createOrderButton);
|
await page.waitToClick(selectors.ordersIndex.createOrderButton);
|
||||||
await page.waitForURL('order/create');
|
let url = await page.expectURL('order/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('order/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new order', async() => {
|
it('should create a new order', async() => {
|
||||||
|
@ -30,16 +29,15 @@ describe('Order catalog', () => {
|
||||||
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
|
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
|
||||||
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
|
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
|
||||||
await page.waitToClick(selectors.createOrderView.createButton);
|
await page.waitToClick(selectors.createOrderView.createButton);
|
||||||
await page.waitForURL('/catalog');
|
let url = await page.expectURL('/catalog');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
|
expect(url).toBe(true);
|
||||||
expect(url.hash).toContain('/catalog');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add the realm and type filters and obtain results', async() => {
|
it('should add the realm and type filters and obtain results', async() => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.orderCatalog.plantRealmButton);
|
await page.waitToClick(selectors.orderCatalog.plantRealmButton);
|
||||||
|
await page.waitForContentLoaded();
|
||||||
await page.autocompleteSearch(selectors.orderCatalog.type, 'Anthurium');
|
await page.autocompleteSearch(selectors.orderCatalog.type, 'Anthurium');
|
||||||
await page.waitForNumberOfElements('section.product', 4);
|
await page.waitForNumberOfElements('section.product', 4);
|
||||||
const result = await page.countElement('section.product');
|
const result = await page.countElement('section.product');
|
||||||
|
@ -70,6 +68,7 @@ describe('Order catalog', () => {
|
||||||
it('should remove the tag filters and have 4 results', async() => {
|
it('should remove the tag filters and have 4 results', async() => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.orderCatalog.fourthFilterRemoveButton);
|
await page.waitToClick(selectors.orderCatalog.fourthFilterRemoveButton);
|
||||||
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.orderCatalog.thirdFilterRemoveButton);
|
await page.waitToClick(selectors.orderCatalog.thirdFilterRemoveButton);
|
||||||
await page.waitForNumberOfElements('.product', 4);
|
await page.waitForNumberOfElements('.product', 4);
|
||||||
const result = await page.countElement('section.product');
|
const result = await page.countElement('section.product');
|
||||||
|
|
|
@ -40,10 +40,11 @@ describe('Order lines', () => {
|
||||||
|
|
||||||
it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => {
|
it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => {
|
||||||
await page.waitToClick(selectors.orderLine.confirmOrder);
|
await page.waitToClick(selectors.orderLine.confirmOrder);
|
||||||
await page.waitForURL('ticket/index');
|
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('ticket/index');
|
let hashPartOne = await page.expectURL('ticket/index');
|
||||||
expect(url.hash).toContain('clientFk');
|
let hashPartTwo = await page.expectURL('clientFk');
|
||||||
|
|
||||||
|
expect(hashPartOne).toBe(true);
|
||||||
|
expect(hashPartTwo).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,10 +19,9 @@ describe('Route create path', () => {
|
||||||
it('should click on the add new route button and open the creation form', async() => {
|
it('should click on the add new route button and open the creation form', async() => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
|
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
|
||||||
await page.wait(selectors.createRouteView.worker);
|
let url = await page.expectURL('#!/route/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/route/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should attempt to create a new route but fail since employee has no access rights`, async() => {
|
it(`should attempt to create a new route but fail since employee has no access rights`, async() => {
|
||||||
|
@ -43,10 +42,9 @@ describe('Route create path', () => {
|
||||||
|
|
||||||
it('should again click on the add new route button and open the creation form', async() => {
|
it('should again click on the add new route button and open the creation form', async() => {
|
||||||
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
|
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
|
||||||
await page.wait(selectors.createRouteView.worker);
|
let url = await page.expectURL('#!/route/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/route/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should create a new route`, async() => {
|
it(`should create a new route`, async() => {
|
||||||
|
@ -62,10 +60,9 @@ describe('Route create path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should confirm the redirection to the created route summary`, async() => {
|
it(`should confirm the redirection to the created route summary`, async() => {
|
||||||
await page.wait(selectors.routeSummary.routeId);
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,10 +31,9 @@ describe('InvoiceOut descriptor path', () => {
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.invoiceOutButton);
|
await page.waitToClick(selectors.globalItems.invoiceOutButton);
|
||||||
await page.wait(selectors.invoiceOutIndex.topbarSearch);
|
await page.wait(selectors.invoiceOutIndex.topbarSearch);
|
||||||
await page.waitForURL('#!/invoice-out/index');
|
let url = await page.expectURL('#!/invoice-out/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/invoice-out/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for the target invoiceOut', async() => {
|
it('should search for the target invoiceOut', async() => {
|
||||||
|
@ -49,10 +48,9 @@ describe('InvoiceOut descriptor path', () => {
|
||||||
|
|
||||||
it(`should click on the search result to access to the invoiceOut summary`, async() => {
|
it(`should click on the search result to access to the invoiceOut summary`, async() => {
|
||||||
await page.accessToSearchResult('T2222222');
|
await page.accessToSearchResult('T2222222');
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete the invoiceOut using the descriptor more menu', async() => {
|
it('should delete the invoiceOut using the descriptor more menu', async() => {
|
||||||
|
@ -65,9 +63,9 @@ describe('InvoiceOut descriptor path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have been relocated to the invoiceOut index', async() => {
|
it('should have been relocated to the invoiceOut index', async() => {
|
||||||
const url = await page.parsedUrl();
|
let url = await page.expectURL('#!/invoice-out/index');
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/invoice-out/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the deleted invouceOut to find no results`, async() => {
|
it(`should search for the deleted invouceOut to find no results`, async() => {
|
||||||
|
@ -83,10 +81,9 @@ describe('InvoiceOut descriptor path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||||
await page.wait(selectors.ticketsIndex.topbarSearch);
|
let url = await page.expectURL('#!/ticket/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/ticket/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for tickets with an specific invoiceOut to find no results', async() => {
|
it('should search for tickets with an specific invoiceOut to find no results', async() => {
|
||||||
|
@ -105,19 +102,17 @@ describe('InvoiceOut descriptor path', () => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||||
await page.waitToClick(selectors.globalItems.invoiceOutButton);
|
await page.waitToClick(selectors.globalItems.invoiceOutButton);
|
||||||
await page.wait(selectors.invoiceOutIndex.topbarSearch);
|
let url = await page.expectURL('#!/invoice-out/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/invoice-out/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search and access to the invoiceOut summary`, async() => {
|
it(`should search and access to the invoiceOut summary`, async() => {
|
||||||
await page.waitForContentLoaded();
|
await page.waitForContentLoaded();
|
||||||
await page.accessToSearchResult('T1111111');
|
await page.accessToSearchResult('T1111111');
|
||||||
await page.waitForURL('/summary');
|
let url = await page.expectURL('/summary');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toContain('/summary');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the invoiceOut is booked in the summary data`, async() => {
|
it(`should check the invoiceOut is booked in the summary data`, async() => {
|
||||||
|
@ -147,6 +142,7 @@ describe('InvoiceOut descriptor path', () => {
|
||||||
|
|
||||||
let expectedDate = `${day}/${month}/${today.getFullYear()}`;
|
let expectedDate = `${day}/${month}/${today.getFullYear()}`;
|
||||||
|
|
||||||
|
await page.waitForContentLoaded();
|
||||||
const result = await page
|
const result = await page
|
||||||
.waitToGetProperty(selectors.invoiceOutSummary.bookedLabel, 'innerText');
|
.waitToGetProperty(selectors.invoiceOutSummary.bookedLabel, 'innerText');
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,16 @@ describe('create client path', () => {
|
||||||
|
|
||||||
it('should access to the create client view by clicking the create-client floating button', async() => {
|
it('should access to the create client view by clicking the create-client floating button', async() => {
|
||||||
await page.waitToClick(selectors.clientsIndex.createClientButton);
|
await page.waitToClick(selectors.clientsIndex.createClientButton);
|
||||||
await page.wait(selectors.createClientView.createButton);
|
let url = await page.expectURL('#!/client/create');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/client/create');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should cancel the client creation to go back to clients index', async() => {
|
it('should cancel the client creation to go back to clients index', async() => {
|
||||||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||||
await page.wait(selectors.clientsIndex.createClientButton);
|
let url = await page.expectURL('#!/client/index');
|
||||||
const url = await page.parsedUrl();
|
|
||||||
|
|
||||||
expect(url.hash).toEqual('#!/client/index');
|
expect(url).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue