Merge branch '1798-e2e-extensions' of verdnatura/salix into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-02-05 11:59:10 +00:00 committed by Gitea
commit 84d6d7cec0
58 changed files with 880 additions and 918 deletions

View File

@ -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) {
@ -27,9 +34,9 @@ let actions = {
let langSelector = '.user-popover vn-autocomplete[ng-model="$ctrl.lang"]'; let langSelector = '.user-popover vn-autocomplete[ng-model="$ctrl.lang"]';
await this.waitToClick('#user'); await this.waitToClick('#user');
await this.wait(langSelector); await this.waitForSelector(`${langSelector} input`, {});
let lang = await this.waitToGetProperty(`${langSelector} input`, 'value');
let lang = await this.waitToGetProperty(langSelector, 'value');
if (lang !== 'English') if (lang !== 'English')
await this.autocompleteSearch(langSelector, 'English'); await this.autocompleteSearch(langSelector, 'English');
@ -38,17 +45,17 @@ let actions = {
}, },
doLogin: async function(userName, password = 'nightmare') { doLogin: async function(userName, password = 'nightmare') {
await this.wait(`vn-login [ng-model="$ctrl.user"]`); await this.waitForSelector(`vn-login vn-textfield[ng-model="$ctrl.user"]`, {visible: true});
await this.clearInput(`vn-login [ng-model="$ctrl.user"]`); await this.clearInput(`vn-login vn-textfield[ng-model="$ctrl.user"]`);
await this.write(`vn-login [ng-model="$ctrl.user"]`, userName); await this.write(`vn-login vn-textfield[ng-model="$ctrl.user"]`, userName);
await this.clearInput(`vn-login [ng-model="$ctrl.password"]`); await this.clearInput(`vn-login vn-textfield[ng-model="$ctrl.password"]`);
await this.write(`vn-login [ng-model="$ctrl.password"]`, password); await this.write(`vn-login vn-textfield[ng-model="$ctrl.password"]`, password);
await this.click('vn-login button[type=submit]'); await this.waitToClick('vn-login button[type=submit]');
}, },
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(() => {
@ -59,7 +66,7 @@ let actions = {
} }
await this.doLogin(userName); await this.doLogin(userName);
await this.wait(() => { await this.waitForFunction(() => {
return document.location.hash === '#!/'; return document.location.hash === '#!/';
}, {}); }, {});
await this.changeLanguageToEnglish(); await this.changeLanguageToEnglish();
@ -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) {
@ -104,14 +111,14 @@ let actions = {
}, },
clearTextarea: async function(selector) { clearTextarea: async function(selector) {
await this.wait(selector); await this.waitForSelector(selector, {visible: true});
await this.evaluate(inputSelector => { await this.evaluate(inputSelector => {
return document.querySelector(inputSelector).value = ''; return document.querySelector(`${inputSelector} textarea`).value = '';
}, selector); }, selector);
}, },
clearInput: async function(selector) { clearInput: async function(selector) {
await this.wait(selector); await this.waitForSelector(selector, {visible: true});
let field = await this.evaluate(selector => { let field = await this.evaluate(selector => {
return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field; return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field;
}, selector); }, selector);
@ -136,38 +143,50 @@ let actions = {
}, },
waitPropertyLength: async function(selector, property, minLength) { waitPropertyLength: async function(selector, property, minLength) {
await this.wait((selector, property, minLength) => { await this.waitForFunction((selector, property, minLength) => {
const element = document.querySelector(selector); const element = document.querySelector(selector);
return element && element[property] != null && element[property] !== '' && element[property].length >= minLength; return element && element[property] != null && element[property] !== '' && element[property].length >= minLength;
}, {}, selector, property, minLength); }, {}, selector, property, minLength);
return await this.getProperty(selector, property); return await this.getProperty(selector, property);
}, },
waitPropertyValue: async function(selector, property, status) { expectPropertyValue: async function(selector, property, value) {
await this.waitForSelector(selector); let builtSelector = selector;
return await this.waitForFunction((selector, property, status) => { if (property != 'innerText')
const element = document.querySelector(selector); builtSelector = await this.selectorFormater(selector);
return element[property] === status;
}, {}, selector, property, status); try {
return await this.waitForFunction((selector, property, value) => {
const element = document.querySelector(selector);
return element[property] == value;
}, {}, builtSelector, property, value);
} catch (error) {
throw new Error(`${value} wasn't the value of ${builtSelector}, ${error}`);
}
}, },
waitToGetProperty: async function(selector, property) { waitToGetProperty: async function(selector, property) {
let builtSelector = selector;
if (property != 'innerText')
builtSelector = await this.selectorFormater(selector);
try { try {
await this.waitForFunction((selector, property) => { await this.waitForFunction((selector, property) => {
const element = document.querySelector(selector); const element = document.querySelector(selector);
return element && element[property] != null && element[property] !== ''; return element && element[property] != null && element[property] !== '';
}, {}, selector, property); }, {}, builtSelector, property);
return await this.getProperty(selector, property); return await this.getProperty(builtSelector, property);
} catch (error) { } catch (error) {
throw new Error(`couldn't get property: ${property} of ${selector}`); throw new Error(`couldn't get property: ${property} of ${builtSelector}, ${error}`);
} }
}, },
write: async function(selector, text) { write: async function(selector, text) {
let builtSelector = await this.selectorFormater(selector);
await this.waitForSelector(selector, {}); await this.waitForSelector(selector, {});
await this.type(`${selector} input`, text); await this.type(builtSelector, text);
await this.waitForTextInInput(selector, text); await this.waitForTextInField(selector, text);
}, },
waitToClick: async function(selector) { waitToClick: async function(selector) {
@ -253,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);
}, },
@ -274,17 +293,33 @@ 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);
}, },
waitForTextInInput: async function(selector, text) { selectorFormater: async function(selector) {
await this.wait(selector); let builtSelector = `${selector} input`;
return await this.wait((selector, text) => {
return document.querySelector(`${selector} input`).value.toLowerCase().includes(text.toLowerCase()); if (selector.includes('vn-autocomplete'))
}, {}, selector, text); return builtSelector = `${selector} input`;
if (selector.includes('vn-textarea'))
return builtSelector = `${selector} textarea`;
if (selector.includes('vn-textfield'))
return builtSelector = `${selector} input`;
return builtSelector;
},
waitForTextInField: async function(selector, text) {
let builtSelector = await this.selectorFormater(selector);
await this.waitForSelector(builtSelector);
return await this.waitForFunction((selector, text) => {
return document.querySelector(selector).value.toLowerCase().includes(text.toLowerCase());
}, {}, builtSelector, text);
}, },
waitForInnerText: async function(selector) { waitForInnerText: async function(selector) {
@ -304,12 +339,6 @@ let actions = {
}, selector); }, selector);
}, },
waitForURL: async function(hashURL) {
await this.waitForFunction(expectedHash => {
return document.location.hash.includes(expectedHash);
}, {}, hashURL);
},
hideSnackbar: async function() { hideSnackbar: async function() {
await this.waitToClick('#shapes .shown button'); await this.waitToClick('#shapes .shown button');
}, },
@ -326,7 +355,7 @@ let actions = {
}, },
waitForLastSnackbar: async function() { waitForLastSnackbar: async function() {
await this.wait(2000); // this needs a refactor to be somehow dynamic ie: page.waitForResponse(urlOrPredicate[, options]) or something to fire waitForLastShape once the request is completed await this.waitFor(1000); // this needs a refactor to be somehow dynamic ie: page.waitForResponse(urlOrPredicate[, options]) or something to fire waitForLastShape once the request is completed
await this.waitForSpinnerLoad(); await this.waitForSpinnerLoad();
return await this.waitForLastShape('vn-snackbar .shown .text'); return await this.waitForLastShape('vn-snackbar .shown .text');
}, },
@ -359,18 +388,20 @@ let actions = {
return navButton.click(); return navButton.click();
}, sectionRoute); }, sectionRoute);
await this.waitForNavigation({waitUntil: ['networkidle0']}); await this.waitForNavigation({waitUntil: ['networkidle0']});
await this.waitForContentLoaded();
}, },
autocompleteSearch: async function(selector, searchValue) { autocompleteSearch: async function(selector, searchValue) {
let builtSelector = await this.selectorFormater(selector);
try { try {
await this.waitToClick(`${selector} input`); await this.waitToClick(builtSelector);
await this.waitForSelector(selector => { await this.waitForSelector(selector => {
document document
.querySelector(`${selector} vn-drop-down`).$ctrl.content .querySelector(`${selector} vn-drop-down`).$ctrl.content
.querySelectorAll('li'); .querySelectorAll('li');
}, selector); }, selector);
await this.write(`.vn-drop-down.shown`, searchValue); await this.type(`.vn-drop-down.shown`, searchValue);
await this.waitForFunction((selector, searchValue) => { await this.waitForFunction((selector, searchValue) => {
let element = document let element = document
.querySelector(`${selector} vn-drop-down`).$ctrl.content .querySelector(`${selector} vn-drop-down`).$ctrl.content
@ -381,11 +412,11 @@ let actions = {
await this.keyboard.press('Enter'); await this.keyboard.press('Enter');
await this.waitForFunction((selector, searchValue) => { await this.waitForFunction((selector, searchValue) => {
return document.querySelector(`${selector} input`).value.toLowerCase() return document.querySelector(selector).value.toLowerCase()
.includes(searchValue.toLowerCase()); .includes(searchValue.toLowerCase());
}, {}, selector, searchValue); }, {}, builtSelector, searchValue);
} catch (error) { } catch (error) {
throw new Error(`${selector} failed to autocomplete ${searchValue}! ${error}`); throw new Error(`${builtSelector} failed to autocomplete ${searchValue}! ${error}`);
} }
await this.waitForMutation(`.vn-drop-down`, 'childList'); await this.waitForMutation(`.vn-drop-down`, 'childList');
}, },
@ -426,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;

View File

@ -4,13 +4,14 @@ 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 = !process.env.E2E_SHOW;
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];

View File

@ -21,25 +21,25 @@ export default {
acceptButton: '.vn-confirm.shown button[response=accept]' acceptButton: '.vn-confirm.shown button[response=accept]'
}, },
clientsIndex: { clientsIndex: {
searchClientInput: 'vn-topbar', topbarSearch: 'vn-topbar',
searchButton: 'vn-searchbar vn-icon[icon="search"]', searchButton: 'vn-searchbar vn-icon[icon="search"]',
searchResult: 'vn-client-index .vn-item', searchResult: 'vn-client-index .vn-item',
createClientButton: `vn-float-button`, createClientButton: `vn-float-button`,
othersButton: 'vn-left-menu li[name="Others"] > a' othersButton: 'vn-left-menu li[name="Others"] > a'
}, },
createClientView: { createClientView: {
name: `vn-client-create [ng-model="$ctrl.client.name"]`, name: 'vn-client-create vn-textfield[ng-model="$ctrl.client.name"]',
taxNumber: 'vn-client-create [ng-model="$ctrl.client.fi"]', taxNumber: 'vn-client-create vn-textfield[ng-model="$ctrl.client.fi"]',
socialName: 'vn-client-create [ng-model="$ctrl.client.socialName"]', socialName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.socialName"]',
street: 'vn-client-create [ng-model="$ctrl.client.street"]', street: 'vn-client-create vn-textfield[ng-model="$ctrl.client.street"]',
postcode: 'vn-client-create [ng-model="$ctrl.client.postcode"]', postcode: 'vn-client-create vn-textfield[ng-model="$ctrl.client.postcode"]',
city: 'vn-client-create [ng-model="$ctrl.client.city"]', city: 'vn-client-create vn-textfield[ng-model="$ctrl.client.city"]',
province: `vn-autocomplete[ng-model="$ctrl.client.provinceFk"]`, province: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
country: `vn-autocomplete[ng-model="$ctrl.client.countryFk"]`, country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
userName: 'vn-client-create [ng-model="$ctrl.client.userName"]', userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]',
email: 'vn-client-create [ng-model="$ctrl.client.email"]', email: 'vn-client-create vn-textfield[ng-model="$ctrl.client.email"]',
salesPersonAutocomplete: `vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]`, salesPerson: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
createButton: `button[type=submit]`, createButton: 'vn-client-create button[type=submit]',
cancelButton: 'vn-button[href="#!/client/index"]' cancelButton: 'vn-button[href="#!/client/index"]'
}, },
clientDescriptor: { clientDescriptor: {
@ -48,78 +48,76 @@ export default {
}, },
clientBasicData: { clientBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]', basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]',
nameInput: 'vn-client-basic-data [ng-model="$ctrl.client.name"]', name: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.name"]',
contactInput: 'vn-client-basic-data [ng-model="$ctrl.client.contact"]', contact: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.contact"]',
phoneInput: 'vn-client-basic-data [ng-model="$ctrl.client.phone"]', email: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.email"]',
mobileInput: 'vn-client-basic-data [ng-model="$ctrl.client.mobile"]', salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
emailInput: 'vn-client-basic-data [ng-model="$ctrl.client.email"]', channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
salesPersonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]', saveButton: 'vn-client-basic-data button[type=submit]'
channelAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
saveButton: `button[type=submit]`
}, },
clientFiscalData: { clientFiscalData: {
fiscalDataButton: 'vn-left-menu a[ui-sref="client.card.fiscalData"]', fiscalDataButton: 'vn-left-menu a[ui-sref="client.card.fiscalData"]',
socialNameInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.socialName"]', socialName: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.socialName"]',
fiscalIdInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.fi"]', fiscalId: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.fi"]',
equalizationTaxCheckbox: 'vn-check[ng-model="$ctrl.client.isEqualizated"]', equalizationTaxCheckbox: 'vn-client-fiscal-data vn-check[ng-model="$ctrl.client.isEqualizated"]',
acceptPropagationButton: '.vn-confirm.shown button[response=accept]', acceptPropagationButton: '.vn-confirm.shown button[response=accept]',
address: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.street"]',
postcode: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.postcode"]',
city: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.city"]',
province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
activeCheckbox: 'vn-client-fiscal-data vn-check[label="Active"]',
frozenCheckbox: 'vn-client-fiscal-data vn-check[label="Frozen"]',
invoiceByAddressCheckbox: 'vn-client-fiscal-data vn-check[label="Invoice by address"]',
verifiedDataCheckbox: 'vn-client-fiscal-data vn-check[label="Verified data"]',
hasToInvoiceCheckbox: 'vn-client-fiscal-data vn-check[label="Has to invoice"]',
invoiceByMailCheckbox: 'vn-client-fiscal-data vn-check[label="Invoice by mail"]',
viesCheckbox: 'vn-client-fiscal-data vn-check[label="Vies"]',
saveButton: 'button[type=submit]',
acceptDuplicationButton: '.vn-confirm.shown button[response=accept]', acceptDuplicationButton: '.vn-confirm.shown button[response=accept]',
addressInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.street"]',
postcodeInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.postcode"]',
cityInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.city"]',
provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
countryAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
activeCheckbox: 'vn-check[label="Active"]',
frozenCheckbox: 'vn-check[label="Frozen"]',
invoiceByAddressCheckbox: 'vn-check[label="Invoice by address"]',
verifiedDataCheckbox: 'vn-check[label="Verified data"]',
hasToInvoiceCheckbox: 'vn-check[label="Has to invoice"]',
invoiceByMailCheckbox: 'vn-check[label="Invoice by mail"]',
viesCheckbox: 'vn-check[label="Vies"]',
saveButton: `button[type=submit]`,
watcher: 'vn-client-fiscal-data vn-watcher' watcher: 'vn-client-fiscal-data vn-watcher'
}, },
clientBillingData: { clientBillingData: {
payMethodAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]', payMethod: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
IBANInput: 'vn-client-billing-data [ng-model="$ctrl.client.iban"]', IBAN: 'vn-client-billing-data vn-textfield[ng-model="$ctrl.client.iban"]',
dueDayInput: 'vn-client-billing-data [ng-model="$ctrl.client.dueDay"]', dueDay: 'vn-client-billing-data vn-input-number[ng-model="$ctrl.client.dueDay"]',
receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]', receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]',
receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]', receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]',
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]', receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]', swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
clearswiftBicButton: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"] .icons > vn-icon[icon=clear]', clearswiftBicButton: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"] .icons > vn-icon[icon=clear]',
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button', newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
newBankEntityName: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.name"]', newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.name"]',
newBankEntityBIC: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.bic"]', newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.bic"]',
newBankEntityCode: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.id"]', newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.id"]',
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]', acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
saveButton: `button[type=submit]`, saveButton: `button[type=submit]`,
watcher: 'vn-client-billing-data vn-watcher' watcher: 'vn-client-billing-data vn-watcher'
}, },
clientAddresses: { clientAddresses: {
addressesButton: 'vn-left-menu a[ui-sref="client.card.address.index"]', addressesButton: 'vn-left-menu a[ui-sref="client.card.address.index"]',
createAddress: `vn-client-address-index vn-float-button`, createAddress: 'vn-client-address-index vn-float-button',
defaultCheckboxInput: 'vn-check[label="Default"]', defaultCheckbox: 'vn-check[label="Default"]',
consigneeInput: '[ng-model="$ctrl.address.nickname"]', consignee: 'vn-textfield[ng-model="$ctrl.address.nickname"]',
streetAddressInput: '[ng-model="$ctrl.address.street"]', streetAddress: 'vn-textfield[ng-model="$ctrl.address.street"]',
postcodeInput: '[ng-model="$ctrl.address.postalCode"]', postcode: 'vn-textfield[ng-model="$ctrl.address.postalCode"]',
cityInput: '[ng-model="$ctrl.address.city"]', city: 'vn-textfield[ng-model="$ctrl.address.city"]',
provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]', province: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]',
agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]', agency: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]',
phoneInput: '[ng-model="$ctrl.address.phone"]', phone: 'vn-textfield[ng-model="$ctrl.address.phone"]',
mobileInput: '[ng-model="$ctrl.address.mobile"]', mobileInput: 'vn-textfield[ng-model="$ctrl.address.mobile"]',
defaultAddress: 'vn-client-address-index div:nth-child(1) div[name="street"]', defaultAddress: 'vn-client-address-index div:nth-child(1) div[name="street"]',
incotermsAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.incotermsId"]', incoterms: 'vn-autocomplete[ng-model="$ctrl.address.incotermsId"]',
customsAgentAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.customsAgentId"]', customsAgent: 'vn-autocomplete[ng-model="$ctrl.address.customsAgentId"]',
secondMakeDefaultStar: 'vn-client-address-index vn-card div:nth-child(2) vn-icon-button[icon="star_border"]', secondMakeDefaultStar: 'vn-client-address-index vn-card div:nth-child(2) vn-icon-button[icon="star_border"]',
firstEditAddress: 'vn-client-address-index div:nth-child(1) > a', firstEditAddress: 'vn-client-address-index div:nth-child(1) > a',
secondEditAddress: 'vn-client-address-index div:nth-child(2) > a', secondEditAddress: 'vn-client-address-index div:nth-child(2) > a',
activeCheckbox: 'vn-check[label="Enabled"]', activeCheckbox: 'vn-check[label="Enabled"]',
equalizationTaxCheckbox: 'vn-client-address-edit vn-check[label="Is equalizated"]', equalizationTaxCheckbox: 'vn-client-address-edit vn-check[label="Is equalizated"]',
firstObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) [ng-model="observation.observationTypeFk"]', firstObservationType: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) vn-autocomplete[ng-model="observation.observationTypeFk"]',
firstObservationDescriptionInput: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) [ng-model="observation.description"]', firstObservationDescription: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) vn-textfield[ng-model="observation.description"]',
secondObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) [ng-model="observation.observationTypeFk"]', secondObservationType: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) vn-autocomplete[ng-model="observation.observationTypeFk"]',
secondObservationDescriptionInput: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) [ng-model="observation.description"]', secondObservationDescription: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) vn-textfield[ng-model="observation.description"]',
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]', addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
saveButton: 'button[type=submit]', saveButton: 'button[type=submit]',
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]', cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
@ -129,26 +127,26 @@ export default {
clientWebAccess: { clientWebAccess: {
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]', webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
enableWebAccessCheckbox: 'vn-check[label="Enable web access"]', enableWebAccessCheckbox: 'vn-check[label="Enable web access"]',
userNameInput: 'vn-client-web-access [ng-model="$ctrl.account.name"]', userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]',
saveButton: 'button[type=submit]' saveButton: 'button[type=submit]'
}, },
clientNotes: { clientNotes: {
addNoteFloatButton: 'vn-float-button', addNoteFloatButton: 'vn-float-button',
noteInput: '[ng-model="$ctrl.note.text"]', note: 'vn-textarea[ng-model="$ctrl.note.text"]',
saveButton: 'button[type=submit]', saveButton: 'button[type=submit]',
firstNoteText: 'vn-client-note .text' firstNoteText: 'vn-client-note .text'
}, },
clientCredit: { clientCredit: {
addCreditFloatButton: 'vn-float-button', addCreditFloatButton: 'vn-float-button',
creditInput: 'vn-client-credit-create [ng-model="$ctrl.client.credit"]', credit: 'vn-client-credit-create vn-input-number[ng-model="$ctrl.client.credit"]',
saveButton: 'button[type=submit]', firstCreditText: 'vn-client-credit-index vn-card vn-table vn-tbody > vn-tr',
firstCreditText: 'vn-client-credit-index vn-card vn-table vn-tbody > vn-tr' saveButton: 'button[type=submit]'
}, },
clientGreuge: { clientGreuge: {
addGreugeFloatButton: 'vn-float-button', addGreugeFloatButton: 'vn-float-button',
amountInput: 'vn-client-greuge-create [ng-model="$ctrl.greuge.amount"]', amount: 'vn-client-greuge-create vn-input-number[ng-model="$ctrl.greuge.amount"]',
descriptionInput: 'vn-client-greuge-create [ng-model="$ctrl.greuge.description"]', description: 'vn-client-greuge-create vn-textfield[ng-model="$ctrl.greuge.description"]',
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]', type: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]',
saveButton: 'button[type=submit]', saveButton: 'button[type=submit]',
firstGreugeText: 'vn-client-greuge-index vn-card vn-table vn-tbody > vn-tr' firstGreugeText: 'vn-client-greuge-index vn-card vn-table vn-tbody > vn-tr'
}, },
@ -167,10 +165,10 @@ export default {
}, },
clientBalance: { clientBalance: {
balanceButton: 'vn-left-menu a[ui-sref="client.card.balance.index"]', balanceButton: 'vn-left-menu a[ui-sref="client.card.balance.index"]',
companyAutocomplete: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]', company: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]',
newPaymentButton: `vn-float-button`, newPaymentButton: `vn-float-button`,
newPaymentBank: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]', newPaymentBank: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]',
newPaymentAmountInput: '.vn-dialog.shown [ng-model="$ctrl.receipt.amountPaid"]', newPaymentAmount: '.vn-dialog.shown vn-input-number[ng-model="$ctrl.receipt.amountPaid"]',
saveButton: '.vn-dialog.shown vn-button[label="Save"]', saveButton: '.vn-dialog.shown vn-button[label="Save"]',
firstBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)' firstBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)'
@ -192,7 +190,7 @@ export default {
searchResultPreviewButton: 'vn-item-index .buttons > [icon="desktop_windows"]', searchResultPreviewButton: 'vn-item-index .buttons > [icon="desktop_windows"]',
searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]', searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]',
acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]', acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]',
searchItemInput: 'vn-searchbar', topbarSearch: 'vn-topbar',
searchButton: 'vn-searchbar vn-icon[icon="search"]', searchButton: 'vn-searchbar vn-icon[icon="search"]',
closeItemSummaryPreview: '.vn-popup.shown', closeItemSummaryPreview: '.vn-popup.shown',
fieldsToShowButton: 'vn-item-index vn-table > div > div > vn-icon-button[icon="menu"]', fieldsToShowButton: 'vn-item-index vn-table > div > div > vn-icon-button[icon="menu"]',
@ -214,10 +212,10 @@ export default {
saveFieldsButton: '.vn-dialog.shown vn-horizontal:nth-child(16) > vn-button > button' saveFieldsButton: '.vn-dialog.shown vn-horizontal:nth-child(16) > vn-button > button'
}, },
itemCreateView: { itemCreateView: {
temporalName: 'vn-item-create [ng-model="$ctrl.item.provisionalName"]', temporalName: 'vn-item-create vn-textfield[ng-model="$ctrl.item.provisionalName"]',
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]', type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]', intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]', origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
createButton: 'button[type=submit]', createButton: 'button[type=submit]',
cancelButton: 'vn-button[ui-sref="item.index"]' cancelButton: 'vn-button[ui-sref="item.index"]'
}, },
@ -225,8 +223,8 @@ export default {
goBackToModuleIndexButton: 'vn-item-descriptor a[href="#!/item/index"]', goBackToModuleIndexButton: 'vn-item-descriptor a[href="#!/item/index"]',
moreMenu: 'vn-item-descriptor vn-icon-menu[icon=more_vert]', moreMenu: 'vn-item-descriptor vn-icon-menu[icon=more_vert]',
moreMenuRegularizeButton: '.vn-drop-down.shown li[name="Regularize stock"]', moreMenuRegularizeButton: '.vn-drop-down.shown li[name="Regularize stock"]',
regularizeQuantityInput: '.vn-dialog.shown [ng-model="$ctrl.quantity"]', regularizeQuantity: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.quantity"]',
regularizeWarehouseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]', regularizeWarehouse: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
editButton: 'vn-item-descriptor vn-float-button[icon="edit"]', editButton: 'vn-item-descriptor vn-float-button[icon="edit"]',
regularizeSaveButton: '.vn-dialog.shown tpl-buttons > button', regularizeSaveButton: '.vn-dialog.shown tpl-buttons > button',
inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]', inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]',
@ -235,13 +233,13 @@ export default {
itemBasicData: { itemBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="item.card.basicData"]', basicDataButton: 'vn-left-menu a[ui-sref="item.card.basicData"]',
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]', type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]', intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
nameInput: 'vn-item-basic-data [ng-model="$ctrl.item.name"]', name: 'vn-item-basic-data vn-textfield[ng-model="$ctrl.item.name"]',
relevancyInput: 'vn-item-basic-data [ng-model="$ctrl.item.relevancy"]', relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]',
originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]', origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
expenseAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]', expense: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]',
longNameInput: 'vn-textfield[ng-model="$ctrl.item.longName"]', longName: 'vn-textfield[ng-model="$ctrl.item.longName"]',
isActiveCheckbox: 'vn-check[label="Active"]', isActiveCheckbox: 'vn-check[label="Active"]',
priceInKgCheckbox: 'vn-check[label="Price in kg"]', priceInKgCheckbox: 'vn-check[label="Price in kg"]',
submitBasicDataButton: `button[type=submit]` submitBasicDataButton: `button[type=submit]`
@ -249,50 +247,50 @@ export default {
itemTags: { itemTags: {
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
tagsButton: 'vn-left-menu a[ui-sref="item.card.tags"]', tagsButton: 'vn-left-menu a[ui-sref="item.card.tags"]',
fourthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]', fourthTag: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]',
fourthValueInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.value"]', fourthValue: 'vn-item-tags vn-horizontal:nth-child(4) vn-textfield[ng-model="itemTag.value"]',
fourthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]', fourthRelevancy: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]',
fourthRemoveTagButton: 'vn-item-tags vn-horizontal:nth-child(4) vn-icon-button[icon="delete"]', fourthRemoveTagButton: 'vn-item-tags vn-horizontal:nth-child(4) vn-icon-button[icon="delete"]',
fifthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]', fifthTag: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]',
fifthValueInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.value"]', fifthValue: 'vn-item-tags vn-horizontal:nth-child(5) vn-textfield[ng-model="itemTag.value"]',
fifthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.priority"]', fifthRelevancy: 'vn-item-tags vn-horizontal:nth-child(5) vn-textfield[ng-model="itemTag.priority"]',
sixthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]', sixthTag: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]',
sixthValueInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.value"]', sixthValue: 'vn-item-tags vn-horizontal:nth-child(6) vn-textfield[ng-model="itemTag.value"]',
sixthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.priority"]', sixthRelevancy: 'vn-item-tags vn-horizontal:nth-child(6) vn-textfield[ng-model="itemTag.priority"]',
seventhTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]', seventhTag: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]',
seventhValueInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.value"]', seventhValue: 'vn-item-tags vn-horizontal:nth-child(7) vn-textfield[ng-model="itemTag.value"]',
seventhRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.priority"]', seventhRelevancy: 'vn-item-tags vn-horizontal:nth-child(7) vn-textfield[ng-model="itemTag.priority"]',
addItemTagButton: 'vn-item-tags vn-icon-button[icon="add_circle"]', addItemTagButton: 'vn-item-tags vn-icon-button[icon="add_circle"]',
submitItemTagsButton: 'vn-item-tags button[type=submit]' submitItemTagsButton: 'vn-item-tags button[type=submit]'
}, },
itemTax: { itemTax: {
undoChangesButton: 'vn-item-tax vn-button-bar > vn-button[label="Undo changes"]', undoChangesButton: 'vn-item-tax vn-button-bar > vn-button[label="Undo changes"]',
firstClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]', firstClass: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]',
secondClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]', secondClass: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]',
thirdClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]', thirdClass: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]',
submitTaxButton: 'vn-item-tax button[type=submit]' submitTaxButton: 'vn-item-tax button[type=submit]'
}, },
itemBarcodes: { itemBarcodes: {
addBarcodeButton: 'vn-item-barcode vn-icon[icon="add_circle"]', addBarcodeButton: 'vn-item-barcode vn-icon[icon="add_circle"]',
thirdCodeInput: 'vn-item-barcode vn-horizontal:nth-child(3) [ng-model="barcode.code"]', thirdCode: 'vn-item-barcode vn-horizontal:nth-child(3) vn-textfield[ng-model="barcode.code"]',
submitBarcodesButton: 'vn-item-barcode button[type=submit]', submitBarcodesButton: 'vn-item-barcode button[type=submit]',
firstCodeRemoveButton: 'vn-item-barcode vn-horizontal vn-none vn-icon[icon="delete"]' firstCodeRemoveButton: 'vn-item-barcode vn-horizontal vn-none vn-icon[icon="delete"]'
}, },
itemNiches: { itemNiches: {
addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]', addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]',
firstWarehouseAutocomplete: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]', firstWarehouse: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
firstCodeInput: 'vn-item-niche vn-horizontal:nth-child(1) [ng-model="niche.code"]', firstCode: 'vn-item-niche vn-horizontal:nth-child(1) vn-textfield[ng-model="niche.code"]',
secondWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]', secondWarehouse: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
secondCodeInput: 'vn-item-niche vn-horizontal:nth-child(2) [ng-model="niche.code"]', secondCode: 'vn-item-niche vn-horizontal:nth-child(2) vn-textfield[ng-model="niche.code"]',
secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]', secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]',
thirdWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]', thirdWarehouse: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
thirdCodeInput: 'vn-item-niche vn-horizontal:nth-child(3) [ng-model="niche.code"]', thirdCode: 'vn-item-niche vn-horizontal:nth-child(3) vn-textfield[ng-model="niche.code"]',
submitNichesButton: 'vn-item-niche button[type=submit]' submitNichesButton: 'vn-item-niche button[type=submit]'
}, },
itemBotanical: { itemBotanical: {
botanicalInput: 'vn-item-botanical vn-horizontal:nth-child(1) [ng-model="$ctrl.botanical.botanical"]', botanical: 'vn-item-botanical vn-horizontal:nth-child(1) vn-textfield[ng-model="$ctrl.botanical.botanical"]',
genusAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]', genus: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
speciesAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]', species: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
submitBotanicalButton: `vn-item-botanical button[type=submit]` submitBotanicalButton: `vn-item-botanical button[type=submit]`
}, },
itemSummary: { itemSummary: {
@ -307,7 +305,7 @@ export default {
secondTicketId: 'vn-item-diary vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > span', secondTicketId: 'vn-item-diary vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > span',
firstBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(1) > vn-td.balance', firstBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(1) > vn-td.balance',
fourthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(4) > vn-td.balance', fourthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(4) > vn-td.balance',
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]', warehouse: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
}, },
itemLog: { itemLog: {
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr', anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
@ -331,29 +329,27 @@ export default {
}, },
ticketsIndex: { ticketsIndex: {
openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]', openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]',
advancedSearchInvoiceOut: 'vn-ticket-search-panel [ng-model="filter.refFk"]', advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"]',
newTicketButton: 'vn-ticket-index > a', newTicketButton: 'vn-ticket-index > a',
searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr', searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr', searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)', searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)',
searchTicketInput: 'vn-searchbar', topbarSearch: 'vn-searchbar',
searchWeeklyClearInput: 'vn-searchbar vn-icon[icon=clear]',
advancedSearchButton: 'vn-ticket-search-panel button[type=submit]', advancedSearchButton: 'vn-ticket-search-panel button[type=submit]',
searchButton: 'vn-searchbar vn-icon[icon="search"]', searchButton: 'vn-searchbar vn-icon[icon="search"]',
searchWeeklyButton: 'vn-searchbar vn-icon[icon="search"]', searchWeeklyButton: 'vn-searchbar vn-icon[icon="search"]',
moreMenu: 'vn-ticket-index vn-icon-menu[icon=more_vert]', moreMenu: 'vn-ticket-index vn-icon-menu[icon=more_vert]',
menuWeeklyTickets: 'vn-left-menu [ui-sref="ticket.weekly.index"]',
sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6)', sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6)',
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr', weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]', firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]' acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]'
}, },
createTicketView: { createTicketView: {
clientAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientId"]', client: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientId"]',
addressAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressId"]', address: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressId"]',
deliveryDateInput: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]', deliveryDate: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]',
warehouseAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseId"]', warehouse: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseId"]',
agencyAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.agencyModeId"]', agency: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
createButton: `button[type=submit]` createButton: `button[type=submit]`
}, },
ticketDescriptor: { ticketDescriptor: {
@ -368,7 +364,7 @@ export default {
moreMenuMakeInvoice: '.vn-drop-down.shown li[name="Make invoice"]', moreMenuMakeInvoice: '.vn-drop-down.shown li[name="Make invoice"]',
moreMenuChangeShippedHour: '.vn-drop-down.shown li[name="Change shipped hour"]', moreMenuChangeShippedHour: '.vn-drop-down.shown li[name="Change shipped hour"]',
changeShippedHourDialog: '.vn-dialog.shown', changeShippedHourDialog: '.vn-dialog.shown',
changeShippedHourInput: '.vn-dialog.shown [ng-model="$ctrl.newShipped"]', changeShippedHour: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newShipped"]',
addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr', addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr',
shipButton: 'vn-ticket-descriptor vn-icon[icon="icon-stowaway"]', shipButton: 'vn-ticket-descriptor vn-icon[icon="icon-stowaway"]',
thursdayButton: '.vn-popup.shown vn-tool-bar > vn-button:nth-child(4)', thursdayButton: '.vn-popup.shown vn-tool-bar > vn-button:nth-child(4)',
@ -382,8 +378,8 @@ export default {
ticketNotes: { ticketNotes: {
firstNoteRemoveButton: 'vn-icon[icon="delete"]', firstNoteRemoveButton: 'vn-icon[icon="delete"]',
addNoteButton: 'vn-icon[icon="add_circle"]', addNoteButton: 'vn-icon[icon="add_circle"]',
firstNoteTypeAutocomplete: 'vn-autocomplete[ng-model="observation.observationTypeFk"]', firstNoteType: 'vn-autocomplete[ng-model="observation.observationTypeFk"]',
firstDescriptionInput: 'vn-ticket-observation [ng-model="observation.description"]', firstDescription: 'vn-ticket-observation vn-textfield[ng-model="observation.description"]',
submitNotesButton: 'button[type=submit]' submitNotesButton: 'button[type=submit]'
}, },
ticketExpedition: { ticketExpedition: {
@ -394,8 +390,8 @@ export default {
}, },
ticketPackages: { ticketPackages: {
packagesButton: 'vn-left-menu a[ui-sref="ticket.card.package"]', packagesButton: 'vn-left-menu a[ui-sref="ticket.card.package"]',
firstPackageAutocomplete: 'vn-autocomplete[label="Package"]', firstPackage: 'vn-autocomplete[label="Package"]',
firstQuantityInput: 'vn-ticket-package vn-horizontal:nth-child(1) [ng-model="package.quantity"]', firstQuantity: 'vn-ticket-package vn-horizontal:nth-child(1) vn-input-number[ng-model="package.quantity"]',
firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]', firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]',
addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]', addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]',
clearPackageAutocompleteButton: 'vn-autocomplete[label="Package"] .icons > vn-icon[icon=clear]', clearPackageAutocompleteButton: 'vn-autocomplete[label="Package"] .icons > vn-icon[icon=clear]',
@ -462,21 +458,18 @@ export default {
}, },
ticketTracking: { ticketTracking: {
trackingButton: 'vn-left-menu a[ui-sref="ticket.card.tracking.index"]', trackingButton: 'vn-left-menu a[ui-sref="ticket.card.tracking.index"]',
createStateButton: `vn-float-button`, createStateButton: 'vn-float-button',
stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[ng-model="$ctrl.stateFk"]', saveButton: 'button[type=submit]',
saveButton: `button[type=submit]`,
cancelButton: 'vn-ticket-tracking-edit vn-button[ui-sref="ticket.card.tracking.index"]' cancelButton: 'vn-ticket-tracking-edit vn-button[ui-sref="ticket.card.tracking.index"]'
}, },
ticketBasicData: { ticketBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="ticket.card.basicData.stepOne"]', basicDataButton: 'vn-left-menu a[ui-sref="ticket.card.basicData.stepOne"]',
clientAutocomplete: 'vn-autocomplete[ng-model="$ctrl.clientFk"]', agency: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
addressAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.addressFk"]', zone: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
zoneAutocomplete: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
nextStepButton: 'vn-step-control .buttons > section:last-child vn-button', nextStepButton: 'vn-step-control .buttons > section:last-child vn-button',
finalizeButton: 'vn-step-control .buttons > section:last-child button[type=submit]', finalizeButton: 'vn-step-control .buttons > section:last-child button[type=submit]',
stepTwoTotalPriceDif: 'vn-ticket-basic-data-step-two vn-tfoot > vn-tr > :nth-child(6)', stepTwoTotalPriceDif: 'vn-ticket-basic-data-step-two vn-tfoot > vn-tr > :nth-child(6)',
chargesReasonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.option"]', chargesReason: 'vn-autocomplete[ng-model="$ctrl.ticket.option"]',
}, },
ticketComponents: { ticketComponents: {
base: 'vn-ticket-components [name="base-sum"]' base: 'vn-ticket-components [name="base-sum"]'
@ -485,9 +478,9 @@ export default {
addRequestButton: 'vn-ticket-request-index > a > vn-float-button > button', addRequestButton: 'vn-ticket-request-index > a > vn-float-button > button',
request: 'vn-ticket-request-index vn-table vn-tr', request: 'vn-ticket-request-index vn-table vn-tr',
descriptionInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.description"]', descriptionInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.description"]',
atenderAutocomplete: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]', atender: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]',
quantityInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.quantity"]', quantity: 'vn-ticket-request-create vn-input-number[ng-model="$ctrl.ticketRequest.quantity"]',
priceInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.price"]', price: 'vn-ticket-request-create vn-input-number[ng-model="$ctrl.ticketRequest.price"]',
firstRemoveRequestButton: 'vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)', firstRemoveRequestButton: 'vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)',
saveButton: 'vn-ticket-request-create button[type=submit]', saveButton: 'vn-ticket-request-create button[type=submit]',
firstDescription: 'vn-ticket-request-index vn-table vn-tr:nth-child(1) > vn-td:nth-child(2) vn-textfield', firstDescription: 'vn-ticket-request-index vn-table vn-tr:nth-child(1) > vn-td:nth-child(2) vn-textfield',
@ -502,20 +495,20 @@ export default {
ticketService: { ticketService: {
addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button', addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button',
firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]', firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]',
firstServiceTypeAutocomplete: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]', firstServiceType: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
firstQuantityInput: 'vn-ticket-service [ng-model="service.quantity"]', firstQuantity: 'vn-ticket-service vn-input-number[ng-model="service.quantity"]',
firstPriceInput: 'vn-ticket-service [ng-model="service.price"]', firstPrice: 'vn-ticket-service vn-input-number[ng-model="service.price"]',
firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]', firstVatType: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(1) vn-icon-button[icon="delete"]', fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(1) vn-icon-button[icon="delete"]',
newServiceTypeNameInput: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]', newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
newServiceTypeExpenseAutocomplete: '.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: {
stateAutocomplete: 'vn-autocomplete[ng-model="$ctrl.stateFk"]', state: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
workerAutocomplete: 'vn-autocomplete[ng-model="$ctrl.workerFk"]', worker: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
clearStateInputButton: 'vn-autocomplete[ng-model="$ctrl.stateFk"] .icons > vn-icon[icon=clear]', clearStateInputButton: 'vn-autocomplete[ng-model="$ctrl.stateFk"] .icons > vn-icon[icon=clear]',
saveStateButton: `button[type=submit]` saveStateButton: `button[type=submit]`
}, },
@ -532,7 +525,7 @@ export default {
claimSummary: { claimSummary: {
header: 'vn-claim-summary > vn-card > h5', header: 'vn-claim-summary > vn-card > h5',
state: 'vn-claim-summary vn-label-value[label="State"] > section > span', state: 'vn-claim-summary vn-label-value[label="State"] > section > span',
observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"] textarea', observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"]',
firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span', firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span',
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor', itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
@ -543,14 +536,14 @@ export default {
firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor' firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor'
}, },
claimBasicData: { claimBasicData: {
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]', claimState: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
responsabilityInputRange: 'vn-range', responsabilityInputRange: 'vn-range',
observationInput: 'vn-textarea[ng-model="$ctrl.claim.observation"] textarea', observation: 'vn-textarea[ng-model="$ctrl.claim.observation"]',
saveButton: `button[type=submit]` saveButton: `button[type=submit]`
}, },
claimDetail: { claimDetail: {
secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span', secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span',
discountInput: '.vn-popover.shown [ng-model="$ctrl.newDiscount"]', discount: '.vn-popover.shown vn-input-number[ng-model="$ctrl.newDiscount"]',
discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5', discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5',
addItemButton: 'vn-claim-detail a vn-float-button', addItemButton: 'vn-claim-detail a vn-float-button',
firstClaimableSaleFromTicket: '.vn-dialog.shown vn-tbody > vn-tr', firstClaimableSaleFromTicket: '.vn-dialog.shown vn-tbody > vn-tr',
@ -561,16 +554,16 @@ export default {
claimDevelopment: { claimDevelopment: {
addDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > vn-one > vn-icon-button > button > vn-icon', addDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > vn-one > vn-icon-button > button > vn-icon',
firstDeleteDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > form > vn-horizontal:nth-child(2) > vn-icon-button > button > vn-icon', firstDeleteDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > form > vn-horizontal:nth-child(2) > vn-icon-button > button > vn-icon',
firstClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]', firstClaimReason: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
firstClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]', firstClaimResult: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
firstClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]', firstClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
firstClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]', firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
firstClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]', firstClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
secondClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]', secondClaimReason: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
secondClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]', secondClaimResult: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
secondClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]', secondClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
secondClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]', secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]', secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
saveDevelopmentButton: 'button[type=submit]' saveDevelopmentButton: 'button[type=submit]'
}, },
claimAction: { claimAction: {
@ -594,31 +587,29 @@ export default {
acceptNavigationButton: '.vn-confirm.shown button[response=accept]' acceptNavigationButton: '.vn-confirm.shown button[response=accept]'
}, },
createOrderView: { createOrderView: {
clientAutocomplete: 'vn-autocomplete[label="Client"]', client: 'vn-autocomplete[label="Client"]',
addressAutocomplete: 'vn-autocomplete[label="Address"]', agency: 'vn-autocomplete[label="Agency"]',
agencyAutocomplete: 'vn-autocomplete[label="Agency"]',
landedDatePicker: 'vn-date-picker[label="Landed"]', landedDatePicker: 'vn-date-picker[label="Landed"]',
createButton: 'button[type=submit]', createButton: 'button[type=submit]',
cancelButton: 'vn-button[href="#!/client/index"]' cancelButton: 'vn-button[href="#!/client/index"]'
}, },
orderCatalog: { orderCatalog: {
orderByAutocomplete: 'vn-autocomplete[label="Order by"]',
plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]', plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]',
typeAutocomplete: 'vn-autocomplete[data="$ctrl.itemTypes"]', type: 'vn-autocomplete[data="$ctrl.itemTypes"]',
itemIdInput: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.itemId"]', itemId: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.itemId"]',
itemTagValueInput: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.value"]', itemTagValue: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.value"]',
openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-vertical > vn-textfield[ng-model="$ctrl.value"] .append i', openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-vertical > vn-textfield[ng-model="$ctrl.value"] .append i',
tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]', tag: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]',
tagValueInput: 'vn-order-catalog-search-panel [ng-model="filter.value"]', tagValue: 'vn-order-catalog-search-panel vn-textfield[ng-model="filter.value"]',
searchTagButton: 'vn-order-catalog-search-panel button[type=submit]', searchTagButton: 'vn-order-catalog-search-panel button[type=submit]',
thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(3) vn-icon[icon=cancel]', thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(3) vn-icon[icon=cancel]',
fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(4) vn-icon[icon=cancel]', fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(4) vn-icon[icon=cancel]',
}, },
orderBasicData: { orderBasicData: {
clientAutocomplete: 'vn-autocomplete[label="Client"]', client: 'vn-autocomplete[label="Client"]',
addressAutocomplete: 'vn-autocomplete[label="Address"]', address: 'vn-autocomplete[label="Address"]',
agencyAutocomplete: 'vn-autocomplete[label="Agency"]', agency: 'vn-autocomplete[label="Agency"]',
observationInput: 'vn-textarea[label="Observation"] textarea', observation: 'vn-textarea[label="Observation"]',
saveButton: `button[type=submit]`, saveButton: `button[type=submit]`,
acceptButton: '.vn-confirm.shown button[response="accept"]' acceptButton: '.vn-confirm.shown button[response="accept"]'
}, },
@ -632,11 +623,11 @@ export default {
addNewRouteButton: 'vn-route-index > a[ui-sref="route.create"]' addNewRouteButton: 'vn-route-index > a[ui-sref="route.create"]'
}, },
createRouteView: { createRouteView: {
workerAutocomplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]', worker: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]', createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
vehicleAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]', vehicleAuto: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
agencyAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]', agency: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
descriptionInput: 'vn-route-create [ng-model="$ctrl.route.description"]', description: 'vn-route-create [ng-model="$ctrl.route.description"]',
submitButton: 'vn-route-create button[type=submit]' submitButton: 'vn-route-create button[type=submit]'
}, },
routeDescriptor: { routeDescriptor: {
@ -646,14 +637,13 @@ export default {
routeId: 'vn-route-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span' routeId: 'vn-route-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span'
}, },
routeBasicData: { routeBasicData: {
workerAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]', worker: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
vehicleAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]', vehicle: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
agencyAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]', kmStart: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmStart"]',
kmStartInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmStart"]', kmEnd: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmEnd"]',
kmEndInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmEnd"]', createdDate: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]',
createdDateInput: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]', startedHour: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.started"]',
startedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.started"]', finishedHour: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.finished"]',
finishedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.finished"]',
saveButton: 'vn-route-basic-data button[type=submit]' saveButton: 'vn-route-basic-data button[type=submit]'
}, },
routeTickets: { routeTickets: {
@ -668,11 +658,11 @@ export default {
confirmButton: '.vn-confirm.shown button[response="accept"]' confirmButton: '.vn-confirm.shown button[response="accept"]'
}, },
workerPbx: { workerPbx: {
extensionInput: 'vn-worker-pbx [ng-model="$ctrl.worker.sip.extension"]', extension: 'vn-worker-pbx vn-textfield[ng-model="$ctrl.worker.sip.extension"]',
saveButton: 'vn-worker-pbx button[type=submit]' saveButton: 'vn-worker-pbx button[type=submit]'
}, },
workerTimeControl: { workerTimeControl: {
timeDialogInput: '.vn-dialog.shown [ng-model="$ctrl.newTime"]', timeDialog: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newTime"]',
mondayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(1) > vn-icon-button', mondayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(1) > vn-icon-button',
tuesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(2) > vn-icon-button', tuesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(2) > vn-icon-button',
wednesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(3) > vn-icon-button', wednesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(3) > vn-icon-button',
@ -724,7 +714,7 @@ export default {
acceptDeleteDialog: '.vn-confirm.shown button[response="accept"]' acceptDeleteDialog: '.vn-confirm.shown button[response="accept"]'
}, },
invoiceOutIndex: { invoiceOutIndex: {
searchInvoiceOutInput: 'vn-searchbar', topbarSearch: 'vn-searchbar',
searchButton: 'vn-searchbar vn-icon[icon="search"]', searchButton: 'vn-searchbar vn-icon[icon="search"]',
searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr', searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
}, },

View File

@ -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);
}); });
}); });

