salix/e2e/helpers/selectors.js

221 lines
19 KiB
JavaScript
Raw Normal View History

2017-09-15 10:24:37 +00:00
// eslint max-len: ["error", 500]
// eslint key-spacing: ["error", 500]
2017-11-08 14:43:34 +00:00
import components from './components_selectors.js';
2017-11-07 08:09:59 +00:00
2017-09-15 10:24:37 +00:00
export default {
globalItems: {
2018-02-20 12:48:25 +00:00
logOutButton: `#logout`,
applicationsMenuButton: `#apps`,
2017-11-07 08:09:59 +00:00
applicationsMenuVisible: `${components.vnMainMenu} .is-visible > div`,
clientsButton: `${components.vnMainMenu} > div > ul > li:nth-child(1)`
},
moduleAccessView: {
clientsSectionButton: `${components.vnModuleContainer}[ui-sref="clients"]`,
itemsSectionButton: `${components.vnModuleContainer}[ui-sref="item.index"]`
},
2017-10-29 14:49:44 +00:00
clientsIndex: {
2017-11-07 08:09:59 +00:00
searchClientInput: `${components.vnTextfield}`,
searchButton: `${components.vnSearchBar} > vn-icon-button > button`,
searchResult: `${components.vnItemClient}:nth-child(1) > a`,
createClientButton: `${components.vnFloatButton}`
},
createClientView: {
2017-11-08 14:43:34 +00:00
name: `${components.vnTextfield}[name="name"]`,
taxNumber: `${components.vnTextfield}[name="fi"]`,
socialName: `${components.vnTextfield}[name="socialName"]`,
userName: `${components.vnTextfield}[name="userName"]`,
email: `${components.vnTextfield}[name="email"]`,
salesPersonInput: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > ${components.vnTextfield}`,
salesBruceBannerOption: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
2017-11-07 08:09:59 +00:00
createButton: `${components.vnSubmit}`
},
clientBasicData: {
2017-11-08 14:43:34 +00:00
basicDataButton: `${components.vnMenuItem}[ui-sref="clientCard.basicData"]`,
nameInput: `${components.vnTextfield}[name="name"]`,
contactInput: `${components.vnTextfield}[name="contact"]`,
2017-11-08 14:43:34 +00:00
phoneInput: `${components.vnTextfield}[name="phone"]`,
mobileInput: `${components.vnTextfield}[name="mobile"]`,
faxInput: `${components.vnTextfield}[name="fax"]`,
emailInput: `${components.vnTextfield}[name="email"]`,
salesPersonInput: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > ${components.vnTextfield}`,
salesPersonOptionOne: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
2017-11-08 14:43:34 +00:00
channelInput: `${components.vnAutocomplete}[field="$ctrl.client.contactChannelFk"] > vn-vertical > ${components.vnTextfield}`,
channelMetropolisOption: `${components.vnAutocomplete}[field="$ctrl.client.contactChannelFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`,
2017-11-08 14:43:34 +00:00
saveButton: `${components.vnSubmit}`
},
clientFiscalData: {
2017-11-08 14:43:34 +00:00
fiscalDataButton: `${components.vnMenuItem}[ui-sref="clientCard.fiscalData"]`,
socialNameInput: `${components.vnTextfield}[name="socialName"]`,
fiscalIdInput: `${components.vnTextfield}[name="fi"]`,
equalizationTaxCheckboxLabel: `${components.vnCheck}[label='Is equalizated'] > label > input`,
acceptPropagationButton: `vn-client-fiscal-data > vn-confirm button[response=ACCEPT]`,
2017-11-08 14:43:34 +00:00
addressInput: `${components.vnTextfield}[name="street"]`,
cityInput: `${components.vnTextfield}[name="city"]`,
2017-11-09 12:29:51 +00:00
postcodeInput: `${components.vnTextfield}[name="postcode"]`,
provinceInput: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > ${components.vnTextfield}`,
provinceFifthOption: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(5)`,
2017-11-09 13:47:09 +00:00
countryInput: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > ${components.vnTextfield}`,
countryThirdOption: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`,
activeCheckboxLabel: `${components.vnCheck}[label='Active'] > label`,
invoiceByAddressCheckboxInput: `${components.vnCheck}[label='Invoice by address'] > label > input`,
verifiedDataCheckboxInput: `${components.vnCheck}[label='Verified data'] > label > input`,
hasToInvoiceCheckboxLabel: `${components.vnCheck}[label='Has to invoice'] > label`,
invoiceByMailCheckboxLabel: `${components.vnCheck}[label='Invoice by mail'] > label`,
viesCheckboxInput: `${components.vnCheck}[label='Vies'] > label > input`,
saveButton: `${components.vnSubmit}`
2017-12-11 11:33:27 +00:00
},
clientPayMethod: {
2017-12-11 11:33:27 +00:00
payMethodButton: `${components.vnMenuItem}[ui-sref="clientCard.billingData"]`,
payMethodInput: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > ${components.vnTextfield}`,
payMethodIBANOption: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(5)`,
payMethodOptionOne: `${components.vnAutocomplete}[field="$ctrl.client.payMethodFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
IBANInput: `${components.vnTextfield}[name="iban"]`,
dueDayInput: `${components.vnTextfield}[name="dueDay"]`,
cancelNotificationButton: 'vn-client-billing-data > vn-confirm button[response=CANCEL]',
receivedCoreVNHCheckbox: `${components.vnCheck}[label='Received core VNH'] > label > input`,
receivedCoreVNLCheckbox: `${components.vnCheck}[label='Received core VNL'] > label > input`,
receivedB2BVNLCheckbox: `${components.vnCheck}[label='Received B2B VNL'] > label > input`,
2017-12-11 11:33:27 +00:00
saveButton: `${components.vnSubmit}`
},
clientAddresses: {
addressesButton: `${components.vnMenuItem}[ui-sref="clientCard.addresses.list"]`,
createAddress: `${components.vnFloatButton}`,
defaultCheckboxInput: `${components.vnCheck}[label='Default'] > label > input`,
consigneeInput: `${components.vnTextfield}[name="nickname"]`,
streetAddressInput: `${components.vnTextfield}[name="street"]`,
postcodeInput: `${components.vnTextfield}[name="postalCode"]`,
cityInput: `${components.vnTextfield}[name="city"]`,
provinceInput: `${components.vnAutocomplete}[field="$ctrl.address.provinceFk"] > vn-vertical > ${components.vnTextfield}`,
provinceSecondOption: `${components.vnAutocomplete}[field="$ctrl.address.provinceFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
agencyInput: `${components.vnAutocomplete}[field="$ctrl.address.agencyFk"] > vn-vertical > ${components.vnTextfield}`,
agenctySecondOption: `${components.vnAutocomplete}[field="$ctrl.address.agencyFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
phoneInput: `${components.vnTextfield}[name="phone"]`,
mobileInput: `${components.vnTextfield}[name="mobile"]`,
2018-02-20 12:48:25 +00:00
defaultAddress: 'vn-client-addresses > vn-vertical > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-one > vn-horizontal > vn-one > div:nth-child(2)',
secondMakeDefaultStar: 'vn-client-addresses > vn-vertical > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-one > vn-horizontal > vn-none > i',
firstEditButton: `${components.vnIconButton}[icon='edit']`,
secondEditButton: `vn-horizontal:nth-child(3) > vn-one > vn-horizontal > a > ${components.vnIconButton}[icon='edit']`,
activeCheckbox: `${components.vnCheck}[label='Enabled'] > label > input`,
equalizationTaxCheckboxLabel: `${components.vnCheck}[label='Is equalizated'] > label > input`,
addAddressNoteButton: `${components.vnIcon}[icon="add_circle"]`,
firstObservationTypeSelect: `${components.vnAutocomplete}[field="observation.observationTypeFk"]:nth-child(1) > vn-vertical > ${components.vnTextfield}`,
firstObservationTypeSelectOptionOne: `${components.vnAutocomplete}[field="observation.observationTypeFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
firstObservationDescriptionInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Description"] > div > input`,
secondObservationTypeSelect: `${components.vnAutocomplete}[field="observation.observationTypeFk"]:nth-child(2) > vn-vertical > ${components.vnTextfield}`,
secondObservationTypeSelectOptionTwo: `${components.vnAutocomplete}[field="observation.observationTypeFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
secondObservationDescriptionInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Description"] > div > input`,
thirdObservationTypeSelect: `${components.vnAutocomplete}[field="observation.observationTypeFk"]:nth-child(3) > vn-vertical > ${components.vnTextfield}`,
thirdObservationTypeSelectOptionThree: `${components.vnAutocomplete}[field="observation.observationTypeFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`,
thirdObservationDescriptionInput: `vn-horizontal:nth-child(5) > vn-textfield[label="Description"] > div > input`,
saveButton: `${components.vnSubmit}`
2017-12-15 09:07:52 +00:00
},
clientWebAccess: {
2017-12-15 09:07:52 +00:00
webAccessButton: `${components.vnMenuItem}[ui-sref="clientCard.webAccess"]`,
enableWebAccessCheckbox: `${components.vnCheck}[label='Enable web access'] > label > input`,
userNameInput: `${components.vnTextfield}[name="name"]`,
saveButton: `${components.vnSubmit}`
2017-12-15 11:51:06 +00:00
},
clientNotes: {
2017-12-15 11:51:06 +00:00
notesButton: `${components.vnMenuItem}[ui-sref="clientCard.notes.list"]`,
addNoteFloatButton: `${components.vnFloatButton}`,
noteInput: `${components.vnTextarea}[label="Note"]`,
saveButton: `${components.vnSubmit}`,
2018-02-20 12:48:25 +00:00
firstNoteText: 'vn-client-notes > vn-card > div > vn-vertical > vn-one:nth-child(2) > vn-horizontal.ng-binding'
},
clientCredit: {
creditButton: `${components.vnMenuItem}[ui-sref="clientCard.credit.list"]`,
addCreditFloatButton: `${components.vnFloatButton}`,
creditInput: `${components.vnTextfield}[name="credit"]`,
saveButton: `${components.vnSubmit}`,
2018-02-20 12:48:25 +00:00
firstCreditText: 'vn-client-credit-list > vn-card > div > vn-vertical > vn-one > vn-horizontal:nth-child(1) > vn-one'
},
clientGreuge: {
greugeButton: `${components.vnMenuItem}[ui-sref="clientCard.greuge.list"]`,
addGreugeFloatButton: `${components.vnFloatButton}`,
amountInput: `${components.vnTextfield}[name="amount"]`,
2018-01-12 08:47:51 +00:00
descriptionInput: `${components.vnTextfield}[name="description"]`,
typeInput: `${components.vnAutocomplete}[field="$ctrl.greuge.greugeTypeFk"] > vn-vertical > ${components.vnTextfield}`,
typeSecondOption: `${components.vnAutocomplete}[field="$ctrl.greuge.greugeTypeFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-auto:nth-child(2) > ul > li`,
2018-01-12 08:47:51 +00:00
saveButton: `${components.vnSubmit}`,
2018-02-20 12:48:25 +00:00
firstGreugeText: 'vn-client-greuge-list > vn-card > div > vn-vertical > vn-one > vn-horizontal'
2018-01-12 13:20:28 +00:00
},
clientMandate: {
2018-01-12 13:20:28 +00:00
mandateButton: `${components.vnMenuItem}[ui-sref="clientCard.mandate"]`,
2018-02-20 12:48:25 +00:00
firstMandateText: 'vn-client-mandate > vn-card > div > vn-vertical > vn-one > vn-horizontal'
},
itemsIndex: {
createItemButton: `${components.vnFloatButton}`,
searchResult: `${components.vnItemProduct} > vn-horizontal > vn-one`,
2018-02-22 15:44:14 +00:00
searchResultPreviewButton: `${components.vnItemProduct}:nth-child(1) > vn-horizontal > vn-horizontal > vn-one:nth-child(2) > vn-icon > i`,
2018-02-23 08:42:19 +00:00
searchResultCloneButton: `${components.vnItemProduct} > vn-horizontal > vn-horizontal > vn-one:nth-child(1) > vn-icon > i`,
acceptClonationAlertButton: `vn-dialog.ng-isolate-scope.vn-dialog.shown > div > form > div.buttons > tpl-buttons > button:nth-child(2)`,
searchItemInput: `${components.vnTextfield}`,
2018-02-22 15:44:14 +00:00
searchButton: `${components.vnSearchBar} > vn-icon-button > button`,
closeItemSummaryPreview: 'body > vn-app > vn-vertical > vn-vertical > ui-view > vn-item-list:nth-child(1) > div > vn-dialog > div > button > vn-icon'
},
itemBasicData: {
2018-02-22 10:26:32 +00:00
basicDataButton: `${components.vnMenuItem}[ui-sref="item.card.data"]`,
typeSelect: `${components.vnAutocomplete}[field="$ctrl.item.typeFk"] > vn-vertical > ${components.vnTextfield}`,
typeSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.item.typeFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
intrastatSelect: `${components.vnAutocomplete}[field="$ctrl.item.intrastatFk"] > vn-vertical > ${components.vnTextfield}`,
intrastatSelectOptionOne: `${components.vnAutocomplete}[field="$ctrl.item.intrastatFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
nameInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`,
relevancyInput: `vn-horizontal:nth-child(3) > ${components.vnTextfield}`,
originSelect: `${components.vnAutocomplete}[field="$ctrl.item.originFk"] > vn-vertical > ${components.vnTextfield}`,
originSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.item.originFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
expenceSelect: `${components.vnAutocomplete}[field="$ctrl.item.expenceFk"] > vn-vertical > ${components.vnTextfield}`,
expenceSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.item.expenceFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
submitBasicDataButton: `${components.vnSubmit}`
},
itemTax: {
taxButton: `${components.vnMenuItem}[ui-sref="item.card.tax"]`,
firstClassSelect: `vn-horizontal:nth-child(2) > ${components.vnAutocomplete}[field="tax.taxClassFk"] > vn-vertical > ${components.vnTextfield}`,
firstClassSelectOptionTwo: `vn-horizontal:nth-child(2) > ${components.vnAutocomplete} > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
secondClassSelect: `vn-horizontal:nth-child(3) > ${components.vnAutocomplete}[field="tax.taxClassFk"] > vn-vertical > ${components.vnTextfield}`,
secondClassSelectOptionOne: `vn-horizontal:nth-child(3) > ${components.vnAutocomplete} > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
thirdClassSelect: `vn-horizontal:nth-child(4) > ${components.vnAutocomplete}[field="tax.taxClassFk"] > vn-vertical > ${components.vnTextfield}`,
thirdClassSelectOptionTwo: `vn-horizontal:nth-child(4) > ${components.vnAutocomplete} > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
submitTaxButton: `${components.vnSubmit}`
},
itemBarcodes: {
barcodeButton: `${components.vnMenuItem}[ui-sref="item.card.itemBarcode"]`,
addBarcodeButton: `${components.vnIcon}[icon="add_circle"]`,
2018-02-20 14:22:24 +00:00
thirdCodeInput: `vn-horizontal:nth-child(4) > ${components.vnTextfield}`,
submitBarcodesButton: `${components.vnSubmit}`,
2018-02-20 14:22:24 +00:00
firstCodeRemoveButton: `vn-horizontal:nth-child(2) > vn-one > ${components.vnIcon}[icon="remove_circle_outline"]`
},
itemNiches: {
nicheButton: `${components.vnMenuItem}[ui-sref="item.card.niche"]`,
addNicheButton: `${components.vnIcon}[icon="add_circle"]`,
firstWarehouseSelect: `${components.vnAutocomplete}[field="itemNiche.warehouseFk"] > vn-vertical > ${components.vnTextfield}`,
firstWarehouseSelectSecondOption: `${components.vnAutocomplete}[field="itemNiche.warehouseFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
thirdWarehouseSelect: `vn-horizontal:nth-child(4) > ${components.vnAutocomplete}[field="itemNiche.warehouseFk"] > vn-vertical > ${components.vnTextfield}`,
thirdWarehouseSelectFourthOption: `vn-horizontal:nth-child(4) > ${components.vnAutocomplete}[field="itemNiche.warehouseFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(4)`,
secondNicheRemoveButton: `vn-horizontal:nth-child(3) > vn-one > ${components.vnIcon}[icon="remove_circle_outline"]`,
firstCodeInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`,
thirdCodeInput: `vn-horizontal:nth-child(4) > ${components.vnTextfield}`,
submitNichesButton: `${components.vnSubmit}`
},
itemBotanical: {
botanicalButton: `${components.vnMenuItem}[ui-sref="item.card.botanical"]`,
botanicalInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`,
genusSelect: `${components.vnAutocomplete}[field="$ctrl.botanical.genusFk"] > vn-vertical > ${components.vnTextfield}`,
genusSelectOptionOne: `${components.vnAutocomplete}[field="$ctrl.botanical.genusFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
genusSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.botanical.genusFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
speciesSelect: `${components.vnAutocomplete}[field="$ctrl.botanical.specieFk"] > vn-vertical > ${components.vnTextfield}`,
speciesSelectOptionOne: `${components.vnAutocomplete}[field="$ctrl.botanical.specieFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
speciesSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.botanical.specieFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`,
submitBotanicalButton: `${components.vnSubmit}`
2018-02-22 10:26:32 +00:00
},
itemTags: {
tagsButton: `${components.vnMenuItem}[ui-sref="item.card.tags"]`
2018-02-22 15:44:14 +00:00
},
itemSummary: {
basicData: `${components.vnItemSummary} > vn-horizontal:nth-child(1) > vn-one:nth-child(2) > vn-vertical > p:nth-child(2)`,
tags: `${components.vnItemSummary} > vn-horizontal:nth-child(1) > vn-one:nth-child(3) > vn-vertical > p`,
niche: `${components.vnItemSummary} > vn-horizontal:nth-child(2) > vn-one:nth-child(1) > vn-vertical > p:nth-child(2)`,
botanical: `${components.vnItemSummary} > vn-horizontal:nth-child(2) > vn-one:nth-child(2) > vn-vertical > p`,
barcode: `${components.vnItemSummary} > vn-horizontal:nth-child(2) > vn-one:nth-child(3) > vn-vertical > p`
2017-09-15 10:24:37 +00:00
}
};