#907 Extensiones nightmare

This commit is contained in:
Carlos Jimenez 2019-01-07 09:33:07 +01:00
parent 535d98f485
commit f67dce0a91
22 changed files with 361 additions and 431 deletions

View File

@ -315,6 +315,20 @@ let actions = {
}) })
.then(done) .then(done)
.catch(done); .catch(done);
},
autocompleteSearch: function(autocompleteSelector, searchValue, done) {
this.wait(autocompleteSelector)
.waitToClick(`${autocompleteSelector} input`)
.type(`${autocompleteSelector} vn-drop-down input`, searchValue)
.waitToClick(`${autocompleteSelector} li.active`)
.wait((autocompleteSelector, searchValue) => {
return document.querySelector(`${autocompleteSelector} input`).value.toLowerCase().includes(searchValue.toLowerCase());
}, autocompleteSelector, searchValue)
.then(done)
.catch(() => {
done(new Error(`.autocompleteSearch() for ${autocompleteSelector}, timed out`));
});
} }
}; };

View File

@ -28,8 +28,7 @@ export default {
socialName: `${components.vnTextfield}[name="socialName"]`, socialName: `${components.vnTextfield}[name="socialName"]`,
userName: `${components.vnTextfield}[name="userName"]`, userName: `${components.vnTextfield}[name="userName"]`,
email: `${components.vnTextfield}[name="email"]`, email: `${components.vnTextfield}[name="email"]`,
salesPersonInput: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] input`, salesPersonAutocomplete: `vn-autocomplete[field="$ctrl.client.salesPersonFk"]`,
salesBruceBannerOption: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] vn-drop-down ul > li:nth-child(1)`,
createButton: `${components.vnSubmit}`, createButton: `${components.vnSubmit}`,
cancelButton: `vn-button[href="#!/client/index"]` cancelButton: `vn-button[href="#!/client/index"]`
}, },
@ -41,11 +40,8 @@ export default {
mobileInput: `${components.vnTextfield}[name="mobile"]`, mobileInput: `${components.vnTextfield}[name="mobile"]`,
faxInput: `${components.vnTextfield}[name="fax"]`, faxInput: `${components.vnTextfield}[name="fax"]`,
emailInput: `${components.vnTextfield}[name="email"]`, emailInput: `${components.vnTextfield}[name="email"]`,
salesPersonInput: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] input`, salesPersonAutocomplete: `vn-autocomplete[field="$ctrl.client.salesPersonFk"]`,
salesPersonOptionOne: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] vn-drop-down ul > li:nth-child(1)`, channelAutocomplete: `vn-autocomplete[field="$ctrl.client.contactChannelFk"]`,
channelInput: `vn-autocomplete[field="$ctrl.client.contactChannelFk"] input`,
channelMetropolisOption: `vn-autocomplete[field="$ctrl.client.contactChannelFk"] vn-drop-down ul > li:nth-child(3)`,
channelRumorsOption: `vn-autocomplete[field="$ctrl.client.contactChannelFk"] vn-drop-down ul > li:nth-child(4)`,
saveButton: `${components.vnSubmit}` saveButton: `${components.vnSubmit}`
}, },
clientFiscalData: { clientFiscalData: {
@ -57,10 +53,8 @@ export default {
addressInput: `${components.vnTextfield}[name="street"]`, addressInput: `${components.vnTextfield}[name="street"]`,
cityInput: `${components.vnTextfield}[name="city"]`, cityInput: `${components.vnTextfield}[name="city"]`,
postcodeInput: `${components.vnTextfield}[name="postcode"]`, postcodeInput: `${components.vnTextfield}[name="postcode"]`,
provinceInput: `vn-autocomplete[field="$ctrl.client.provinceFk"] input`, provinceAutocomplete: `vn-autocomplete[field="$ctrl.client.provinceFk"]`,
provinceFifthOption: `vn-autocomplete[field="$ctrl.client.provinceFk"] vn-drop-down ul > li:nth-child(5)`, countryAutocomplete: `vn-autocomplete[field="$ctrl.client.countryFk"]`,
countryInput: `vn-autocomplete[field="$ctrl.client.countryFk"] input`,
countryThirdOption: `vn-autocomplete[field="$ctrl.client.countryFk"] vn-drop-down ul > li:nth-child(3)`,
activeCheckboxLabel: `vn-check[label="Active"] > label`, activeCheckboxLabel: `vn-check[label="Active"] > label`,
activeCheckboxInput: `vn-check[label="Active"] input`, activeCheckboxInput: `vn-check[label="Active"] input`,
frozenCheckboxLabel: `vn-check[label="Frozen"] > label`, frozenCheckboxLabel: `vn-check[label="Frozen"] > label`,
@ -77,15 +71,13 @@ export default {
}, },
clientPayMethod: { clientPayMethod: {
payMethodButton: `vn-left-menu a[ui-sref="client.card.billingData"]`, payMethodButton: `vn-left-menu a[ui-sref="client.card.billingData"]`,
payMethodInput: `vn-autocomplete[field="$ctrl.client.payMethodFk"] input`, payMethodAutocomplete: `vn-autocomplete[field="$ctrl.client.payMethodFk"]`,
payMethodIBANOption: `vn-autocomplete[field="$ctrl.client.payMethodFk"] vn-drop-down ul > li:nth-child(5)`,
payMethodOptionOne: `vn-autocomplete[field="$ctrl.client.payMethodFk"] vn-drop-down ul > li:nth-child(2)`,
IBANInput: `${components.vnTextfield}[name="iban"]`, IBANInput: `${components.vnTextfield}[name="iban"]`,
dueDayInput: `${components.vnTextfield}[name="dueDay"]`, dueDayInput: `${components.vnTextfield}[name="dueDay"]`,
receivedCoreLCRCheckbox: `vn-check[label='Received LCR'] > label > input`, receivedCoreLCRCheckbox: `vn-check[label='Received LCR'] > label > input`,
receivedCoreVNLCheckbox: `vn-check[label='Received core VNL'] > label > input`, receivedCoreVNLCheckbox: `vn-check[label='Received core VNL'] > label > input`,
receivedB2BVNLCheckbox: `vn-check[label='Received B2B VNL'] > label > input`, receivedB2BVNLCheckbox: `vn-check[label='Received B2B VNL'] > label > input`,
swiftBicInput: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] input', swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"]',
firstSwiftBicOption: `vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] vn-drop-down ul > li:nth-child(1)`, firstSwiftBicOption: `vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] vn-drop-down ul > li:nth-child(1)`,
clearswiftBicButton: `vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] > div > div > div > vn-icon > i`, clearswiftBicButton: `vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] > div > div > div > vn-icon > i`,
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',
@ -102,10 +94,8 @@ export default {
streetAddressInput: `${components.vnTextfield}[name="street"]`, streetAddressInput: `${components.vnTextfield}[name="street"]`,
postcodeInput: `${components.vnTextfield}[name="postalCode"]`, postcodeInput: `${components.vnTextfield}[name="postalCode"]`,
cityInput: `${components.vnTextfield}[name="city"]`, cityInput: `${components.vnTextfield}[name="city"]`,
provinceInput: `vn-autocomplete[field="$ctrl.address.provinceFk"] input`, provinceAutocomplete: `vn-autocomplete[field="$ctrl.address.provinceFk"]`,
provinceSecondOption: `vn-autocomplete[field="$ctrl.address.provinceFk"] vn-drop-down ul > li:nth-child(2)`, agencyAutocomplete: `vn-autocomplete[field="$ctrl.address.agencyModeFk"]`,
agencyInput: `vn-autocomplete[field="$ctrl.address.agencyModeFk"] input`,
agenctySecondOption: `vn-autocomplete[field="$ctrl.address.agencyModeFk"] vn-drop-down ul > li:nth-child(2)`,
phoneInput: `${components.vnTextfield}[name="phone"]`, phoneInput: `${components.vnTextfield}[name="phone"]`,
mobileInput: `${components.vnTextfield}[name="mobile"]`, mobileInput: `${components.vnTextfield}[name="mobile"]`,
defaultAddress: 'vn-client-address-index vn-horizontal:nth-child(2) div[name="street"]', defaultAddress: 'vn-client-address-index vn-horizontal:nth-child(2) div[name="street"]',
@ -114,15 +104,10 @@ export default {
secondEditButton: `vn-client-address-index vn-horizontal:nth-child(3) vn-icon-button[icon='edit']`, secondEditButton: `vn-client-address-index vn-horizontal:nth-child(3) vn-icon-button[icon='edit']`,
activeCheckbox: `vn-check[label='Enabled'] > label > input`, activeCheckbox: `vn-check[label='Enabled'] > label > input`,
equalizationTaxCheckboxLabel: `vn-client-address-edit vn-check[label='Is equalizated'] > label > input`, equalizationTaxCheckboxLabel: `vn-client-address-edit vn-check[label='Is equalizated'] > label > input`,
firstObservationTypeSelect: `vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"] input`, firstObservationTypeAutocomplete: `vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"]`,
firstObservationTypeSelectOptionOne: `vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(1)`,
firstObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(1) [model="observation.description"] input`, firstObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(1) [model="observation.description"] input`,
secondObservationTypeSelect: `vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"] input`, secondObservationTypeAutocomplete: `vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"]`,
secondObservationTypeSelectOptionTwo: `vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(2)`,
secondObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(2) [model="observation.description"] input`, secondObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(2) [model="observation.description"] input`,
thirdObservationTypeSelect: `vn-client-address-edit [name=observations] :nth-child(3) [field="observation.observationTypeFk"] input`,
thirdObservationTypeSelectOptionThree: `vn-client-address-edit [name=observations] :nth-child(3) [field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(3)`,
thirdObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(3) [model="observation.description"] input`,
addObservationButton: `vn-client-address-edit vn-icon-button[icon="add_circle"]`, addObservationButton: `vn-client-address-edit vn-icon-button[icon="add_circle"]`,
saveButton: `${components.vnSubmit}`, saveButton: `${components.vnSubmit}`,
cancelButton: `button[ui-sref="client.card.address.index"]` cancelButton: `button[ui-sref="client.card.address.index"]`
@ -152,8 +137,7 @@ export default {
addGreugeFloatButton: `${components.vnFloatButton}`, addGreugeFloatButton: `${components.vnFloatButton}`,
amountInput: `${components.vnTextfield}[name="amount"]`, amountInput: `${components.vnTextfield}[name="amount"]`,
descriptionInput: `${components.vnTextfield}[name="description"]`, descriptionInput: `${components.vnTextfield}[name="description"]`,
typeInput: `vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"] input`, typeAutocomplete: `vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"]`,
typeSecondOption: `vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"] vn-drop-down ul > li`,
saveButton: `${components.vnSubmit}`, saveButton: `${components.vnSubmit}`,
firstGreugeText: 'vn-client-greuge-index vn-card > div vn-table vn-tbody > vn-tr' firstGreugeText: 'vn-client-greuge-index vn-card > div vn-table vn-tbody > vn-tr'
}, },
@ -193,12 +177,9 @@ export default {
}, },
itemCreateView: { itemCreateView: {
name: `${components.vnTextfield}[name="name"]`, name: `${components.vnTextfield}[name="name"]`,
typeSelect: `vn-autocomplete[field="$ctrl.item.typeFk"] input`, typeAutocomplete: `vn-autocomplete[field="$ctrl.item.typeFk"]`,
typeSelectOptionThree: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(3)`, intrastatAutocomplete: `vn-autocomplete[field="$ctrl.item.intrastatFk"]`,
intrastatSelect: `vn-autocomplete[field="$ctrl.item.intrastatFk"] input`, originAutocomplete: `vn-autocomplete[field="$ctrl.item.originFk"]`,
intrastatSelectOptionOne: `vn-autocomplete[field="$ctrl.item.intrastatFk"] vn-drop-down ul > li:nth-child(2)`,
originSelect: `vn-autocomplete[field="$ctrl.item.originFk"] input`,
originSelectOptionOne: `vn-autocomplete[field="$ctrl.item.originFk"] vn-drop-down ul > li:nth-child(2)`,
createButton: `${components.vnSubmit}`, createButton: `${components.vnSubmit}`,
cancelButton: `button[ui-sref="item.index"]` cancelButton: `button[ui-sref="item.index"]`
}, },
@ -206,24 +187,19 @@ export default {
moreMenu: `vn-item-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, moreMenu: `vn-item-descriptor > vn-card > div vn-icon-menu > div > vn-icon`,
moreMenuRegularizeButton: `vn-item-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`, moreMenuRegularizeButton: `vn-item-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`,
regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`, regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`,
regularizeWarehouseSelect: `#warehouse > div > div > input`, regularizeWarehouseAutocomplete: `#warehouse`,
regularizeWarehouseSelectSecondOption: `#warehouse > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(2)`,
regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button` regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button`
}, },
itemBasicData: { itemBasicData: {
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
basicDataButton: `vn-left-menu a[ui-sref="item.card.data"]`, basicDataButton: `vn-left-menu a[ui-sref="item.card.data"]`,
typeSelect: `vn-autocomplete[field="$ctrl.item.typeFk"] input`, typeAutocomplete: `vn-autocomplete[field="$ctrl.item.typeFk"]`,
typeSelectOptionThree: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(3)`, intrastatAutocomplete: `vn-autocomplete[field="$ctrl.item.intrastatFk"]`,
intrastatSelect: `vn-autocomplete[field="$ctrl.item.intrastatFk"] input`,
intrastatSelectOptionOne: `vn-autocomplete[field="$ctrl.item.intrastatFk"] vn-drop-down ul > li:nth-child(1)`,
nameInput: `vn-textfield[label="Name"] input`, nameInput: `vn-textfield[label="Name"] input`,
relevancyInput: `vn-textfield[label="Relevancy"] input`, relevancyInput: `vn-textfield[label="Relevancy"] input`,
originSelect: `vn-autocomplete[field="$ctrl.item.originFk"] input`, originAutocomplete: `vn-autocomplete[field="$ctrl.item.originFk"]`,
originSelectOptionTwo: `vn-autocomplete[field="$ctrl.item.originFk"] vn-drop-down ul > li:nth-child(2)`, expenceAutocomplete: `vn-autocomplete[field="$ctrl.item.expenceFk"]`,
expenceSelect: `vn-autocomplete[field="$ctrl.item.expenceFk"] input`, longNameInput: `vn-textfield[field="$ctrl.item.longName"] input`,
expenceSelectOptionThree: `vn-autocomplete[field="$ctrl.item.expenceFk"] vn-drop-down ul > li:nth-child(3)`,
longNameInput: `vn-textfield[label="Full name"] input`,
isActiveCheckbox: `vn-check[label='Active'] > label > input`, isActiveCheckbox: `vn-check[label='Active'] > label > input`,
submitBasicDataButton: `${components.vnSubmit}` submitBasicDataButton: `${components.vnSubmit}`
}, },
@ -231,27 +207,22 @@ export default {
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"]`,
firstRemoveTagButton: `vn-item-tags vn-horizontal:nth-child(2) vn-icon-button[icon="delete"]`, firstRemoveTagButton: `vn-item-tags vn-horizontal:nth-child(2) vn-icon-button[icon="delete"]`,
firstTagSelect: `vn-item-tags vn-horizontal:nth-child(2) > vn-autocomplete[field="itemTag.tagFk"] input`, firstTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(2) > vn-autocomplete[field="itemTag.tagFk"]`,
firstTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(2) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`,
firstValueInput: `vn-item-tags vn-horizontal:nth-child(2) > vn-textfield[label="Value"] input`, firstValueInput: `vn-item-tags vn-horizontal:nth-child(2) > vn-textfield[label="Value"] input`,
firstRelevancyInput: `vn-horizontal:nth-child(2) > vn-textfield[label="Relevancy"] input`, firstRelevancyInput: `vn-horizontal:nth-child(2) > vn-textfield[label="Relevancy"] input`,
secondTagSelect: `vn-item-tags vn-horizontal:nth-child(3) > vn-autocomplete[field="itemTag.tagFk"] input`, secondTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(3) > vn-autocomplete[field="itemTag.tagFk"]`,
secondTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(3) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`,
secondValueInput: `vn-item-tags vn-horizontal:nth-child(3) > vn-textfield[label="Value"] input`, secondValueInput: `vn-item-tags vn-horizontal:nth-child(3) > vn-textfield[label="Value"] input`,
secondRelevancyInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Relevancy"] input`, secondRelevancyInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Relevancy"] input`,
thirdTagSelect: `vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"] input`, thirdTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"]`,
thirdTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`,
thirdValueInput: `vn-item-tags vn-horizontal:nth-child(4) > vn-textfield[label="Value"] input`, thirdValueInput: `vn-item-tags vn-horizontal:nth-child(4) > vn-textfield[label="Value"] input`,
thirdRelevancyInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Relevancy"] input`, thirdRelevancyInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Relevancy"] input`,
fourthTagSelect: `vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"] input`, fourthTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"]`,
fourthTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`,
fourthValueInput: `vn-item-tags vn-horizontal:nth-child(5) > vn-textfield[label="Value"] input`, fourthValueInput: `vn-item-tags vn-horizontal:nth-child(5) > vn-textfield[label="Value"] input`,
fourthRelevancyInput: `vn-horizontal:nth-child(5) > vn-textfield[label="Relevancy"] input`, fourthRelevancyInput: `vn-horizontal:nth-child(5) > vn-textfield[label="Relevancy"] input`,
fifthTagSelect: `vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[field="itemTag.tagFk"] input`, fifthTagSelect: `vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[field="itemTag.tagFk"] input`,
fifthValueInput: `vn-item-tags vn-horizontal:nth-child(6) > vn-textfield[label="Value"] input`, fifthValueInput: `vn-item-tags vn-horizontal:nth-child(6) > vn-textfield[label="Value"] input`,
fifthRelevancyInput: `vn-horizontal:nth-child(6) > vn-textfield[label="Relevancy"] input`, fifthRelevancyInput: `vn-horizontal:nth-child(6) > vn-textfield[label="Relevancy"] input`,
seventhTagSelectOptionFive: `vn-item-tags vn-horizontal:nth-child(8) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(5)`, seventhTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(8) > vn-autocomplete[field="itemTag.tagFk"]`,
seventhTagSelect: `vn-item-tags vn-horizontal:nth-child(8) > vn-autocomplete[field="itemTag.tagFk"] input`,
seventhValueInput: `vn-item-tags vn-horizontal:nth-child(8) > vn-textfield[label="Value"] input`, seventhValueInput: `vn-item-tags vn-horizontal:nth-child(8) > vn-textfield[label="Value"] input`,
seventhRelevancyInput: `vn-horizontal:nth-child(8) > vn-textfield[label="Relevancy"] input`, seventhRelevancyInput: `vn-horizontal:nth-child(8) > vn-textfield[label="Relevancy"] input`,
addItemTagButton: `vn-icon-button[icon="add_circle"]`, addItemTagButton: `vn-icon-button[icon="add_circle"]`,
@ -259,12 +230,9 @@ export default {
}, },
itemTax: { itemTax: {
taxButton: `vn-left-menu a[ui-sref="item.card.tax"]`, taxButton: `vn-left-menu a[ui-sref="item.card.tax"]`,
firstClassSelect: `vn-horizontal:nth-child(2) > vn-autocomplete[field="tax.taxClassFk"] input`, firstClassAutocomplete: `vn-horizontal:nth-child(2) > vn-autocomplete[field="tax.taxClassFk"]`,
firstClassSelectOptionTwo: `vn-horizontal:nth-child(2) > vn-autocomplete vn-drop-down ul > li:nth-child(2)`, secondClassAutocomplete: `vn-horizontal:nth-child(3) > vn-autocomplete[field="tax.taxClassFk"]`,
secondClassSelect: `vn-horizontal:nth-child(3) > vn-autocomplete[field="tax.taxClassFk"] input`, thirdClassAutocomplete: `vn-horizontal:nth-child(4) > vn-autocomplete[field="tax.taxClassFk"]`,
secondClassSelectOptionOne: `vn-horizontal:nth-child(3) > vn-autocomplete vn-drop-down ul > li:nth-child(1)`,
thirdClassSelect: `vn-horizontal:nth-child(4) > vn-autocomplete[field="tax.taxClassFk"] input`,
thirdClassSelectOptionTwo: `vn-horizontal:nth-child(4) > vn-autocomplete vn-drop-down ul > li:nth-child(2)`,
submitTaxButton: `${components.vnSubmit}` submitTaxButton: `${components.vnSubmit}`
}, },
itemBarcodes: { itemBarcodes: {
@ -277,26 +245,20 @@ export default {
itemNiches: { itemNiches: {
nicheButton: `vn-left-menu a[ui-sref="item.card.niche"]`, nicheButton: `vn-left-menu a[ui-sref="item.card.niche"]`,
addNicheButton: `vn-icon[icon="add_circle"]`, addNicheButton: `vn-icon[icon="add_circle"]`,
firstWarehouseSelect: `vn-autocomplete[field="niche.warehouseFk"] input`, firstWarehouseAutocomplete: `vn-autocomplete[field="niche.warehouseFk"] input`,
firstWarehouseSelectSecondOption: `vn-autocomplete[field="niche.warehouseFk"] vn-drop-down ul > li:nth-child(2)`,
firstCodeInput: `vn-horizontal:nth-child(2) > vn-textfield[label="Code"] input`, firstCodeInput: `vn-horizontal:nth-child(2) > vn-textfield[label="Code"] input`,
secondWarehouseSelect: `vn-horizontal:nth-child(3) > vn-autocomplete[field="niche.warehouseFk"] input`, secondWarehouseSelect: `vn-horizontal:nth-child(3) > vn-autocomplete[field="niche.warehouseFk"] input`,
secondCodeInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Code"] input`, secondCodeInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Code"] input`,
secondNicheRemoveButton: `vn-horizontal:nth-child(3) > vn-none > vn-icon[icon="delete"]`, secondNicheRemoveButton: `vn-horizontal:nth-child(3) > vn-none > vn-icon[icon="delete"]`,
thirdWarehouseSelect: `vn-horizontal:nth-child(4) > vn-autocomplete[field="niche.warehouseFk"] input`, thirdWarehouseAutocomplete: `vn-horizontal:nth-child(4) > vn-autocomplete[field="niche.warehouseFk"]`,
thirdWarehouseSelectFourthOption: `vn-horizontal:nth-child(4) > vn-autocomplete[field="niche.warehouseFk"] vn-drop-down ul > li:nth-child(4)`,
thirdCodeInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Code"] input`, thirdCodeInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Code"] input`,
submitNichesButton: `${components.vnSubmit}` submitNichesButton: `${components.vnSubmit}`
}, },
itemBotanical: { itemBotanical: {
botanicalButton: `vn-left-menu a[ui-sref="item.card.botanical"]`, botanicalButton: `vn-left-menu a[ui-sref="item.card.botanical"]`,
botanicalInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`, botanicalInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`,
genusSelect: `vn-autocomplete[field="$ctrl.botanical.genusFk"] input`, genusAutocomplete: `vn-autocomplete[field="$ctrl.botanical.genusFk"]`,
genusSelectOptionOne: `vn-autocomplete[field="$ctrl.botanical.genusFk"] vn-drop-down ul > li:nth-child(1)`, speciesAutocomplete: `vn-autocomplete[field="$ctrl.botanical.specieFk"]`,
genusSelectOptionTwo: `vn-autocomplete[field="$ctrl.botanical.genusFk"] vn-drop-down ul > li:nth-child(2)`,
speciesSelect: `vn-autocomplete[field="$ctrl.botanical.specieFk"] input`,
speciesSelectOptionOne: `vn-autocomplete[field="$ctrl.botanical.specieFk"] vn-drop-down ul > li:nth-child(1)`,
speciesSelectOptionTwo: `vn-autocomplete[field="$ctrl.botanical.specieFk"] vn-drop-down ul > li:nth-child(2)`,
submitBotanicalButton: `${components.vnSubmit}` submitBotanicalButton: `${components.vnSubmit}`
}, },
itemSummary: { itemSummary: {
@ -311,8 +273,7 @@ export default {
thirdTicketId: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(3) > vn-td:nth-child(2) > span', thirdTicketId: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(3) > vn-td:nth-child(2) > span',
firstBalance: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td.balance', firstBalance: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td.balance',
fifthBalance: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr.ng-scope.isToday.isIn > vn-td.balance > span', fifthBalance: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr.ng-scope.isToday.isIn > vn-td.balance > span',
warehouseSelect: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"] > div > div > input', warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]',
warehouseSelectFourthOption: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(4)'
}, },
ticketSummary: { ticketSummary: {
sale: 'vn-ticket-summary > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-one > table > tbody > tr', sale: 'vn-ticket-summary > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-one > table > tbody > tr',
@ -345,8 +306,7 @@ export default {
notesButton: `vn-left-menu a[ui-sref="ticket.card.observation"]`, notesButton: `vn-left-menu a[ui-sref="ticket.card.observation"]`,
firstNoteRemoveButton: `vn-icon[icon="delete"]`, firstNoteRemoveButton: `vn-icon[icon="delete"]`,
addNoteButton: `vn-icon[icon="add_circle"]`, addNoteButton: `vn-icon[icon="add_circle"]`,
firstNoteSelect: `vn-autocomplete[field="observation.observationTypeFk"] input`, firstNoteTypeAutocomplete: `vn-autocomplete[field="observation.observationTypeFk"]`,
firstNoteSelectSecondOption: `vn-autocomplete[field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(2)`,
firstDescriptionInput: `vn-textfield[label="Description"] input`, firstDescriptionInput: `vn-textfield[label="Description"] input`,
submitNotesButton: `${components.vnSubmit}` submitNotesButton: `${components.vnSubmit}`
}, },
@ -358,8 +318,7 @@ export default {
}, },
ticketPackages: { ticketPackages: {
packagesButton: `vn-left-menu a[ui-sref="ticket.card.package.index"]`, packagesButton: `vn-left-menu a[ui-sref="ticket.card.package.index"]`,
firstPackageSelect: `vn-autocomplete[label="Package"] > div > div > input`, firstPackageAutocomplete: `vn-autocomplete[label="Package"]`,
firstPackageSelectOptionTwo: `vn-autocomplete[label="Package"] vn-drop-down ul > li:nth-child(2)`,
firstQuantityInput: `vn-textfield[label="Quantity"] input`, firstQuantityInput: `vn-textfield[label="Quantity"] input`,
firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`, firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`,
addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`, addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`,
@ -472,9 +431,7 @@ export default {
}, },
claimBasicData: { claimBasicData: {
basicDataButton: `vn-left-menu a[ui-sref="claim.card.basicData"]`, basicDataButton: `vn-left-menu a[ui-sref="claim.card.basicData"]`,
claimStateSelect: `vn-autocomplete[field="$ctrl.claim.claimStateFk"] input`, claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]',
claimStateSelectThirdOption: `vn-autocomplete[field="$ctrl.claim.claimStateFk"] vn-drop-down ul > li:nth-child(3)`,
claimStateSelectFourthOption: `vn-autocomplete[field="$ctrl.claim.claimStateFk"] vn-drop-down ul > li:nth-child(4)`,
isPaidWithManaCheckbox: `vn-check[field="$ctrl.claim.isChargedToMana"] > label > input`, isPaidWithManaCheckbox: `vn-check[field="$ctrl.claim.isChargedToMana"] > label > input`,
responsabilityInputRange: `vn-input-range`, responsabilityInputRange: `vn-input-range`,
observationInput: `vn-textarea[label="Observation"] textarea`, observationInput: `vn-textarea[label="Observation"] textarea`,

View File

@ -11,10 +11,9 @@ describe('Claim edit basic data path', () => {
.accessToSection('claim.card.basicData'); .accessToSection('claim.card.basicData');
}); });
it(`should edit claim state, is paid with mana and observation fields`, async () => { it(`should edit claim state, is paid with mana and observation fields`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.claimBasicData.claimStateSelect) .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado')
.waitToClick(selectors.claimBasicData.claimStateSelectThirdOption)
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput) .clearInput(selectors.claimBasicData.observationInput)
.type(selectors.claimBasicData.observationInput, 'edited observation') .type(selectors.claimBasicData.observationInput, 'edited observation')
@ -24,18 +23,18 @@ describe('Claim edit basic data path', () => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!'])); expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
}); });
it('should confirm the claim state was edited', async () => { it('should confirm the claim state was edited', async() => {
const result = await nightmare const result = await nightmare
.click(selectors.claimDetails.detailsButton) .click(selectors.claimDetails.detailsButton)
.wait(selectors.claimDetails.addItemButton) .wait(selectors.claimDetails.addItemButton)
.click(selectors.claimBasicData.basicDataButton) .click(selectors.claimBasicData.basicDataButton)
.wait(selectors.claimBasicData.claimStateSelect) .wait(selectors.claimBasicData.claimStateSelect)
.waitToGetProperty(selectors.claimBasicData.claimStateSelect, 'value'); .waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value');
expect(result).toEqual('Gestionado'); expect(result).toEqual('Gestionado');
}); });
it('should confirm the Is paid with mana checkbox is checked', async () => { it('should confirm the Is paid with mana checkbox is checked', async() => {
const value = await nightmare const value = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -44,17 +43,16 @@ describe('Claim edit basic data path', () => {
expect(value).toBeTruthy(); expect(value).toBeTruthy();
}); });
it('should confirm the claim observation was edited', async () => { it('should confirm the claim observation was edited', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.claimBasicData.observationInput, 'value'); .waitToGetProperty(selectors.claimBasicData.observationInput, '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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.claimBasicData.claimStateSelect) .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente')
.waitToClick(selectors.claimBasicData.claimStateSelectFourthOption)
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput) .clearInput(selectors.claimBasicData.observationInput)
.type(selectors.claimBasicData.observationInput, 'Observation one') .type(selectors.claimBasicData.observationInput, 'Observation one')

View File

@ -9,7 +9,7 @@ describe('Client create path', () => {
.loginAndModule('employee', 'client'); .loginAndModule('employee', 'client');
}); });
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() => {
const result = await nightmare const result = await nightmare
.wait(selectors.clientsIndex.searchClientInput) .wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Carol Danvers') .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
@ -20,7 +20,7 @@ describe('Client create path', () => {
expect(result).toEqual(0); expect(result).toEqual(0);
}); });
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() => {
const url = await nightmare const url = await nightmare
.click(selectors.clientsIndex.createClientButton) .click(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton) .wait(selectors.createClientView.createButton)
@ -29,7 +29,7 @@ describe('Client create path', () => {
expect(url.hash).toEqual('#!/client/create'); expect(url.hash).toEqual('#!/client/create');
}); });
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() => {
const result = await nightmare const result = await nightmare
.click(selectors.createClientView.createButton) .click(selectors.createClientView.createButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -37,20 +37,19 @@ describe('Client create path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it('should receive an error when clicking the create button having name and Business name fields empty', async () => { it('should receive an error when clicking the create button having name and Business name fields empty', async() => {
const result = await nightmare const result = await nightmare
.type(selectors.createClientView.taxNumber, '74451390E') .type(selectors.createClientView.taxNumber, '74451390E')
.type(selectors.createClientView.userName, 'CaptainMarvel') .type(selectors.createClientView.userName, 'CaptainMarvel')
.type(selectors.createClientView.email, 'CarolDanvers@verdnatura.es') .type(selectors.createClientView.email, 'CarolDanvers@verdnatura.es')
.waitToClick(selectors.createClientView.salesPersonInput) .autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'Accessory')
.waitToClick(selectors.createClientView.salesBruceBannerOption)
.click(selectors.createClientView.createButton) .click(selectors.createClientView.createButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should attempt to create a new user with all it's data but wrong email`, async () => { it(`should attempt to create a new user with all it's data but wrong email`, async() => {
const result = await nightmare const result = await nightmare
.type(selectors.createClientView.name, 'Carol Danvers') .type(selectors.createClientView.name, 'Carol Danvers')
.type(selectors.createClientView.socialName, 'AVG tax') .type(selectors.createClientView.socialName, 'AVG tax')
@ -62,7 +61,7 @@ describe('Client create path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should create a new user with all correct data`, async () => { it(`should create a new user with all correct data`, async() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.createClientView.email) .clearInput(selectors.createClientView.email)
.type(selectors.createClientView.email, 'caroldanvers@verdnatura.es') .type(selectors.createClientView.email, 'caroldanvers@verdnatura.es')
@ -72,7 +71,7 @@ describe('Client create path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should click on the Clients button of the top bar menu', async () => { it('should click on the Clients button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -83,7 +82,7 @@ describe('Client create path', () => {
expect(url.hash).toEqual('#!/client/index'); expect(url.hash).toEqual('#!/client/index');
}); });
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() => {
const result = await nightmare const result = await nightmare
.wait(selectors.clientsIndex.searchClientInput) .wait(selectors.clientsIndex.searchClientInput)
.type(selectors.clientsIndex.searchClientInput, 'Carol Danvers') .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers')

View File

@ -11,17 +11,17 @@ describe('Client Edit basicData path', () => {
.accessToSection('client.card.basicData'); .accessToSection('client.card.basicData');
}); });
it('should not be able to change the salesPerson', async () => { it('should not be able to change the salesPerson', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.clientBasicData.nameInput) .wait(selectors.clientBasicData.nameInput)
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, selectors.clientBasicData.salesPersonInput); }, `${selectors.clientBasicData.salesPersonAutocomplete} 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() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.clientBasicData.nameInput) .clearInput(selectors.clientBasicData.nameInput)
.type(selectors.clientBasicData.nameInput, 'Ptonomy Wallace') .type(selectors.clientBasicData.nameInput, 'Ptonomy Wallace')
@ -33,15 +33,14 @@ describe('Client Edit basicData path', () => {
.type(selectors.clientBasicData.mobileInput, '123456789') .type(selectors.clientBasicData.mobileInput, '123456789')
.clearInput(selectors.clientBasicData.emailInput) .clearInput(selectors.clientBasicData.emailInput)
.type(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es') .type(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es')
.waitToClick(selectors.clientBasicData.channelInput) .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets')
.waitToClick(selectors.clientBasicData.channelRumorsOption)
.click(selectors.clientBasicData.saveButton) .click(selectors.clientBasicData.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should confirm the name have been edited', async () => { it('should confirm the name have been edited', async() => {
const result = await nightmare const result = await nightmare
.click(selectors.clientFiscalData.fiscalDataButton) .click(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.addressInput) .wait(selectors.clientFiscalData.addressInput)
@ -51,37 +50,37 @@ describe('Client Edit basicData path', () => {
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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.contactInput, 'value'); .waitToGetProperty(selectors.clientBasicData.contactInput, 'value');
expect(result).toEqual('David Haller'); expect(result).toEqual('David Haller');
}); });
it('should confirm the landline phone number have been added', async () => { it('should confirm the landline phone number have been added', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.phoneInput, 'value'); .waitToGetProperty(selectors.clientBasicData.phoneInput, 'value');
expect(result).toEqual('987654321'); expect(result).toEqual('987654321');
}); });
it('should confirm the mobile phone number have been added', async () => { it('should confirm the mobile phone number have been added', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.mobileInput, 'value'); .waitToGetProperty(selectors.clientBasicData.mobileInput, 'value');
expect(result).toEqual('123456789'); expect(result).toEqual('123456789');
}); });
it('should confirm the email have been edited', async () => { it('should confirm the email have been edited', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.emailInput, 'value'); .waitToGetProperty(selectors.clientBasicData.emailInput, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.channelInput, 'value'); .waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value');
expect(result).toEqual('Rumors on the streets'); expect(result).toEqual('Rumors on the streets');
}); });
@ -96,17 +95,17 @@ describe('Client Edit basicData path', () => {
.accessToSection('client.card.basicData'); .accessToSection('client.card.basicData');
}); });
it('should be able to change the salesPerson', async () => { it('should be able to change the salesPerson', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.clientBasicData.nameInput) .wait(selectors.clientBasicData.nameInput)
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
}, selectors.clientBasicData.salesPersonInput); }, `${selectors.clientBasicData.salesPersonAutocomplete} 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() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.clientBasicData.nameInput) .clearInput(selectors.clientBasicData.nameInput)
.type(selectors.clientBasicData.nameInput, 'Ororo Munroe') .type(selectors.clientBasicData.nameInput, 'Ororo Munroe')
@ -118,17 +117,15 @@ describe('Client Edit basicData path', () => {
.type(selectors.clientBasicData.mobileInput, '987654321') .type(selectors.clientBasicData.mobileInput, '987654321')
.clearInput(selectors.clientBasicData.emailInput) .clearInput(selectors.clientBasicData.emailInput)
.type(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es') .type(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es')
.waitToClick(selectors.clientBasicData.salesPersonInput) .autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory')
.waitToClick(selectors.clientBasicData.salesPersonOptionOne) .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper')
.waitToClick(selectors.clientBasicData.channelInput)
.waitToClick(selectors.clientBasicData.channelMetropolisOption)
.click(selectors.clientBasicData.saveButton) .click(selectors.clientBasicData.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should now confirm the name have been edited', async () => { it('should now confirm the name have been edited', async() => {
const result = await nightmare const result = await nightmare
.click(selectors.clientFiscalData.fiscalDataButton) .click(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.addressInput) .wait(selectors.clientFiscalData.addressInput)
@ -138,44 +135,44 @@ describe('Client Edit basicData path', () => {
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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.contactInput, 'value'); .waitToGetProperty(selectors.clientBasicData.contactInput, 'value');
expect(result).toEqual('Black Panther'); expect(result).toEqual('Black Panther');
}); });
it('should now confirm the landline phone number have been added', async () => { it('should now confirm the landline phone number have been added', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.phoneInput, 'value'); .waitToGetProperty(selectors.clientBasicData.phoneInput, 'value');
expect(result).toEqual('123456789'); expect(result).toEqual('123456789');
}); });
it('should now confirm the mobile phone number have been added', async () => { it('should now confirm the mobile phone number have been added', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.mobileInput, 'value'); .waitToGetProperty(selectors.clientBasicData.mobileInput, 'value');
expect(result).toEqual('987654321'); expect(result).toEqual('987654321');
}); });
it('should now confirm the email have been edited', async () => { it('should now confirm the email have been edited', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.emailInput, 'value'); .waitToGetProperty(selectors.clientBasicData.emailInput, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.salesPersonInput, 'value'); .waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value');
expect(result).toEqual('accessory accessory'); expect(result).toEqual('accessory accessory');
}); });
it('should now confirm the channel have been selected', async () => { it('should now confirm the channel have been selected', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientBasicData.channelInput, 'value'); .waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value');
expect(result).toEqual('Metropolis newspaper'); expect(result).toEqual('Metropolis newspaper');
}); });