View File

@ -15,7 +15,7 @@ describe('Client create path', async() => {
}); });
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => { it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
await page.write(selectors.clientsIndex.searchClientInput, 'Carol Danvers'); await page.write(selectors.clientsIndex.topbarSearch, 'Carol Danvers');
await page.waitToClick(selectors.clientsIndex.searchButton); await page.waitToClick(selectors.clientsIndex.searchButton);
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 0); await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 0);
const result = await page.countElement(selectors.clientsIndex.searchResult); const result = await page.countElement(selectors.clientsIndex.searchResult);
@ -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() => {
@ -42,7 +42,7 @@ describe('Client create path', async() => {
await page.write(selectors.createClientView.taxNumber, '74451390E'); await page.write(selectors.createClientView.taxNumber, '74451390E');
await page.write(selectors.createClientView.userName, 'CaptainMarvel'); await page.write(selectors.createClientView.userName, 'CaptainMarvel');
await page.write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es'); await page.write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es');
await page.autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'replenisher'); await page.autocompleteSearch(selectors.createClientView.salesPerson, 'replenisher');
await page.waitToClick(selectors.createClientView.createButton); await page.waitToClick(selectors.createClientView.createButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -79,13 +79,13 @@ describe('Client create path', async() => {
it(`should check for autocompleted city, province and country`, async() => { it(`should check for autocompleted city, province and country`, async() => {
const clientCity = await page const clientCity = await page
.waitToGetProperty(`${selectors.createClientView.city} input`, 'value'); .waitToGetProperty(selectors.createClientView.city, 'value');
const clientProvince = await page const clientProvince = await page
.waitToGetProperty(`${selectors.createClientView.province} input`, 'value'); .waitToGetProperty(selectors.createClientView.province, 'value');
const clientCountry = await page const clientCountry = await page
.waitToGetProperty(`${selectors.createClientView.country} input`, 'value'); .waitToGetProperty(selectors.createClientView.country, 'value');
expect(clientCity).toEqual('Valencia'); expect(clientCity).toEqual('Valencia');
expect(clientProvince).toEqual('Province one'); expect(clientProvince).toEqual('Province one');
@ -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);
}); });
}); });