View File

@ -12,7 +12,7 @@ describe('Client Edit fiscalData path', () => {
}); });
// Confirms all addresses have EQtax false for future propagation test step 1 // Confirms all addresses have EQtax false for future propagation test step 1
it(`should click on the 1st edit icon to check EQtax isnt checked`, async () => { it(`should click on the 1st edit icon to check EQtax isnt checked`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.firstEditButton)
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel) .wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
@ -24,7 +24,7 @@ describe('Client Edit fiscalData path', () => {
}); });
// Confirms all addresses have EQtax false for future propagation test step 2 // Confirms all addresses have EQtax false for future propagation test step 2
it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, async () => { it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.addressesButton)
.waitToClick(selectors.clientAddresses.secondEditButton) .waitToClick(selectors.clientAddresses.secondEditButton)
@ -36,7 +36,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it(`should click on the fiscal data button`, async () => { it(`should click on the fiscal data button`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitToClick(selectors.clientFiscalData.fiscalDataButton)
.waitForURL('fiscal-data') .waitForURL('fiscal-data')
@ -45,7 +45,7 @@ describe('Client Edit fiscalData path', () => {
expect(url.hash).toContain('fiscal-data'); expect(url.hash).toContain('fiscal-data');
}); });
it('should not be able to edit the verified data checkbox', async () => { it('should not be able to edit the verified data checkbox', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).disabled; return document.querySelector(selector).disabled;
@ -63,7 +63,7 @@ describe('Client Edit fiscalData path', () => {
.accessToSection('client.card.fiscalData'); .accessToSection('client.card.fiscalData');
}); });
it('should receive an error if VIES and EQtax are being ticked together', async () => { it('should receive an error if VIES and EQtax are being ticked together', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.clientFiscalData.socialNameInput) .wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput)
@ -76,10 +76,8 @@ describe('Client Edit fiscalData path', () => {
.type(selectors.clientFiscalData.postcodeInput, '12345') .type(selectors.clientFiscalData.postcodeInput, '12345')
.clearInput(selectors.clientFiscalData.cityInput) .clearInput(selectors.clientFiscalData.cityInput)
.type(selectors.clientFiscalData.cityInput, 'N/A') .type(selectors.clientFiscalData.cityInput, 'N/A')
.waitToClick(selectors.clientFiscalData.countryInput) .autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'Francia')
.waitToClick(selectors.clientFiscalData.countryThirdOption) .autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province two')
.waitToClick(selectors.clientFiscalData.provinceInput)
.waitToClick(selectors.clientFiscalData.provinceFifthOption)
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel) .waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
.waitToClick(selectors.clientFiscalData.frozenCheckboxLabel) .waitToClick(selectors.clientFiscalData.frozenCheckboxLabel)
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel) .waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
@ -94,7 +92,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toEqual('Cannot check VIES and Equalization Tax'); expect(result).toEqual('Cannot check VIES and Equalization Tax');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientFiscalData.viesCheckboxInput) .waitToClick(selectors.clientFiscalData.viesCheckboxInput)
.clearInput(selectors.clientFiscalData.fiscalIdInput) .clearInput(selectors.clientFiscalData.fiscalIdInput)
@ -105,7 +103,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toEqual('Cannot check Equalization Tax in this NIF/CIF'); expect(result).toEqual('Cannot check Equalization Tax in this NIF/CIF');
}); });
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() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.clientFiscalData.fiscalIdInput) .clearInput(selectors.clientFiscalData.fiscalIdInput)
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C') .type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
@ -115,7 +113,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should propagate the Equalization tax', async () => { it('should propagate the Equalization tax', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientFiscalData.acceptPropagationButton) .waitToClick(selectors.clientFiscalData.acceptPropagationButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -124,7 +122,7 @@ 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() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.addressesButton)
.waitForURL('/address/index') .waitForURL('/address/index')
@ -134,7 +132,7 @@ describe('Client Edit fiscalData path', () => {
}); });
// confirm all addresses have now EQtax checked step 2 // confirm all addresses have now EQtax checked step 2
it(`should click on the 1st edit icon to confirm EQtax is checked`, async () => { it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.firstEditButton)
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel) .wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
@ -146,7 +144,7 @@ describe('Client Edit fiscalData path', () => {
}); });
// confirm all addresses have now EQtax checked step 3 // confirm all addresses have now EQtax checked step 3
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, async () => { it(`should go back to addresses then select the second one and confirm the EQtax is checked`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.addressesButton)
.waitToClick(selectors.clientAddresses.secondEditButton) .waitToClick(selectors.clientAddresses.secondEditButton)
@ -158,7 +156,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
it('should navigate back to fiscal data and uncheck EQtax then check VIES', async () => { it('should navigate back to fiscal data and uncheck EQtax then check VIES', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitToClick(selectors.clientFiscalData.fiscalDataButton)
.waitToClick(selectors.clientFiscalData.viesCheckboxInput) .waitToClick(selectors.clientFiscalData.viesCheckboxInput)
@ -169,7 +167,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should propagate the Equalization tax changes', async () => { it('should propagate the Equalization tax changes', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientFiscalData.acceptPropagationButton) .waitToClick(selectors.clientFiscalData.acceptPropagationButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -177,7 +175,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toEqual('Equivalent tax spreaded'); expect(result).toEqual('Equivalent tax spreaded');
}); });
it('should confirm its name have been edited', async () => { it('should confirm its name have been edited', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitToClick(selectors.clientFiscalData.fiscalDataButton)
.waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value'); .waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value');
@ -185,49 +183,49 @@ describe('Client Edit fiscalData path', () => {
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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientFiscalData.fiscalIdInput, 'value'); .waitToGetProperty(selectors.clientFiscalData.fiscalIdInput, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientFiscalData.addressInput, 'value'); .waitToGetProperty(selectors.clientFiscalData.addressInput, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.clientFiscalData.postcodeInput, 'value'); .waitToGetProperty(selectors.clientFiscalData.postcodeInput, 'value');
expect(result).toEqual('12345'); expect(result).toEqual('12345');
}); });
it('should confirm the city have been edited', async () => { it('should confirm the city have been edited', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientFiscalData.cityInput, 'value'); .waitToGetProperty(selectors.clientFiscalData.cityInput, 'value');
expect(result).toEqual('N/A'); expect(result).toEqual('N/A');
}); });
it(`should confirm the country have been selected`, async () => { it(`should confirm the country have been selected`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientFiscalData.countryInput, 'value'); .waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value');
expect(result).toEqual('Francia'); expect(result).toEqual('Francia');
}); });
it(`should confirm the province have been selected`, async () => { it(`should confirm the province have been selected`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientFiscalData.provinceInput, 'value'); .waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value');
expect(result).toEqual('Province two'); expect(result).toEqual('Province two');
}); });
it('should confirm active checkbox is unchecked', async () => { it('should confirm active checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -236,7 +234,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should confirm frozen checkbox is unchecked', async () => { it('should confirm frozen checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -245,7 +243,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should confirm Has to invoice checkbox is unchecked', async () => { it('should confirm Has to invoice checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -254,7 +252,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should confirm Vies checkbox is checked', async () => { it('should confirm Vies checkbox is checked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -263,7 +261,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
it('should confirm Invoice by mail checkbox is unchecked', async () => { it('should confirm Invoice by mail checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -272,7 +270,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should confirm invoice by address checkbox is unchecked', async () => { it('should confirm invoice by address checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -281,7 +279,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should confirm Equalization tax checkbox is unchecked', async () => { it('should confirm Equalization tax checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -290,7 +288,7 @@ describe('Client Edit fiscalData path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should confirm Verified data checkbox is checked', async () => { it('should confirm Verified data checkbox is checked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -300,7 +298,7 @@ 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() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.addressesButton)
.waitForURL('/address/index') .waitForURL('/address/index')
@ -310,7 +308,7 @@ describe('Client Edit fiscalData path', () => {
}); });
// 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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.firstEditButton)
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel) .waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
@ -321,7 +319,7 @@ describe('Client Edit fiscalData path', () => {
}); });
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 3 // confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 3
it('should navigate back to fiscal data to confirm invoice by address is now checked', async () => { it('should navigate back to fiscal data to confirm invoice by address is now checked', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitToClick(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.invoiceByAddressCheckboxInput) .wait(selectors.clientFiscalData.invoiceByAddressCheckboxInput)

View File

@ -11,14 +11,10 @@ describe('Client Edit pay method path', () => {
.accessToSection('client.card.billingData'); .accessToSection('client.card.billingData');
}); });
it(`should attempt to edit the Pay method without an IBAN but fail`, async () => { it(`should attempt to edit the Pay method without an IBAN but fail`, async() => {
const snackbarMessage = await nightmare const snackbarMessage = await nightmare
.waitToClick(selectors.clientPayMethod.payMethodInput) .autocompleteSearch(selectors.clientPayMethod.payMethodAutocomplete, 'PayMethod with IBAN')
.waitToClick(selectors.clientPayMethod.payMethodIBANOption) .autocompleteSearch(selectors.clientPayMethod.swiftBicAutocomplete, 'BBKKESMMMMM')
.waitForTextInInput(selectors.clientPayMethod.payMethodInput, 'PayMethod with IBAN')
.waitToClick(selectors.clientPayMethod.swiftBicInput)
.waitToClick(selectors.clientPayMethod.firstSwiftBicOption)
.waitForTextInInput(selectors.clientPayMethod.swiftBicInput, 'BBKKESMMMMM')
.clearInput(selectors.clientPayMethod.dueDayInput) .clearInput(selectors.clientPayMethod.dueDayInput)
.type(selectors.clientPayMethod.dueDayInput, '60') .type(selectors.clientPayMethod.dueDayInput, '60')
.waitForTextInInput(selectors.clientPayMethod.dueDayInput, '60') .waitForTextInInput(selectors.clientPayMethod.dueDayInput, '60')
@ -31,7 +27,7 @@ describe('Client Edit pay method path', () => {
expect(snackbarMessage).toEqual('That payment method requires an IBAN'); expect(snackbarMessage).toEqual('That payment method requires an IBAN');
}); });
it(`should add the IBAN but fail as it requires a BIC code`, async () => { it(`should add the IBAN but fail as it requires a BIC code`, async() => {
const snackbarMessage = await nightmare const snackbarMessage = await nightmare
.clearInput(selectors.clientPayMethod.IBANInput) .clearInput(selectors.clientPayMethod.IBANInput)
.type(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332') .type(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332')
@ -43,46 +39,46 @@ describe('Client Edit pay method path', () => {
expect(snackbarMessage).toEqual('That payment method requires a BIC'); expect(snackbarMessage).toEqual('That payment method requires a BIC');
}); });
it(`should create a new BIC code`, async () => { it(`should create a new BIC code`, async() => {
const newcode = await nightmare const newcode = await nightmare
.click(selectors.clientPayMethod.newBankEntityButton) .click(selectors.clientPayMethod.newBankEntityButton)
.type(selectors.clientPayMethod.newBankEntityName, 'Gotham City Banks') .type(selectors.clientPayMethod.newBankEntityName, 'Gotham City Banks')
.type(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT') .type(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT')
.click(selectors.clientPayMethod.acceptBankEntityButton) .click(selectors.clientPayMethod.acceptBankEntityButton)
.waitToGetProperty(selectors.clientPayMethod.swiftBicInput, 'value'); .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value');
expect(newcode).toEqual('GTHMCT Gotham City Banks'); expect(newcode).toEqual('GTHMCT Gotham City Banks');
}); });
it(`should confirm the IBAN pay method is sucessfully saved`, async () => { it(`should confirm the IBAN pay method is sucessfully saved`, async() => {
const payMethod = await nightmare const payMethod = await nightmare
.waitToGetProperty(selectors.clientPayMethod.payMethodInput, 'value'); .waitToGetProperty(`${selectors.clientPayMethod.payMethodAutocomplete} input`, 'value');
expect(payMethod).toEqual('PayMethod with IBAN'); expect(payMethod).toEqual('PayMethod with IBAN');
}); });
it('should confirm the due day have been edited', async () => { it('should confirm the due day have been edited', async() => {
const dueDate = await nightmare const dueDate = await nightmare
.waitToGetProperty(selectors.clientPayMethod.dueDayInput, 'value'); .waitToGetProperty(selectors.clientPayMethod.dueDayInput, '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() => {
const IBAN = await nightmare const IBAN = await nightmare
.waitToGetProperty(selectors.clientPayMethod.IBANInput, 'value'); .waitToGetProperty(selectors.clientPayMethod.IBANInput, '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() => {
const code = await nightmare const code = await nightmare
.waitToGetProperty(selectors.clientPayMethod.swiftBicInput, 'value'); .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value');
expect(code).toEqual('GTHMCT Gotham City Banks'); expect(code).toEqual('GTHMCT Gotham City Banks');
}); });
it('should confirm Received LCR checkbox is checked', async () => { it('should confirm Received LCR checkbox is checked', async() => {
const checkedBox = await nightmare const checkedBox = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -91,7 +87,7 @@ describe('Client Edit pay method path', () => {
expect(checkedBox).toBeTruthy(); expect(checkedBox).toBeTruthy();
}); });
it('should confirm Received core VNL checkbox is unchecked', async () => { it('should confirm Received core VNL checkbox is unchecked', async() => {
const checkedBox = await nightmare const checkedBox = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
@ -100,7 +96,7 @@ describe('Client Edit pay method path', () => {
expect(checkedBox).toBeFalsy(); expect(checkedBox).toBeFalsy();
}); });
it('should confirm Received B2B VNL checkbox is unchecked', async () => { it('should confirm Received B2B VNL checkbox is unchecked', async() => {
const checkedBox = await nightmare const checkedBox = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;

View File

@ -11,7 +11,7 @@ describe('Client Add address path', () => {
.accessToSection('client.card.address.index'); .accessToSection('client.card.address.index');
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientAddresses.createAddress) .waitToClick(selectors.clientAddresses.createAddress)
.waitForURL('address/create') .waitForURL('address/create')
@ -20,7 +20,7 @@ describe('Client Add address path', () => {
expect(url.hash).toContain('address/create'); expect(url.hash).toContain('address/create');
}); });
it(`should return to the addreses section by clicking the cancel button`, async () => { it(`should return to the addreses section by clicking the cancel button`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientAddresses.cancelButton) .waitToClick(selectors.clientAddresses.cancelButton)
.waitForURL('address/index') .waitForURL('address/index')
@ -29,7 +29,7 @@ describe('Client Add address path', () => {
expect(url.hash).toContain('address/index'); expect(url.hash).toContain('address/index');
}); });
it(`should now click on the add new address button to access to the new address form`, async () => { it(`should now click on the add new address button to access to the new address form`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientAddresses.createAddress) .waitToClick(selectors.clientAddresses.createAddress)
.waitForURL('address/create') .waitForURL('address/create')
@ -38,15 +38,13 @@ describe('Client Add address path', () => {
expect(url.hash).toContain('address/create'); expect(url.hash).toContain('address/create');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.defaultCheckboxInput) .waitToClick(selectors.clientAddresses.defaultCheckboxInput)
.clearInput(selectors.clientAddresses.streetAddressInput) .clearInput(selectors.clientAddresses.streetAddressInput)
.type(selectors.clientAddresses.postcodeInput, '10022') .type(selectors.clientAddresses.postcodeInput, '10022')
.waitToClick(selectors.clientAddresses.provinceInput) .autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province four')
.waitToClick(selectors.clientAddresses.provinceSecondOption) .autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement')
.waitToClick(selectors.clientAddresses.agencyInput)
.waitToClick(selectors.clientAddresses.agenctySecondOption)
.type(selectors.clientAddresses.phoneInput, '999887744') .type(selectors.clientAddresses.phoneInput, '999887744')
.type(selectors.clientAddresses.mobileInput, '999887744') .type(selectors.clientAddresses.mobileInput, '999887744')
.waitToClick(selectors.clientFiscalData.saveButton) .waitToClick(selectors.clientFiscalData.saveButton)
@ -55,7 +53,7 @@ describe('Client Add address path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should create a new address with all it's data`, async () => { it(`should create a new address with all it's data`, async() => {
const result = await nightmare const result = await nightmare
.type(selectors.clientAddresses.consigneeInput, 'Bruce Bunner') .type(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
.type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York') .type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
@ -66,7 +64,7 @@ describe('Client Add address path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should click on the addresses button confirm the new address exists and it's the default one`, async () => { it(`should click on the addresses button confirm the new address exists and it's the default one`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.addressesButton)
.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText'); .waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
@ -74,7 +72,7 @@ describe('Client Add address path', () => {
expect(result).toContain('320 Park Avenue New York'); expect(result).toContain('320 Park Avenue New York');
}); });
it(`should click on the make default icon of the second address then confirm it is the default one now`, async () => { it(`should click on the make default icon of the second address then confirm it is the default one now`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.secondMakeDefaultStar) .waitToClick(selectors.clientAddresses.secondMakeDefaultStar)
.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand') .waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand')
@ -83,7 +81,7 @@ describe('Client Add address path', () => {
expect(result).toContain('Somewhere in Thailand'); expect(result).toContain('Somewhere in Thailand');
}); });
it(`should click on the edit icon of the default address`, async () => { it(`should click on the edit icon of the default address`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand') .waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand')
.waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.firstEditButton)
@ -93,7 +91,7 @@ describe('Client Add address path', () => {
expect(url.hash).toContain('/edit'); expect(url.hash).toContain('/edit');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.activeCheckbox) .waitToClick(selectors.clientAddresses.activeCheckbox)
.waitToClick(selectors.clientAddresses.saveButton) .waitToClick(selectors.clientAddresses.saveButton)

View File

@ -11,7 +11,7 @@ describe('Client add address notes path', () => {
.accessToSection('client.card.address.index'); .accessToSection('client.card.address.index');
}); });
it(`should click on the edit icon of the default address`, async () => { it(`should click on the edit icon of the default address`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street') .waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street')
.waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.firstEditButton)
@ -21,7 +21,7 @@ describe('Client add address notes path', () => {
expect(url.hash).toContain('/edit'); expect(url.hash).toContain('/edit');
}); });
it('should not save a description without observation type', async () => { it('should not save a description without observation type', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientAddresses.addObservationButton) .waitToClick(selectors.clientAddresses.addObservationButton)
.wait(selectors.clientAddresses.firstObservationDescriptionInput) .wait(selectors.clientAddresses.firstObservationDescriptionInput)
@ -32,23 +32,21 @@ describe('Client add address notes path', () => {
expect(result).toEqual('Observation type cannot be blank'); expect(result).toEqual('Observation type cannot be blank');
}); });
it('should not save an observation type without description', async () => { it('should not save an observation type without description', async() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.clientAddresses.firstObservationDescriptionInput) .clearInput(selectors.clientAddresses.firstObservationDescriptionInput)
.waitToClick(selectors.clientAddresses.firstObservationTypeSelect) .autocompleteSearch(selectors.clientAddresses.firstObservationTypeAutocomplete, 'comercial')
.waitToClick(selectors.clientAddresses.firstObservationTypeSelectOptionOne)
.waitToClick(selectors.clientAddresses.saveButton) .waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it('should create two new observations', async () => { it('should create two new observations', async() => {
const result = await nightmare const result = await nightmare
.type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description') .type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description')
.waitToClick(selectors.clientAddresses.addObservationButton) .waitToClick(selectors.clientAddresses.addObservationButton)
.waitToClick(selectors.clientAddresses.secondObservationTypeSelect) .autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one')
.waitToClick(selectors.clientAddresses.secondObservationTypeSelectOptionTwo)
.type(selectors.clientAddresses.secondObservationDescriptionInput, 'second description') .type(selectors.clientAddresses.secondObservationDescriptionInput, 'second description')
.waitToClick(selectors.clientAddresses.saveButton) .waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();

View File

@ -11,7 +11,7 @@ describe('Client Add greuge path', () => {
.accessToSection('client.card.greuge.index'); .accessToSection('client.card.greuge.index');
}); });
it(`should click on the add greuge button`, async () => { it(`should click on the add greuge button`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.clientGreuge.addGreugeFloatButton) .waitToClick(selectors.clientGreuge.addGreugeFloatButton)
.waitForURL('greuge/create') .waitForURL('greuge/create')
@ -20,17 +20,16 @@ describe('Client Add greuge path', () => {
expect(url.hash).toContain('greuge/create'); expect(url.hash).toContain('greuge/create');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.clientGreuge.typeInput) .autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff')
.waitToClick(selectors.clientGreuge.typeSecondOption)
.click(selectors.clientGreuge.saveButton) .click(selectors.clientGreuge.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should create a new greuge with all its data`, async () => { it(`should create a new greuge with all its data`, async() => {
const result = await nightmare const result = await nightmare
.type(selectors.clientGreuge.amountInput, 999) .type(selectors.clientGreuge.amountInput, 999)
.waitForTextInInput(selectors.clientGreuge.amountInput, '999') .waitForTextInInput(selectors.clientGreuge.amountInput, '999')
@ -41,7 +40,7 @@ describe('Client Add greuge path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should confirm the greuge was added to the list', async () => { it('should confirm the greuge was added to the list', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText'); .waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText');

View File

@ -11,31 +11,27 @@ describe('Item Edit basic data path', () => {
.accessToSection('item.card.data'); .accessToSection('item.card.data');
}); });
it(`should edit the item basic data`, async () => { it(`should edit the item basic data`, async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.itemBasicData.nameInput) .wait(selectors.itemBasicData.nameInput)
.clearInput(selectors.itemBasicData.nameInput) .clearInput(selectors.itemBasicData.nameInput)
.type(selectors.itemBasicData.nameInput, 'Rose of Purity') .type(selectors.itemBasicData.nameInput, 'Rose of Purity')
.waitToClick(selectors.itemBasicData.typeSelect) .autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Crisantemo')
.waitToClick(selectors.itemBasicData.typeSelectOptionThree) .autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares')
.waitToClick(selectors.itemBasicData.intrastatSelect)
.waitToClick(selectors.itemBasicData.intrastatSelectOptionOne)
.clearInput(selectors.itemBasicData.relevancyInput) .clearInput(selectors.itemBasicData.relevancyInput)
.type(selectors.itemBasicData.relevancyInput, '1') .type(selectors.itemBasicData.relevancyInput, '1')
.waitToClick(selectors.itemBasicData.originSelect) .autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain')
.waitToClick(selectors.itemBasicData.originSelectOptionTwo) .autocompleteSearch(selectors.itemBasicData.expenceAutocomplete, 'Alquiler VNH')
.waitToClick(selectors.itemBasicData.expenceSelect)
.waitToClick(selectors.itemBasicData.expenceSelectOptionThree)
.clearInput(selectors.itemBasicData.longNameInput) .clearInput(selectors.itemBasicData.longNameInput)
.type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity') .type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
.waitToClick(selectors.itemBasicData.isActiveCheckbox) .waitToClick(selectors.itemBasicData.isActiveCheckbox)
.click(selectors.itemBasicData.submitBasicDataButton) .waitToClick(selectors.itemBasicData.submitBasicDataButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); }, 15000);
it(`should confirm the item name was edited`, async () => { it(`should confirm the item name was edited`, async() => {
const result = await nightmare const result = await nightmare
.click(selectors.itemNiches.nicheButton) .click(selectors.itemNiches.nicheButton)
.wait(selectors.itemNiches.firstWarehouseDisabled) .wait(selectors.itemNiches.firstWarehouseDisabled)
@ -45,49 +41,49 @@ describe('Item Edit basic data path', () => {
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 nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBasicData.typeSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
expect(result).toEqual('Crisantemo'); expect(result).toEqual('Crisantemo');
}); });
it(`should confirm the item intrastad was edited`, async () => { it(`should confirm the item intrastad was edited`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBasicData.intrastatSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBasicData.relevancyInput, 'value'); .waitToGetProperty(selectors.itemBasicData.relevancyInput, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBasicData.originSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, '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 nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBasicData.expenceSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.expenceAutocomplete} input`, 'value');
expect(result).toEqual('Adquisición mercancia Extracomunitaria'); 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 nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBasicData.longNameInput, 'value'); .waitToGetProperty(selectors.itemBasicData.longNameInput, 'value');
expect(result).toEqual('RS Rose of Purity'); expect(result).toEqual('RS Rose of Purity');
}); });
it('should confirm isActive checkbox is unchecked', async () => { it('should confirm isActive checkbox is unchecked', async() => {
const result = await nightmare const result = await nightmare
.evaluate(selector => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;

View File

@ -11,42 +11,38 @@ describe('Item edit tax path', () => {
.accessToSection('item.card.tax'); .accessToSection('item.card.tax');
}); });
it(`should add the item tax to all countries`, async () => { it(`should add the item tax to all countries`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemTax.firstClassSelect) .autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT')
.waitToClick(selectors.itemTax.firstClassSelectOptionTwo) .autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT')
.waitToClick(selectors.itemTax.secondClassSelect) .autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'Reduced VAT')
.waitToClick(selectors.itemTax.secondClassSelectOptionOne)
.waitToClick(selectors.itemTax.thirdClassSelect)
.waitToClick(selectors.itemTax.thirdClassSelectOptionTwo)
.click(selectors.itemTax.submitTaxButton) .click(selectors.itemTax.submitTaxButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the first item tax class was edited`, async () => { it(`should confirm the first item tax class was edited`, async() => {
const firstVatType = await nightmare const firstVatType = await nightmare
.click(selectors.itemTags.tagsButton) .click(selectors.itemTags.tagsButton)
.wait(selectors.itemTags.firstTagDisabled) .wait(selectors.itemTags.firstTagDisabled)
.click(selectors.itemTax.taxButton) .click(selectors.itemTax.taxButton)
.waitToClick(selectors.itemTax.taxButton) .waitToClick(selectors.itemTax.taxButton)
.waitForTextInInput(selectors.itemTax.firstClassSelect, 'reduced') .waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
.waitToGetProperty(selectors.itemTax.firstClassSelect, 'value');
expect(firstVatType).toEqual('Reduced VAT'); expect(firstVatType).toEqual('Reduced 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 nightmare const secondVatType = await nightmare
.waitToGetProperty(selectors.itemTax.secondClassSelect, 'value'); .waitToGetProperty(`${selectors.itemTax.secondClassAutocomplete} input`, '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 nightmare const thirdVatType = await nightmare
.waitToGetProperty(selectors.itemTax.thirdClassSelect, 'value'); .waitToGetProperty(`${selectors.itemTax.thirdClassAutocomplete} input`, 'value');
expect(thirdVatType).toEqual('Reduced VAT'); expect(thirdVatType).toEqual('Reduced VAT');
}); });

View File

@ -11,12 +11,11 @@ describe('Item create tags path', () => {
.accessToSection('item.card.tags'); .accessToSection('item.card.tags');
}); });
it(`should create a new tag and delete a former one`, async () => { it(`should create a new tag and delete a former one`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemTags.firstRemoveTagButton) .waitToClick(selectors.itemTags.firstRemoveTagButton)
.waitToClick(selectors.itemTags.addItemTagButton) .waitToClick(selectors.itemTags.addItemTagButton)
.waitToClick(selectors.itemTags.seventhTagSelect) .autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base')
.waitToClick(selectors.itemTags.seventhTagSelectOptionFive)
.type(selectors.itemTags.seventhValueInput, '50') .type(selectors.itemTags.seventhValueInput, '50')
.clearInput(selectors.itemTags.seventhRelevancyInput) .clearInput(selectors.itemTags.seventhRelevancyInput)
.type(selectors.itemTags.seventhRelevancyInput, '1') .type(selectors.itemTags.seventhRelevancyInput, '1')
@ -26,13 +25,13 @@ describe('Item create tags path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the first row data is the expected one`, async () => { it(`should confirm the first row data is the expected one`, async() => {
let result = await nightmare let result = await nightmare
.click(selectors.itemBasicData.basicDataButton) .click(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput) .wait(selectors.itemBasicData.nameInput)
.click(selectors.itemTags.tagsButton) .click(selectors.itemTags.tagsButton)
.wait('vn-item-tags') .wait('vn-item-tags')
.waitToGetProperty(selectors.itemTags.firstTagSelect, 'value'); .waitToGetProperty(`${selectors.itemTags.firstTagAutocomplete} input`, 'value');
expect(result).toEqual('Ancho de la base'); expect(result).toEqual('Ancho de la base');
@ -47,9 +46,9 @@ describe('Item create tags path', () => {
expect(result).toEqual('1'); expect(result).toEqual('1');
}); });
it(`should confirm the second row data is the expected one`, async () => { it(`should confirm the second row data is the expected one`, async() => {
let tag = await nightmare let tag = await nightmare
.waitToGetProperty(selectors.itemTags.secondTagSelect, 'value'); .waitToGetProperty(`${selectors.itemTags.secondTagAutocomplete} input`, 'value');
let value = await nightmare let value = await nightmare
.waitToGetProperty(selectors.itemTags.secondValueInput, 'value'); .waitToGetProperty(selectors.itemTags.secondValueInput, 'value');
@ -62,9 +61,9 @@ describe('Item create tags path', () => {
expect(relevancy).toEqual('2'); expect(relevancy).toEqual('2');
}); });
it(`should confirm the third row data is the expected one`, async () => { it(`should confirm the third row data is the expected one`, async() => {
let tag = await nightmare let tag = await nightmare
.waitToGetProperty(selectors.itemTags.thirdTagSelect, 'value'); .waitToGetProperty(`${selectors.itemTags.thirdTagAutocomplete} input`, 'value');
let value = await nightmare let value = await nightmare
.waitToGetProperty(selectors.itemTags.thirdValueInput, 'value'); .waitToGetProperty(selectors.itemTags.thirdValueInput, 'value');
@ -77,9 +76,9 @@ describe('Item create tags path', () => {
expect(relevancy).toEqual('3'); expect(relevancy).toEqual('3');
}); });
it(`should confirm the fourth row data is the expected one`, async () => { it(`should confirm the fourth row data is the expected one`, async() => {
let tag = await nightmare let tag = await nightmare
.waitToGetProperty(selectors.itemTags.fourthTagSelect, 'value'); .waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value');
let value = await nightmare let value = await nightmare
.waitToGetProperty(selectors.itemTags.fourthValueInput, 'value'); .waitToGetProperty(selectors.itemTags.fourthValueInput, 'value');
@ -92,7 +91,7 @@ describe('Item create tags path', () => {
expect(relevancy).toEqual('4'); expect(relevancy).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 nightmare let tag = await nightmare
.waitToGetProperty(selectors.itemTags.fifthTagSelect, 'value'); .waitToGetProperty(selectors.itemTags.fifthTagSelect, 'value');

View File

@ -11,12 +11,11 @@ describe('Item create niche path', () => {
.accessToSection('item.card.niche'); .accessToSection('item.card.niche');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemNiches.addNicheButton) .waitToClick(selectors.itemNiches.addNicheButton)
.waitToClick(selectors.itemNiches.secondNicheRemoveButton) .waitToClick(selectors.itemNiches.secondNicheRemoveButton)
.waitToClick(selectors.itemNiches.thirdWarehouseSelect) .autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two')
.waitToClick(selectors.itemNiches.thirdWarehouseSelectFourthOption)
.type(selectors.itemNiches.thirdCodeInput, 'A4') .type(selectors.itemNiches.thirdCodeInput, 'A4')
.click(selectors.itemNiches.submitNichesButton) .click(selectors.itemNiches.submitNichesButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -24,13 +23,13 @@ describe('Item create niche path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the first niche is the expected one`, async () => { it(`should confirm the first niche is the expected one`, async() => {
let result = await nightmare let result = await nightmare
.click(selectors.itemBasicData.basicDataButton) .click(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput) .wait(selectors.itemBasicData.nameInput)
.click(selectors.itemNiches.nicheButton) .click(selectors.itemNiches.nicheButton)
.waitForTextInInput(selectors.itemNiches.firstWarehouseSelect, 'Warehouse One') .waitForTextInInput(`${selectors.itemNiches.firstWarehouseAutocomplete}`, 'Warehouse One')
.waitToGetProperty(selectors.itemNiches.firstWarehouseSelect, 'value'); .waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete}`, 'value');
expect(result).toEqual('Warehouse One'); expect(result).toEqual('Warehouse One');
result = await nightmare result = await nightmare
@ -39,7 +38,7 @@ describe('Item create niche path', () => {
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 nightmare let result = await nightmare
.waitToGetProperty(selectors.itemNiches.secondWarehouseSelect, 'value'); .waitToGetProperty(selectors.itemNiches.secondWarehouseSelect, 'value');
@ -51,9 +50,9 @@ describe('Item create niche path', () => {
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 nightmare let result = await nightmare
.waitToGetProperty(selectors.itemNiches.thirdWarehouseSelect, 'value'); .waitToGetProperty(`${selectors.itemNiches.thirdWarehouseAutocomplete} input`, 'value');
expect(result).toEqual('Warehouse Two'); expect(result).toEqual('Warehouse Two');
result = await nightmare result = await nightmare

View File

@ -11,21 +11,19 @@ describe('Item Create botanical path', () => {
.accessToSection('item.card.botanical'); .accessToSection('item.card.botanical');
}); });
it(`should create a new botanical for the item Mjolnir`, async () => { it(`should create a new botanical for the item Mjolnir`, async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.itemBotanical.botanicalInput) .wait(selectors.itemBotanical.botanicalInput)
.type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') .type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
.waitToClick(selectors.itemBotanical.genusSelect) .autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia')
.waitToClick(selectors.itemBotanical.genusSelectOptionOne) .autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata')
.waitToClick(selectors.itemBotanical.speciesSelect)
.waitToClick(selectors.itemBotanical.speciesSelectOptionOne)
.waitToClick(selectors.itemBotanical.submitBotanicalButton) .waitToClick(selectors.itemBotanical.submitBotanicalButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the botanical for item Mjolnir was created`, async () => { it(`should confirm the botanical for item Mjolnir was created`, async() => {
const result = await nightmare const result = await nightmare
.click(selectors.itemBasicData.basicDataButton) .click(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput) .wait(selectors.itemBasicData.nameInput)
@ -36,36 +34,34 @@ describe('Item Create botanical path', () => {
expect(result).toEqual('Cicuta maculata'); expect(result).toEqual('Cicuta maculata');
}); });
it(`should confirm the Genus for item Mjolnir was created`, async () => { it(`should confirm the Genus for item Mjolnir was created`, async() => {
const result = await nightmare const result = await nightmare
.waitForTextInInput(selectors.itemBotanical.genusSelect, 'Abelia') .waitForTextInInput(`${selectors.itemBotanical.genusAutocomplete} input`, 'Abelia')
.waitToGetProperty(selectors.itemBotanical.genusSelect, 'value'); .waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
expect(result).toEqual('Abelia'); expect(result).toEqual('Abelia');
}); });
it(`should confirm the Species for item Mjolnir was created`, async () => { it(`should confirm the Species for item Mjolnir was created`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBotanical.speciesSelect, 'value'); .waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
expect(result).toEqual('dealbata'); expect(result).toEqual('dealbata');
}); });
it(`should edit botanical for the item Mjolnir`, async () => { it(`should edit botanical for the item Mjolnir`, async() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.itemBotanical.botanicalInput) .clearInput(selectors.itemBotanical.botanicalInput)
.type(selectors.itemBotanical.botanicalInput, 'Herp Derp') .type(selectors.itemBotanical.botanicalInput, 'Herp Derp')
.waitToClick(selectors.itemBotanical.genusSelect) .autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies')
.waitToClick(selectors.itemBotanical.genusSelectOptionTwo) .autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens')
.waitToClick(selectors.itemBotanical.speciesSelect)
.waitToClick(selectors.itemBotanical.speciesSelectOptionTwo)
.waitToClick(selectors.itemBotanical.submitBotanicalButton) .waitToClick(selectors.itemBotanical.submitBotanicalButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the botanical for item Mjolnir was edited`, async () => { it(`should confirm the botanical for item Mjolnir was edited`, async() => {
const result = await nightmare const result = await nightmare
.click(selectors.itemBasicData.basicDataButton) .click(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput) .wait(selectors.itemBasicData.nameInput)
@ -76,17 +72,17 @@ describe('Item Create botanical path', () => {
expect(result).toEqual('Herp Derp'); expect(result).toEqual('Herp Derp');
}); });
it(`should confirm the Genus for item Mjolnir was edited`, async () => { it(`should confirm the Genus for item Mjolnir was edited`, async() => {
const result = await nightmare const result = await nightmare
.waitForTextInInput(selectors.itemBotanical.genusSelect, 'Abies') .waitForTextInInput(`${selectors.itemBotanical.genusAutocomplete} input`, 'Abies')
.waitToGetProperty(selectors.itemBotanical.genusSelect, 'value'); .waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
expect(result).toEqual('Abies'); expect(result).toEqual('Abies');
}); });
it(`should confirm the Species for item Mjolnir was edited`, async () => { it(`should confirm the Species for item Mjolnir was edited`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.itemBotanical.speciesSelect, 'value'); .waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
expect(result).toEqual('decurrens'); expect(result).toEqual('decurrens');
}); });

View File

@ -9,7 +9,7 @@ describe('Item Create/Clone path', () => {
.loginAndModule('buyer', 'item'); .loginAndModule('buyer', 'item');
}); });
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() => {
const result = await nightmare const result = await nightmare
.wait(selectors.itemsIndex.searchItemInput) .wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
@ -20,7 +20,7 @@ describe('Item Create/Clone path', () => {
expect(result).toEqual(0); expect(result).toEqual(0);
}); });
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() => {
const url = await nightmare const url = await nightmare
.click(selectors.itemsIndex.createItemButton) .click(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton) .wait(selectors.itemCreateView.createButton)
@ -29,7 +29,7 @@ describe('Item Create/Clone path', () => {
expect(url.hash).toEqual('#!/item/create'); expect(url.hash).toEqual('#!/item/create');
}); });
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() => {
const url = await nightmare const url = await nightmare
.click(selectors.itemCreateView.cancelButton) .click(selectors.itemCreateView.cancelButton)
.wait(selectors.itemsIndex.createItemButton) .wait(selectors.itemsIndex.createItemButton)
@ -38,7 +38,7 @@ describe('Item Create/Clone path', () => {
expect(url.hash).toEqual('#!/item/index'); expect(url.hash).toEqual('#!/item/index');
}); });
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() => {
const url = await nightmare const url = await nightmare
.click(selectors.itemsIndex.createItemButton) .click(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton) .wait(selectors.itemCreateView.createButton)
@ -47,22 +47,19 @@ describe('Item Create/Clone path', () => {
expect(url.hash).toEqual('#!/item/create'); expect(url.hash).toEqual('#!/item/create');
}); });
it('should create the Infinity Gauntlet item', async () => { it('should create the Infinity Gauntlet item', async() => {
const result = await nightmare const result = await nightmare
.type(selectors.itemCreateView.name, 'Infinity Gauntlet') .type(selectors.itemCreateView.name, 'Infinity Gauntlet')
.waitToClick(selectors.itemCreateView.typeSelect) .autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo')
.waitToClick(selectors.itemCreateView.typeSelectOptionThree) .autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares')
.waitToClick(selectors.itemCreateView.intrastatSelect) .autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand')
.waitToClick(selectors.itemCreateView.intrastatSelectOptionOne)
.waitToClick(selectors.itemCreateView.originSelect)
.waitToClick(selectors.itemCreateView.originSelectOptionOne)
.click(selectors.itemCreateView.createButton) .click(selectors.itemCreateView.createButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should confirm Infinity Gauntlet item was created', async () => { it('should confirm Infinity Gauntlet item was created', async() => {
let result = await nightmare let result = await nightmare
.waitToGetProperty(selectors.itemBasicData.nameInput, 'value'); .waitToGetProperty(selectors.itemBasicData.nameInput, 'value');
@ -70,24 +67,24 @@ describe('Item Create/Clone path', () => {
result = await nightmare result = await nightmare
.waitToGetProperty(selectors.itemBasicData.typeSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
expect(result).toEqual('Crisantemo'); expect(result).toEqual('Crisantemo');
result = await nightmare result = await nightmare
.waitToGetProperty(selectors.itemBasicData.intrastatSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value');
expect(result).toEqual('6021010 Plantas vivas: Esqueje/injerto, Vid'); expect(result).toEqual('5080000 Coral y materiales similares');
result = await nightmare result = await nightmare
.waitToGetProperty(selectors.itemBasicData.originSelect, 'value'); .waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value');
expect(result).toEqual('Spain'); expect(result).toEqual('Holand');
}); });
}); });
describe('clone', () => { describe('clone', () => {
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() => {
const url = await nightmare const url = await nightmare
.click(selectors.itemBasicData.goToItemIndexButton) .click(selectors.itemBasicData.goToItemIndexButton)
.wait(selectors.itemsIndex.createItemButton) .wait(selectors.itemsIndex.createItemButton)
@ -97,7 +94,7 @@ describe('Item Create/Clone path', () => {
expect(url.hash).toContain('#!/item/index'); expect(url.hash).toContain('#!/item/index');
}); });
it(`should search for the item Infinity Gauntlet`, async () => { it(`should search for the item Infinity Gauntlet`, async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.itemsIndex.searchItemInput) .wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
@ -108,7 +105,7 @@ describe('Item Create/Clone path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should clone the Infinity Gauntlet`, async () => { it(`should clone the Infinity Gauntlet`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet') .waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet')
.click(selectors.itemsIndex.searchResultCloneButton) .click(selectors.itemsIndex.searchResultCloneButton)
@ -119,7 +116,7 @@ describe('Item Create/Clone path', () => {
expect(url.hash).toContain('tags'); expect(url.hash).toContain('tags');
}); });
it('should search for the item Infinity Gauntlet and find two', async () => { it('should search for the item Infinity Gauntlet and find two', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemTags.goToItemIndexButton) .waitToClick(selectors.itemTags.goToItemIndexButton)
.wait(selectors.itemsIndex.searchItemInput) .wait(selectors.itemsIndex.searchItemInput)

View File

@ -8,7 +8,7 @@ describe('Item regularize path', () => {
.loginAndModule('employee', 'item'); .loginAndModule('employee', 'item');
}); });
it('should search for the item Mjolnir', async () => { it('should search for the item Mjolnir', async() => {
const resultCount = await nightmare const resultCount = await nightmare
.wait(selectors.itemsIndex.searchItemInput) .wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Mjolnir') .type(selectors.itemsIndex.searchItemInput, 'Mjolnir')
@ -19,7 +19,7 @@ describe('Item regularize path', () => {
expect(resultCount).toEqual(1); expect(resultCount).toEqual(1);
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir') .waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir')
.waitToClick(selectors.itemsIndex.searchResult) .waitToClick(selectors.itemsIndex.searchResult)
@ -29,21 +29,20 @@ describe('Item regularize path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
it('should regularize the item', async () => { it('should regularize the item', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenu)
.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton)
.wait(selectors.itemDescriptor.regularizeQuantityInput) .wait(selectors.itemDescriptor.regularizeQuantityInput)
.type(selectors.itemDescriptor.regularizeQuantityInput, 100) .type(selectors.itemDescriptor.regularizeQuantityInput, 100)
.waitToClick(selectors.itemDescriptor.regularizeWarehouseSelect) .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One')
.waitToClick(selectors.itemDescriptor.regularizeWarehouseSelectSecondOption)
.waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitToClick(selectors.itemDescriptor.regularizeSaveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should click on the Tickets button of the top bar menu', async () => { it('should click on the Tickets button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -54,7 +53,7 @@ describe('Item regularize path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should search for the ticket with alias missing', async () => { it('should search for the ticket with alias missing', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'missing') .type(selectors.ticketsIndex.searchTicketInput, 'missing')
@ -65,7 +64,7 @@ describe('Item regularize path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -75,7 +74,7 @@ describe('Item regularize path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100') .waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100')
.waitToGetProperty(selectors.ticketSummary.firstSaleQuantity, 'innerText'); .waitToGetProperty(selectors.ticketSummary.firstSaleQuantity, 'innerText');
@ -83,14 +82,14 @@ describe('Item regularize path', () => {
expect(result).toContain('-100'); expect(result).toContain('-100');
}); });
it(`should check the ticket sale discount is 100%`, async () => { it(`should check the ticket sale discount is 100%`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.ticketSummary.firstSaleDiscount, 'innerText'); .waitToGetProperty(selectors.ticketSummary.firstSaleDiscount, 'innerText');
expect(result).toContain('100 %'); expect(result).toContain('100 %');
}); });
it('should now click on the Items button of the top bar menu', async () => { it('should now click on the Items button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -101,7 +100,7 @@ describe('Item regularize path', () => {
expect(url.hash).toEqual('#!/item/index'); expect(url.hash).toEqual('#!/item/index');
}); });
it('should search for the item Mjolnir once again', async () => { it('should search for the item Mjolnir once again', async() => {
const resultCount = await nightmare const resultCount = await nightmare
.wait(selectors.itemsIndex.searchItemInput) .wait(selectors.itemsIndex.searchItemInput)
.type(selectors.itemsIndex.searchItemInput, 'Mjolnir') .type(selectors.itemsIndex.searchItemInput, 'Mjolnir')
@ -112,7 +111,7 @@ describe('Item regularize path', () => {
expect(resultCount).toEqual(1); expect(resultCount).toEqual(1);
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir') .waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir')
.waitToClick(selectors.itemsIndex.searchResult) .waitToClick(selectors.itemsIndex.searchResult)
@ -122,21 +121,20 @@ describe('Item regularize path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
it('should regularize the item once more', async () => { it('should regularize the item once more', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenu)
.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton)
.wait(selectors.itemDescriptor.regularizeQuantityInput) .wait(selectors.itemDescriptor.regularizeQuantityInput)
.type(selectors.itemDescriptor.regularizeQuantityInput, 100) .type(selectors.itemDescriptor.regularizeQuantityInput, 100)
.waitToClick(selectors.itemDescriptor.regularizeWarehouseSelect) .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One')
.waitToClick(selectors.itemDescriptor.regularizeWarehouseSelectSecondOption)
.waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitToClick(selectors.itemDescriptor.regularizeSaveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should again click on the Tickets button of the top bar menu', async () => { it('should again click on the Tickets button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -147,7 +145,7 @@ describe('Item regularize path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should search for the ticket with id 22 once again', async () => { it('should search for the ticket with id 22 once again', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:22') .type(selectors.ticketsIndex.searchTicketInput, 'id:22')
@ -158,7 +156,7 @@ describe('Item regularize path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, '22') .waitForTextInElement(selectors.ticketsIndex.searchResult, '22')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -168,7 +166,7 @@ describe('Item regularize path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
it(`should check the ticket contains now two sales`, async () => { it(`should check the ticket contains now two sales`, async() => {
const result = await nightmare const result = await nightmare
.waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100') .waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100')
.countElement(selectors.ticketSummary.sale); .countElement(selectors.ticketSummary.sale);

View File

@ -11,12 +11,11 @@ describe('Ticket Create notes path', () => {
.accessToSection('ticket.card.observation'); .accessToSection('ticket.card.observation');
}); });
it(`should click create a new note and delete a former one`, async () => { it(`should click create a new note and delete a former one`, async() => {
let result = await nightmare let result = await nightmare
.waitToClick(selectors.ticketNotes.firstNoteRemoveButton) .waitToClick(selectors.ticketNotes.firstNoteRemoveButton)
.waitToClick(selectors.ticketNotes.addNoteButton) .waitToClick(selectors.ticketNotes.addNoteButton)
.waitToClick(selectors.ticketNotes.firstNoteSelect) .autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one')
.waitToClick(selectors.ticketNotes.firstNoteSelectSecondOption)
.type(selectors.ticketNotes.firstDescriptionInput, 'description') .type(selectors.ticketNotes.firstDescriptionInput, 'description')
.click(selectors.ticketNotes.submitNotesButton) .click(selectors.ticketNotes.submitNotesButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -24,14 +23,14 @@ describe('Ticket Create notes path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the note is the expected one`, async () => { it(`should confirm the note is the expected one`, async() => {
let firstNoteSelect = await nightmare let result = await nightmare
.click(selectors.ticketPackages.packagesButton) .click(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageSelect) .wait(selectors.ticketPackages.firstPackageAutocomplete)
.click(selectors.ticketNotes.notesButton) .click(selectors.ticketNotes.notesButton)
.waitToGetProperty(selectors.ticketNotes.firstNoteSelect, 'value'); .waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value');
expect(firstNoteSelect).toEqual('observation one'); expect(result).toEqual('observation one');
let firstDescription = await nightmare let firstDescription = await nightmare
.waitToGetProperty(selectors.ticketNotes.firstDescriptionInput, 'value'); .waitToGetProperty(selectors.ticketNotes.firstDescriptionInput, 'value');

View File

@ -11,12 +11,12 @@ describe('Ticket Delete expeditions path', () => {
.accessToSection('ticket.card.expedition'); .accessToSection('ticket.card.expedition');
}); });
it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async () => { it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton) .waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
.waitToClick(selectors.ticketExpedition.acceptDeleteRowButton) .waitToClick(selectors.ticketExpedition.acceptDeleteRowButton)
.click(selectors.ticketPackages.packagesButton) .click(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageSelect) .wait(selectors.ticketPackages.firstPackageAutocomplete)
.click(selectors.ticketExpedition.expeditionButton) .click(selectors.ticketExpedition.expeditionButton)
.wait(selectors.ticketExpedition.expeditionRow) .wait(selectors.ticketExpedition.expeditionRow)
.countElement(selectors.ticketExpedition.expeditionRow); .countElement(selectors.ticketExpedition.expeditionRow);

View File

@ -11,19 +11,18 @@ describe('Ticket Create packages path', () => {
.accessToSection('ticket.card.package.index'); .accessToSection('ticket.card.package.index');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketPackages.firstRemovePackageButton) .waitToClick(selectors.ticketPackages.firstRemovePackageButton)
.waitToClick(selectors.ticketPackages.addPackageButton) .waitToClick(selectors.ticketPackages.addPackageButton)
.waitToClick(selectors.ticketPackages.firstPackageSelect) .autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box')
.waitToClick(selectors.ticketPackages.firstPackageSelectOptionTwo)
.click(selectors.ticketPackages.savePackagesButton) .click(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should attempt create a new package but receive an error if quantity is a string`, async () => { it(`should attempt create a new package but receive an error if quantity is a string`, async() => {
const result = await nightmare const result = await nightmare
.type(selectors.ticketPackages.firstQuantityInput, 'ninety 9') .type(selectors.ticketPackages.firstQuantityInput, 'ninety 9')
.click(selectors.ticketPackages.savePackagesButton) .click(selectors.ticketPackages.savePackagesButton)
@ -32,7 +31,7 @@ describe('Ticket Create packages path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
it(`should attempt create a new package but receive an error if quantity is 0`, async () => { it(`should attempt create a new package but receive an error if quantity is 0`, async() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput) .clearInput(selectors.ticketPackages.firstQuantityInput)
.type(selectors.ticketPackages.firstQuantityInput, 0) .type(selectors.ticketPackages.firstQuantityInput, 0)
@ -42,7 +41,7 @@ describe('Ticket Create packages path', () => {
expect(result).toEqual('Some fields are invalid'); expect(result).toEqual('Some fields are invalid');
}); });
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() => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput) .clearInput(selectors.ticketPackages.firstQuantityInput)
.type(selectors.ticketPackages.firstQuantityInput, 99) .type(selectors.ticketPackages.firstQuantityInput, 99)
@ -53,29 +52,27 @@ describe('Ticket Create packages path', () => {
expect(result).toEqual('Package cannot be blank'); expect(result).toEqual('Package cannot be blank');
}); });
it(`should create a new package with correct data`, async () => { it(`should create a new package with correct data`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketPackages.firstPackageSelect) .autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box')
.waitToClick(selectors.ticketPackages.firstPackageSelectOptionTwo)
.waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Legendary Box')
.click(selectors.ticketPackages.savePackagesButton) .click(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the first select is the expected one`, async () => { it(`should confirm the first select is the expected one`, async() => {
const result = await nightmare const result = await nightmare
.click(selectors.ticketSales.saleButton) .waitToClick(selectors.ticketSales.saleButton)
.wait(selectors.ticketSales.firstPackageSelect) .wait(selectors.ticketSales.firstPackageAutocomplete)
.click(selectors.ticketPackages.packagesButton) .waitToClick(selectors.ticketPackages.packagesButton)
.waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Legendary Box') .waitForTextInInput(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'Legendary Box')
.waitToGetProperty(selectors.ticketPackages.firstPackageSelect, 'value'); .waitToGetProperty(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'value');
expect(result).toEqual('7 : Legendary Box'); expect(result).toEqual('7 : Legendary Box');
}); });
it(`should confirm the first quantity is the expected one`, async () => { it(`should confirm the first quantity is the expected one`, async() => {
const result = await nightmare const result = await nightmare
.waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '99') .waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '99')
.waitToGetProperty(selectors.ticketPackages.firstQuantityInput, 'value'); .waitToGetProperty(selectors.ticketPackages.firstQuantityInput, 'value');

View File

@ -11,17 +11,17 @@ describe('Ticket Edit sale path', () => {
.accessToSection('ticket.card.sale'); .accessToSection('ticket.card.sale');
}); });
it(`should click on the first claim id to navigate over there`, async () => { it(`should click on the first claim id to navigate over there`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.secondSaleClaimId) .waitToClick(selectors.ticketSales.secondSaleClaimId)
.wait(selectors.claimBasicData.claimStateSelect) .wait(selectors.claimBasicData.claimStateAutocomplete)
.parsedUrl(); .parsedUrl();
expect(url.hash).toEqual('#!/claim/2/basic-data'); expect(url.hash).toEqual('#!/claim/2/basic-data');
}); });
it('should now click on the Tickets button of the top bar menu', async () => { it('should now click on the Tickets button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -32,7 +32,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should again search for a specific ticket', async () => { it('should again search for a specific ticket', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:16') .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
@ -43,7 +43,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should now click on the search result to access to the ticket Sale`, async () => { it(`should now click on the search result to access to the ticket Sale`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -54,14 +54,14 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it(`should check the zoomed image isnt present`, async () => { it(`should check the zoomed image isnt present`, async() => {
const result = await nightmare const result = await nightmare
.countElement(selectors.ticketSales.firstSaleZoomedImage); .countElement(selectors.ticketSales.firstSaleZoomedImage);
expect(result).toEqual(0); expect(result).toEqual(0);
}); });
it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, async () => { it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleThumbnailImage) .waitToClick(selectors.ticketSales.firstSaleThumbnailImage)
.countElement(selectors.ticketSales.firstSaleZoomedImage); .countElement(selectors.ticketSales.firstSaleZoomedImage);
@ -69,7 +69,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should click on the zoomed image to close it`, async () => { it(`should click on the zoomed image to close it`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleZoomedImage) .waitToClick(selectors.ticketSales.firstSaleZoomedImage)
.countElement(selectors.ticketSales.firstSaleZoomedImage); .countElement(selectors.ticketSales.firstSaleZoomedImage);
@ -77,14 +77,14 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(0); expect(result).toEqual(0);
}); });
it(`should confirm the item descriptor insnt visible yet`, async () => { it(`should confirm the item descriptor insnt visible yet`, async() => {
const visible = await nightmare const visible = await nightmare
.isVisible(selectors.ticketSales.saleDescriptorPopover); .isVisible(selectors.ticketSales.saleDescriptorPopover);
expect(visible).toBeFalsy(); expect(visible).toBeFalsy();
}); });
it(`should click on the first sale ID making the item descriptor visible`, async () => { it(`should click on the first sale ID making the item descriptor visible`, async() => {
const visible = await nightmare const visible = await nightmare
.waitToClick(selectors.ticketSales.firstSaleID) .waitToClick(selectors.ticketSales.firstSaleID)
.wait(1000) .wait(1000)
@ -93,7 +93,7 @@ describe('Ticket Edit sale path', () => {
expect(visible).toBeTruthy(); expect(visible).toBeTruthy();
}); });
it(`should click on the descriptor image of the 1st sale and see the zoomed image`, async () => { it(`should click on the descriptor image of the 1st sale and see the zoomed image`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick('vn-item-descriptor img') .waitToClick('vn-item-descriptor img')
.countElement(selectors.ticketSales.firstSaleZoomedImage); .countElement(selectors.ticketSales.firstSaleZoomedImage);
@ -101,7 +101,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should click on the zoomed image to close it`, async () => { it(`should click on the zoomed image to close it`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleZoomedImage) .waitToClick(selectors.ticketSales.firstSaleZoomedImage)
.countElement(selectors.ticketSales.firstSaleZoomedImage); .countElement(selectors.ticketSales.firstSaleZoomedImage);
@ -109,7 +109,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(0); expect(result).toEqual(0);
}); });
it(`should click on the summary icon of the item-descriptor to access to the item summary`, async () => { it(`should click on the summary icon of the item-descriptor to access to the item summary`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.saleDescriptorPopoverSummaryButton) .waitToClick(selectors.ticketSales.saleDescriptorPopoverSummaryButton)
.waitForURL('/summary') .waitForURL('/summary')
@ -118,7 +118,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
it('should return to ticket sales section', async () => { it('should return to ticket sales section', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -136,7 +136,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it('should try to add a higher quantity value and then receive an error', async () => { it('should try to add a higher quantity value and then receive an error', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleQuantityClearInput) .waitToClick(selectors.ticketSales.firstSaleQuantityClearInput)
.type(selectors.ticketSales.firstSaleQuantity, '9\u000d') .type(selectors.ticketSales.firstSaleQuantity, '9\u000d')
@ -145,7 +145,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual('The new quantity should be smaller than the old one'); expect(result).toEqual('The new quantity should be smaller than the old one');
}); });
it('should remove 1 from quantity', async () => { it('should remove 1 from quantity', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleQuantityClearInput) .waitToClick(selectors.ticketSales.firstSaleQuantityClearInput)
.type(selectors.ticketSales.firstSaleQuantity, '4\u000d') .type(selectors.ticketSales.firstSaleQuantity, '4\u000d')
@ -154,7 +154,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should update the price', async () => { it('should update the price', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSalePrice) .waitToClick(selectors.ticketSales.firstSalePrice)
.wait(selectors.ticketSales.firstSalePriceInput) .wait(selectors.ticketSales.firstSalePriceInput)
@ -165,21 +165,21 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should confirm the price have been updated', async () => { it('should confirm the price have been updated', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText'); .waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText');
expect(result).toContain('5.00'); expect(result).toContain('5.00');
}); });
it('should confirm the total price for that item have been updated', async () => { it('should confirm the total price for that item have been updated', async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText'); .waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
expect(result).toContain('20.00'); expect(result).toContain('20.00');
}); });
it('should update the discount', async () => { it('should update the discount', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleDiscount) .waitToClick(selectors.ticketSales.firstSaleDiscount)
.wait('vn-textfield[label="Discount"] > div[class="container selected"]') // a function selects the text after it's loaded .wait('vn-textfield[label="Discount"] > div[class="container selected"]') // a function selects the text after it's loaded
@ -190,7 +190,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it('should confirm the discount have been updated', async () => { it('should confirm the discount have been updated', async() => {
const result = await nightmare const result = await nightmare
.waitForTextInElement(selectors.ticketSales.firstSaleDiscount, '50 %') .waitForTextInElement(selectors.ticketSales.firstSaleDiscount, '50 %')
.waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText'); .waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText');
@ -198,7 +198,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toContain('50 %'); expect(result).toContain('50 %');
}); });
it('should confirm the total import for that item have been updated', async () => { it('should confirm the total import for that item have been updated', async() => {
const result = await nightmare const result = await nightmare
.waitForTextInElement(selectors.ticketSales.firstSaleImport, '10.00') .waitForTextInElement(selectors.ticketSales.firstSaleImport, '10.00')
.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText'); .waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
@ -206,18 +206,18 @@ describe('Ticket Edit sale path', () => {
expect(result).toContain('10.00'); expect(result).toContain('10.00');
}); });
it('should select the third sale and create a claim of it', async () => { it('should select the third sale and create a claim of it', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.thirdSaleCheckbox)
.waitToClick(selectors.ticketSales.moreMenuButton) .waitToClick(selectors.ticketSales.moreMenuButton)
.waitToClick(selectors.ticketSales.moreMenuCreateClaim) .waitToClick(selectors.ticketSales.moreMenuCreateClaim)
.wait(selectors.claimBasicData.claimStateSelect) .wait(selectors.claimBasicData.claimStateAutocomplete)
.parsedUrl(); .parsedUrl();
expect(url.hash).toEqual('#!/claim/4/basic-data'); expect(url.hash).toEqual('#!/claim/4/basic-data');
}); });
it('should click on the Claims button of the top bar menu', async () => { it('should click on the Claims button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -228,7 +228,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toEqual('#!/claim/index'); expect(url.hash).toEqual('#!/claim/index');
}); });
it('should search for the claim with id 4', async () => { it('should search for the claim with id 4', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.claimsIndex.searchResult) .wait(selectors.claimsIndex.searchResult)
.type(selectors.claimsIndex.searchClaimInput, 4) .type(selectors.claimsIndex.searchClaimInput, 4)
@ -239,7 +239,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it('should click the Tickets button of the top bar menu', async () => { it('should click the Tickets button of the top bar menu', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible) .wait(selectors.globalItems.applicationsMenuVisible)
@ -250,7 +250,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should search the ticket', async () => { it('should search the ticket', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:16') .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
@ -261,7 +261,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should click on the result to access to the ticket Sale`, async () => { it(`should click on the result to access to the ticket Sale`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -272,7 +272,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it('should select the third sale and delete it', async () => { it('should select the third sale and delete it', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.thirdSaleCheckbox)
.waitToClick(selectors.ticketSales.deleteSaleButton) .waitToClick(selectors.ticketSales.deleteSaleButton)
@ -282,14 +282,14 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual('Data saved!'); expect(result).toEqual('Data saved!');
}); });
it(`should confirm the third sale was deleted`, async () => { it(`should confirm the third sale was deleted`, async() => {
const result = await nightmare const result = await nightmare
.countElement(selectors.ticketSales.saleLine); .countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(3); expect(result).toEqual(3);
}); });
it('should select the third sale and attempt to send it to a frozen client ticket', async () => { it('should select the third sale and attempt to send it to a frozen client ticket', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.thirdSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton) .waitToClick(selectors.ticketSales.transferSaleButton)
@ -301,7 +301,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(`The sales of this ticket can't be modified`); expect(result).toEqual(`The sales of this ticket can't be modified`);
}); });
it('should transfer the sale to a valid ticket', async () => { it('should transfer the sale to a valid ticket', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.moveToTicketInputClearButton) .waitToClick(selectors.ticketSales.moveToTicketInputClearButton)
.type(selectors.ticketSales.moveToTicketInput, 12) .type(selectors.ticketSales.moveToTicketInput, 12)
@ -312,7 +312,7 @@ describe('Ticket Edit sale path', () => {
expect(result.hash).toContain(`ticket/12/sale`); expect(result.hash).toContain(`ticket/12/sale`);
}); });
it('should confirm the transfered line is the correct one', async () => { it('should confirm the transfered line is the correct one', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketSales.firstSaleText) .wait(selectors.ticketSales.firstSaleText)
.waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText'); .waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText');
@ -320,7 +320,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toContain(`Mark I`); expect(result).toContain(`Mark I`);
}); });
it('should go back to the original ticket sales section', async () => { it('should go back to the original ticket sales section', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
@ -336,7 +336,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it(`should confirm the original ticket has only two lines now`, async () => { it(`should confirm the original ticket has only two lines now`, async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketSales.saleLine) .wait(selectors.ticketSales.saleLine)
.countElement(selectors.ticketSales.saleLine); .countElement(selectors.ticketSales.saleLine);
@ -344,7 +344,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(2); expect(result).toEqual(2);
}); });
it('should go back to the receiver ticket sales section', async () => { it('should go back to the receiver ticket sales section', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
@ -360,7 +360,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it('should transfer the sale back to the original ticket', async () => { it('should transfer the sale back to the original ticket', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton) .waitToClick(selectors.ticketSales.transferSaleButton)
@ -373,7 +373,7 @@ describe('Ticket Edit sale path', () => {
expect(result.hash).toContain(`ticket/16/sale`); expect(result.hash).toContain(`ticket/16/sale`);
}); });
it('should confirm the original ticket received the line', async () => { it('should confirm the original ticket received the line', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketSales.saleLine) .wait(selectors.ticketSales.saleLine)
.countElement(selectors.ticketSales.saleLine); .countElement(selectors.ticketSales.saleLine);
@ -381,7 +381,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(3); expect(result).toEqual(3);
}); });
it('should go back to the original ticket sales section', async () => { it('should go back to the original ticket sales section', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
@ -397,7 +397,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it('should select the second and third sale and tranfer them to a new ticket then get to the ticket index', async () => { it('should select the second and third sale and tranfer them to a new ticket then get to the ticket index', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton) .waitToClick(selectors.ticketSales.transferSaleButton)
@ -412,7 +412,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should search for a specific created ticket', async () => { it('should search for a specific created ticket', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2') .type(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2')
@ -423,7 +423,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should click on the search result to access to the ticket Sale once more`, async () => { it(`should click on the search result to access to the ticket Sale once more`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -434,21 +434,21 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/sale'); expect(url.hash).toContain('/sale');
}); });
it('should confirm the new ticket received both lines', async () => { it('should confirm the new ticket received both lines', async() => {
const result = await nightmare const result = await nightmare
.countElement(selectors.ticketSales.saleLine); .countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it('should check the first sale reserved icon isnt visible', async () => { it('should check the first sale reserved icon isnt visible', async() => {
const result = await nightmare const result = await nightmare
.isVisible(selectors.ticketSales.firstSaleReservedIcon); .isVisible(selectors.ticketSales.firstSaleReservedIcon);
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should mark the first sale as reserved', async () => { it('should mark the first sale as reserved', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.moreMenuButton) .waitToClick(selectors.ticketSales.moreMenuButton)
@ -459,7 +459,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeTruthy(); expect(result).toBeTruthy();
}); });
it('should unmark the first sale as reserved', async () => { it('should unmark the first sale as reserved', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.moreMenuButton) .waitToClick(selectors.ticketSales.moreMenuButton)
@ -470,7 +470,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should update all sales discount', async () => { it('should update all sales discount', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.selectAllSalesCheckbox) .waitToClick(selectors.ticketSales.selectAllSalesCheckbox)
.waitToClick(selectors.ticketSales.moreMenuButton) .waitToClick(selectors.ticketSales.moreMenuButton)
@ -484,7 +484,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toContain('0.00'); expect(result).toContain('0.00');
}); });
it('should log in as Production role and go to the ticket index', async () => { it('should log in as Production role and go to the ticket index', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.logOutButton) .waitToClick(selectors.globalItems.logOutButton)
.waitForLogin('production') .waitForLogin('production')
@ -497,7 +497,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should now search for a specific ticket', async () => { it('should now search for a specific ticket', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:16') .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
@ -508,7 +508,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should now click on the search result to access to the ticket Tracking`, async () => { it(`should now click on the search result to access to the ticket Tracking`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -519,7 +519,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/tracking/index'); expect(url.hash).toContain('/tracking/index');
}); });
it(`should click on the edit ticket tracking state button`, async () => { it(`should click on the edit ticket tracking state button`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketTracking.createStateButton) .waitToClick(selectors.ticketTracking.createStateButton)
.waitForURL('/tracking/edit') .waitForURL('/tracking/edit')
@ -528,7 +528,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/tracking/edit'); expect(url.hash).toContain('/tracking/edit');
}); });
it(`should set the state of the ticket to preparation`, async () => { it(`should set the state of the ticket to preparation`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketTracking.stateSelect) .waitToClick(selectors.ticketTracking.stateSelect)
.wait(selectors.ticketTracking.stateSelectInput) .wait(selectors.ticketTracking.stateSelectInput)
@ -542,7 +542,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toContain('/tracking/index'); expect(url.hash).toContain('/tracking/index');
}); });
it(`should click on the ticket Sale menu button`, async () => { it(`should click on the ticket Sale menu button`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.saleButton) .waitToClick(selectors.ticketSales.saleButton)
.waitForURL('/sale') .waitForURL('/sale')
@ -552,7 +552,7 @@ describe('Ticket Edit sale path', () => {
}); });
describe('when state is preparation and loged as Production', () => { describe('when state is preparation and loged as Production', () => {
it(`should not be able to edit the sale price`, async () => { it(`should not be able to edit the sale price`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSalePrice) .waitToClick(selectors.ticketSales.firstSalePrice)
.exists(selectors.ticketSales.firstSalePriceInput); .exists(selectors.ticketSales.firstSalePriceInput);
@ -560,7 +560,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it(`should not be able to edit the sale discount`, async () => { it(`should not be able to edit the sale discount`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleDiscount) .waitToClick(selectors.ticketSales.firstSaleDiscount)
.exists(selectors.ticketSales.firstSaleDiscountInput); .exists(selectors.ticketSales.firstSaleDiscountInput);
@ -568,7 +568,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it(`should not be able to edit the sale state`, async () => { it(`should not be able to edit the sale state`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.stateMenuButton) .waitToClick(selectors.ticketSales.stateMenuButton)
.exists(selectors.ticketSales.stateMenuOptions); .exists(selectors.ticketSales.stateMenuOptions);
@ -576,7 +576,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it('should log in as salesPerson role and go to the ticket index', async () => { it('should log in as salesPerson role and go to the ticket index', async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.globalItems.logOutButton) .waitToClick(selectors.globalItems.logOutButton)
.waitForLogin('salesPerson') .waitForLogin('salesPerson')
@ -589,7 +589,7 @@ describe('Ticket Edit sale path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should once again search for a specific ticket', async () => { it('should once again search for a specific ticket', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:16') .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
@ -600,7 +600,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
it(`should click on the search result to access to the ticket Sale once again`, async () => { it(`should click on the search result to access to the ticket Sale once again`, async() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -613,7 +613,7 @@ describe('Ticket Edit sale path', () => {
}); });
describe('when state is preparation and loged as salesPerson', () => { describe('when state is preparation and loged as salesPerson', () => {
it(`shouldnt be able to edit the sale price`, async () => { it(`shouldnt be able to edit the sale price`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSalePrice) .waitToClick(selectors.ticketSales.firstSalePrice)
.exists(selectors.ticketSales.firstSalePriceInput); .exists(selectors.ticketSales.firstSalePriceInput);
@ -621,7 +621,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it(`shouldnt be able to edit the sale discount`, async () => { it(`shouldnt be able to edit the sale discount`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleDiscount) .waitToClick(selectors.ticketSales.firstSaleDiscount)
.exists(selectors.ticketSales.firstSaleDiscountInput); .exists(selectors.ticketSales.firstSaleDiscountInput);
@ -629,7 +629,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toBeFalsy(); expect(result).toBeFalsy();
}); });
it(`shouldnt be able to edit the sale state`, async () => { it(`shouldnt be able to edit the sale state`, async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketSales.stateMenuButton) .waitToClick(selectors.ticketSales.stateMenuButton)
.exists(selectors.ticketSales.stateMenuOptions); .exists(selectors.ticketSales.stateMenuOptions);

View File

@ -10,7 +10,7 @@ describe('Ticket diary path', () => {
.loginAndModule('employee', 'ticket'); .loginAndModule('employee', 'ticket');
}); });
it('should search for a specific ticket', async () => { it('should search for a specific ticket', async() => {
const result = await nightmare const result = await nightmare
.wait(selectors.ticketsIndex.searchTicketInput) .wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, 'id:1') .type(selectors.ticketsIndex.searchTicketInput, 'id:1')
@ -21,7 +21,7 @@ describe('Ticket diary path', () => {
expect(result).toEqual(1); expect(result).toEqual(1);
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketsIndex.searchResult)
@ -31,7 +31,7 @@ describe('Ticket diary path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
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() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSummary.firstSaleItemId) .waitToClick(selectors.ticketSummary.firstSaleItemId)
.waitToClick(selectors.ticketSummary.popoverDiaryButton) .waitToClick(selectors.ticketSummary.popoverDiaryButton)
@ -42,24 +42,23 @@ describe('Ticket diary path', () => {
expect(url.hash).toContain('/diary'); expect(url.hash).toContain('/diary');
}); });
it(`should check the seventh line id is marked as counter`, async () => { it(`should check the seventh line id is marked as counter`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.itemDiary.thirdTicketId, 'className'); .waitToGetProperty(selectors.itemDiary.thirdTicketId, 'className');
expect(result).toContain('counter'); expect(result).toContain('counter');
}); });
it(`should check the fifth line balance is marked as counter`, async () => { it(`should check the fifth line balance is marked as counter`, async() => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(selectors.itemDiary.fifthBalance, 'className'); .waitToGetProperty(selectors.itemDiary.fifthBalance, 'className');
expect(result).toContain('counter'); expect(result).toContain('counter');
}); });
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() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemDiary.warehouseSelect) .autocompleteSearch(selectors.itemDiary.warehouseAutocomplete, 'Warehouse Two')
.waitToClick(selectors.itemDiary.warehouseSelectFourthOption)
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className'); .waitToGetProperty(selectors.itemDiary.firstBalance, 'className');
expect(result).toContain('balance'); expect(result).toContain('balance');