View File

@ -18,22 +18,22 @@ describe('Client Edit basicData path', () => {
describe('as employee', () => { describe('as employee', () => {
it('should not be able to change the salesPerson', async() => { it('should not be able to change the salesPerson', async() => {
await page.wait(selectors.clientBasicData.nameInput); await page.wait(selectors.clientBasicData.name);
const result = await page.evaluate(selector => { const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, `${selectors.clientBasicData.salesPersonAutocomplete} input`); }, `${selectors.clientBasicData.salesPerson} input`);
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
it('should edit the client basic data but leave salesPerson untainted', async() => { it('should edit the client basic data but leave salesPerson untainted', async() => {
await page.clearInput(selectors.clientBasicData.nameInput); await page.clearInput(selectors.clientBasicData.name);
await page.write(selectors.clientBasicData.nameInput, 'Ptonomy Wallace'); await page.write(selectors.clientBasicData.name, 'Ptonomy Wallace');
await page.clearInput(selectors.clientBasicData.contactInput); await page.clearInput(selectors.clientBasicData.contact);
await page.write(selectors.clientBasicData.contactInput, 'David Haller'); await page.write(selectors.clientBasicData.contact, 'David Haller');
await page.clearInput(selectors.clientBasicData.emailInput); await page.clearInput(selectors.clientBasicData.email);
await page.write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es'); await page.write(selectors.clientBasicData.email, 'PWallace@verdnatura.es');
await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets'); await page.autocompleteSearch(selectors.clientBasicData.channel, 'Rumors on the streets');
await page.waitToClick(selectors.clientBasicData.saveButton); await page.waitToClick(selectors.clientBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -42,28 +42,28 @@ describe('Client Edit basicData path', () => {
it('should confirm the name have been edited', async() => { it('should confirm the name have been edited', async() => {
await page.reloadSection('client.card.basicData'); await page.reloadSection('client.card.basicData');
const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientBasicData.name, 'value');
expect(result).toEqual('Ptonomy Wallace'); expect(result).toEqual('Ptonomy Wallace');
}); });
it('should confirm the contact name have been edited', async() => { it('should confirm the contact name have been edited', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.contact, 'value');
expect(result).toEqual('David Haller'); expect(result).toEqual('David Haller');
}); });
it('should confirm the email have been edited', async() => { it('should confirm the email have been edited', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.email, 'value');
expect(result).toEqual('PWallace@verdnatura.es'); expect(result).toEqual('PWallace@verdnatura.es');
}); });
it('should confirm the channel have been selected', async() => { it('should confirm the channel have been selected', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.channel, 'value');
expect(result).toEqual('Rumors on the streets'); expect(result).toEqual('Rumors on the streets');
}); });
@ -77,23 +77,23 @@ describe('Client Edit basicData path', () => {
}); });
it('should be able to change the salesPerson', async() => { it('should be able to change the salesPerson', async() => {
await page.wait(selectors.clientBasicData.nameInput); await page.wait(selectors.clientBasicData.name);
const result = await page.evaluate(selector => { const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, `${selectors.clientBasicData.salesPersonAutocomplete} input`); }, `${selectors.clientBasicData.salesPerson} input`);
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should edit the client basic data including salesPerson', async() => { it('should edit the client basic data including salesPerson', async() => {
await page.clearInput(selectors.clientBasicData.nameInput); await page.clearInput(selectors.clientBasicData.name);
await page.write(selectors.clientBasicData.nameInput, 'Ororo Munroe'); await page.write(selectors.clientBasicData.name, 'Ororo Munroe');
await page.clearInput(selectors.clientBasicData.contactInput); await page.clearInput(selectors.clientBasicData.contact);
await page.write(selectors.clientBasicData.contactInput, 'Black Panther'); await page.write(selectors.clientBasicData.contact, 'Black Panther');
await page.clearInput(selectors.clientBasicData.emailInput); await page.clearInput(selectors.clientBasicData.email);
await page.write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es'); await page.write(selectors.clientBasicData.email, 'Storm@verdnatura.es');
await page.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'replenisherNick'); await page.autocompleteSearch(selectors.clientBasicData.salesPerson, 'replenisherNick');
await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper'); await page.autocompleteSearch(selectors.clientBasicData.channel, 'Metropolis newspaper');
await page.waitToClick(selectors.clientBasicData.saveButton); await page.waitToClick(selectors.clientBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -102,35 +102,35 @@ describe('Client Edit basicData path', () => {
it('should now confirm the name have been edited', async() => { it('should now confirm the name have been edited', async() => {
await page.reloadSection('client.card.basicData'); await page.reloadSection('client.card.basicData');
const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientBasicData.name, 'value');
expect(result).toEqual('Ororo Munroe'); expect(result).toEqual('Ororo Munroe');
}); });
it('should now confirm the contact name have been edited', async() => { it('should now confirm the contact name have been edited', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.contact, 'value');
expect(result).toEqual('Black Panther'); expect(result).toEqual('Black Panther');
}); });
it('should now confirm the email have been edited', async() => { it('should now confirm the email have been edited', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.email, 'value');
expect(result).toEqual('Storm@verdnatura.es'); expect(result).toEqual('Storm@verdnatura.es');
}); });
it('should confirm the sales person have been selected', async() => { it('should confirm the sales person have been selected', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.salesPerson, 'value');
expect(result).toEqual('replenisherNick'); expect(result).toEqual('replenisherNick');
}); });
it('should now confirm the channel have been selected', async() => { it('should now confirm the channel have been selected', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value'); .waitToGetProperty(selectors.clientBasicData.channel, 'value');
expect(result).toEqual('Metropolis newspaper'); expect(result).toEqual('Metropolis newspaper');
}); });

View File

@ -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() => {
@ -58,19 +57,19 @@ describe('Client Edit fiscalData path', () => {
}); });
it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => { it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => {
await page.wait(selectors.clientFiscalData.socialNameInput); await page.wait(selectors.clientFiscalData.socialName);
await page.clearInput(selectors.clientFiscalData.socialNameInput); await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialNameInput, 'SMASH'); await page.write(selectors.clientFiscalData.socialName, 'SMASH');
await page.clearInput(selectors.clientFiscalData.fiscalIdInput); await page.clearInput(selectors.clientFiscalData.fiscalId);
await page.write(selectors.clientFiscalData.fiscalIdInput, 'INVALID!'); await page.write(selectors.clientFiscalData.fiscalId, 'INVALID!');
await page.clearInput(selectors.clientFiscalData.addressInput); await page.clearInput(selectors.clientFiscalData.address);
await page.write(selectors.clientFiscalData.addressInput, 'Somewhere edited'); await page.write(selectors.clientFiscalData.address, 'Somewhere edited');
await page.autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'España'); await page.autocompleteSearch(selectors.clientFiscalData.country, 'España');
await page.autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province one'); await page.autocompleteSearch(selectors.clientFiscalData.province, 'Province one');
await page.clearInput(selectors.clientFiscalData.cityInput); await page.clearInput(selectors.clientFiscalData.city);
await page.write(selectors.clientFiscalData.cityInput, 'Valencia'); await page.write(selectors.clientFiscalData.city, 'Valencia');
await page.clearInput(selectors.clientFiscalData.postcodeInput); await page.clearInput(selectors.clientFiscalData.postcode);
await page.write(selectors.clientFiscalData.postcodeInput, '46000'); await page.write(selectors.clientFiscalData.postcode, '46000');
await page.waitToClick(selectors.clientFiscalData.activeCheckbox); await page.waitToClick(selectors.clientFiscalData.activeCheckbox);
await page.waitToClick(selectors.clientFiscalData.frozenCheckbox); await page.waitToClick(selectors.clientFiscalData.frozenCheckbox);
await page.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox); await page.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox);
@ -87,8 +86,8 @@ describe('Client Edit fiscalData path', () => {
}, 15000); }, 15000);
it(`should edit the fiscal this time with a valid fiscal id`, async() => { it(`should edit the fiscal this time with a valid fiscal id`, async() => {
await page.clearInput(selectors.clientFiscalData.fiscalIdInput); await page.clearInput(selectors.clientFiscalData.fiscalId);
await page.write(selectors.clientFiscalData.fiscalIdInput, '94980061C'); await page.write(selectors.clientFiscalData.fiscalId, '94980061C');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton); await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -105,8 +104,8 @@ describe('Client Edit fiscalData path', () => {
it('should receive an error if the fiscal id contains A or B at the beginning', async() => { it('should receive an error if the fiscal id contains A or B at the beginning', async() => {
await page.waitToClick(selectors.clientFiscalData.viesCheckbox); await page.waitToClick(selectors.clientFiscalData.viesCheckbox);
await page.clearInput(selectors.clientFiscalData.fiscalIdInput); await page.clearInput(selectors.clientFiscalData.fiscalId);
await page.write(selectors.clientFiscalData.fiscalIdInput, 'A94980061C'); await page.write(selectors.clientFiscalData.fiscalId, 'A94980061C');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -114,8 +113,8 @@ describe('Client Edit fiscalData path', () => {
}); });
it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => { it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => {
await page.clearInput(selectors.clientFiscalData.fiscalIdInput); await page.clearInput(selectors.clientFiscalData.fiscalId);
await page.write(selectors.clientFiscalData.fiscalIdInput, '94980061C'); await page.write(selectors.clientFiscalData.fiscalId, '94980061C');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -125,10 +124,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
@ -170,44 +168,44 @@ describe('Client Edit fiscalData path', () => {
it('should confirm its name have been edited', async() => { it('should confirm its name have been edited', async() => {
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton); await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('SMASH'); expect(result).toEqual('SMASH');
}); });
it('should confirm the fiscal id have been edited', async() => { it('should confirm the fiscal id have been edited', async() => {
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.fiscalIdInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.fiscalId, 'value');
expect(result).toEqual('94980061C'); expect(result).toEqual('94980061C');
}); });
it('should confirm the address have been edited', async() => { it('should confirm the address have been edited', async() => {
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.addressInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.address, 'value');
expect(result).toEqual('Somewhere edited'); expect(result).toEqual('Somewhere edited');
}); });
it('should confirm the postcode have been edited', async() => { it('should confirm the postcode have been edited', async() => {
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.postcodeInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.postcode, 'value');
expect(result).toContain('46000'); expect(result).toContain('46000');
}); });
it('should confirm the city have been autocompleted', async() => { it('should confirm the city have been autocompleted', async() => {
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.cityInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');
expect(result).toEqual('Valencia'); expect(result).toEqual('Valencia');
}); });
it(`should confirm the province have been autocompleted`, async() => { it(`should confirm the province have been autocompleted`, async() => {
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.province, 'value');
expect(result).toEqual('Province one'); expect(result).toEqual('Province one');
}); });
it('should confirm the country have been autocompleted', async() => { it('should confirm the country have been autocompleted', async() => {
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.country, 'value');
expect(result).toEqual('España'); expect(result).toEqual('España');
}); });
@ -263,16 +261,15 @@ 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
it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => { it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => {
await page.waitToClick(selectors.clientAddresses.firstEditAddress); await page.waitToClick(selectors.clientAddresses.firstEditAddress);
await page.waitForTextInInput(selectors.clientAddresses.cityInput, 'Silla'); await page.waitForTextInField(selectors.clientAddresses.city, 'Silla');
await page.waitToClick(selectors.clientAddresses.equalizationTaxCheckbox); await page.waitToClick(selectors.clientAddresses.equalizationTaxCheckbox);
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -17,11 +17,11 @@ describe('Client Edit billing data path', () => {
}); });
it(`should attempt to edit the billing data without an IBAN but fail`, async() => { it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
await page.autocompleteSearch(selectors.clientBillingData.payMethodAutocomplete, 'PayMethod with IBAN'); await page.autocompleteSearch(selectors.clientBillingData.payMethod, 'PayMethod with IBAN');
await page.autocompleteSearch(selectors.clientBillingData.swiftBicAutocomplete, 'BBKKESMMMMM'); await page.autocompleteSearch(selectors.clientBillingData.swiftBic, 'BBKKESMMMMM');
await page.clearInput(selectors.clientBillingData.dueDayInput); await page.clearInput(selectors.clientBillingData.dueDay);
await page.write(selectors.clientBillingData.dueDayInput, '60'); await page.write(selectors.clientBillingData.dueDay, '60');
await page.waitForTextInInput(selectors.clientBillingData.dueDayInput, '60'); await page.waitForTextInField(selectors.clientBillingData.dueDay, '60');
await page.waitToClick(selectors.clientBillingData.receivedCoreLCRCheckbox); await page.waitToClick(selectors.clientBillingData.receivedCoreLCRCheckbox);
await page.waitToClick(selectors.clientBillingData.receivedCoreVNLCheckbox); await page.waitToClick(selectors.clientBillingData.receivedCoreVNLCheckbox);
await page.waitToClick(selectors.clientBillingData.receivedB2BVNLCheckbox); await page.waitToClick(selectors.clientBillingData.receivedB2BVNLCheckbox);
@ -37,30 +37,30 @@ describe('Client Edit billing data path', () => {
await page.write(selectors.clientBillingData.newBankEntityCode, '9999'); await page.write(selectors.clientBillingData.newBankEntityCode, '9999');
await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT'); await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT');
await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton); await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton);
await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'Gotham City Bank'); await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'Gotham City Bank');
let newcode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value'); let newcode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
expect(newcode).toEqual('GTHMCT Gotham City Bank'); expect(newcode).toEqual('GTHMCT Gotham City Bank');
}); });
it(`should confirm the IBAN pay method was sucessfully saved`, async() => { it(`should confirm the IBAN pay method was sucessfully saved`, async() => {
let payMethod = await page.waitToGetProperty(`${selectors.clientBillingData.payMethodAutocomplete} input`, 'value'); let payMethod = await page.waitToGetProperty(selectors.clientBillingData.payMethod, 'value');
expect(payMethod).toEqual('PayMethod with IBAN'); expect(payMethod).toEqual('PayMethod with IBAN');
}); });
it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => { it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => {
await page.write(selectors.clientBillingData.IBANInput, 'ES9121000418450200051332'); await page.write(selectors.clientBillingData.IBAN, 'ES9121000418450200051332');
await page.keyboard.press('Tab'); await page.keyboard.press('Tab');
await page.keyboard.press('Tab'); await page.keyboard.press('Tab');
await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'caixesbb'); await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'caixesbb');
let automaticCode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value'); let automaticCode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
expect(automaticCode).toEqual('CAIXESBB Caixa Bank'); expect(automaticCode).toEqual('CAIXESBB Caixa Bank');
}); });
it(`should save the form with all its new data`, async() => { it(`should save the form with all its new data`, async() => {
await page.waitForContentLoaded(); // await page.waitFor(3000);
await page.waitForWatcherData(selectors.clientBillingData.watcher); await page.waitForWatcherData(selectors.clientBillingData.watcher);
await page.waitToClick(selectors.clientBillingData.saveButton); await page.waitToClick(selectors.clientBillingData.saveButton);
let snackbarMessage = await page.waitForLastSnackbar(); let snackbarMessage = await page.waitForLastSnackbar();
@ -69,19 +69,19 @@ describe('Client Edit billing data path', () => {
}); });
it('should confirm the due day have been edited', async() => { it('should confirm the due day have been edited', async() => {
let dueDate = await page.waitToGetProperty(`${selectors.clientBillingData.dueDayInput} input`, 'value'); let dueDate = await page.waitToGetProperty(selectors.clientBillingData.dueDay, 'value');
expect(dueDate).toEqual('60'); expect(dueDate).toEqual('60');
}); });
it('should confirm the IBAN was saved', async() => { it('should confirm the IBAN was saved', async() => {
let IBAN = await page.waitToGetProperty(`${selectors.clientBillingData.IBANInput} input`, 'value'); let IBAN = await page.waitToGetProperty(selectors.clientBillingData.IBAN, 'value');
expect(IBAN).toEqual('ES9121000418450200051332'); expect(IBAN).toEqual('ES9121000418450200051332');
}); });
it('should confirm the swift / BIC code was saved', async() => { it('should confirm the swift / BIC code was saved', async() => {
let code = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value'); let code = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
expect(code).toEqual('CAIXESBB Caixa Bank'); expect(code).toEqual('CAIXESBB Caixa Bank');
}); });

View File

@ -18,19 +18,18 @@ 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() => {
await page.waitToClick(selectors.clientAddresses.defaultCheckboxInput); await page.waitToClick(selectors.clientAddresses.defaultCheckbox);
await page.autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province five'); await page.autocompleteSearch(selectors.clientAddresses.province, 'Province five');
await page.write(selectors.clientAddresses.cityInput, 'Valencia'); await page.write(selectors.clientAddresses.city, 'Valencia');
await page.write(selectors.clientAddresses.postcodeInput, '46000'); await page.write(selectors.clientAddresses.postcode, '46000');
await page.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement'); await page.autocompleteSearch(selectors.clientAddresses.agency, 'Entanglement');
await page.write(selectors.clientAddresses.phoneInput, '999887744'); await page.write(selectors.clientAddresses.phone, '999887744');
await page.write(selectors.clientAddresses.mobileInput, '999887744'); await page.write(selectors.clientAddresses.mobileInput, '999887744');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -40,8 +39,8 @@ describe('Client Add address path', () => {
it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => { it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => {
await page.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner'); await page.write(selectors.clientAddresses.consignee, 'Bruce Bunner');
await page.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York'); await page.write(selectors.clientAddresses.streetAddress, '320 Park Avenue New York');
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -49,7 +48,7 @@ describe('Client Add address path', () => {
}); });
it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => { it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => {
await page.autocompleteSearch(selectors.clientAddresses.incotermsAutocomplete, 'Free Alongside Ship'); await page.autocompleteSearch(selectors.clientAddresses.incoterms, 'Free Alongside Ship');
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -57,7 +56,7 @@ describe('Client Add address path', () => {
}); });
it(`should create a new address with all it's data`, async() => { it(`should create a new address with all it's data`, async() => {
await page.autocompleteSearch(selectors.clientAddresses.customsAgentAutocomplete, 'Agent one'); await page.autocompleteSearch(selectors.clientAddresses.customsAgent, 'Agent one');
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -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);
}); });
}); });

View File

@ -19,15 +19,14 @@ 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() => {
await page.waitToClick(selectors.clientAddresses.addObservationButton); await page.waitToClick(selectors.clientAddresses.addObservationButton);
await page.write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description'); await page.write(selectors.clientAddresses.firstObservationDescription, 'first description');
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -35,8 +34,8 @@ describe('Client add address notes path', () => {
}); });
it('should not save an observation type without description', async() => { it('should not save an observation type without description', async() => {
await page.clearInput(selectors.clientAddresses.firstObservationDescriptionInput); await page.clearInput(selectors.clientAddresses.firstObservationDescription);
await page.autocompleteSearch(selectors.clientAddresses.firstObservationTypeAutocomplete, 'comercial'); await page.autocompleteSearch(selectors.clientAddresses.firstObservationType, 'comercial');
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -44,10 +43,10 @@ describe('Client add address notes path', () => {
}); });
it('should create two new observations', async() => { it('should create two new observations', async() => {
await page.write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description'); await page.write(selectors.clientAddresses.firstObservationDescription, 'first description');
await page.waitToClick(selectors.clientAddresses.addObservationButton); await page.waitToClick(selectors.clientAddresses.addObservationButton);
await page.autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one'); await page.autocompleteSearch(selectors.clientAddresses.secondObservationType, 'observation one');
await page.write(selectors.clientAddresses.secondObservationDescriptionInput, 'second description'); await page.write(selectors.clientAddresses.secondObservationDescription, 'second description');
await page.waitToClick(selectors.clientAddresses.saveButton); await page.waitToClick(selectors.clientAddresses.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -18,8 +18,8 @@ describe('Client Edit web access path', () => {
it(`should uncheck the Enable web access checkbox and update the name`, async() => { it(`should uncheck the Enable web access checkbox and update the name`, async() => {
await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox); await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox);
await page.clearInput(selectors.clientWebAccess.userNameInput); await page.clearInput(selectors.clientWebAccess.userName);
await page.write(selectors.clientWebAccess.userNameInput, 'Hulk'); await page.write(selectors.clientWebAccess.userName, 'Hulk');
await page.waitToClick(selectors.clientWebAccess.saveButton); await page.waitToClick(selectors.clientWebAccess.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -28,7 +28,7 @@ describe('Client Edit web access path', () => {
it('should confirm web access is now unchecked', async() => { it('should confirm web access is now unchecked', async() => {
await page.waitToClick(selectors.clientBasicData.basicDataButton); await page.waitToClick(selectors.clientBasicData.basicDataButton);
await page.wait(selectors.clientBasicData.nameInput); await page.wait(selectors.clientBasicData.name);
await page.waitToClick(selectors.clientsIndex.othersButton); await page.waitToClick(selectors.clientsIndex.othersButton);
await page.waitToClick(selectors.clientWebAccess.webAccessButton); await page.waitToClick(selectors.clientWebAccess.webAccessButton);
const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox); const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox);
@ -37,7 +37,7 @@ describe('Client Edit web access path', () => {
}); });
it('should confirm web access name have been updated', async() => { it('should confirm web access name have been updated', async() => {
const result = await page.waitToGetProperty(`${selectors.clientWebAccess.userNameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientWebAccess.userName, 'value');
expect(result).toEqual('Hulk'); expect(result).toEqual('Hulk');
}); });

View File

@ -18,15 +18,14 @@ 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() => {
await page.waitFor(selectors.clientNotes.noteInput); await page.waitFor(selectors.clientNotes.note);
await page.type(`${selectors.clientNotes.noteInput} textarea`, 'Meeting with Black Widow 21st 9am'); await page.type(`${selectors.clientNotes.note} textarea`, 'Meeting with Black Widow 21st 9am');
await page.waitToClick(selectors.clientNotes.saveButton); await page.waitToClick(selectors.clientNotes.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -18,16 +18,15 @@ 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() => {
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.clearInput(selectors.clientCredit.creditInput); await page.clearInput(selectors.clientCredit.credit);
await page.write(selectors.clientCredit.creditInput, '999'); await page.write(selectors.clientCredit.credit, '999');
await page.waitToClick(selectors.clientCredit.saveButton); await page.waitToClick(selectors.clientCredit.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -18,14 +18,13 @@ 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() => {
await page.autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff'); await page.autocompleteSearch(selectors.clientGreuge.type, 'Diff');
await page.waitToClick(selectors.clientGreuge.saveButton); await page.waitToClick(selectors.clientGreuge.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -33,9 +32,9 @@ describe('Client Add greuge path', () => {
}); });
it(`should create a new greuge with all its data`, async() => { it(`should create a new greuge with all its data`, async() => {
await page.write(selectors.clientGreuge.amountInput, '999'); await page.write(selectors.clientGreuge.amount, '999');
await page.waitForTextInInput(selectors.clientGreuge.amountInput, '999'); await page.waitForTextInField(selectors.clientGreuge.amount, '999');
await page.write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!'); await page.write(selectors.clientGreuge.description, 'new armor for Batman!');
await page.waitToClick(selectors.clientGreuge.saveButton); await page.waitToClick(selectors.clientGreuge.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -26,9 +26,9 @@ describe('Client lock verified data path', () => {
}); });
it('should edit the social name', async() => { it('should edit the social name', async() => {
await page.wait(selectors.clientFiscalData.socialNameInput); await page.wait(selectors.clientFiscalData.socialName);
await page.clearInput(selectors.clientFiscalData.socialNameInput); await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialNameInput, 'Captain America Civil War'); await page.write(selectors.clientFiscalData.socialName, 'Captain America Civil War');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -37,7 +37,7 @@ describe('Client lock verified data path', () => {
it('should confirm the social name have been edited', async() => { it('should confirm the social name have been edited', async() => {
await page.reloadSection('client.card.fiscalData'); await page.reloadSection('client.card.fiscalData');
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('Captain America Civil War'); expect(result).toEqual('Captain America Civil War');
}); });
@ -73,9 +73,9 @@ describe('Client lock verified data path', () => {
}); });
it('should again edit the social name', async() => { it('should again edit the social name', async() => {
await page.wait(selectors.clientFiscalData.socialNameInput); await page.wait(selectors.clientFiscalData.socialName);
await page.clearInput(selectors.clientFiscalData.socialNameInput); await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialNameInput, 'Ant man and the Wasp'); await page.write(selectors.clientFiscalData.socialName, 'Ant man and the Wasp');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -84,7 +84,7 @@ describe('Client lock verified data path', () => {
it('should again confirm the social name have been edited', async() => { it('should again confirm the social name have been edited', async() => {
await page.reloadSection('client.card.fiscalData'); await page.reloadSection('client.card.fiscalData');
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('Ant man and the Wasp'); expect(result).toEqual('Ant man and the Wasp');
}); });
@ -104,8 +104,8 @@ describe('Client lock verified data path', () => {
}); });
it('should not be able to save change throwing a verified data error', async() => { it('should not be able to save change throwing a verified data error', async() => {
await page.clearInput(selectors.clientFiscalData.socialNameInput); await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialNameInput, 'This wont happen'); await page.write(selectors.clientFiscalData.socialName, 'This wont happen');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -114,12 +114,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);
@ -128,8 +128,8 @@ describe('Client lock verified data path', () => {
}); });
it('should now edit the social name', async() => { it('should now edit the social name', async() => {
await page.clearInput(selectors.clientFiscalData.socialNameInput); await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialNameInput, 'new social name edition'); await page.write(selectors.clientFiscalData.socialName, 'new social name edition');
await page.waitToClick(selectors.clientFiscalData.saveButton); await page.waitToClick(selectors.clientFiscalData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -138,7 +138,7 @@ describe('Client lock verified data path', () => {
it('should now confirm the social name have been edited once and for all', async() => { it('should now confirm the social name have been edited once and for all', async() => {
await page.reloadSection('client.card.fiscalData'); await page.reloadSection('client.card.fiscalData');
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
expect(result).toEqual('new social name edition'); expect(result).toEqual('new social name edition');
}); });
@ -159,7 +159,7 @@ describe('Client lock verified data path', () => {
}); });
it('should confirm the form is enabled for salesPerson', async() => { it('should confirm the form is enabled for salesPerson', async() => {
await page.wait(selectors.clientFiscalData.socialNameInput); await page.wait(selectors.clientFiscalData.socialName);
const result = await page.evaluate(selector => { const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, 'vn-textfield[ng-model="$ctrl.client.socialName"] > div'); }, 'vn-textfield[ng-model="$ctrl.client.socialName"] > div');

View File

@ -17,8 +17,8 @@ describe('Client log path', () => {
}); });
it('should update the clients name', async() => { it('should update the clients name', async() => {
await page.clearInput(selectors.clientBasicData.nameInput); await page.clearInput(selectors.clientBasicData.name);
await page.write(selectors.clientBasicData.nameInput, 'this is a test'); await page.write(selectors.clientBasicData.name, 'this is a test');
await page.waitToClick(selectors.clientBasicData.saveButton); await page.waitToClick(selectors.clientBasicData.saveButton);
let result = await page.waitForLastSnackbar(); let result = await page.waitForLastSnackbar();
@ -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() => {

View File

@ -9,7 +9,7 @@ describe('Client balance path', () => {
page = browser.page; page = browser.page;
await page.loginAndModule('administrative', 'client'); await page.loginAndModule('administrative', 'client');
await page.accessToSearchResult('Petter Parker'); await page.accessToSearchResult('Petter Parker');
}, 30000); });
afterAll(async() => { afterAll(async() => {
await browser.close(); await browser.close();
@ -17,6 +17,7 @@ describe('Client balance path', () => {
it('should now edit the local user config data', async() => { it('should now edit the local user config data', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton); await page.waitToClick(selectors.globalItems.userMenuButton);
await page.waitForContentLoaded();
await page.autocompleteSearch(selectors.globalItems.userLocalCompany, 'CCs'); await page.autocompleteSearch(selectors.globalItems.userLocalCompany, 'CCs');
let result = await page.waitForLastSnackbar(); let result = await page.waitForLastSnackbar();
@ -25,7 +26,7 @@ describe('Client balance path', () => {
it('should access to the balance section to check the data shown matches the local settings', async() => { it('should access to the balance section to check the data shown matches the local settings', async() => {
await page.accessToSection('client.card.balance.index'); await page.accessToSection('client.card.balance.index');
let result = await page.waitToGetProperty(`${selectors.clientBalance.companyAutocomplete} input`, 'value'); let result = await page.waitToGetProperty(selectors.clientBalance.company, 'value');
expect(result).toEqual('CCs'); expect(result).toEqual('CCs');
}); });
@ -41,18 +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 Promise.all([ await page.waitToClick(selectors.clientBalance.newPaymentButton);
page.waitToClick(selectors.clientBalance.newPaymentButton), await page.waitForContentLoaded();
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();
@ -63,7 +60,7 @@ describe('Client balance path', () => {
it('should check balance is now 0 and the company is now VNL becouse the user local settings were removed', async() => { it('should check balance is now 0 and the company is now VNL becouse the user local settings were removed', async() => {
await page.waitForSpinnerLoad(); await page.waitForSpinnerLoad();
let company = await page let company = await page
.waitToGetProperty(`${selectors.clientBalance.companyAutocomplete} input`, 'value'); .waitToGetProperty(selectors.clientBalance.company, 'value');
let firstBalanceLine = await page let firstBalanceLine = await page
.waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText'); .waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText');
@ -76,8 +73,8 @@ describe('Client balance path', () => {
it('should create a new payment that sets the balance to positive value', async() => { it('should create a new payment that sets the balance to positive value', async() => {
await page.waitToClick(selectors.clientBalance.newPaymentButton); await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :( await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :(
await page.clearInput(selectors.clientBalance.newPaymentAmountInput); await page.clearInput(selectors.clientBalance.newPaymentAmount);
await page.write(selectors.clientBalance.newPaymentAmountInput, '100'); await page.write(selectors.clientBalance.newPaymentAmount, '100');
await page.waitToClick(selectors.clientBalance.saveButton); await page.waitToClick(selectors.clientBalance.saveButton);
let result = await page.waitForLastSnackbar(); let result = await page.waitForLastSnackbar();
@ -95,8 +92,8 @@ describe('Client balance path', () => {
await page.waitToClick(selectors.clientBalance.newPaymentButton); await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :( await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :(
await page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true}); await page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true});
await page.clearInput(selectors.clientBalance.newPaymentAmountInput); await page.clearInput(selectors.clientBalance.newPaymentAmount);
await page.write(selectors.clientBalance.newPaymentAmountInput, '-150'); await page.write(selectors.clientBalance.newPaymentAmount, '-150');
await page.waitToClick(selectors.clientBalance.saveButton); await page.waitToClick(selectors.clientBalance.saveButton);
let result = await page.waitForLastSnackbar(); let result = await page.waitForLastSnackbar();
@ -116,13 +113,14 @@ 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.write(selectors.clientsIndex.searchClientInput, 'Petter Parker'); await page.waitForContentLoaded();
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);
let resultCount = await page.countElement(selectors.clientsIndex.searchResult); let resultCount = await page.countElement(selectors.clientsIndex.searchResult);
@ -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() => {

View File

@ -16,30 +16,32 @@ describe('User config', () => {
describe('as salesPerson', () => { describe('as salesPerson', () => {
it('should login', async() => { it('should login', async() => {
await page.login('salesPerson'); await page.login('salesPerson');
await page.waitForContentLoaded();
}); });
it('should now open the user config form to check the settings', async() => { it('should now open the user config form to check the settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton); await page.waitToClick(selectors.globalItems.userMenuButton);
await page.waitFor(1000);
let userLocalWarehouse = await page let expectedLocalWarehouse = await page
.getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value'); .expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
let userLocalBank = await page let expectedLocalBank = await page
.getProperty(`${selectors.globalItems.userLocalBank} input`, 'value'); .expectPropertyValue(selectors.globalItems.userLocalBank, 'value', '');
let userLocalCompany = await page let expectedLocalCompany = await page
.getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value'); .expectPropertyValue(selectors.globalItems.userLocalCompany, 'value', '');
let userWarehouse = await page let userWarehouse = await page
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value'); .waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
let userCompany = await page let userCompany = await page
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value'); .waitToGetProperty(selectors.globalItems.userCompany, 'value');
expect(userLocalWarehouse).toEqual(''); expect(expectedLocalWarehouse).toBeTruthy();
expect(userLocalBank).toEqual(''); expect(expectedLocalBank).toBeTruthy();
expect(userLocalCompany).toEqual(''); expect(expectedLocalCompany).toBeTruthy();
expect(userWarehouse).toEqual('Warehouse Three'); expect(userWarehouse).toEqual('Warehouse Three');
expect(userCompany).toEqual('VNH'); expect(userCompany).toEqual('VNH');
}); });
@ -48,28 +50,31 @@ describe('User config', () => {
describe('as employee', () => { describe('as employee', () => {
it('should log in', async() => { it('should log in', async() => {
await page.login('employee'); await page.login('employee');
await page.waitForContentLoaded();
}); });
it('should open the user config form to check the settings', async() => { it('should open the user config form to check the settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton); await page.waitToClick(selectors.globalItems.userMenuButton);
let userLocalWarehouse = await page await page.waitFor(1000);
.getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value'); let expectedLocalWarehouse = await page
.expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
let userLocalBank = await page
.getProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
let userLocalCompany = await page let expectedLocalBank = await page
.getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value'); .expectPropertyValue(selectors.globalItems.userLocalBank, 'value', '');
let expectedLocalCompany = await page
.expectPropertyValue(selectors.globalItems.userLocalCompany, 'value', '');
let userWarehouse = await page let userWarehouse = await page
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value'); .waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
let userCompany = await page let userCompany = await page
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value'); .waitToGetProperty(selectors.globalItems.userCompany, 'value');
expect(userLocalWarehouse).toEqual(''); expect(expectedLocalWarehouse).toBeTruthy();
expect(userLocalBank).toEqual(''); expect(expectedLocalBank).toBeTruthy();
expect(userLocalCompany).toEqual(''); expect(expectedLocalCompany).toBeTruthy();
expect(userWarehouse).toEqual('Warehouse Two'); expect(userWarehouse).toEqual('Warehouse Two');
expect(userCompany).toEqual('CCs'); expect(userCompany).toEqual('CCs');
}); });
@ -87,24 +92,25 @@ describe('User config', () => {
describe('as salesPerson 2nd run', () => { describe('as salesPerson 2nd run', () => {
it('should log in once more', async() => { it('should log in once more', async() => {
await page.login('salesPerson'); await page.login('salesPerson');
await page.waitForContentLoaded();
}); });
it('should again open the user config form to check the local settings', async() => { it('should again open the user config form to check the local settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton); await page.waitToClick(selectors.globalItems.userMenuButton);
let userLocalWarehouse = await page let userLocalWarehouse = await page
.waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value'); .waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
let userLocalBank = await page let userLocalBank = await page
.waitToGetProperty(`${selectors.globalItems.userLocalBank} input`, 'value'); .waitToGetProperty(selectors.globalItems.userLocalBank, 'value');
let userLocalCompany = await page let userLocalCompany = await page
.waitToGetProperty(`${selectors.globalItems.userLocalCompany} input`, 'value'); .waitToGetProperty(selectors.globalItems.userLocalCompany, 'value');
let userWarehouse = await page let userWarehouse = await page
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value'); .waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
let userCompany = await page let userCompany = await page
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value'); .waitToGetProperty(selectors.globalItems.userCompany, 'value');
expect(userLocalWarehouse).toContain('Warehouse Four'); expect(userLocalWarehouse).toContain('Warehouse Four');
expect(userLocalBank).toContain('Pay on receipt'); expect(userLocalBank).toContain('Pay on receipt');

View File

@ -17,8 +17,7 @@ describe('Worker pbx path', () => {
}); });
it('should receive an error when the extension exceeds 4 characters', async() => { it('should receive an error when the extension exceeds 4 characters', async() => {
await page.waitForContentLoaded(); await page.write(selectors.workerPbx.extension, '55555');
await page.write(selectors.workerPbx.extensionInput, '55555');
await page.waitToClick(selectors.workerPbx.saveButton); await page.waitToClick(selectors.workerPbx.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -26,8 +25,8 @@ describe('Worker pbx path', () => {
}); });
it('should sucessfully save the changes', async() => { it('should sucessfully save the changes', async() => {
await page.clearInput(selectors.workerPbx.extensionInput); await page.clearInput(selectors.workerPbx.extension);
await page.write(selectors.workerPbx.extensionInput, '4444'); await page.write(selectors.workerPbx.extension, '4444');
await page.waitToClick(selectors.workerPbx.saveButton); await page.waitToClick(selectors.workerPbx.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -23,7 +23,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '07:00'; const scanTime = '07:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfMonday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfMonday, 'innerText');
@ -34,7 +34,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:00'; const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfMonday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfMonday, 'innerText');
@ -45,7 +45,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '18:00'; const scanTime = '18:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText');
@ -67,7 +67,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '14:00'; const scanTime = '14:00';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText');
@ -78,7 +78,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:20'; const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfMonday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfMonday, 'innerText');
@ -108,7 +108,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '08:00'; const scanTime = '08:00';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfTuesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfTuesday, 'innerText');
@ -119,7 +119,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:00'; const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfTuesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfTuesday, 'innerText');
@ -130,7 +130,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:20'; const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfTuesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfTuesday, 'innerText');
@ -141,7 +141,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '16:00'; const scanTime = '16:00';
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfTuesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfTuesday, 'innerText');
@ -161,7 +161,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '09:00'; const scanTime = '09:00';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfWednesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfWednesday, 'innerText');
@ -172,7 +172,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:00'; const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfWednesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfWednesday, 'innerText');
@ -183,7 +183,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '10:20'; const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfWednesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfWednesday, 'innerText');
@ -194,7 +194,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '17:00'; const scanTime = '17:00';
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfWednesday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfWednesday, 'innerText');
@ -214,7 +214,7 @@ xdescribe('Worker time control path', () => {
const scanTime = '09:59'; const scanTime = '09:59';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfThursday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfThursday, 'innerText');
@ -224,7 +224,7 @@ xdescribe('Worker time control path', () => {
it(`should joyfully scan out Hank Pym for break`, async() => { it(`should joyfully scan out Hank Pym for break`, async() => {
const scanTime = '10:00'; const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfThursday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfThursday, 'innerText');
@ -234,7 +234,7 @@ xdescribe('Worker time control path', () => {
it(`should joyfully scan in Hank Pym from the break`, async() => { it(`should joyfully scan in Hank Pym from the break`, async() => {
const scanTime = '10:20'; const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfThursday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfThursday, 'innerText');
@ -244,7 +244,7 @@ xdescribe('Worker time control path', () => {
it(`should joyfully scan out Hank Pym for the day`, async() => { it(`should joyfully scan out Hank Pym for the day`, async() => {
const scanTime = '17:59'; const scanTime = '17:59';
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfThursday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfThursday, 'innerText');
@ -263,7 +263,7 @@ xdescribe('Worker time control path', () => {
it('should smilingly scan in Hank Pym', async() => { it('should smilingly scan in Hank Pym', async() => {
const scanTime = '07:30'; const scanTime = '07:30';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfFriday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfFriday, 'innerText');
@ -273,7 +273,7 @@ xdescribe('Worker time control path', () => {
it(`should smilingly scan out Hank Pym for break`, async() => { it(`should smilingly scan out Hank Pym for break`, async() => {
const scanTime = '10:00'; const scanTime = '10:00';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfFriday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfFriday, 'innerText');
@ -283,7 +283,7 @@ xdescribe('Worker time control path', () => {
it(`should smilingly scan in Hank Pym from the break`, async() => { it(`should smilingly scan in Hank Pym from the break`, async() => {
const scanTime = '10:20'; const scanTime = '10:20';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfFriday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfFriday, 'innerText');
@ -293,7 +293,7 @@ xdescribe('Worker time control path', () => {
it(`should smilingly scan out Hank Pym for the day`, async() => { it(`should smilingly scan out Hank Pym for the day`, async() => {
const scanTime = '15:30'; const scanTime = '15:30';
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfFriday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfFriday, 'innerText');
@ -324,7 +324,7 @@ xdescribe('Worker time control path', () => {
it('should lovingly scan in Hank Pym', async() => { it('should lovingly scan in Hank Pym', async() => {
const scanTime = '06:00'; const scanTime = '06:00';
await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSaturday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSaturday, 'innerText');
@ -334,7 +334,7 @@ xdescribe('Worker time control path', () => {
it(`should lovingly scan out Hank Pym for the day with no break to leave a bit early`, async() => { it(`should lovingly scan out Hank Pym for the day with no break to leave a bit early`, async() => {
const scanTime = '13:40'; const scanTime = '13:40';
await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSaturday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSaturday, 'innerText');
@ -353,7 +353,7 @@ xdescribe('Worker time control path', () => {
it('should gladly scan in Hank Pym', async() => { it('should gladly scan in Hank Pym', async() => {
const scanTime = '05:00'; const scanTime = '05:00';
await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSunday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSunday, 'innerText');
@ -363,7 +363,7 @@ xdescribe('Worker time control path', () => {
it(`should gladly scan out Hank Pym for the day with no break to leave a bit early`, async() => { it(`should gladly scan out Hank Pym for the day with no break to leave a bit early`, async() => {
const scanTime = '12:40'; const scanTime = '12:40';
await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton); await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton);
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime); await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
await page.waitToClick(selectors.workerTimeControl.confirmButton); await page.waitToClick(selectors.workerTimeControl.confirmButton);
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSunday, 'innerText'); const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSunday, 'innerText');

View File

@ -15,8 +15,8 @@ describe('Item summary path', () => {
}); });
it('should search for an item', async() => { it('should search for an item', async() => {
await page.clearInput(selectors.itemsIndex.searchItemInput); await page.clearInput(selectors.itemsIndex.topbarSearch);
await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon longbow 2m'); await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon longbow 2m');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const result = await page.countElement(selectors.itemsIndex.searchResult); const result = await page.countElement(selectors.itemsIndex.searchResult);
@ -76,7 +76,7 @@ describe('Item summary path', () => {
it('should search for other item', async() => { it('should search for other item', async() => {
await page.clearInput('vn-searchbar'); await page.clearInput('vn-searchbar');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.write(selectors.itemsIndex.searchItemInput, 'Melee weapon combat fist 15cm'); await page.write(selectors.itemsIndex.topbarSearch, 'Melee weapon combat fist 15cm');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const result = await page.countElement(selectors.itemsIndex.searchResult); const result = await page.countElement(selectors.itemsIndex.searchResult);
@ -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() => {

View File

@ -21,16 +21,16 @@ describe('Item Edit basic data path', () => {
}); });
it(`should edit the item basic data`, async() => { it(`should edit the item basic data`, async() => {
await page.clearInput(selectors.itemBasicData.nameInput); await page.clearInput(selectors.itemBasicData.name);
await page.write(selectors.itemBasicData.nameInput, 'Rose of Purity'); await page.write(selectors.itemBasicData.name, 'Rose of Purity');
await page.autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Anthurium'); await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium');
await page.autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares'); await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares');
await page.clearInput(selectors.itemBasicData.relevancyInput); await page.clearInput(selectors.itemBasicData.relevancy);
await page.write(selectors.itemBasicData.relevancyInput, '1'); await page.write(selectors.itemBasicData.relevancy, '1');
await page.autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain'); await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain');
await page.autocompleteSearch(selectors.itemBasicData.expenseAutocomplete, 'Alquiler VNH'); await page.autocompleteSearch(selectors.itemBasicData.expense, 'Alquiler VNH');
await page.clearInput(selectors.itemBasicData.longNameInput); await page.clearInput(selectors.itemBasicData.longName);
await page.write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity'); await page.write(selectors.itemBasicData.longName, 'RS Rose of Purity');
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox); await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox); await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox);
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton); await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
@ -42,49 +42,49 @@ describe('Item Edit basic data path', () => {
it(`should confirm the item name was edited`, async() => { it(`should confirm the item name was edited`, async() => {
await page.reloadSection('item.card.basicData'); await page.reloadSection('item.card.basicData');
await page.waitForContentLoaded(); await page.waitForContentLoaded();
const result = await page.waitToGetProperty(`${selectors.itemBasicData.nameInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.itemBasicData.name, 'value');
expect(result).toEqual('Rose of Purity'); expect(result).toEqual('Rose of Purity');
}); });
it(`should confirm the item type was edited`, async() => { it(`should confirm the item type was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.type, 'value');
expect(result).toEqual('Anthurium'); expect(result).toEqual('Anthurium');
}); });
it(`should confirm the item intrastad was edited`, async() => { it(`should confirm the item intrastad was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
expect(result).toEqual('5080000 Coral y materiales similares'); expect(result).toEqual('5080000 Coral y materiales similares');
}); });
it(`should confirm the item relevancy was edited`, async() => { it(`should confirm the item relevancy was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBasicData.relevancyInput} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.relevancy, 'value');
expect(result).toEqual('1'); expect(result).toEqual('1');
}); });
it(`should confirm the item origin was edited`, async() => { it(`should confirm the item origin was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.origin, 'value');
expect(result).toEqual('Spain'); expect(result).toEqual('Spain');
}); });
it(`should confirm the item expence was edited`, async() => { it(`should confirm the item expence was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBasicData.expenseAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.expense, 'value');
expect(result).toEqual('Alquiler VNH'); expect(result).toEqual('Alquiler VNH');
}); });
it(`should confirm the item long name was edited`, async() => { it(`should confirm the item long name was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBasicData.longNameInput} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.longName, 'value');
expect(result).toEqual('RS Rose of Purity'); expect(result).toEqual('RS Rose of Purity');
}); });

View File

@ -17,9 +17,9 @@ describe('Item edit tax path', () => {
}); });
it(`should add the item tax to all countries`, async() => { it(`should add the item tax to all countries`, async() => {
await page.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'General VAT'); await page.autocompleteSearch(selectors.itemTax.firstClass, 'General VAT');
await page.autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT'); await page.autocompleteSearch(selectors.itemTax.secondClass, 'General VAT');
await page.autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'General VAT'); await page.autocompleteSearch(selectors.itemTax.thirdClass, 'General VAT');
await page.waitToClick(selectors.itemTax.submitTaxButton); await page.waitToClick(selectors.itemTax.submitTaxButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -28,35 +28,35 @@ describe('Item edit tax path', () => {
it(`should confirm the first item tax class was edited`, async() => { it(`should confirm the first item tax class was edited`, async() => {
await page.reloadSection('item.card.tax'); await page.reloadSection('item.card.tax');
const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value'); const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('General VAT'); expect(firstVatType).toEqual('General VAT');
}); });
it(`should confirm the second item tax class was edited`, async() => { it(`should confirm the second item tax class was edited`, async() => {
const secondVatType = await page const secondVatType = await page
.waitToGetProperty(`${selectors.itemTax.secondClassAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemTax.secondClass, 'value');
expect(secondVatType).toEqual('General VAT'); expect(secondVatType).toEqual('General VAT');
}); });
it(`should confirm the third item tax class was edited`, async() => { it(`should confirm the third item tax class was edited`, async() => {
const thirdVatType = await page const thirdVatType = await page
.waitToGetProperty(`${selectors.itemTax.thirdClassAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemTax.thirdClass, 'value');
expect(thirdVatType).toEqual('General VAT'); expect(thirdVatType).toEqual('General VAT');
}); });
it(`should edit the first class without saving the form`, async() => { it(`should edit the first class without saving the form`, async() => {
await page.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT'); await page.autocompleteSearch(selectors.itemTax.firstClass, 'Reduced VAT');
const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value'); const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('Reduced VAT'); expect(firstVatType).toEqual('Reduced VAT');
}); });
it(`should now click the undo changes button and see the changes works`, async() => { it(`should now click the undo changes button and see the changes works`, async() => {
await page.waitToClick(selectors.itemTax.undoChangesButton); await page.waitToClick(selectors.itemTax.undoChangesButton);
const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value'); const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('General VAT'); expect(firstVatType).toEqual('General VAT');
}); });

View File

@ -19,10 +19,10 @@ describe('Item create tags path', () => {
it(`should create a new tag and delete a former one`, async() => { it(`should create a new tag and delete a former one`, async() => {
await page.waitToClick(selectors.itemTags.fourthRemoveTagButton); await page.waitToClick(selectors.itemTags.fourthRemoveTagButton);
await page.waitToClick(selectors.itemTags.addItemTagButton); await page.waitToClick(selectors.itemTags.addItemTagButton);
await page.autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base'); await page.autocompleteSearch(selectors.itemTags.seventhTag, 'Ancho de la base');
await page.write(selectors.itemTags.seventhValueInput, '50'); await page.write(selectors.itemTags.seventhValue, '50');
await page.clearInput(selectors.itemTags.seventhRelevancyInput); await page.clearInput(selectors.itemTags.seventhRelevancy);
await page.write(selectors.itemTags.seventhRelevancyInput, '4'); await page.write(selectors.itemTags.seventhRelevancy, '4');
await page.waitToClick(selectors.itemTags.submitItemTagsButton); await page.waitToClick(selectors.itemTags.submitItemTagsButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -32,30 +32,30 @@ describe('Item create tags path', () => {
it(`should confirm the fourth row data is the expected one`, async() => { it(`should confirm the fourth row data is the expected one`, async() => {
await page.reloadSection('item.card.tags'); await page.reloadSection('item.card.tags');
await page.wait('vn-item-tags'); await page.wait('vn-item-tags');
let result = await page.waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value'); let result = await page.waitToGetProperty(selectors.itemTags.fourthTag, 'value');
expect(result).toEqual('Ancho de la base'); expect(result).toEqual('Ancho de la base');
result = await page result = await page
.waitToGetProperty(`${selectors.itemTags.fourthValueInput} input`, 'value'); .waitToGetProperty(selectors.itemTags.fourthValue, 'value');
expect(result).toEqual('50'); expect(result).toEqual('50');
result = await page result = await page
.waitToGetProperty(`${selectors.itemTags.fourthRelevancyInput} input`, 'value'); .waitToGetProperty(selectors.itemTags.fourthRelevancy, 'value');
expect(result).toEqual('4'); expect(result).toEqual('4');
}); });
it(`should confirm the fifth row data is the expected one`, async() => { it(`should confirm the fifth row data is the expected one`, async() => {
let tag = await page let tag = await page
.waitToGetProperty(`${selectors.itemTags.fifthTagAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemTags.fifthTag, 'value');
let value = await page let value = await page
.waitToGetProperty(`${selectors.itemTags.fifthValueInput} input`, 'value'); .waitToGetProperty(selectors.itemTags.fifthValue, 'value');
let relevancy = await page let relevancy = await page
.waitToGetProperty(`${selectors.itemTags.fifthRelevancyInput} input`, 'value'); .waitToGetProperty(selectors.itemTags.fifthRelevancy, 'value');
expect(tag).toEqual('Color'); expect(tag).toEqual('Color');
expect(value).toEqual('Brown'); expect(value).toEqual('Brown');
@ -64,13 +64,13 @@ describe('Item create tags path', () => {
it(`should confirm the sixth row data is the expected one`, async() => { it(`should confirm the sixth row data is the expected one`, async() => {
let tag = await page let tag = await page
.waitToGetProperty(`${selectors.itemTags.sixthTagAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemTags.sixthTag, 'value');
let value = await page let value = await page
.waitToGetProperty(`${selectors.itemTags.sixthValueInput} input`, 'value'); .waitToGetProperty(selectors.itemTags.sixthValue, 'value');
let relevancy = await page let relevancy = await page
.waitToGetProperty(`${selectors.itemTags.sixthRelevancyInput} input`, 'value'); .waitToGetProperty(selectors.itemTags.sixthRelevancy, 'value');
expect(tag).toEqual('Categoria'); expect(tag).toEqual('Categoria');
expect(value).toEqual('+1 precission'); expect(value).toEqual('+1 precission');

View File

@ -17,11 +17,11 @@ describe('Item create niche path', () => {
}); });
it(`should click create a new niche and delete a former one`, async() => { it(`should click create a new niche and delete a former one`, async() => {
await page.waitForTextInInput(selectors.itemNiches.firstWarehouseAutocomplete, 'Warehouse One'); await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemNiches.addNicheButton); await page.waitToClick(selectors.itemNiches.addNicheButton);
await page.waitToClick(selectors.itemNiches.secondNicheRemoveButton); await page.waitToClick(selectors.itemNiches.secondNicheRemoveButton);
await page.autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two'); await page.autocompleteSearch(selectors.itemNiches.thirdWarehouse, 'Warehouse Two');
await page.write(selectors.itemNiches.thirdCodeInput, 'A4'); await page.write(selectors.itemNiches.thirdCode, 'A4');
await page.waitToClick(selectors.itemNiches.submitNichesButton); await page.waitToClick(selectors.itemNiches.submitNichesButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -30,36 +30,36 @@ describe('Item create niche path', () => {
it(`should confirm the first niche is the expected one`, async() => { it(`should confirm the first niche is the expected one`, async() => {
await page.reloadSection('item.card.niche'); await page.reloadSection('item.card.niche');
await page.waitForTextInInput(selectors.itemNiches.firstWarehouseAutocomplete, 'Warehouse One'); await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
let result = await page let result = await page
.waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemNiches.firstWarehouse, 'value');
expect(result).toEqual('Warehouse One'); expect(result).toEqual('Warehouse One');
result = await page result = await page
.waitToGetProperty(`${selectors.itemNiches.firstCodeInput} input`, 'value'); .waitToGetProperty(selectors.itemNiches.firstCode, 'value');
expect(result).toEqual('A1'); expect(result).toEqual('A1');
}); });
it(`should confirm the second niche is the expected one`, async() => { it(`should confirm the second niche is the expected one`, async() => {
let result = await page let result = await page
.waitToGetProperty(`${selectors.itemNiches.secondWarehouseAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemNiches.secondWarehouse, 'value');
expect(result).toEqual('Warehouse Three'); expect(result).toEqual('Warehouse Three');
result = await page result = await page
.waitToGetProperty(`${selectors.itemNiches.secondCodeInput} input`, 'value'); .waitToGetProperty(selectors.itemNiches.secondCode, 'value');
expect(result).toEqual('A3'); expect(result).toEqual('A3');
}); });
it(`should confirm the third niche is the expected one`, async() => { it(`should confirm the third niche is the expected one`, async() => {
let result = await page let result = await page
.waitToGetProperty(`${selectors.itemNiches.thirdWarehouseAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemNiches.thirdWarehouse, 'value');
expect(result).toEqual('Warehouse Two'); expect(result).toEqual('Warehouse Two');
result = await page result = await page
.waitToGetProperty(`${selectors.itemNiches.thirdCodeInput} input`, 'value'); .waitToGetProperty(selectors.itemNiches.thirdCode, 'value');
expect(result).toEqual('A4'); expect(result).toEqual('A4');
}); });

View File

@ -17,9 +17,9 @@ describe('Item Create botanical path', () => {
}); });
it(`should create a new botanical for the item`, async() => { it(`should create a new botanical for the item`, async() => {
await page.write(selectors.itemBotanical.botanicalInput, 'Cicuta maculata'); await page.write(selectors.itemBotanical.botanical, 'Cicuta maculata');
await page.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia'); await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abelia');
await page.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata'); await page.autocompleteSearch(selectors.itemBotanical.species, 'dealbata');
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton); await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -28,33 +28,33 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was created`, async() => { it(`should confirm the botanical for the item was created`, async() => {
await page.reloadSection('item.card.botanical'); await page.reloadSection('item.card.botanical');
await page.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata'); await page.waitForTextInField(selectors.itemBotanical.botanical, 'Cicuta maculata');
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBotanical.botanicalInput} input`, 'value'); .waitToGetProperty(selectors.itemBotanical.botanical, 'value');
expect(result).toEqual('Cicuta maculata'); expect(result).toEqual('Cicuta maculata');
}); });
it(`should confirm the Genus for the item was created`, async() => { it(`should confirm the Genus for the item was created`, async() => {
await page.waitForTextInInput(selectors.itemBotanical.genusAutocomplete, 'Abelia'); await page.waitForTextInField(selectors.itemBotanical.genus, 'Abelia');
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBotanical.genus, 'value');
expect(result).toEqual('Abelia'); expect(result).toEqual('Abelia');
}); });
it(`should confirm the Species for the item was created`, async() => { it(`should confirm the Species for the item was created`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBotanical.species, 'value');
expect(result).toEqual('dealbata'); expect(result).toEqual('dealbata');
}); });
it(`should edit botanical for the item`, async() => { it(`should edit botanical for the item`, async() => {
await page.clearInput(selectors.itemBotanical.botanicalInput); await page.clearInput(selectors.itemBotanical.botanical);
await page.write(selectors.itemBotanical.botanicalInput, 'Herp Derp'); await page.write(selectors.itemBotanical.botanical, 'Herp Derp');
await page.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies'); await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abies');
await page.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens'); await page.autocompleteSearch(selectors.itemBotanical.species, 'decurrens');
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton); await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -63,24 +63,24 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was edited`, async() => { it(`should confirm the botanical for the item was edited`, async() => {
await page.reloadSection('item.card.botanical'); await page.reloadSection('item.card.botanical');
await page.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp'); await page.waitForTextInField(selectors.itemBotanical.botanical, 'Herp Derp');
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBotanical.botanicalInput} input`, 'value'); .waitToGetProperty(selectors.itemBotanical.botanical, 'value');
expect(result).toEqual('Herp Derp'); expect(result).toEqual('Herp Derp');
}); });
it(`should confirm the Genus for the item was edited`, async() => { it(`should confirm the Genus for the item was edited`, async() => {
await page.waitForTextInInput(selectors.itemBotanical.genusAutocomplete, 'Abies'); await page.waitForTextInField(selectors.itemBotanical.genus, 'Abies');
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBotanical.genus, 'value');
expect(result).toEqual('Abies'); expect(result).toEqual('Abies');
}); });
it(`should confirm the Species for the item was edited`, async() => { it(`should confirm the Species for the item was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBotanical.species, 'value');
expect(result).toEqual('decurrens'); expect(result).toEqual('decurrens');
}); });

View File

@ -19,7 +19,7 @@ describe('Item Create barcodes path', () => {
it(`should click create a new code and delete a former one`, async() => { it(`should click create a new code and delete a former one`, async() => {
await page.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton); await page.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton);
await page.waitToClick(selectors.itemBarcodes.addBarcodeButton); await page.waitToClick(selectors.itemBarcodes.addBarcodeButton);
await page.write(selectors.itemBarcodes.thirdCodeInput, '5'); await page.write(selectors.itemBarcodes.thirdCode, '5');
await page.waitToClick(selectors.itemBarcodes.submitBarcodesButton); await page.waitToClick(selectors.itemBarcodes.submitBarcodesButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -28,9 +28,9 @@ describe('Item Create barcodes path', () => {
it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => { it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => {
await page.reloadSection('item.card.itemBarcode'); await page.reloadSection('item.card.itemBarcode');
await page.waitForTextInInput(selectors.itemBarcodes.thirdCodeInput, '5'); await page.waitForTextInField(selectors.itemBarcodes.thirdCode, '5');
const result = await page const result = await page
.waitToGetProperty(`${selectors.itemBarcodes.thirdCodeInput} input`, 'value'); .waitToGetProperty(selectors.itemBarcodes.thirdCode, 'value');
expect(result).toEqual('5'); expect(result).toEqual('5');
}); });

View File

@ -16,8 +16,8 @@ describe('Item Create/Clone path', () => {
describe('create', () => { describe('create', () => {
it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => { it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => {
await page.clearInput(selectors.itemsIndex.searchItemInput); await page.clearInput(selectors.itemsIndex.topbarSearch);
await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet'); await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0);
const result = await page.countElement(selectors.itemsIndex.searchResult); const result = await page.countElement(selectors.itemsIndex.searchResult);
@ -27,34 +27,31 @@ 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() => {
await page.write(selectors.itemCreateView.temporalName, 'Infinity Gauntlet'); await page.write(selectors.itemCreateView.temporalName, 'Infinity Gauntlet');
await page.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo'); await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares'); await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand'); await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton); await page.waitToClick(selectors.itemCreateView.createButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -63,23 +60,23 @@ describe('Item Create/Clone path', () => {
it('should confirm Infinity Gauntlet item was created', async() => { it('should confirm Infinity Gauntlet item was created', async() => {
let result = await page let result = await page
.waitToGetProperty(`${selectors.itemBasicData.nameInput} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.name, 'value');
expect(result).toEqual('Infinity Gauntlet'); expect(result).toEqual('Infinity Gauntlet');
result = await page result = await page
.waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.type, 'value');
expect(result).toEqual('Crisantemo'); expect(result).toEqual('Crisantemo');
result = await page result = await page
.waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
expect(result).toEqual('5080000 Coral y materiales similares'); expect(result).toEqual('5080000 Coral y materiales similares');
result = await page result = await page
.waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value'); .waitToGetProperty(selectors.itemBasicData.origin, 'value');
expect(result).toEqual('Holand'); expect(result).toEqual('Holand');
}); });
@ -89,15 +86,14 @@ 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() => {
await page.clearInput(selectors.itemsIndex.searchItemInput); await page.clearInput(selectors.itemsIndex.topbarSearch);
await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet'); await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const result = await page.countElement(selectors.itemsIndex.searchResult); const result = await page.countElement(selectors.itemsIndex.searchResult);
@ -109,16 +105,15 @@ 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() => {
await page.waitToClick(selectors.itemTags.goToItemIndexButton); await page.waitToClick(selectors.itemTags.goToItemIndexButton);
await page.clearInput(selectors.itemsIndex.searchItemInput); await page.clearInput(selectors.itemsIndex.topbarSearch);
await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet'); await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
const result = await page.countElement(selectors.itemsIndex.searchResult); const result = await page.countElement(selectors.itemsIndex.searchResult);

View File

@ -25,7 +25,7 @@ describe('Item regularize path', () => {
it('should check the local settings were saved', async() => { it('should check the local settings were saved', async() => {
const userLocalWarehouse = await page const userLocalWarehouse = await page
.waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value'); .waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
await page.keyboard.press('Escape'); await page.keyboard.press('Escape');
await page.waitForSelector('.user-popover.vn-popover', {hidden: true}); await page.waitForSelector('.user-popover.vn-popover', {hidden: true});
@ -34,8 +34,8 @@ describe('Item regularize path', () => {
}); });
it('should search for an specific item', async() => { it('should search for an specific item', async() => {
await page.clearInput(selectors.itemsIndex.searchItemInput); await page.clearInput(selectors.itemsIndex.topbarSearch);
await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm'); await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon pistol 9mm');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const resultCount = await page.countElement(selectors.itemsIndex.searchResult); const resultCount = await page.countElement(selectors.itemsIndex.searchResult);
@ -46,23 +46,22 @@ 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() => {
await page.waitToClick(selectors.itemDescriptor.moreMenu); await page.waitToClick(selectors.itemDescriptor.moreMenu);
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton); await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
const result = await page.waitToGetProperty(`${selectors.itemDescriptor.regularizeWarehouseAutocomplete} input`, 'value'); const result = await page.waitToGetProperty(selectors.itemDescriptor.regularizeWarehouse, 'value');
expect(result).toEqual('Warehouse Four'); expect(result).toEqual('Warehouse Four');
}); });
it('should regularize the item', async() => { it('should regularize the item', async() => {
await page.write(selectors.itemDescriptor.regularizeQuantityInput, '100'); await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One'); await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton); await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -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() => {
@ -92,7 +91,7 @@ describe('Item regularize path', () => {
it('should search for the ticket with alias missing', async() => { it('should search for the ticket with alias missing', async() => {
await page.keyboard.press('Escape'); await page.keyboard.press('Escape');
await page.write(selectors.ticketsIndex.searchTicketInput, 'missing'); await page.write(selectors.ticketsIndex.topbarSearch, 'missing');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult); const result = await page.countElement(selectors.ticketsIndex.searchResult);
@ -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,15 +126,14 @@ 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.searchItemInput); 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() => {
await page.clearInput(selectors.itemsIndex.searchItemInput); await page.clearInput(selectors.itemsIndex.topbarSearch);
await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm'); await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon pistol 9mm');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
const resultCount = await page.countElement(selectors.itemsIndex.searchResult); const resultCount = await page.countElement(selectors.itemsIndex.searchResult);
@ -147,17 +144,16 @@ 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() => {
await page.waitToClick(selectors.itemDescriptor.moreMenu); await page.waitToClick(selectors.itemDescriptor.moreMenu);
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton); await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
await page.write(selectors.itemDescriptor.regularizeQuantityInput, '100'); await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One'); await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton); await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -172,13 +168,13 @@ 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() => {
await page.write(selectors.ticketsIndex.searchTicketInput, '25'); await page.write(selectors.ticketsIndex.topbarSearch, '25');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult); const result = await page.countElement(selectors.ticketsIndex.searchResult);
@ -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() => {

View File

@ -15,7 +15,7 @@ describe('Item log path', () => {
}); });
it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => { it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => {
await page.write(selectors.itemsIndex.searchItemInput, 'Knowledge artifact'); await page.write(selectors.itemsIndex.topbarSearch, 'Knowledge artifact');
await page.waitToClick(selectors.itemsIndex.searchButton); await page.waitToClick(selectors.itemsIndex.searchButton);
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0);
const result = await page.countElement(selectors.itemsIndex.searchResult); const result = await page.countElement(selectors.itemsIndex.searchResult);
@ -25,17 +25,16 @@ 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() => {
await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact'); await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact');
await page.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo'); await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares'); await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand'); await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton); await page.waitToClick(selectors.itemCreateView.createButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -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() => {

View File

@ -18,7 +18,6 @@ describe('Ticket List sale path', () => {
}); });
it('should confirm the first ticket sale contains the colour tag', async() => { it('should confirm the first ticket sale contains the colour tag', async() => {
await page.waitForContentLoaded();
const value = await page const value = await page
.waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText'); .waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText');

View File

@ -21,7 +21,7 @@ xdescribe('Ticket Edit sale path', () => {
it(`should click on the first sale claim icon to navigate over there`, async() => { it(`should click on the first sale claim icon to navigate over there`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.firstSaleClaimIcon) .waitToClick(selectors.ticketSales.firstSaleClaimIcon)
.wait(selectors.claimBasicData.claimStateAutocomplete) .wait(selectors.claimBasicData.claimState)
.parsedUrl(); .parsedUrl();
expect(url.hash).toEqual('#!/claim/2/basic-data'); expect(url.hash).toEqual('#!/claim/2/basic-data');
@ -32,7 +32,7 @@ xdescribe('Ticket Edit sale path', () => {
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
.waitToClick(selectors.globalItems.ticketsButton) .waitToClick(selectors.globalItems.ticketsButton)
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.topbarSearch)
.parsedUrl(); .parsedUrl();
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
@ -196,7 +196,7 @@ xdescribe('Ticket Edit sale path', () => {
.waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.thirdSaleCheckbox)
.waitToClick(selectors.ticketSales.moreMenu) .waitToClick(selectors.ticketSales.moreMenu)
.waitToClick(selectors.ticketSales.moreMenuCreateClaim) .waitToClick(selectors.ticketSales.moreMenuCreateClaim)
.wait(selectors.claimBasicData.claimStateAutocomplete) .wait(selectors.claimBasicData.claimState)
.parsedUrl(); .parsedUrl();
expect(url.hash).toContain('basic-data'); expect(url.hash).toContain('basic-data');
@ -228,7 +228,7 @@ xdescribe('Ticket Edit sale path', () => {
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
.waitToClick(selectors.globalItems.ticketsButton) .waitToClick(selectors.globalItems.ticketsButton)
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.topbarSearch)
.parsedUrl(); .parsedUrl();
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');

View File

@ -18,10 +18,9 @@ describe('Ticket Create notes path', () => {
}); });
it('should create a new note', async() => { it('should create a new note', async() => {
await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketNotes.addNoteButton); await page.waitToClick(selectors.ticketNotes.addNoteButton);
await page.autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one'); await page.autocompleteSearch(selectors.ticketNotes.firstNoteType, 'observation one');
await page.write(selectors.ticketNotes.firstDescriptionInput, 'description'); await page.write(selectors.ticketNotes.firstDescription, 'description');
await page.waitToClick(selectors.ticketNotes.submitNotesButton); await page.waitToClick(selectors.ticketNotes.submitNotesButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -31,12 +30,12 @@ describe('Ticket Create notes path', () => {
it('should confirm the note is the expected one', async() => { it('should confirm the note is the expected one', async() => {
await page.reloadSection('ticket.card.observation'); await page.reloadSection('ticket.card.observation');
const result = await page const result = await page
.waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value'); .waitToGetProperty(selectors.ticketNotes.firstNoteType, 'value');
expect(result).toEqual('observation one'); expect(result).toEqual('observation one');
const firstDescription = await page const firstDescription = await page
.waitToGetProperty(`${selectors.ticketNotes.firstDescriptionInput} input`, 'value'); .waitToGetProperty(selectors.ticketNotes.firstDescription, 'value');
expect(firstDescription).toEqual('description'); expect(firstDescription).toEqual('description');
}); });

View File

@ -20,7 +20,7 @@ describe('Ticket Create packages path', () => {
it(`should attempt create a new package but receive an error if package is blank`, async() => { it(`should attempt create a new package but receive an error if package is blank`, async() => {
await page.waitToClick(selectors.ticketPackages.firstRemovePackageButton); await page.waitToClick(selectors.ticketPackages.firstRemovePackageButton);
await page.waitToClick(selectors.ticketPackages.addPackageButton); await page.waitToClick(selectors.ticketPackages.addPackageButton);
await page.write(selectors.ticketPackages.firstQuantityInput, '99'); await page.write(selectors.ticketPackages.firstQuantity, '99');
await page.waitToClick(selectors.ticketPackages.savePackagesButton); await page.waitToClick(selectors.ticketPackages.savePackagesButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -28,8 +28,8 @@ describe('Ticket Create packages path', () => {
}); });
it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => { it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => {
await page.clearInput(selectors.ticketPackages.firstQuantityInput); await page.clearInput(selectors.ticketPackages.firstQuantity);
await page.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Container medical box 1m'); await page.autocompleteSearch(selectors.ticketPackages.firstPackage, 'Container medical box 1m');
await page.waitToClick(selectors.ticketPackages.savePackagesButton); await page.waitToClick(selectors.ticketPackages.savePackagesButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -40,14 +40,14 @@ describe('Ticket Create packages path', () => {
const result = await page const result = await page
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(`${selector} input`).checkValidity(); return document.querySelector(`${selector} input`).checkValidity();
}, selectors.ticketPackages.firstQuantityInput); }, selectors.ticketPackages.firstQuantity);
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
it(`should create a new package with correct data`, async() => { it(`should create a new package with correct data`, async() => {
await page.clearInput(selectors.ticketPackages.firstQuantityInput); await page.clearInput(selectors.ticketPackages.firstQuantity);
await page.write(selectors.ticketPackages.firstQuantityInput, '-99'); await page.write(selectors.ticketPackages.firstQuantity, '-99');
await page.waitToClick(selectors.ticketPackages.savePackagesButton); await page.waitToClick(selectors.ticketPackages.savePackagesButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -56,15 +56,15 @@ describe('Ticket Create packages path', () => {
it(`should confirm the first select is the expected one`, async() => { it(`should confirm the first select is the expected one`, async() => {
await page.reloadSection('ticket.card.package'); await page.reloadSection('ticket.card.package');
await page.waitForTextInInput(selectors.ticketPackages.firstPackageAutocomplete, 'Container medical box 1m'); await page.waitForTextInField(selectors.ticketPackages.firstPackage, 'Container medical box 1m');
const result = await page.waitToGetProperty(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'value'); const result = await page.waitToGetProperty(selectors.ticketPackages.firstPackage, 'value');
expect(result).toEqual('7 : Container medical box 1m'); expect(result).toEqual('7 : Container medical box 1m');
}); });
it(`should confirm the first quantity is just a number and the string part was ignored by the imput number`, async() => { it(`should confirm the first quantity is just a number and the string part was ignored by the imput number`, async() => {
await page.waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '-99'); await page.waitForTextInField(selectors.ticketPackages.firstQuantity, '-99');
const result = await page.waitToGetProperty(`${selectors.ticketPackages.firstQuantityInput} input`, 'value'); const result = await page.waitToGetProperty(selectors.ticketPackages.firstQuantity, 'value');
expect(result).toEqual('-99'); expect(result).toEqual('-99');
}); });

View File

@ -19,12 +19,11 @@ 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.waitForContentLoaded();
await page.waitToClick(selectors.ticketTracking.createStateButton); await page.waitToClick(selectors.ticketTracking.createStateButton);
await page.waitForSelector(selectors.createStateView.stateAutocomplete, {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() => {
@ -35,7 +34,7 @@ describe('Ticket Create new tracking state path', () => {
}); });
it(`should create a new state`, async() => { it(`should create a new state`, async() => {
await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?'); await page.autocompleteSearch(selectors.createStateView.state, '¿Fecha?');
await page.waitToClick(selectors.createStateView.saveStateButton); await page.waitToClick(selectors.createStateView.saveStateButton);
let result = await page.waitForLastSnackbar(); let result = await page.waitForLastSnackbar();
@ -52,15 +51,14 @@ 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() => {
await page.waitFor(1500); await page.waitFor(1500);
await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'Encajado'); await page.autocompleteSearch(selectors.createStateView.state, 'Encajado');
await page.waitToClick(selectors.createStateView.saveStateButton); await page.waitToClick(selectors.createStateView.saveStateButton);
let result = await page.waitForLastSnackbar(); let result = await page.waitForLastSnackbar();
@ -68,9 +66,9 @@ describe('Ticket Create new tracking state path', () => {
}); });
it(`should make sure the worker gets autocomplete uppon selecting the assigned state`, async() => { it(`should make sure the worker gets autocomplete uppon selecting the assigned state`, async() => {
await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'asignado'); await page.autocompleteSearch(selectors.createStateView.state, 'asignado');
let result = await page let result = await page
.waitToGetProperty(`${selectors.createStateView.workerAutocomplete} input`, 'value'); .waitToGetProperty(selectors.createStateView.worker, 'value');
expect(result).toEqual('salesPersonNick'); expect(result).toEqual('salesPersonNick');
}); });

View File

@ -18,10 +18,10 @@ describe('Ticket Edit basic data path', () => {
}); });
it(`should confirm the zone autocomplete is disabled unless your role is productionBoss`, async() => { it(`should confirm the zone autocomplete is disabled unless your role is productionBoss`, async() => {
await page.waitForSelector(selectors.ticketBasicData.zoneAutocomplete, {}); await page.waitForSelector(selectors.ticketBasicData.zone, {});
const disabled = await page.evaluate(selector => { const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, `${selectors.ticketBasicData.zoneAutocomplete} input`); }, `${selectors.ticketBasicData.zone} input`);
expect(disabled).toBeTruthy(); expect(disabled).toBeTruthy();
}); });
@ -34,43 +34,43 @@ describe('Ticket Edit basic data path', () => {
it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => { it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => {
await page.waitForSpinnerLoad(); await page.waitForSpinnerLoad();
await page.wait(selectors.ticketBasicData.zoneAutocomplete); await page.wait(selectors.ticketBasicData.zone);
const disabled = await page.evaluate(selector => { const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, `${selectors.ticketBasicData.zoneAutocomplete} input`); }, `${selectors.ticketBasicData.zone} input`);
expect(disabled).toBeFalsy(); expect(disabled).toBeFalsy();
}); });
it(`should check the zone is for Silla247`, async() => { it(`should check the zone is for Silla247`, async() => {
let zone = await page let zone = await page
.waitToGetProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value'); .waitToGetProperty(selectors.ticketBasicData.zone, 'value');
expect(zone).toContain('Zone 247 A'); expect(zone).toContain('Zone 247 A');
}); });
it(`should edit the ticket agency then check there are no zones for it`, async() => { it(`should edit the ticket agency then check there are no zones for it`, async() => {
await page.autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Entanglement'); await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Entanglement');
let zone = await page await page.waitFor(1000);
.getProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value'); let emptyZone = await page
.expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');
expect(zone.length).toEqual(0); expect(emptyZone).toBeTruthy();
}); });
it(`should edit the ticket zone then check the agency is for the new zone`, async() => { it(`should edit the ticket zone then check the agency is for the new zone`, async() => {
await page.autocompleteSearch(selectors.ticketBasicData.zoneAutocomplete, 'Zone expensive A'); await page.autocompleteSearch(selectors.ticketBasicData.zone, 'Zone expensive A');
let zone = await page let zone = await page
.waitToGetProperty(`${selectors.ticketBasicData.agencyAutocomplete} input`, 'value'); .waitToGetProperty(selectors.ticketBasicData.agency, 'value');
expect(zone).toContain('Silla247Expensive'); expect(zone).toContain('Silla247Expensive');
}); });
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() => {
@ -82,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.chargesReasonAutocomplete, '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);
}); });
}); });

View File

@ -42,16 +42,14 @@ 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() => {
await page.accessToSection('ticket.weekly.index'); await page.accessToSection('ticket.weekly.index');
const result = await page.waitToGetProperty(`${selectors.ticketsIndex.sixthWeeklyTicket} input`, 'value'); const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
expect(result).toEqual('Thursday'); expect(result).toEqual('Thursday');
}); });
@ -60,16 +58,14 @@ 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() => {
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.write(selectors.ticketsIndex.searchTicketInput, '11'); await page.write(selectors.ticketsIndex.topbarSearch, '11');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult); const result = await page.countElement(selectors.ticketsIndex.searchResult);
@ -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,21 +94,20 @@ 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.searchTicketInput); 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() => {
await page.accessToSection('ticket.weekly.index'); await page.accessToSection('ticket.weekly.index');
const result = await page.waitToGetProperty(`${selectors.ticketsIndex.sixthWeeklyTicket} input`, 'value'); const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
expect(result).toEqual('Saturday'); expect(result).toEqual('Saturday');
}); });
it('should now search for the weekly ticket 11', async() => { it('should now search for the weekly ticket 11', async() => {
await page.write(selectors.ticketsIndex.searchTicketInput, '11'); await page.write(selectors.ticketsIndex.topbarSearch, '11');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchWeeklyResult); const result = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);

View File

@ -20,9 +20,9 @@ describe('Ticket purchase request path', () => {
it(`should add a new request`, async() => { it(`should add a new request`, async() => {
await page.waitToClick(selectors.ticketRequests.addRequestButton); await page.waitToClick(selectors.ticketRequests.addRequestButton);
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff'); await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
await page.write(selectors.ticketRequests.quantityInput, '99'); await page.write(selectors.ticketRequests.quantity, '99');
await page.autocompleteSearch(selectors.ticketRequests.atenderAutocomplete, 'buyerNick'); await page.autocompleteSearch(selectors.ticketRequests.atender, 'buyerNick');
await page.write(selectors.ticketRequests.priceInput, '999'); await page.write(selectors.ticketRequests.price, '999');
await page.waitToClick(selectors.ticketRequests.saveButton); await page.waitToClick(selectors.ticketRequests.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -30,15 +30,14 @@ 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() => {
await page.reloadSection('ticket.card.request.index'); await page.reloadSection('ticket.card.request.index');
const result = await page.waitToGetProperty(`${selectors.ticketRequests.firstDescription} input`, 'value'); const result = await page.waitToGetProperty(selectors.ticketRequests.firstDescription, 'value');
expect(result).toEqual('New stuff'); expect(result).toEqual('New stuff');
}); });

View File

@ -17,7 +17,7 @@ xdescribe('Ticket diary path', () => {
}); });
it('should search for a specific ticket', async() => { it('should search for a specific ticket', async() => {
await page.write(selectors.ticketsIndex.searchTicketInput, '1'); await page.write(selectors.ticketsIndex.topbarSearch, '1');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult); const result = await page.countElement(selectors.ticketsIndex.searchResult);
@ -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() => {
@ -59,7 +57,7 @@ xdescribe('Ticket diary path', () => {
}); });
it(`should change to the warehouse two and check there are sales marked as negative balance`, async() => { it(`should change to the warehouse two and check there are sales marked as negative balance`, async() => {
await page.autocompleteSearch(selectors.itemDiary.warehouseAutocomplete, 'Warehouse Two'); await page.autocompleteSearch(selectors.itemDiary.warehouse, 'Warehouse Two');
const result = await page const result = await page
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className'); .waitToGetProperty(selectors.itemDiary.firstBalance, 'className');

View File

@ -17,7 +17,7 @@ describe('Ticket descriptor path', () => {
describe('Delete ticket', () => { describe('Delete ticket', () => {
it('should search for an specific ticket', async() => { it('should search for an specific ticket', async() => {
await page.write(selectors.ticketsIndex.searchTicketInput, '18'); await page.write(selectors.ticketsIndex.topbarSearch, '18');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult); const result = await page.countElement(selectors.ticketsIndex.searchResult);
@ -28,17 +28,16 @@ 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() => {
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuChangeShippedHour); await page.waitToClick(selectors.ticketDescriptor.moreMenuChangeShippedHour);
await page.pickTime(selectors.ticketDescriptor.changeShippedHourInput, '08:15'); await page.pickTime(selectors.ticketDescriptor.changeShippedHour, '08:15');
await page.waitToClick(selectors.ticketDescriptor.acceptChangeHourButton); await page.waitToClick(selectors.ticketDescriptor.acceptChangeHourButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -62,13 +61,13 @@ 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() => {
await page.write(selectors.ticketsIndex.searchTicketInput, '18'); await page.write(selectors.ticketsIndex.topbarSearch, '18');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
await page.wait(selectors.ticketsIndex.searchResultDate); await page.wait(selectors.ticketsIndex.searchResultDate);
@ -80,8 +79,8 @@ describe('Ticket descriptor path', () => {
describe('add stowaway', () => { describe('add stowaway', () => {
it('should search for a ticket', async() => { it('should search for a ticket', async() => {
await page.clearInput(selectors.ticketsIndex.searchTicketInput); await page.clearInput(selectors.ticketsIndex.topbarSearch);
await page.write(selectors.ticketsIndex.searchTicketInput, '16'); await page.write(selectors.ticketsIndex.topbarSearch, '16');
await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult); const result = await page.countElement(selectors.ticketsIndex.searchResult);
@ -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() => {

View File

@ -29,8 +29,8 @@ describe('Ticket services path', () => {
}, 15000); }, 15000);
it('should receive an error if you attempt to save a service without access rights', async() => { it('should receive an error if you attempt to save a service without access rights', async() => {
await page.clearInput(selectors.ticketService.firstPriceInput); await page.clearInput(selectors.ticketService.firstPrice);
await page.write(selectors.ticketService.firstPriceInput, '999'); await page.write(selectors.ticketService.firstPrice, '999');
await page.waitToClick(selectors.ticketService.saveServiceButton); await page.waitToClick(selectors.ticketService.saveServiceButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -44,17 +44,16 @@ 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() => {
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketService.addServiceButton); await page.waitToClick(selectors.ticketService.addServiceButton);
const result = await page const result = await page
.isVisible(selectors.ticketService.firstServiceTypeAutocomplete); .isVisible(selectors.ticketService.firstServiceType);
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
@ -69,7 +68,7 @@ describe('Ticket services path', () => {
it('should click on the add new service type to open the dialog', async() => { it('should click on the add new service type to open the dialog', async() => {
await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton); await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton);
await page.wait('.vn-dialog.shown'); await page.wait('.vn-dialog.shown');
const result = await page.isVisible(selectors.ticketService.newServiceTypeNameInput); const result = await page.isVisible(selectors.ticketService.newServiceTypeName);
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
@ -82,10 +81,11 @@ describe('Ticket services path', () => {
}); });
it('should create a new service type then add price then create the service', async() => { it('should create a new service type then add price then create the service', async() => {
await page.write(selectors.ticketService.newServiceTypeNameInput, 'Documentos'); await page.write(selectors.ticketService.newServiceTypeName, 'Documentos');
await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpenseAutocomplete, '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.firstPriceInput, '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();
@ -95,28 +95,28 @@ describe('Ticket services path', () => {
it('should confirm the service description was created correctly', async() => { it('should confirm the service description was created correctly', async() => {
await page.reloadSection('ticket.card.service'); await page.reloadSection('ticket.card.service');
const result = await page const result = await page
.waitToGetProperty(`${selectors.ticketService.firstServiceTypeAutocomplete} input`, 'value'); .waitToGetProperty(selectors.ticketService.firstServiceType, 'value');
expect(result).toEqual('Documentos'); expect(result).toEqual('Documentos');
}); });
it('should confirm the service quantity was created correctly', async() => { it('should confirm the service quantity was created correctly', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.ticketService.firstQuantityInput} input`, 'value'); .waitToGetProperty(selectors.ticketService.firstQuantity, 'value');
expect(result).toEqual('1'); expect(result).toEqual('1');
}); });
it('should confirm the service price was created correctly', async() => { it('should confirm the service price was created correctly', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.ticketService.firstPriceInput} input`, 'value'); .waitToGetProperty(selectors.ticketService.firstPrice, 'value');
expect(result).toEqual('999'); expect(result).toEqual('999');
}); });
it('should confirm the service VAT was created correctly', async() => { it('should confirm the service VAT was created correctly', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.ticketService.firstVatTypeAutocomplete} input`, 'value'); .waitToGetProperty(selectors.ticketService.firstVatType, 'value');
expect(result).toEqual('General VAT'); expect(result).toEqual('General VAT');
}); });
@ -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();

View File

@ -17,18 +17,17 @@ 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.clientAutocomplete); 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() => {
await page.autocompleteSearch(selectors.createTicketView.clientAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.createTicketView.client, 'Tony Stark');
await page.autocompleteSearch(selectors.createTicketView.addressAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.createTicketView.address, 'Tony Stark');
await page.datePicker(selectors.createTicketView.deliveryDateInput, 1, null); await page.datePicker(selectors.createTicketView.deliveryDate, 1, null);
await page.autocompleteSearch(selectors.createTicketView.warehouseAutocomplete, 'Warehouse One'); await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse One');
await page.autocompleteSearch(selectors.createTicketView.agencyAutocomplete, 'Silla247'); await page.autocompleteSearch(selectors.createTicketView.agency, 'Silla247');
await page.waitToClick(selectors.createTicketView.createButton); await page.waitToClick(selectors.createTicketView.createButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -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);
}); });
}); });

View File

@ -17,20 +17,20 @@ describe('Ticket create from client path', () => {
}); });
it('should click the create simple ticket on the descriptor menu', async() => { it('should click the create simple ticket on the descriptor menu', async() => {
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() => {
const client = await page const client = await page
.waitToGetProperty(`${selectors.createTicketView.clientAutocomplete} input`, 'value'); .waitToGetProperty(selectors.createTicketView.client, 'value');
const address = await page const address = await page
.waitToGetProperty(`${selectors.createTicketView.addressAutocomplete} input`, 'value'); .waitToGetProperty(selectors.createTicketView.address, 'value');
expect(client).toContain('Petter Parker'); expect(client).toContain('Petter Parker');

View File

@ -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() => {

View File

@ -8,19 +8,22 @@ describe('Claim edit basic data path', () => {
beforeAll(async() => { beforeAll(async() => {
browser = await getBrowser(); browser = await getBrowser();
page = browser.page; page = browser.page;
await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult('1');
await page.accessToSection('claim.card.basicData');
}); });
afterAll(async() => { afterAll(async() => {
await browser.close(); await browser.close();
}); });
it(`should log in as salesAssistant then reach basic data of the target claim`, async() => {
await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult('1');
await page.accessToSection('claim.card.basicData');
});
it(`should edit claim state and observation fields`, async() => { it(`should edit claim state and observation fields`, async() => {
await page.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado'); await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Gestionado');
await page.clearTextarea(selectors.claimBasicData.observationInput); await page.clearTextarea(selectors.claimBasicData.observation);
await page.type(selectors.claimBasicData.observationInput, 'edited observation'); await page.write(selectors.claimBasicData.observation, 'edited observation');
await page.waitToClick(selectors.claimBasicData.saveButton); await page.waitToClick(selectors.claimBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -28,31 +31,30 @@ 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() => {
await page.reloadSection('claim.card.basicData'); await page.reloadSection('claim.card.basicData');
await page.wait(selectors.claimBasicData.claimStateAutocomplete); await page.wait(selectors.claimBasicData.claimState);
const result = await page.waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value'); const result = await page.waitToGetProperty(selectors.claimBasicData.claimState, 'value');
expect(result).toEqual('Gestionado'); expect(result).toEqual('Gestionado');
}); });
it('should confirm the claim observation was edited', async() => { it('should confirm the claim observation was edited', async() => {
const result = await page const result = await page
.waitToGetProperty(selectors.claimBasicData.observationInput, 'value'); .waitToGetProperty(selectors.claimBasicData.observation, 'value');
expect(result).toEqual('edited observation'); expect(result).toEqual('edited observation');
}); });
it(`should edit the claim to leave it untainted`, async() => { it(`should edit the claim to leave it untainted`, async() => {
await page.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente'); await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Pendiente');
await page.clearTextarea(selectors.claimBasicData.observationInput); await page.clearTextarea(selectors.claimBasicData.observation);
await page.type(selectors.claimBasicData.observationInput, 'Observation one'); await page.write(selectors.claimBasicData.observation, 'Observation one');
await page.waitToClick(selectors.claimBasicData.saveButton); await page.waitToClick(selectors.claimBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -20,11 +20,11 @@ describe('Claim development', () => {
it('should delete a development and create a new one', async() => { it('should delete a development and create a new one', async() => {
await page.waitToClick(selectors.claimDevelopment.firstDeleteDevelopmentButton); await page.waitToClick(selectors.claimDevelopment.firstDeleteDevelopmentButton);
await page.waitToClick(selectors.claimDevelopment.addDevelopmentButton); await page.waitToClick(selectors.claimDevelopment.addDevelopmentButton);
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimReasonAutocomplete, 'Baja calidad'); await page.autocompleteSearch(selectors.claimDevelopment.secondClaimReason, 'Baja calidad');
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResultAutocomplete, 'Deshidratacion'); await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResult, 'Deshidratacion');
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsibleAutocomplete, 'Calidad general'); await page.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsible, 'Calidad general');
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimWorkerAutocomplete, 'deliveryNick'); await page.autocompleteSearch(selectors.claimDevelopment.secondClaimWorker, 'deliveryNick');
await page.autocompleteSearch(selectors.claimDevelopment.secondClaimRedeliveryAutocomplete, 'Reparto'); await page.autocompleteSearch(selectors.claimDevelopment.secondClaimRedelivery, 'Reparto');
await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton); await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -32,19 +32,18 @@ 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() => {
await page.reloadSection('claim.card.development'); await page.reloadSection('claim.card.development');
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimReasonAutocomplete, 'Calor'); await page.autocompleteSearch(selectors.claimDevelopment.firstClaimReason, 'Calor');
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResultAutocomplete, 'Cocido'); await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResult, 'Cocido');
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsibleAutocomplete, 'Calidad general'); await page.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsible, 'Calidad general');
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimWorkerAutocomplete, 'adminAssistantNick'); await page.autocompleteSearch(selectors.claimDevelopment.firstClaimWorker, 'adminAssistantNick');
await page.autocompleteSearch(selectors.claimDevelopment.firstClaimRedeliveryAutocomplete, 'Cliente'); await page.autocompleteSearch(selectors.claimDevelopment.firstClaimRedelivery, 'Cliente');
await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton); await page.waitToClick(selectors.claimDevelopment.saveDevelopmentButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -54,19 +53,19 @@ describe('Claim development', () => {
it('should confirm the first development is the expected one', async() => { it('should confirm the first development is the expected one', async() => {
await page.reloadSection('claim.card.development'); await page.reloadSection('claim.card.development');
const reason = await page const reason = await page
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimReasonAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.firstClaimReason, 'value');
const result = await page const result = await page
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimResultAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.firstClaimResult, 'value');
const responsible = await page const responsible = await page
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimResponsibleAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.firstClaimResponsible, 'value');
const worker = await page const worker = await page
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimWorkerAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.firstClaimWorker, 'value');
const redelivery = await page const redelivery = await page
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimRedeliveryAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.firstClaimRedelivery, 'value');
expect(reason).toEqual('Calor'); expect(reason).toEqual('Calor');
expect(result).toEqual('Cocido'); expect(result).toEqual('Cocido');
@ -77,19 +76,19 @@ describe('Claim development', () => {
it('should confirm the second development is the expected one', async() => { it('should confirm the second development is the expected one', async() => {
const reason = await page const reason = await page
.waitToGetProperty(`${selectors.claimDevelopment.secondClaimReasonAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.secondClaimReason, 'value');
const result = await page const result = await page
.waitToGetProperty(`${selectors.claimDevelopment.secondClaimResultAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.secondClaimResult, 'value');
const responsible = await page const responsible = await page
.waitToGetProperty(`${selectors.claimDevelopment.secondClaimResponsibleAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.secondClaimResponsible, 'value');
const worker = await page const worker = await page
.waitToGetProperty(`${selectors.claimDevelopment.secondClaimWorkerAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.secondClaimWorker, 'value');
const redelivery = await page const redelivery = await page
.waitToGetProperty(`${selectors.claimDevelopment.secondClaimRedeliveryAutocomplete} input`, 'value'); .waitToGetProperty(selectors.claimDevelopment.secondClaimRedelivery, 'value');
expect(reason).toEqual('Baja calidad'); expect(reason).toEqual('Baja calidad');
expect(result).toEqual('Deshidratacion'); expect(result).toEqual('Deshidratacion');

View File

@ -56,15 +56,14 @@ 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() => {
await page.waitToClick(selectors.claimDetail.secondItemDiscount); await page.waitToClick(selectors.claimDetail.secondItemDiscount);
await page.write(selectors.claimDetail.discountInput, '100'); await page.write(selectors.claimDetail.discount, '100');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -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() => {

View File

@ -49,7 +49,7 @@ describe('Claim action path', () => {
it('should refresh the view to check the remaining line is the expected one', async() => { it('should refresh the view to check the remaining line is the expected one', async() => {
await page.reloadSection('claim.card.action'); await page.reloadSection('claim.card.action');
const result = await page.waitToGetProperty(`${selectors.claimAction.firstLineDestination} input`, 'value'); const result = await page.waitToGetProperty(selectors.claimAction.firstLineDestination, 'value');
expect(result).toEqual('Bueno'); expect(result).toEqual('Bueno');
}); });

View File

@ -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() => {

View File

@ -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() => {

View File

@ -21,8 +21,8 @@ describe('Order edit basic data path', () => {
describe('when confirmed order', () => { describe('when confirmed order', () => {
it('should not be able to change the client', async() => { it('should not be able to change the client', async() => {
await page.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.orderBasicData.client, 'Tony Stark');
await page.autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.orderBasicData.address, 'Tony Stark');
await page.waitToClick(selectors.orderBasicData.saveButton); await page.waitToClick(selectors.orderBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -40,15 +40,15 @@ describe('Order edit basic data path', () => {
await page.accessToSearchResult(orderId); await page.accessToSearchResult(orderId);
await page.accessToSection('order.card.basicData'); await page.accessToSection('order.card.basicData');
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.waitForSelector(selectors.orderBasicData.observationInput, {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() => {
await page.type(selectors.orderBasicData.observationInput, 'observation'); await page.waitForContentLoaded();
await page.write(selectors.orderBasicData.observation, 'observation');
await page.waitToClick(selectors.orderBasicData.saveButton); await page.waitToClick(selectors.orderBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -62,36 +62,33 @@ 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() => {
await page.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Jessica Jones'); await page.autocompleteSearch(selectors.createOrderView.client, 'Jessica Jones');
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today); await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, '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.observationInput); 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() => {
await page.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.orderBasicData.client, 'Tony Stark');
await page.autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.orderBasicData.address, 'Tony Stark');
await page.autocompleteSearch(selectors.orderBasicData.agencyAutocomplete, 'Silla247'); await page.autocompleteSearch(selectors.orderBasicData.agency, 'Silla247');
await page.type(selectors.orderBasicData.observationInput, 'my observation'); await page.write(selectors.orderBasicData.observation, 'my observation');
await page.waitToClick(selectors.orderBasicData.saveButton); await page.waitToClick(selectors.orderBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -101,21 +98,21 @@ describe('Order edit basic data path', () => {
it('should now confirm the client have been edited', async() => { it('should now confirm the client have been edited', async() => {
await page.reloadSection('order.card.basicData'); await page.reloadSection('order.card.basicData');
const result = await page const result = await page
.waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value'); .waitToGetProperty(selectors.orderBasicData.client, 'value');
expect(result).toEqual('104: Tony Stark'); expect(result).toEqual('104: Tony Stark');
}); });
it('should now confirm the agency have been edited', async() => { it('should now confirm the agency have been edited', async() => {
const result = await page const result = await page
.waitToGetProperty(`${selectors.orderBasicData.agencyAutocomplete} input`, 'value'); .waitToGetProperty(selectors.orderBasicData.agency, 'value');
expect(result).toEqual('7: Silla247'); expect(result).toEqual('7: Silla247');
}); });
it('should now confirm the observations have been edited', async() => { it('should now confirm the observations have been edited', async() => {
const result = await page const result = await page
.waitToGetProperty(selectors.orderBasicData.observationInput, 'value'); .waitToGetProperty(selectors.orderBasicData.observation, 'value');
expect(result).toEqual('my observation'); expect(result).toEqual('my observation');
}); });

View File

@ -17,30 +17,28 @@ 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() => {
let today = new Date().getDate(); let today = new Date().getDate();
await page.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Tony Stark'); await page.autocompleteSearch(selectors.createOrderView.client, 'Tony Stark');
await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today); await page.datePicker(selectors.createOrderView.landedDatePicker, 0, today);
await page.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, '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.autocompleteSearch(selectors.orderCatalog.typeAutocomplete, 'Anthurium'); await page.waitForContentLoaded();
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');
@ -48,7 +46,7 @@ describe('Order catalog', () => {
}); });
it('should search for the item tag value +1 and find two results', async() => { it('should search for the item tag value +1 and find two results', async() => {
await page.write(selectors.orderCatalog.itemTagValueInput, '+1'); await page.write(selectors.orderCatalog.itemTagValue, '+1');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
await page.waitForNumberOfElements('section.product', 2); await page.waitForNumberOfElements('section.product', 2);
const result = await page.countElement('section.product'); const result = await page.countElement('section.product');
@ -58,8 +56,8 @@ describe('Order catalog', () => {
it('should search for the item tag categoria +1 and find two results', async() => { it('should search for the item tag categoria +1 and find two results', async() => {
await page.waitToClick(selectors.orderCatalog.openTagSearch); await page.waitToClick(selectors.orderCatalog.openTagSearch);
await page.autocompleteSearch(selectors.orderCatalog.tagAutocomplete, 'categoria'); await page.autocompleteSearch(selectors.orderCatalog.tag, 'categoria');
await page.write(selectors.orderCatalog.tagValueInput, '+1'); await page.write(selectors.orderCatalog.tagValue, '+1');
await page.waitToClick(selectors.orderCatalog.searchTagButton); await page.waitToClick(selectors.orderCatalog.searchTagButton);
await page.waitForNumberOfElements('section.product', 1); await page.waitForNumberOfElements('section.product', 1);
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');
@ -78,7 +77,7 @@ describe('Order catalog', () => {
}); });
it('should search for an item by id', async() => { it('should search for an item by id', async() => {
await page.write(selectors.orderCatalog.itemIdInput, '2'); await page.write(selectors.orderCatalog.itemId, '2');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
await page.waitForNumberOfElements('section.product', 1); await page.waitForNumberOfElements('section.product', 1);
const result = await page.countElement('section.product'); const result = await page.countElement('section.product');

View File

@ -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);
}); });
}); });

View File

@ -19,14 +19,13 @@ 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.workerAutocomplete); 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() => {
await page.write(selectors.createRouteView.descriptionInput, 'faster faster!!'); await page.write(selectors.createRouteView.description, 'faster faster!!');
await page.waitToClick(selectors.createRouteView.submitButton); await page.waitToClick(selectors.createRouteView.submitButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -43,18 +42,17 @@ 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.workerAutocomplete); 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() => {
await page.autocompleteSearch(selectors.createRouteView.workerAutocomplete, 'teamManagerNick'); await page.autocompleteSearch(selectors.createRouteView.worker, 'teamManagerNick');
await page.datePicker(selectors.createRouteView.createdDatePicker, 0, null); await page.datePicker(selectors.createRouteView.createdDatePicker, 0, null);
await page.autocompleteSearch(selectors.createRouteView.vehicleAutoComplete, '4444-IMK'); await page.autocompleteSearch(selectors.createRouteView.vehicleAuto, '4444-IMK');
await page.autocompleteSearch(selectors.createRouteView.agencyAutoComplete, 'Teleportation device'); await page.autocompleteSearch(selectors.createRouteView.agency, 'Teleportation device');
await page.write(selectors.createRouteView.descriptionInput, 'faster faster!!'); await page.write(selectors.createRouteView.description, 'faster faster!!');
await page.waitToClick(selectors.createRouteView.submitButton); await page.waitToClick(selectors.createRouteView.submitButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -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);
}); });
}); });
}); });

View File

@ -18,15 +18,15 @@ describe('Route basic Data path', () => {
}); });
it('should edit the route basic data', async() => { it('should edit the route basic data', async() => {
await page.autocompleteSearch(selectors.routeBasicData.workerAutoComplete, 'adminBossNick'); await page.autocompleteSearch(selectors.routeBasicData.worker, 'adminBossNick');
await page.autocompleteSearch(selectors.routeBasicData.vehicleAutoComplete, '1111-IMK'); await page.autocompleteSearch(selectors.routeBasicData.vehicle, '1111-IMK');
await page.datePicker(selectors.routeBasicData.createdDateInput, 1, null); await page.datePicker(selectors.routeBasicData.createdDate, 1, null);
await page.clearInput(selectors.routeBasicData.kmStartInput); await page.clearInput(selectors.routeBasicData.kmStart);
await page.write(selectors.routeBasicData.kmStartInput, '1'); await page.write(selectors.routeBasicData.kmStart, '1');
await page.clearInput(selectors.routeBasicData.kmEndInput); await page.clearInput(selectors.routeBasicData.kmEnd);
await page.write(selectors.routeBasicData.kmEndInput, '2'); await page.write(selectors.routeBasicData.kmEnd, '2');
await page.type(`${selectors.routeBasicData.startedHourInput} input`, '0800'); await page.type(`${selectors.routeBasicData.startedHour} input`, '0800');
await page.type(`${selectors.routeBasicData.finishedHourInput} input`, '1230'); await page.type(`${selectors.routeBasicData.finishedHour} input`, '1230');
await page.waitToClick(selectors.routeBasicData.saveButton); await page.waitToClick(selectors.routeBasicData.saveButton);
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();
@ -35,26 +35,26 @@ describe('Route basic Data path', () => {
it('should confirm the worker was edited', async() => { it('should confirm the worker was edited', async() => {
await page.reloadSection('route.card.basicData'); await page.reloadSection('route.card.basicData');
const worker = await page.waitToGetProperty(`${selectors.routeBasicData.workerAutoComplete} input`, 'value'); const worker = await page.waitToGetProperty(selectors.routeBasicData.worker, 'value');
expect(worker).toEqual('adminBoss - adminBossNick'); expect(worker).toEqual('adminBoss - adminBossNick');
}); });
it('should confirm the vehicle was edited', async() => { it('should confirm the vehicle was edited', async() => {
const vehicle = await page.waitToGetProperty(`${selectors.routeBasicData.vehicleAutoComplete} input`, 'value'); const vehicle = await page.waitToGetProperty(selectors.routeBasicData.vehicle, 'value');
expect(vehicle).toEqual('1111-IMK'); expect(vehicle).toEqual('1111-IMK');
}); });
it('should confirm the km start was edited', async() => { it('should confirm the km start was edited', async() => {
const kmStart = await page.waitToGetProperty(`${selectors.routeBasicData.kmStartInput} input`, 'value'); const kmStart = await page.waitToGetProperty(selectors.routeBasicData.kmStart, 'value');
expect(kmStart).toEqual('1'); expect(kmStart).toEqual('1');
}); });
it('should confirm the km end was edited', async() => { it('should confirm the km end was edited', async() => {
const kmEnd = await page.waitToGetProperty(`${selectors.routeBasicData.kmEndInput} input`, 'value'); const kmEnd = await page.waitToGetProperty(selectors.routeBasicData.kmEnd, 'value');
expect(kmEnd).toEqual('2'); expect(kmEnd).toEqual('2');
}); });

View File

@ -30,16 +30,15 @@ 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.searchInvoiceOutInput); 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() => {
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.write(selectors.invoiceOutIndex.searchInvoiceOutInput, 'T2222222'); await page.write(selectors.invoiceOutIndex.topbarSearch, 'T2222222');
await page.waitToClick(selectors.invoiceOutIndex.searchButton); await page.waitToClick(selectors.invoiceOutIndex.searchButton);
await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 1); await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 1);
const result = await page.countElement(selectors.invoiceOutIndex.searchResult); const result = await page.countElement(selectors.invoiceOutIndex.searchResult);
@ -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,13 +63,13 @@ 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() => {
await page.write(selectors.invoiceOutIndex.searchInvoiceOutInput, 'T2222222'); await page.write(selectors.invoiceOutIndex.topbarSearch, 'T2222222');
await page.waitToClick(selectors.invoiceOutIndex.searchButton); await page.waitToClick(selectors.invoiceOutIndex.searchButton);
await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 0); await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 0);
const result = await page.countElement(selectors.invoiceOutIndex.searchResult); const result = await page.countElement(selectors.invoiceOutIndex.searchResult);
@ -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.searchTicketInput); 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.searchInvoiceOutInput); 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');

View File

@ -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);
}); });
}); });

View File

@ -161,6 +161,9 @@ function e2eSingleRun() {
const jasmine = require('gulp-jasmine'); const jasmine = require('gulp-jasmine');
const SpecReporter = require('jasmine-spec-reporter').SpecReporter; const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
if (argv.show || argv.s)
process.env.E2E_SHOW = true;
const specFiles = [ const specFiles = [
`${__dirname}/e2e/paths/01*/*[sS]pec.js`, `${__dirname}/e2e/paths/01*/*[sS]pec.js`,
`${__dirname}/e2e/paths/02*/*[sS]pec.js`, `${__dirname}/e2e/paths/02*/*[sS]pec.js`,
@ -557,6 +560,7 @@ module.exports = {
backTest, backTest,
backTestDocker, backTestDocker,
e2e, e2e,
e2eSingleRun,
smokes, smokes,
smokesOnly, smokesOnly,
i, i,
@ -573,5 +577,4 @@ module.exports = {
dockerStart, dockerStart,
dockerWait, dockerWait,
backendStatus, backendStatus,
e2eSingleRun
}; };