{{ $t('title') }}
+{{$t('dearClient')}},
+ + ++
diff --git a/.gitignore b/.gitignore
index 9a4c04b95..50d3f3f91 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@ dist/*
npm-debug.log
.eslintcache
datasources.*.json
+print.*.json
db.json
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 6c0a6a410..510faa06b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,6 +6,7 @@ RUN apt-get update \
curl \
ca-certificates \
gnupg2 \
+ libfontconfig \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
@@ -18,12 +19,14 @@ RUN apt-get update \
WORKDIR /salix
COPY package.json package-lock.json ./
COPY loopback/package.json loopback/
+COPY print/package.json print/
RUN npm install --only=prod
COPY loopback loopback
COPY back back
COPY modules modules
COPY dist/webpack-assets.json dist/
+COPY print print
COPY \
modules.yml \
LICENSE \
diff --git a/Jenkinsfile b/Jenkinsfile
index a5ad595d7..72988ce92 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -2,6 +2,9 @@
pipeline {
agent any
+ options {
+ disableConcurrentBuilds()
+ }
environment {
REGISTRY = 'registry.verdnatura.es'
DOCKER_HOST_1 = 'tcp://vch1.verdnatura.es:2376'
diff --git a/README.md b/README.md
index 1381289d0..ab7cf3f36 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,7 @@ $ karma start
For server-side unit tests run from project's root.
```
-$ npm run test
+$ gulp backTest
```
For end-to-end tests run from project's root.
diff --git a/back/methods/message/specs/send.spec.js b/back/methods/message/specs/send.spec.js
index 49a4ae5ff..079595b12 100644
--- a/back/methods/message/specs/send.spec.js
+++ b/back/methods/message/specs/send.spec.js
@@ -1,4 +1,4 @@
-const app = require(`${serviceRoot}/server/server`);
+const app = require('vn-loopback/server/server');
describe('message send()', () => {
it('should call the send method and return the response', async() => {
diff --git a/back/methods/user-config/specs/getUserConfig.spec.js b/back/methods/user-config/specs/getUserConfig.spec.js
index 2d2c4ab97..da3fc958f 100644
--- a/back/methods/user-config/specs/getUserConfig.spec.js
+++ b/back/methods/user-config/specs/getUserConfig.spec.js
@@ -1,4 +1,4 @@
-const app = require(`${serviceRoot}/server/server`);
+const app = require('vn-loopback/server/server');
describe('userConfig getUserConfig()', () => {
it(`should return the configuration data of a given user`, async() => {
diff --git a/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js b/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js
index 29f848e8a..1d48eef58 100644
--- a/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js
+++ b/back/methods/worker-mana/specs/getCurrentWorkerMana.spec.js
@@ -1,4 +1,4 @@
-const app = require(`${serviceRoot}/server/server`);
+const app = require('vn-loopback/server/server');
describe('workerMana getCurrentWorkerMana()', () => {
it('should get the mana of the logged worker', async() => {
diff --git a/back/models/specs/account.spec.js b/back/models/specs/account.spec.js
index b9d561074..c52bc4378 100644
--- a/back/models/specs/account.spec.js
+++ b/back/models/specs/account.spec.js
@@ -1,4 +1,4 @@
-const app = require(`${serviceRoot}/server/server`);
+const app = require('vn-loopback/server/server');
describe('loopback model Account', () => {
it('should return true if the user has the given role', async() => {
diff --git a/back/tests.js b/back/tests.js
index ac3372d80..8e21985c5 100644
--- a/back/tests.js
+++ b/back/tests.js
@@ -11,8 +11,6 @@ let verbose = false;
if (process.argv[2] === '--v')
verbose = true;
-serviceRoot = `${__dirname}/../loopback`;
-
let Jasmine = require('jasmine');
let jasmine = new Jasmine();
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
diff --git a/docker-compose.yml b/docker-compose.yml
index 2d5c8cb33..cc66e2ab2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,7 +10,6 @@ services:
- ${PORT}:80
links:
- api
- - mailer
api:
image: registry.verdnatura.es/salix-api:${TAG}
restart: unless-stopped
diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js
index be9914ef6..d5807ba0b 100644
--- a/e2e/helpers/extensions.js
+++ b/e2e/helpers/extensions.js
@@ -3,6 +3,7 @@
import config from './config.js';
import Nightmare from 'nightmare';
import {URL} from 'url';
+let currentUser;
Nightmare.asyncAction = function(name, func) {
@@ -19,8 +20,7 @@ Nightmare.asyncAction('clearInput', async function(selector) {
for (let i = 0; i < 50; i += 1)
backSpaces.push('\u0008');
- await this.wait(selector)
- .type(selector, backSpaces.join(''));
+ await this.write(selector, backSpaces.join(''));
});
let actions = {
@@ -32,7 +32,18 @@ let actions = {
.click(`vn-login input[type=submit]`)
// FIXME: Wait for dom to be ready: https://github.com/segmentio/nightmare/issues/481
.wait(1000)
- .then(done)
+ .then(() => {
+ currentUser = userName;
+ done();
+ })
+ .catch(done);
+ },
+
+ resetLogin: function(done) {
+ this.then(() => {
+ currentUser = undefined;
+ done();
+ })
.catch(done);
},
@@ -55,7 +66,13 @@ let actions = {
},
waitForLogin: function(userName, done) {
- this.login(userName)
+ if (currentUser === userName) {
+ return this.waitToClick('vn-topbar a[ui-sref="home"]')
+ .waitForURL('#!/')
+ .then(done)
+ .catch(done);
+ }
+ return this.login(userName)
.waitForURL('#!/')
.url()
.changeLanguageToEnglish()
@@ -284,9 +301,9 @@ let actions = {
},
accessToSearchResult: function(searchValue, done) {
- this.wait(`vn-searchbar input`)
- .type(`vn-searchbar input`, searchValue)
+ this.write(`vn-searchbar input`, searchValue)
.click(`vn-searchbar vn-icon[icon="search"]`)
+ .waitForNumberOfElements('.searchResult', 1)
.evaluate(() => {
return document.querySelector('ui-view vn-card vn-table') != null;
})
@@ -320,7 +337,7 @@ let actions = {
autocompleteSearch: function(autocompleteSelector, searchValue, done) {
this.wait(autocompleteSelector)
.waitToClick(`${autocompleteSelector} input`)
- .type(`${autocompleteSelector} vn-drop-down input`, searchValue)
+ .write(`${autocompleteSelector} vn-drop-down input`, searchValue)
.waitToClick(`${autocompleteSelector} li.active`)
.wait((autocompleteSelector, searchValue) => {
return document.querySelector(`${autocompleteSelector} input`).value.toLowerCase().includes(searchValue.toLowerCase());
diff --git a/e2e/helpers/nightmare.js b/e2e/helpers/nightmare.js
index f88396fbf..b4d0cad41 100644
--- a/e2e/helpers/nightmare.js
+++ b/e2e/helpers/nightmare.js
@@ -1,8 +1,12 @@
/* eslint no-console: 0 */
import Nightmare from 'nightmare';
+let nightmare;
export default function createNightmare(width = 1280, height = 720) {
- const nightmare = new Nightmare({
+ if (nightmare)
+ return nightmare;
+
+ nightmare = new Nightmare({
show: process.env.E2E_SHOW,
typeInterval: 10,
x: 0,
@@ -12,18 +16,13 @@ export default function createNightmare(width = 1280, height = 720) {
nightmare.on('console', (type, message, ...args) => {
if (type === 'error')
- fail(message);
+ throw new Error(message);
else
console[type](message, ...args);
});
nightmare.header('Accept-Language', 'en');
- afterAll(() => {
- return nightmare
- .end();
- });
-
return nightmare;
}
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 932ecc845..a7487acc0 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -115,7 +115,8 @@ export default {
secondObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(2) [model="observation.description"] input`,
addObservationButton: `vn-client-address-edit vn-icon-button[icon="add_circle"]`,
saveButton: `${components.vnSubmit}`,
- cancelButton: `button[ui-sref="client.card.address.index"]`
+ cancelCreateAddressButton: `button[ui-sref="client.card.address.index"]`,
+ cancelEditAddressButton: 'vn-client-address-edit > form > vn-button-bar > vn-button > button'
},
clientWebAccess: {
webAccessButton: `vn-left-menu a[ui-sref="client.card.webAccess"]`,
@@ -192,7 +193,7 @@ export default {
moreMenu: `vn-item-descriptor vn-icon-menu > div > vn-icon`,
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`,
- regularizeWarehouseAutocomplete: `#warehouse`,
+ regularizeWarehouseAutocomplete: 'vn-item-descriptor > vn-dialog vn-autocomplete[field="$ctrl.warehouseFk"]',
regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button`
},
itemBasicData: {
@@ -385,8 +386,9 @@ export default {
ticketTracking: {
trackingButton: `vn-left-menu a[ui-sref="ticket.card.tracking.index"]`,
createStateButton: `${components.vnFloatButton}`,
- stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[field="$ctrl.ticket.stateFk"]',
- saveButton: `${components.vnSubmit}`
+ stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[field="$ctrl.stateFk"]',
+ saveButton: `${components.vnSubmit}`,
+ cancelButton: `vn-ticket-tracking-edit vn-button[ui-sref="ticket.card.tracking.index"]`
},
ticketBasicData: {
basicDataButton: `vn-left-menu a[ui-sref="ticket.card.data.stepOne"]`,
@@ -437,8 +439,9 @@ export default {
saveServiceButton: `${components.vnSubmit}`
},
createStateView: {
- stateAutocomplete: `vn-autocomplete[field="$ctrl.ticket.stateFk"]`,
- clearStateInputButton: `vn-autocomplete[field="$ctrl.ticket.stateFk"] > div > div > div > vn-icon > i`,
+ stateAutocomplete: `vn-autocomplete[field="$ctrl.stateFk"]`,
+ workerAutocomplete: `vn-autocomplete[field="$ctrl.workerFk"]`,
+ clearStateInputButton: `vn-autocomplete[field="$ctrl.stateFk"] > div > div > div > vn-icon > i`,
saveStateButton: `${components.vnSubmit}`
},
claimsIndex: {
@@ -449,14 +452,19 @@ export default {
claimBasicData: {
basicDataButton: `vn-left-menu a[ui-sref="claim.card.basicData"]`,
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]',
- isPaidWithManaCheckbox: `vn-check[field="$ctrl.claim.isChargedToMana"] > label > input`,
+ isPaidWithManaCheckbox: 'vn-check[field="$ctrl.claim.isChargedToMana"] > label > input',
responsabilityInputRange: `vn-input-range`,
observationInput: `vn-textarea[label="Observation"] textarea`,
saveButton: `${components.vnSubmit}`
},
- claimDetails: {
- detailsButton: `vn-left-menu a[ui-sref="claim.card.detail"]`,
- addItemButton: `vn-claim-detail a vn-float-button`
+ claimDetail: {
+ detailButton: `vn-left-menu a[ui-sref="claim.card.detail"]`,
+ addItemButton: `vn-claim-detail a vn-float-button`,
+ firstClaimableSaleFromTicket: 'vn-claim-detail > vn-dialog vn-tbody > vn-tr',
+ claimDetailLine: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr',
+ secondItemQuantityInput: 'vn-claim-detail vn-tr:nth-child(2) vn-textfield[model="saleClaimed.quantity"] input',
+ totalClaimed: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > div > vn-label-value:nth-child(2) > section > span',
+ secondItemDeleteButton: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(9) > vn-icon-button > button > vn-icon > i'
},
claimDevelopment: {
developmentButton: 'vn-left-menu a[ui-sref="claim.card.development"]',
diff --git a/e2e/paths/claim-module/01_edit_basic_data.spec.js b/e2e/paths/claim-module/01_edit_basic_data.spec.js
index 3c9355bb6..15c89c690 100644
--- a/e2e/paths/claim-module/01_edit_basic_data.spec.js
+++ b/e2e/paths/claim-module/01_edit_basic_data.spec.js
@@ -16,8 +16,8 @@ describe('Claim edit basic data path', () => {
.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado')
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput)
- .type(selectors.claimBasicData.observationInput, 'edited observation')
- .click(selectors.claimBasicData.saveButton)
+ .write(selectors.claimBasicData.observationInput, 'edited observation')
+ .waitToClick(selectors.claimBasicData.saveButton)
.waitForSnackbar();
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
@@ -25,9 +25,9 @@ describe('Claim edit basic data path', () => {
it('should confirm the claim state was edited', async() => {
const result = await nightmare
- .click(selectors.claimDetails.detailsButton)
- .wait(selectors.claimDetails.addItemButton)
- .click(selectors.claimBasicData.basicDataButton)
+ .waitToClick(selectors.claimDetail.detailButton)
+ .wait(selectors.claimDetail.addItemButton)
+ .waitToClick(selectors.claimBasicData.basicDataButton)
.wait(selectors.claimBasicData.claimStateAutocomplete)
.waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value');
@@ -55,8 +55,8 @@ describe('Claim edit basic data path', () => {
.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente')
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput)
- .type(selectors.claimBasicData.observationInput, 'Observation one')
- .click(selectors.claimBasicData.saveButton)
+ .write(selectors.claimBasicData.observationInput, 'Observation one')
+ .waitToClick(selectors.claimBasicData.saveButton)
.waitForSnackbar();
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
diff --git a/e2e/paths/claim-module/02_create_development.spec.js b/e2e/paths/claim-module/02_create_development.spec.js
index bce93b704..32b45337a 100644
--- a/e2e/paths/claim-module/02_create_development.spec.js
+++ b/e2e/paths/claim-module/02_create_development.spec.js
@@ -43,7 +43,7 @@ describe('Claim development', () => {
const reason = await nightmare
.waitToClick(selectors.claimBasicData.basicDataButton)
.wait(selectors.claimBasicData.claimStateAutocomplete)
- .click(selectors.claimDevelopment.developmentButton)
+ .waitToClick(selectors.claimDevelopment.developmentButton)
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimReasonAutocomplete} input`, 'value');
const result = await nightmare
diff --git a/e2e/paths/claim-module/03_detail.spec.js b/e2e/paths/claim-module/03_detail.spec.js
new file mode 100644
index 000000000..1a7112ff8
--- /dev/null
+++ b/e2e/paths/claim-module/03_detail.spec.js
@@ -0,0 +1,64 @@
+import selectors from '../../helpers/selectors.js';
+import createNightmare from '../../helpers/nightmare';
+
+describe('Claim detail', () => {
+ const nightmare = createNightmare();
+
+ beforeAll(() => {
+ nightmare
+ .loginAndModule('salesPerson', 'claim')
+ .accessToSearchResult('4')
+ .accessToSection('claim.card.detail');
+ });
+
+ it('should add the first claimable item from ticket to the claim', async() => {
+ const result = await nightmare
+ .waitToClick(selectors.claimDetail.addItemButton)
+ .waitToClick(selectors.claimDetail.firstClaimableSaleFromTicket)
+ .waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+
+ it('should confirm the claim contains now two items', async() => {
+ const result = await nightmare
+ .countElement(selectors.claimDetail.claimDetailLine);
+
+ expect(result).toEqual(2);
+ });
+
+ it('should edit de second item claimed quantity', async() => {
+ const result = await nightmare
+ .write(selectors.claimDetail.secondItemQuantityInput, 10)
+ .write('body', '\u000d') // simulates enter
+ .waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+
+ it('should confirm the second item, and the claimed total were correctly edited', async() => {
+ const claimedQuantity = await nightmare
+ .waitToGetProperty(selectors.claimDetail.secondItemQuantityInput, 'value');
+
+ const totalClaimed = await nightmare
+ .waitToGetProperty(selectors.claimDetail.totalClaimed, 'innerText');
+
+ expect(claimedQuantity).toEqual('10');
+ expect(totalClaimed).toEqual('29.50 €');
+ });
+
+ it('should delete the second item from the claim', async() => {
+ const result = await nightmare
+ .waitToClick(selectors.claimDetail.secondItemDeleteButton)
+ .waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
+
+ it('should confirm the claim contains now one item', async() => {
+ const result = await nightmare
+ .countElement(selectors.claimDetail.claimDetailLine);
+
+ expect(result).toEqual(1);
+ });
+});
diff --git a/e2e/paths/client-module/01_create_client.spec.js b/e2e/paths/client-module/01_create_client.spec.js
index 06c981c15..467603d70 100644
--- a/e2e/paths/client-module/01_create_client.spec.js
+++ b/e2e/paths/client-module/01_create_client.spec.js
@@ -11,9 +11,8 @@ describe('Client create path', () => {
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
const result = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 0)
.countElement(selectors.clientsIndex.searchResult);
@@ -22,7 +21,7 @@ describe('Client create path', () => {
it('should now access to the create client view by clicking the create-client floating button', async() => {
const url = await nightmare
- .click(selectors.clientsIndex.createClientButton)
+ .waitToClick(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton)
.parsedUrl();
@@ -31,7 +30,7 @@ describe('Client create path', () => {
it('should receive an error when clicking the create button having all the form fields empty', async() => {
const result = await nightmare
- .click(selectors.createClientView.createButton)
+ .waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -39,11 +38,11 @@ describe('Client create path', () => {
it('should receive an error when clicking the create button having name and Business name fields empty', async() => {
const result = await nightmare
- .type(selectors.createClientView.taxNumber, '74451390E')
- .type(selectors.createClientView.userName, 'CaptainMarvel')
- .type(selectors.createClientView.email, 'CarolDanvers@verdnatura.es')
+ .write(selectors.createClientView.taxNumber, '74451390E')
+ .write(selectors.createClientView.userName, 'CaptainMarvel')
+ .write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es')
.autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'Accessory')
- .click(selectors.createClientView.createButton)
+ .waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -51,11 +50,11 @@ describe('Client create path', () => {
it(`should attempt to create a new user with all it's data but wrong email`, async() => {
const result = await nightmare
- .type(selectors.createClientView.name, 'Carol Danvers')
- .type(selectors.createClientView.socialName, 'AVG tax')
+ .write(selectors.createClientView.name, 'Carol Danvers')
+ .write(selectors.createClientView.socialName, 'AVG tax')
.clearInput(selectors.createClientView.email)
- .type(selectors.createClientView.email, 'incorrect email format')
- .click(selectors.createClientView.createButton)
+ .write(selectors.createClientView.email, 'incorrect email format')
+ .waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -64,8 +63,8 @@ describe('Client create path', () => {
it(`should create a new user with all correct data`, async() => {
const result = await nightmare
.clearInput(selectors.createClientView.email)
- .type(selectors.createClientView.email, 'caroldanvers@verdnatura.es')
- .click(selectors.createClientView.createButton)
+ .write(selectors.createClientView.email, 'caroldanvers@verdnatura.es')
+ .waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -84,9 +83,8 @@ describe('Client create path', () => {
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
const result = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
diff --git a/e2e/paths/client-module/02_edit_basic_data.spec.js b/e2e/paths/client-module/02_edit_basic_data.spec.js
index 0f3111ab9..220c0d186 100644
--- a/e2e/paths/client-module/02_edit_basic_data.spec.js
+++ b/e2e/paths/client-module/02_edit_basic_data.spec.js
@@ -24,17 +24,17 @@ describe('Client Edit basicData path', () => {
it('should edit the client basic data but leave salesPerson untainted', async() => {
const result = await nightmare
.clearInput(selectors.clientBasicData.nameInput)
- .type(selectors.clientBasicData.nameInput, 'Ptonomy Wallace')
+ .write(selectors.clientBasicData.nameInput, 'Ptonomy Wallace')
.clearInput(selectors.clientBasicData.contactInput)
- .type(selectors.clientBasicData.contactInput, 'David Haller')
+ .write(selectors.clientBasicData.contactInput, 'David Haller')
.clearInput(selectors.clientBasicData.phoneInput)
- .type(selectors.clientBasicData.phoneInput, '987654321')
+ .write(selectors.clientBasicData.phoneInput, '987654321')
.clearInput(selectors.clientBasicData.mobileInput)
- .type(selectors.clientBasicData.mobileInput, '123456789')
+ .write(selectors.clientBasicData.mobileInput, '123456789')
.clearInput(selectors.clientBasicData.emailInput)
- .type(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es')
+ .write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es')
.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets')
- .click(selectors.clientBasicData.saveButton)
+ .waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -42,9 +42,9 @@ describe('Client Edit basicData path', () => {
it('should confirm the name have been edited', async() => {
const result = await nightmare
- .click(selectors.clientFiscalData.fiscalDataButton)
+ .waitToClick(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.addressInput)
- .click(selectors.clientBasicData.basicDataButton)
+ .waitToClick(selectors.clientBasicData.basicDataButton)
.waitToGetProperty(selectors.clientBasicData.nameInput, 'value');
expect(result).toEqual('Ptonomy Wallace');
@@ -108,18 +108,18 @@ describe('Client Edit basicData path', () => {
it('should edit the client basic data including salesPerson', async() => {
const result = await nightmare
.clearInput(selectors.clientBasicData.nameInput)
- .type(selectors.clientBasicData.nameInput, 'Ororo Munroe')
+ .write(selectors.clientBasicData.nameInput, 'Ororo Munroe')
.clearInput(selectors.clientBasicData.contactInput)
- .type(selectors.clientBasicData.contactInput, 'Black Panther')
+ .write(selectors.clientBasicData.contactInput, 'Black Panther')
.clearInput(selectors.clientBasicData.phoneInput)
- .type(selectors.clientBasicData.phoneInput, '123456789')
+ .write(selectors.clientBasicData.phoneInput, '123456789')
.clearInput(selectors.clientBasicData.mobileInput)
- .type(selectors.clientBasicData.mobileInput, '987654321')
+ .write(selectors.clientBasicData.mobileInput, '987654321')
.clearInput(selectors.clientBasicData.emailInput)
- .type(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es')
+ .write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es')
.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory')
.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper')
- .click(selectors.clientBasicData.saveButton)
+ .waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -127,9 +127,9 @@ describe('Client Edit basicData path', () => {
it('should now confirm the name have been edited', async() => {
const result = await nightmare
- .click(selectors.clientFiscalData.fiscalDataButton)
+ .waitToClick(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.addressInput)
- .click(selectors.clientBasicData.basicDataButton)
+ .waitToClick(selectors.clientBasicData.basicDataButton)
.waitToGetProperty(selectors.clientBasicData.nameInput, 'value');
expect(result).toEqual('Ororo Munroe');
diff --git a/e2e/paths/client-module/03_edit_fiscal_data.spec.js b/e2e/paths/client-module/03_edit_fiscal_data.spec.js
index ada6adb78..2326a1108 100644
--- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js
+++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js
@@ -67,15 +67,15 @@ describe('Client Edit fiscalData path', () => {
const result = await nightmare
.wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
- .type(selectors.clientFiscalData.socialNameInput, 'SMASH!')
+ .write(selectors.clientFiscalData.socialNameInput, 'SMASH!')
.clearInput(selectors.clientFiscalData.fiscalIdInput)
- .type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
+ .write(selectors.clientFiscalData.fiscalIdInput, '94980061C')
.clearInput(selectors.clientFiscalData.addressInput)
- .type(selectors.clientFiscalData.addressInput, 'Somewhere edited')
+ .write(selectors.clientFiscalData.addressInput, 'Somewhere edited')
.clearInput(selectors.clientFiscalData.postcodeInput)
- .type(selectors.clientFiscalData.postcodeInput, '12345')
+ .write(selectors.clientFiscalData.postcodeInput, '12345')
.clearInput(selectors.clientFiscalData.cityInput)
- .type(selectors.clientFiscalData.cityInput, 'N/A')
+ .write(selectors.clientFiscalData.cityInput, 'N/A')
.autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'Francia')
.autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province two')
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
@@ -96,7 +96,7 @@ describe('Client Edit fiscalData path', () => {
const result = await nightmare
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
.clearInput(selectors.clientFiscalData.fiscalIdInput)
- .type(selectors.clientFiscalData.fiscalIdInput, 'A94980061C')
+ .write(selectors.clientFiscalData.fiscalIdInput, 'A94980061C')
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
@@ -106,7 +106,7 @@ describe('Client Edit fiscalData path', () => {
it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => {
const result = await nightmare
.clearInput(selectors.clientFiscalData.fiscalIdInput)
- .type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
+ .write(selectors.clientFiscalData.fiscalIdInput, '94980061C')
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
@@ -312,7 +312,7 @@ describe('Client Edit fiscalData path', () => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.firstEditButton)
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
- .click(selectors.clientAddresses.saveButton)
+ .waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
diff --git a/e2e/paths/client-module/04_edit_pay_method.spec.js b/e2e/paths/client-module/04_edit_pay_method.spec.js
index ee26b5cf3..5af4c894f 100644
--- a/e2e/paths/client-module/04_edit_pay_method.spec.js
+++ b/e2e/paths/client-module/04_edit_pay_method.spec.js
@@ -16,7 +16,7 @@ describe('Client Edit pay method path', () => {
.autocompleteSearch(selectors.clientPayMethod.payMethodAutocomplete, 'PayMethod with IBAN')
.autocompleteSearch(selectors.clientPayMethod.swiftBicAutocomplete, 'BBKKESMMMMM')
.clearInput(selectors.clientPayMethod.dueDayInput)
- .type(selectors.clientPayMethod.dueDayInput, '60')
+ .write(selectors.clientPayMethod.dueDayInput, '60')
.waitForTextInInput(selectors.clientPayMethod.dueDayInput, '60')
.waitToClick(selectors.clientPayMethod.receivedCoreLCRCheckbox)
.waitToClick(selectors.clientPayMethod.receivedCoreVNLCheckbox)
@@ -31,7 +31,7 @@ describe('Client Edit pay method path', () => {
const snackbarMessage = await nightmare
.waitToClick(selectors.clientPayMethod.clearswiftBicButton)
.clearInput(selectors.clientPayMethod.IBANInput)
- .type(selectors.clientPayMethod.IBANInput, 'FR9121000418450200051332')
+ .write(selectors.clientPayMethod.IBANInput, 'FR9121000418450200051332')
.waitForTextInInput(selectors.clientPayMethod.IBANInput, 'FR9121000418450200051332')
.wait(1000)
.waitToClick(selectors.clientPayMethod.saveButton)
@@ -42,10 +42,10 @@ describe('Client Edit pay method path', () => {
it(`should create a new BIC code`, async() => {
const newcode = await nightmare
- .click(selectors.clientPayMethod.newBankEntityButton)
- .type(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank')
- .type(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT')
- .click(selectors.clientPayMethod.acceptBankEntityButton)
+ .waitToClick(selectors.clientPayMethod.newBankEntityButton)
+ .write(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank')
+ .write(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT')
+ .waitToClick(selectors.clientPayMethod.acceptBankEntityButton)
.waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value');
expect(newcode).toEqual('GTHMCT Gotham City Bank');
@@ -62,7 +62,7 @@ describe('Client Edit pay method path', () => {
const AutomaticCode = await nightmare
.clearInput(selectors.clientPayMethod.IBANInput)
.waitToClick(selectors.clientPayMethod.clearswiftBicButton)
- .type(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332')
+ .write(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332')
.waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value');
expect(AutomaticCode).toEqual('CAIXESBB Caixa Bank');
diff --git a/e2e/paths/client-module/05_add_address.spec.js b/e2e/paths/client-module/05_add_address.spec.js
index f7f3e361e..e082b6d8c 100644
--- a/e2e/paths/client-module/05_add_address.spec.js
+++ b/e2e/paths/client-module/05_add_address.spec.js
@@ -20,33 +20,15 @@ describe('Client Add address path', () => {
expect(url.hash).toContain('address/create');
});
- it(`should return to the addreses section by clicking the cancel button`, async() => {
- const url = await nightmare
- .waitToClick(selectors.clientAddresses.cancelButton)
- .waitForURL('address/index')
- .parsedUrl();
-
- expect(url.hash).toContain('address/index');
- });
-
- it(`should now click on the add new address button to access to the new address form`, async() => {
- const url = await nightmare
- .waitToClick(selectors.clientAddresses.createAddress)
- .waitForURL('address/create')
- .parsedUrl();
-
- expect(url.hash).toContain('address/create');
- });
-
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.defaultCheckboxInput)
.clearInput(selectors.clientAddresses.streetAddressInput)
- .type(selectors.clientAddresses.postcodeInput, '10022')
+ .write(selectors.clientAddresses.postcodeInput, '10022')
.autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province four')
.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement')
- .type(selectors.clientAddresses.phoneInput, '999887744')
- .type(selectors.clientAddresses.mobileInput, '999887744')
+ .write(selectors.clientAddresses.phoneInput, '999887744')
+ .write(selectors.clientAddresses.mobileInput, '999887744')
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
@@ -55,10 +37,10 @@ describe('Client Add address path', () => {
it(`should create a new address with all it's data`, async() => {
const result = await nightmare
- .type(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
- .type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
- .type(selectors.clientAddresses.cityInput, 'New York')
- .click(selectors.clientAddresses.saveButton)
+ .write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
+ .write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
+ .write(selectors.clientAddresses.cityInput, 'New York')
+ .waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -99,4 +81,15 @@ describe('Client Add address path', () => {
expect(result).toEqual('The default consignee can not be unchecked');
});
+
+ // this "it" should be removed if the watcher doesn't prevent the navigation upon state changes
+ it(`should go back to the addreses section by clicking the cancel button`, async() => {
+ const url = await nightmare
+ .waitToClick(selectors.clientAddresses.cancelEditAddressButton)
+ .waitToClick('vn-confirm button[response="ACCEPT"]')
+ .waitForURL('address/index')
+ .parsedUrl();
+
+ expect(url.hash).toContain('address/index');
+ });
});
diff --git a/e2e/paths/client-module/06_add_address_notes.spec.js b/e2e/paths/client-module/06_add_address_notes.spec.js
index a27f62430..5434bfc08 100644
--- a/e2e/paths/client-module/06_add_address_notes.spec.js
+++ b/e2e/paths/client-module/06_add_address_notes.spec.js
@@ -24,8 +24,7 @@ describe('Client add address notes path', () => {
it('should not save a description without observation type', async() => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.addObservationButton)
- .wait(selectors.clientAddresses.firstObservationDescriptionInput)
- .type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description')
+ .write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description')
.waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
@@ -44,10 +43,10 @@ describe('Client add address notes path', () => {
it('should create two new observations', async() => {
const result = await nightmare
- .type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description')
+ .write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description')
.waitToClick(selectors.clientAddresses.addObservationButton)
.autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one')
- .type(selectors.clientAddresses.secondObservationDescriptionInput, 'second description')
+ .write(selectors.clientAddresses.secondObservationDescriptionInput, 'second description')
.waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
diff --git a/e2e/paths/client-module/07_edit_web_access.spec.js b/e2e/paths/client-module/07_edit_web_access.spec.js
index 71721d9ca..6f8ef2843 100644
--- a/e2e/paths/client-module/07_edit_web_access.spec.js
+++ b/e2e/paths/client-module/07_edit_web_access.spec.js
@@ -15,7 +15,7 @@ describe('Client Edit web access path', () => {
const result = await nightmare
.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox)
.clearInput(selectors.clientWebAccess.userNameInput)
- .type(selectors.clientWebAccess.userNameInput, 'Hulk')
+ .write(selectors.clientWebAccess.userNameInput, 'Hulk')
.waitToClick(selectors.clientWebAccess.saveButton)
.waitForLastSnackbar();
diff --git a/e2e/paths/client-module/08_add_notes.spec.js b/e2e/paths/client-module/08_add_notes.spec.js
index 5a488ff67..1528dd79b 100644
--- a/e2e/paths/client-module/08_add_notes.spec.js
+++ b/e2e/paths/client-module/08_add_notes.spec.js
@@ -22,8 +22,8 @@ describe('Client Add notes path', () => {
it(`should create a note`, async() => {
const result = await nightmare
- .type(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am')
- .click(selectors.clientNotes.saveButton)
+ .write(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am')
+ .waitToClick(selectors.clientNotes.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
diff --git a/e2e/paths/client-module/09_add_credit.spec.js b/e2e/paths/client-module/09_add_credit.spec.js
index 0cbd0c703..60ff2d347 100644
--- a/e2e/paths/client-module/09_add_credit.spec.js
+++ b/e2e/paths/client-module/09_add_credit.spec.js
@@ -23,8 +23,8 @@ describe('Client Add credit path', () => {
it(`should edit the credit`, async() => {
const result = await nightmare
.clearInput(selectors.clientCredit.creditInput)
- .type(selectors.clientCredit.creditInput, 999)
- .click(selectors.clientCredit.saveButton)
+ .write(selectors.clientCredit.creditInput, 999)
+ .waitToClick(selectors.clientCredit.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
diff --git a/e2e/paths/client-module/10_add_greuge.spec.js b/e2e/paths/client-module/10_add_greuge.spec.js
index c1ca1ba18..46fdf65e3 100644
--- a/e2e/paths/client-module/10_add_greuge.spec.js
+++ b/e2e/paths/client-module/10_add_greuge.spec.js
@@ -23,7 +23,7 @@ describe('Client Add greuge path', () => {
it(`should receive an error if all fields are empty but date and type on submit`, async() => {
const result = await nightmare
.autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff')
- .click(selectors.clientGreuge.saveButton)
+ .waitToClick(selectors.clientGreuge.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -31,10 +31,10 @@ describe('Client Add greuge path', () => {
it(`should create a new greuge with all its data`, async() => {
const result = await nightmare
- .type(selectors.clientGreuge.amountInput, 999)
+ .write(selectors.clientGreuge.amountInput, 999)
.waitForTextInInput(selectors.clientGreuge.amountInput, '999')
- .type(selectors.clientGreuge.descriptionInput, 'new armor for Batman!')
- .click(selectors.clientGreuge.saveButton)
+ .write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!')
+ .waitToClick(selectors.clientGreuge.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
diff --git a/e2e/paths/client-module/12_lock_of_verified_data.spec.js b/e2e/paths/client-module/12_lock_of_verified_data.spec.js
index 902632551..367753586 100644
--- a/e2e/paths/client-module/12_lock_of_verified_data.spec.js
+++ b/e2e/paths/client-module/12_lock_of_verified_data.spec.js
@@ -27,8 +27,8 @@ describe('Client lock verified data path', () => {
const result = await nightmare
.wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
- .type(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
- .click(selectors.clientFiscalData.saveButton)
+ .write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
+ .waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -65,9 +65,8 @@ describe('Client lock verified data path', () => {
it('should search again for the user Petter Parker', async() => {
const resultCount = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
@@ -130,8 +129,8 @@ describe('Client lock verified data path', () => {
const result = await nightmare
.wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
- .type(selectors.clientFiscalData.socialNameInput, 'administrative was here')
- .click(selectors.clientFiscalData.saveButton)
+ .write(selectors.clientFiscalData.socialNameInput, 'administrative was here')
+ .waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -168,9 +167,8 @@ describe('Client lock verified data path', () => {
it('should again search for the user Petter Parker', async() => {
const resultCount = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
@@ -209,10 +207,9 @@ describe('Client lock verified data path', () => {
it('should not be able to save change throwing a verified data error', async() => {
const result = await nightmare
- .wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
- .type(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
- .click(selectors.clientFiscalData.saveButton)
+ .write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
+ .waitToClick(selectors.clientFiscalData.saveButton)
.waitForSnackbar();
expect(result).toEqual(jasmine.arrayContaining([`You can't make changes on a client with verified data`]));
@@ -239,9 +236,8 @@ describe('Client lock verified data path', () => {
it('should now search again for the user Petter Parker', async() => {
const resultCount = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
@@ -280,10 +276,9 @@ describe('Client lock verified data path', () => {
it('should now edit the social name', async() => {
const result = await nightmare
- .wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
- .type(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here')
- .click(selectors.clientFiscalData.saveButton)
+ .write(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here')
+ .waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -320,9 +315,8 @@ describe('Client lock verified data path', () => {
it('should once again search for the user Petter Parker', async() => {
const resultCount = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
diff --git a/e2e/paths/client-module/13_log.spec.js b/e2e/paths/client-module/13_log.spec.js
index 046c281fc..2a82744ff 100644
--- a/e2e/paths/client-module/13_log.spec.js
+++ b/e2e/paths/client-module/13_log.spec.js
@@ -13,9 +13,8 @@ describe('Client log path', () => {
it('should update the clients name', async() => {
let result = await nightmare
- .wait(selectors.clientBasicData.nameInput)
.clearInput(selectors.clientBasicData.nameInput)
- .type(selectors.clientBasicData.nameInput, 'this is a test')
+ .write(selectors.clientBasicData.nameInput, 'this is a test')
.waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar();
diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js
index 49154daee..b0613e4fb 100644
--- a/e2e/paths/client-module/14_risk.spec.js
+++ b/e2e/paths/client-module/14_risk.spec.js
@@ -23,7 +23,7 @@ describe('Client risk path', () => {
it('should create a new payment that clears the debt', async() => {
let result = await nightmare
.clearInput(selectors.clientRisk.newPaymentBankInut)
- .type(selectors.clientRisk.newPaymentBankInut, '2')
+ .write(selectors.clientRisk.newPaymentBankInut, '2')
.waitToClick(selectors.clientRisk.saveButton)
.waitForLastSnackbar();
@@ -49,7 +49,7 @@ describe('Client risk path', () => {
it('should create a new payment that sets the balance to positive value', async() => {
let result = await nightmare
.clearInput(selectors.clientRisk.newPaymentAmountInput)
- .type(selectors.clientRisk.newPaymentAmountInput, '100')
+ .write(selectors.clientRisk.newPaymentAmountInput, '100')
.waitToClick(selectors.clientRisk.saveButton)
.waitForLastSnackbar();
@@ -75,7 +75,7 @@ describe('Client risk path', () => {
it('should create a new payment that sets the balance back to the original negative value', async() => {
let result = await nightmare
.clearInput(selectors.clientRisk.newPaymentAmountInput)
- .type(selectors.clientRisk.newPaymentAmountInput, '-150')
+ .write(selectors.clientRisk.newPaymentAmountInput, '-150')
.waitToClick(selectors.clientRisk.saveButton)
.waitForLastSnackbar();
@@ -103,9 +103,8 @@ describe('Client risk path', () => {
it('should now search for the user Petter Parker', async() => {
let resultCount = await nightmare
- .wait(selectors.clientsIndex.searchClientInput)
- .type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
- .click(selectors.clientsIndex.searchButton)
+ .write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
+ .waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
diff --git a/e2e/paths/item-module/01_item_summary.spec.js b/e2e/paths/item-module/01_item_summary.spec.js
index d454ddf81..ee6fd8785 100644
--- a/e2e/paths/item-module/01_item_summary.spec.js
+++ b/e2e/paths/item-module/01_item_summary.spec.js
@@ -11,9 +11,8 @@ describe('Item summary path', () => {
it('should search for an item', async() => {
const result = await nightmare
- .wait(selectors.itemsIndex.searchItemInput)
- .type(selectors.itemsIndex.searchItemInput, 'Object1 Gem1 5')
- .click(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Object1 Gem1 5')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@@ -84,9 +83,9 @@ describe('Item summary path', () => {
it('should search for other item', async() => {
const result = await nightmare
.clearInput('vn-item-index vn-searchbar input')
- .click(selectors.itemsIndex.searchButton)
- .type(selectors.itemsIndex.searchItemInput, 'Object2 Gem2 3')
- .click(selectors.itemsIndex.searchButton)
+ .waitToClick(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Object2 Gem2 3')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
diff --git a/e2e/paths/item-module/02_edit_item_basic_data.spec.js b/e2e/paths/item-module/02_edit_item_basic_data.spec.js
index 0d0a397d9..7cdd89993 100644
--- a/e2e/paths/item-module/02_edit_item_basic_data.spec.js
+++ b/e2e/paths/item-module/02_edit_item_basic_data.spec.js
@@ -13,17 +13,16 @@ describe('Item Edit basic data path', () => {
it(`should edit the item basic data`, async() => {
const result = await nightmare
- .wait(selectors.itemBasicData.nameInput)
.clearInput(selectors.itemBasicData.nameInput)
- .type(selectors.itemBasicData.nameInput, 'Rose of Purity')
+ .write(selectors.itemBasicData.nameInput, 'Rose of Purity')
.autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Crisantemo')
.autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares')
.clearInput(selectors.itemBasicData.relevancyInput)
- .type(selectors.itemBasicData.relevancyInput, '1')
+ .write(selectors.itemBasicData.relevancyInput, '1')
.autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain')
.autocompleteSearch(selectors.itemBasicData.expenceAutocomplete, 'Alquiler VNH')
.clearInput(selectors.itemBasicData.longNameInput)
- .type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
+ .write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
.waitToClick(selectors.itemBasicData.isActiveCheckbox)
.waitToClick(selectors.itemBasicData.submitBasicDataButton)
.waitForLastSnackbar();
@@ -33,7 +32,7 @@ describe('Item Edit basic data path', () => {
it(`should confirm the item name was edited`, async() => {
const result = await nightmare
- .click(selectors.itemNiches.nicheButton)
+ .waitToClick(selectors.itemNiches.nicheButton)
.wait(selectors.itemNiches.firstWarehouseDisabled)
.waitToClick(selectors.itemBasicData.basicDataButton)
.waitToGetProperty(selectors.itemBasicData.nameInput, 'value');
diff --git a/e2e/paths/item-module/03_edit_item_tax.spec.js b/e2e/paths/item-module/03_edit_item_tax.spec.js
index 66260a69b..f5f533db9 100644
--- a/e2e/paths/item-module/03_edit_item_tax.spec.js
+++ b/e2e/paths/item-module/03_edit_item_tax.spec.js
@@ -16,7 +16,7 @@ describe('Item edit tax path', () => {
.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT')
.autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT')
.autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'Reduced VAT')
- .click(selectors.itemTax.submitTaxButton)
+ .waitToClick(selectors.itemTax.submitTaxButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -24,9 +24,9 @@ describe('Item edit tax path', () => {
it(`should confirm the first item tax class was edited`, async() => {
const firstVatType = await nightmare
- .click(selectors.itemTags.tagsButton)
+ .waitToClick(selectors.itemTags.tagsButton)
.wait(selectors.itemTags.firstTagDisabled)
- .click(selectors.itemTax.taxButton)
+ .waitToClick(selectors.itemTax.taxButton)
.waitToClick(selectors.itemTax.taxButton)
.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
diff --git a/e2e/paths/item-module/04_create_item_tags.spec.js b/e2e/paths/item-module/04_create_item_tags.spec.js
index 2362a36c3..7b7e1b3a4 100644
--- a/e2e/paths/item-module/04_create_item_tags.spec.js
+++ b/e2e/paths/item-module/04_create_item_tags.spec.js
@@ -16,10 +16,10 @@ describe('Item create tags path', () => {
.waitToClick(selectors.itemTags.fourthRemoveTagButton)
.waitToClick(selectors.itemTags.addItemTagButton)
.autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base')
- .type(selectors.itemTags.seventhValueInput, '50')
+ .write(selectors.itemTags.seventhValueInput, '50')
.clearInput(selectors.itemTags.seventhRelevancyInput)
- .type(selectors.itemTags.seventhRelevancyInput, '4')
- .click(selectors.itemTags.submitItemTagsButton)
+ .write(selectors.itemTags.seventhRelevancyInput, '4')
+ .waitToClick(selectors.itemTags.submitItemTagsButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -27,9 +27,9 @@ describe('Item create tags path', () => {
it(`should confirm the fourth row data is the expected one`, async() => {
let result = await nightmare
- .click(selectors.itemBasicData.basicDataButton)
+ .waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
- .click(selectors.itemTags.tagsButton)
+ .waitToClick(selectors.itemTags.tagsButton)
.wait('vn-item-tags')
.waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value');
diff --git a/e2e/paths/item-module/05_create_item_niche.spec.js b/e2e/paths/item-module/05_create_item_niche.spec.js
index db63c1d3f..f43500634 100644
--- a/e2e/paths/item-module/05_create_item_niche.spec.js
+++ b/e2e/paths/item-module/05_create_item_niche.spec.js
@@ -16,8 +16,8 @@ describe('Item create niche path', () => {
.waitToClick(selectors.itemNiches.addNicheButton)
.waitToClick(selectors.itemNiches.secondNicheRemoveButton)
.autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two')
- .type(selectors.itemNiches.thirdCodeInput, 'A4')
- .click(selectors.itemNiches.submitNichesButton)
+ .write(selectors.itemNiches.thirdCodeInput, 'A4')
+ .waitToClick(selectors.itemNiches.submitNichesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -25,9 +25,9 @@ describe('Item create niche path', () => {
it(`should confirm the first niche is the expected one`, async() => {
let result = await nightmare
- .click(selectors.itemBasicData.basicDataButton)
+ .waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
- .click(selectors.itemNiches.nicheButton)
+ .waitToClick(selectors.itemNiches.nicheButton)
.waitForTextInInput(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'Warehouse One')
.waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'value');
diff --git a/e2e/paths/item-module/06_create_item_botanical.spec.js b/e2e/paths/item-module/06_create_item_botanical.spec.js
index 1e7103e60..98bd38f4a 100644
--- a/e2e/paths/item-module/06_create_item_botanical.spec.js
+++ b/e2e/paths/item-module/06_create_item_botanical.spec.js
@@ -13,8 +13,7 @@ describe('Item Create botanical path', () => {
it(`should create a new botanical for the item`, async() => {
const result = await nightmare
- .wait(selectors.itemBotanical.botanicalInput)
- .type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
+ .write(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia')
.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata')
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
@@ -25,9 +24,9 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was created`, async() => {
const result = await nightmare
- .click(selectors.itemBasicData.basicDataButton)
+ .waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
- .click(selectors.itemBotanical.botanicalButton)
+ .waitToClick(selectors.itemBotanical.botanicalButton)
.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
.waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value');
@@ -52,7 +51,7 @@ describe('Item Create botanical path', () => {
it(`should edit botanical for the item`, async() => {
const result = await nightmare
.clearInput(selectors.itemBotanical.botanicalInput)
- .type(selectors.itemBotanical.botanicalInput, 'Herp Derp')
+ .write(selectors.itemBotanical.botanicalInput, 'Herp Derp')
.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies')
.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens')
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
@@ -63,9 +62,9 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was edited`, async() => {
const result = await nightmare
- .click(selectors.itemBasicData.basicDataButton)
+ .waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
- .click(selectors.itemBotanical.botanicalButton)
+ .waitToClick(selectors.itemBotanical.botanicalButton)
.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp')
.waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value');
diff --git a/e2e/paths/item-module/07_create_item_barcode.spec.js b/e2e/paths/item-module/07_create_item_barcode.spec.js
index b396bd05d..5bcfde7d1 100644
--- a/e2e/paths/item-module/07_create_item_barcode.spec.js
+++ b/e2e/paths/item-module/07_create_item_barcode.spec.js
@@ -15,8 +15,7 @@ describe('Item Create barcodes path', () => {
const result = await nightmare
.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton)
.waitToClick(selectors.itemBarcodes.addBarcodeButton)
- .wait(selectors.itemBarcodes.thirdCodeInput)
- .type(selectors.itemBarcodes.thirdCodeInput, '5')
+ .write(selectors.itemBarcodes.thirdCodeInput, '5')
.waitToClick(selectors.itemBarcodes.submitBarcodesButton)
.waitForLastSnackbar();
@@ -25,9 +24,8 @@ describe('Item Create barcodes path', () => {
it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => {
const result = await nightmare
- .click(selectors.itemBasicData.basicDataButton)
- .wait(selectors.itemBasicData.nameInput)
- .click(selectors.itemBarcodes.barcodeButton)
+ .waitToClick(selectors.itemBasicData.basicDataButton)
+ .waitToClick(selectors.itemBarcodes.barcodeButton)
.waitForTextInInput(selectors.itemBarcodes.thirdCodeInput, '5')
.waitToGetProperty(selectors.itemBarcodes.thirdCodeInput, 'value');
diff --git a/e2e/paths/item-module/08_item_create_and_clone.spec.js b/e2e/paths/item-module/08_item_create_and_clone.spec.js
index 679e32ff7..b5e33cc4a 100644
--- a/e2e/paths/item-module/08_item_create_and_clone.spec.js
+++ b/e2e/paths/item-module/08_item_create_and_clone.spec.js
@@ -11,9 +11,8 @@ describe('Item Create/Clone path', () => {
it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => {
const result = await nightmare
- .wait(selectors.itemsIndex.searchItemInput)
- .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
- .click(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0)
.countElement(selectors.itemsIndex.searchResult);
@@ -22,7 +21,7 @@ describe('Item Create/Clone path', () => {
it('should access to the create item view by clicking the create floating button', async() => {
const url = await nightmare
- .click(selectors.itemsIndex.createItemButton)
+ .waitToClick(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton)
.parsedUrl();
@@ -31,7 +30,7 @@ describe('Item Create/Clone path', () => {
it('should return to the item index by clickig the cancel button', async() => {
const url = await nightmare
- .click(selectors.itemCreateView.cancelButton)
+ .waitToClick(selectors.itemCreateView.cancelButton)
.wait(selectors.itemsIndex.createItemButton)
.parsedUrl();
@@ -40,7 +39,7 @@ describe('Item Create/Clone path', () => {
it('should now access to the create item view by clicking the create floating button', async() => {
const url = await nightmare
- .click(selectors.itemsIndex.createItemButton)
+ .waitToClick(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton)
.parsedUrl();
@@ -49,11 +48,11 @@ describe('Item Create/Clone path', () => {
it('should create the Infinity Gauntlet item', async() => {
const result = await nightmare
- .type(selectors.itemCreateView.temporalName, 'Infinity Gauntlet')
+ .write(selectors.itemCreateView.temporalName, 'Infinity Gauntlet')
.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo')
.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares')
.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand')
- .click(selectors.itemCreateView.createButton)
+ .waitToClick(selectors.itemCreateView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -86,7 +85,7 @@ describe('Item Create/Clone path', () => {
describe('clone', () => {
it('should return to the items index by clicking the return to items button', async() => {
const url = await nightmare
- .click(selectors.itemBasicData.goToItemIndexButton)
+ .waitToClick(selectors.itemBasicData.goToItemIndexButton)
.wait(selectors.itemsIndex.createItemButton)
.waitForURL('#!/item/index')
.parsedUrl();
@@ -96,9 +95,8 @@ describe('Item Create/Clone path', () => {
it(`should search for the item Infinity Gauntlet`, async() => {
const result = await nightmare
- .wait(selectors.itemsIndex.searchItemInput)
- .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
- .click(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@@ -108,7 +106,7 @@ describe('Item Create/Clone path', () => {
it(`should clone the Infinity Gauntlet`, async() => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet')
- .click(selectors.itemsIndex.searchResultCloneButton)
+ .waitToClick(selectors.itemsIndex.searchResultCloneButton)
.waitToClick(selectors.itemsIndex.acceptClonationAlertButton)
.waitForURL('tags')
.parsedUrl();
@@ -119,9 +117,8 @@ describe('Item Create/Clone path', () => {
it('should search for the item Infinity Gauntlet and find two', async() => {
const result = await nightmare
.waitToClick(selectors.itemTags.goToItemIndexButton)
- .wait(selectors.itemsIndex.searchItemInput)
- .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
- .click(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2)
.countElement(selectors.itemsIndex.searchResult);
diff --git a/e2e/paths/item-module/09_regularize_item.spec.js b/e2e/paths/item-module/09_regularize_item.spec.js
index 07ceb4e62..302a66c42 100644
--- a/e2e/paths/item-module/09_regularize_item.spec.js
+++ b/e2e/paths/item-module/09_regularize_item.spec.js
@@ -10,9 +10,8 @@ describe('Item regularize path', () => {
it('should search for the item', async() => {
const resultCount = await nightmare
- .wait(selectors.itemsIndex.searchItemInput)
- .type(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50')
- .click(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@@ -33,8 +32,7 @@ describe('Item regularize path', () => {
const result = await nightmare
.waitToClick(selectors.itemDescriptor.moreMenu)
.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton)
- .wait(selectors.itemDescriptor.regularizeQuantityInput)
- .type(selectors.itemDescriptor.regularizeQuantityInput, 100)
+ .write(selectors.itemDescriptor.regularizeQuantityInput, 100)
.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One')
.waitToClick(selectors.itemDescriptor.regularizeSaveButton)
.waitForLastSnackbar();
@@ -55,9 +53,8 @@ describe('Item regularize path', () => {
it('should search for the ticket with alias missing', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'missing')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'missing')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -102,9 +99,8 @@ describe('Item regularize path', () => {
it('should search for the item once again', async() => {
const resultCount = await nightmare
- .wait(selectors.itemsIndex.searchItemInput)
- .type(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50')
- .click(selectors.itemsIndex.searchButton)
+ .write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50')
+ .waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@@ -125,8 +121,7 @@ describe('Item regularize path', () => {
const result = await nightmare
.waitToClick(selectors.itemDescriptor.moreMenu)
.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton)
- .wait(selectors.itemDescriptor.regularizeQuantityInput)
- .type(selectors.itemDescriptor.regularizeQuantityInput, 100)
+ .write(selectors.itemDescriptor.regularizeQuantityInput, 100)
.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One')
.waitToClick(selectors.itemDescriptor.regularizeSaveButton)
.waitForLastSnackbar();
@@ -147,9 +142,8 @@ describe('Item regularize path', () => {
it('should search for the ticket with id 23 once again', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:23')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:23')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
diff --git a/e2e/paths/order-module/01_edit_basic_data.spec.js b/e2e/paths/order-module/01_edit_basic_data.spec.js
index 1b4e270c7..3a5ccdd2f 100644
--- a/e2e/paths/order-module/01_edit_basic_data.spec.js
+++ b/e2e/paths/order-module/01_edit_basic_data.spec.js
@@ -14,7 +14,7 @@ describe('Order edit basic data path', () => {
it('should not be able to change the client', async() => {
const result = await nightmare
.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark')
- .click(selectors.orderBasicData.saveButton)
+ .waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
@@ -38,7 +38,7 @@ describe('Order edit basic data path', () => {
it('should not be able to change the company', async() => {
const result = await nightmare
.autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs')
- .click(selectors.orderBasicData.saveButton)
+ .waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
@@ -46,11 +46,17 @@ describe('Order edit basic data path', () => {
});
describe('when new order', () => {
- beforeAll(() => {
- nightmare
- .loginAndModule('employee', 'order')
+ it('should once more navigate to order index', async() => {
+ const url = await nightmare
+ .waitToClick(selectors.globalItems.returnToModuleIndexButton)
+ .waitToClick(selectors.globalItems.acceptVnConfirm)
+ .wait(selectors.ordersIndex.createOrderButton)
.accessToSearchResult('18')
- .accessToSection('order.card.basicData');
+ .accessToSection('order.card.basicData')
+ .wait(selectors.orderBasicData.companyAutocomplete)
+ .parsedUrl();
+
+ expect(url.hash).toEqual('#!/order/18/basic-data');
});
it('should be able to modify all the properties', async() => {
@@ -58,8 +64,8 @@ describe('Order edit basic data path', () => {
.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark')
.autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs')
.clearInput(selectors.orderBasicData.observationInput)
- .type(selectors.orderBasicData.observationInput, 'Observation modified')
- .click(selectors.orderBasicData.saveButton)
+ .write(selectors.orderBasicData.observationInput, 'Observation modified')
+ .waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -67,9 +73,9 @@ describe('Order edit basic data path', () => {
it('should now confirm the client have been edited', async() => {
const result = await nightmare
- .click(selectors.orderCatalog.catalogButton)
+ .waitToClick(selectors.orderCatalog.catalogButton)
.wait(selectors.orderCatalog.orderByAutocomplete)
- .click(selectors.orderBasicData.basicDataButton)
+ .waitToClick(selectors.orderBasicData.basicDataButton)
.waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value');
expect(result).toEqual('104: Tony Stark');
diff --git a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js
index 0beded970..bcfd04380 100644
--- a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js
+++ b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js
@@ -16,8 +16,8 @@ describe('Ticket Create notes path', () => {
.waitToClick(selectors.ticketNotes.firstNoteRemoveButton)
.waitToClick(selectors.ticketNotes.addNoteButton)
.autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one')
- .type(selectors.ticketNotes.firstDescriptionInput, 'description')
- .click(selectors.ticketNotes.submitNotesButton)
+ .write(selectors.ticketNotes.firstDescriptionInput, 'description')
+ .waitToClick(selectors.ticketNotes.submitNotesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -25,9 +25,9 @@ describe('Ticket Create notes path', () => {
it(`should confirm the note is the expected one`, async() => {
let result = await nightmare
- .click(selectors.ticketPackages.packagesButton)
+ .waitToClick(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageAutocomplete)
- .click(selectors.ticketNotes.notesButton)
+ .waitToClick(selectors.ticketNotes.notesButton)
.waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value');
expect(result).toEqual('observation one');
diff --git a/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js b/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js
index 8cf348320..b6c3a44c3 100644
--- a/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js
+++ b/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js
@@ -16,9 +16,9 @@ xdescribe('Ticket expeditions and log path', () => {
const result = await nightmare
.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
.waitToClick(selectors.ticketExpedition.acceptDeleteRowButton)
- .click(selectors.ticketPackages.packagesButton)
+ .waitToClick(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageAutocomplete)
- .click(selectors.ticketExpedition.expeditionButton)
+ .waitToClick(selectors.ticketExpedition.expeditionButton)
.wait(selectors.ticketExpedition.expeditionRow)
.countElement(selectors.ticketExpedition.expeditionRow);
diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
index 39536da61..ce74601ad 100644
--- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
+++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
@@ -16,7 +16,7 @@ describe('Ticket Create packages path', () => {
.waitToClick(selectors.ticketPackages.firstRemovePackageButton)
.waitToClick(selectors.ticketPackages.addPackageButton)
.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box')
- .click(selectors.ticketPackages.savePackagesButton)
+ .waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -24,8 +24,8 @@ describe('Ticket Create packages path', () => {
it(`should attempt create a new package but receive an error if quantity is a string`, async() => {
const result = await nightmare
- .type(selectors.ticketPackages.firstQuantityInput, 'ninety 9')
- .click(selectors.ticketPackages.savePackagesButton)
+ .write(selectors.ticketPackages.firstQuantityInput, 'ninety 9')
+ .waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -34,8 +34,8 @@ describe('Ticket Create packages path', () => {
it(`should attempt create a new package but receive an error if quantity is 0`, async() => {
const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
- .type(selectors.ticketPackages.firstQuantityInput, 0)
- .click(selectors.ticketPackages.savePackagesButton)
+ .write(selectors.ticketPackages.firstQuantityInput, 0)
+ .waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@@ -44,9 +44,9 @@ describe('Ticket Create packages path', () => {
it(`should attempt create a new package but receive an error if package is blank`, async() => {
const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
- .type(selectors.ticketPackages.firstQuantityInput, 99)
- .click(selectors.ticketPackages.clearPackageAutocompleteButton)
- .click(selectors.ticketPackages.savePackagesButton)
+ .write(selectors.ticketPackages.firstQuantityInput, 99)
+ .waitToClick(selectors.ticketPackages.clearPackageAutocompleteButton)
+ .waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Package cannot be blank');
@@ -55,7 +55,7 @@ describe('Ticket Create packages path', () => {
it(`should create a new package with correct data`, async() => {
const result = await nightmare
.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box')
- .click(selectors.ticketPackages.savePackagesButton)
+ .waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
diff --git a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js
index 44f3dae51..061d67c1c 100644
--- a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js
+++ b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js
@@ -4,55 +4,94 @@ import createNightmare from '../../helpers/nightmare';
describe('Ticket Create new tracking state path', () => {
const nightmare = createNightmare();
- beforeAll(() => {
- return nightmare
- .loginAndModule('production', 'ticket')
- .accessToSearchResult('id:1')
- .accessToSection('ticket.card.tracking.index');
+ describe('as production', () => {
+ beforeAll(() => {
+ return nightmare
+ .loginAndModule('production', 'ticket')
+ .accessToSearchResult('id:1')
+ .accessToSection('ticket.card.tracking.index');
+ });
+
+ it('should access to the create state view by clicking the create floating button', async() => {
+ let url = await nightmare
+ .waitToClick(selectors.ticketTracking.createStateButton)
+ .wait(selectors.createStateView.stateAutocomplete)
+ .parsedUrl();
+
+ expect(url.hash).toContain('tracking/edit');
+ });
+
+ it(`should attempt create a new state but receive an error if state is empty`, async() => {
+ let result = await nightmare
+ .waitToClick(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
+
+ expect(result).toEqual('State cannot be blank');
+ });
+
+ it(`should attempt create a new state then clear and save it`, async() => {
+ let result = await nightmare
+ .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
+ .waitToClick(selectors.createStateView.clearStateInputButton)
+ .waitToClick(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
+
+ expect(result).toEqual('State cannot be blank');
+ });
+
+
+ it(`should create a new state`, async() => {
+ let result = await nightmare
+ .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
+ .waitToClick(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
+
+ expect(result).toEqual('Data saved!');
+ });
});
- it('should access to the create state view by clicking the create floating button', async() => {
- let url = await nightmare
- .waitToClick(selectors.ticketTracking.createStateButton)
- .wait(selectors.createStateView.stateAutocomplete)
- .parsedUrl();
+ describe('as salesPerson', () => {
+ beforeAll(() => {
+ return nightmare
+ .loginAndModule('salesPerson', 'ticket')
+ .accessToSearchResult('id:1')
+ .accessToSection('ticket.card.tracking.index');
+ });
- expect(url.hash).toContain('tracking/edit');
- });
+ it('should now access to the create state view by clicking the create floating button', async() => {
+ let url = await nightmare
+ .waitToClick(selectors.ticketTracking.createStateButton)
+ .wait(selectors.createStateView.stateAutocomplete)
+ .parsedUrl();
- it(`should attempt create a new state but receive an error if state is empty`, async() => {
- let result = await nightmare
- .click(selectors.createStateView.saveStateButton)
- .waitForLastSnackbar();
+ expect(url.hash).toContain('tracking/edit');
+ });
- expect(result).toEqual('No changes to save');
- });
+ it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
+ let result = await nightmare
+ .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
+ .waitToClick(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
- it(`should attempt create a new state then clear and save it`, async() => {
- let result = await nightmare
- .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
- .waitToClick(selectors.createStateView.clearStateInputButton)
- .click(selectors.createStateView.saveStateButton)
- .waitForLastSnackbar();
+ expect(result).toEqual(`You don't have enough privileges to change the state of this ticket`);
+ });
- expect(result).toEqual('Data saved!');
- });
+ it(`should attempt to create an state for the type salesPerson has rights but fail as worker is blank`, async() => {
+ let result = await nightmare
+ .autocompleteSearch(selectors.createStateView.stateAutocomplete, 'asignado')
+ .waitToClick(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
- it('should again access to the create state view by clicking the create floating button', async() => {
- let url = await nightmare
- .click(selectors.ticketTracking.createStateButton)
- .wait(selectors.createStateView.stateAutocomplete)
- .parsedUrl();
+ expect(result).toEqual(`Worker cannot be blank`);
+ });
- expect(url.hash).toContain('tracking/edit');
- });
+ it(`should create a new state with all it's data`, async() => {
+ let result = await nightmare
+ .autocompleteSearch(selectors.createStateView.workerAutocomplete, 'accessory')
+ .waitToClick(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
- it(`should create a new state`, async() => {
- let result = await nightmare
- .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
- .click(selectors.createStateView.saveStateButton)
- .waitForLastSnackbar();
-
- expect(result).toEqual('Data saved!');
+ expect(result).toEqual('Data saved!');
+ });
});
});
diff --git a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js
index 5d2e84e14..0bf4b01ea 100644
--- a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js
+++ b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js
@@ -16,7 +16,7 @@ describe('Ticket Edit basic data path', () => {
.autocompleteSearch(selectors.ticketBasicData.clientAutocomplete, 'Charles Xavier')
.wait(500)
.autocompleteSearch(selectors.ticketBasicData.addressAutocomplete, 'Charles Xavier')
- .click(selectors.ticketBasicData.nextStepButton)
+ .waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-two')
.parsedUrl();
@@ -32,7 +32,7 @@ describe('Ticket Edit basic data path', () => {
it(`should click next to move on to step three`, async() => {
let url = await nightmare
- .click(selectors.ticketBasicData.nextStepButton)
+ .waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-three')
.parsedUrl();
@@ -61,7 +61,7 @@ describe('Ticket Edit basic data path', () => {
it(`should edit the ticket agency then click next`, async() => {
let url = await nightmare
.autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Silla247Expensive')
- .click(selectors.ticketBasicData.nextStepButton)
+ .waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-two')
.parsedUrl();
@@ -77,7 +77,7 @@ describe('Ticket Edit basic data path', () => {
it(`should then click next to move on to step three`, async() => {
let url = await nightmare
- .click(selectors.ticketBasicData.nextStepButton)
+ .waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-three')
.parsedUrl();
@@ -87,7 +87,7 @@ describe('Ticket Edit basic data path', () => {
it(`should select a new reason for the changes made then click on finalize`, async() => {
let url = await nightmare
.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket')
- .click(selectors.ticketBasicData.finalizeButton)
+ .waitToClick(selectors.ticketBasicData.finalizeButton)
.waitForURL('summary')
.parsedUrl();
diff --git a/e2e/paths/ticket-module/07_edit_sale.spec.js b/e2e/paths/ticket-module/07_edit_sale.spec.js
index 239c0e83e..9f6c8a748 100644
--- a/e2e/paths/ticket-module/07_edit_sale.spec.js
+++ b/e2e/paths/ticket-module/07_edit_sale.spec.js
@@ -11,7 +11,7 @@ describe('Ticket Edit sale path', () => {
.accessToSection('ticket.card.sale');
});
- it(`should click on the first claim id to navigate over there`, async() => {
+ it(`should click on the second claim id to navigate over there`, async() => {
const url = await nightmare
.waitToClick(selectors.ticketSales.secondSaleClaimId)
.wait(selectors.claimBasicData.claimStateAutocomplete)
@@ -34,9 +34,8 @@ describe('Ticket Edit sale path', () => {
it('should again search for a specific ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:16')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -123,9 +122,8 @@ describe('Ticket Edit sale path', () => {
.waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible)
.waitToClick(selectors.globalItems.ticketsButton)
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:16')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
@@ -139,7 +137,7 @@ describe('Ticket Edit sale path', () => {
it('should try to add a higher quantity value and then receive an error', async() => {
const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleQuantityClearInput)
- .type(selectors.ticketSales.firstSaleQuantity, '9\u000d')
+ .write(selectors.ticketSales.firstSaleQuantity, '9\u000d')
.waitForLastSnackbar();
expect(result).toEqual('The new quantity should be smaller than the old one');
@@ -148,7 +146,7 @@ describe('Ticket Edit sale path', () => {
it('should remove 1 from quantity', async() => {
const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleQuantityClearInput)
- .type(selectors.ticketSales.firstSaleQuantity, '4\u000d')
+ .write(selectors.ticketSales.firstSaleQuantity, '4\u000d')
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -157,9 +155,8 @@ describe('Ticket Edit sale path', () => {
it('should update the price', async() => {
const result = await nightmare
.waitToClick(selectors.ticketSales.firstSalePrice)
- .wait(selectors.ticketSales.firstSalePriceInput)
- .type(selectors.ticketSales.firstSalePriceInput, 5)
- .type('body', '\u000d') // simulates enter
+ .write(selectors.ticketSales.firstSalePriceInput, 5)
+ .write('body', '\u000d') // simulates enter
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -183,8 +180,8 @@ describe('Ticket Edit sale path', () => {
const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleDiscount)
.wait('vn-textfield[label="Discount"] > div[class="container selected"]') // a function selects the text after it's loaded
- .type(selectors.ticketSales.firstSaleDiscountInput, 50)
- .type('body', '\u000d') // simulates enter
+ .write(selectors.ticketSales.firstSaleDiscountInput, 50)
+ .write('body', '\u000d') // simulates enter
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@@ -230,9 +227,8 @@ describe('Ticket Edit sale path', () => {
it('should search for the claim with id 4', async() => {
const result = await nightmare
- .wait(selectors.claimsIndex.searchResult)
- .type(selectors.claimsIndex.searchClaimInput, 4)
- .click(selectors.claimsIndex.searchButton)
+ .write(selectors.claimsIndex.searchClaimInput, 4)
+ .waitToClick(selectors.claimsIndex.searchButton)
.waitForNumberOfElements(selectors.claimsIndex.searchResult, 1)
.countElement(selectors.claimsIndex.searchResult);
@@ -252,9 +248,8 @@ describe('Ticket Edit sale path', () => {
it('should search the ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:16')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -293,8 +288,7 @@ describe('Ticket Edit sale path', () => {
const result = await nightmare
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton)
- .wait(selectors.ticketSales.moveToTicketInput)
- .type(selectors.ticketSales.moveToTicketInput, 2)
+ .write(selectors.ticketSales.moveToTicketInput, 2)
.waitToClick(selectors.ticketSales.moveToTicketButton)
.waitForLastSnackbar();
@@ -304,7 +298,7 @@ describe('Ticket Edit sale path', () => {
it('should transfer the sale to a valid ticket', async() => {
const result = await nightmare
.waitToClick(selectors.ticketSales.moveToTicketInputClearButton)
- .type(selectors.ticketSales.moveToTicketInput, 12)
+ .write(selectors.ticketSales.moveToTicketInput, 12)
.waitToClick(selectors.ticketSales.moveToTicketButton)
.waitForURL('ticket/12/sale')
.parsedUrl();
@@ -323,9 +317,8 @@ describe('Ticket Edit sale path', () => {
it('should go back to the original ticket sales section', async() => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:16')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
@@ -347,9 +340,8 @@ describe('Ticket Edit sale path', () => {
it('should go back to the receiver ticket sales section', async() => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:12')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:12')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
@@ -364,8 +356,7 @@ describe('Ticket Edit sale path', () => {
const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton)
- .wait(selectors.ticketSales.moveToTicketInput)
- .type(selectors.ticketSales.moveToTicketInput, 16)
+ .write(selectors.ticketSales.moveToTicketInput, 16)
.waitToClick(selectors.ticketSales.moveToTicketButton)
.waitForURL('ticket/16/sale')
.parsedUrl();
@@ -384,9 +375,8 @@ describe('Ticket Edit sale path', () => {
it('should now go back to the original ticket sales section', async() => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:8')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:8')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24')
.waitToClick(selectors.ticketsIndex.searchResult)
@@ -402,6 +392,7 @@ describe('Ticket Edit sale path', () => {
.waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton)
.waitToClick(selectors.ticketSales.moveToNewTicketButton)
+ .resetLogin()
.waitForLogin('salesPerson')
.waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible)
@@ -414,9 +405,8 @@ describe('Ticket Edit sale path', () => {
it('should search for a specific created ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -475,9 +465,8 @@ describe('Ticket Edit sale path', () => {
.waitToClick(selectors.ticketSales.selectAllSalesCheckbox)
.waitToClick(selectors.ticketSales.moreMenuButton)
.waitToClick(selectors.ticketSales.moreMenuUpdateDiscount)
- .wait(selectors.ticketSales.moreMenuUpdateDiscountInput)
- .type(selectors.ticketSales.moreMenuUpdateDiscountInput, 100)
- .type('body', '\u000d') // simulates enter
+ .write(selectors.ticketSales.moreMenuUpdateDiscountInput, 100)
+ .write('body', '\u000d') // simulates enter
.waitForTextInElement(selectors.ticketSales.totalImport, '0.00')
.waitToGetProperty(selectors.ticketSales.totalImport, 'innerText');
@@ -499,9 +488,8 @@ describe('Ticket Edit sale path', () => {
it('should now search for a specific ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:16')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -531,7 +519,7 @@ describe('Ticket Edit sale path', () => {
it(`should set the state of the ticket to preparation`, async() => {
const url = await nightmare
.autocompleteSearch(selectors.ticketTracking.stateAutocomplete, 'Preparación')
- .click(selectors.ticketTracking.saveButton)
+ .waitToClick(selectors.ticketTracking.saveButton)
.waitForURL('/tracking/index')
.parsedUrl();
@@ -587,9 +575,8 @@ describe('Ticket Edit sale path', () => {
it('should once again search for a specific ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:16')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:16')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
diff --git a/e2e/paths/ticket-module/09_ticket_weekly.spec.js b/e2e/paths/ticket-module/09_ticket_weekly.spec.js
index c92633d81..4b7a5266b 100644
--- a/e2e/paths/ticket-module/09_ticket_weekly.spec.js
+++ b/e2e/paths/ticket-module/09_ticket_weekly.spec.js
@@ -32,9 +32,8 @@ describe('Ticket descriptor path', () => {
it('should search for the ticket 11', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:11')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:11')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -93,9 +92,8 @@ describe('Ticket descriptor path', () => {
it('should now search for the ticket 11', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:11')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:11')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
diff --git a/e2e/paths/ticket-module/10_ticket_request.spec.js b/e2e/paths/ticket-module/10_ticket_request.spec.js
index fcc7eb0a4..24d601900 100644
--- a/e2e/paths/ticket-module/10_ticket_request.spec.js
+++ b/e2e/paths/ticket-module/10_ticket_request.spec.js
@@ -14,12 +14,11 @@ describe('Ticket purchase request path', () => {
it(`should add a new request`, async() => {
const result = await nightmare
.waitToClick(selectors.ticketRequests.addRequestButton)
- .wait(selectors.ticketRequests.descriptionInput)
- .type(selectors.ticketRequests.descriptionInput, 'New stuff')
- .type(selectors.ticketRequests.quantityInput, 99)
+ .write(selectors.ticketRequests.descriptionInput, 'New stuff')
+ .write(selectors.ticketRequests.quantityInput, 99)
.waitToClick(selectors.ticketRequests.atenderSelect)
.waitToClick(selectors.ticketRequests.atenderSelectSecondOption)
- .type(selectors.ticketRequests.priceInput, 999)
+ .write(selectors.ticketRequests.priceInput, 999)
.waitToClick(selectors.ticketRequests.saveButton)
.waitForLastSnackbar();
diff --git a/e2e/paths/ticket-module/11_ticket_diary.spec.js b/e2e/paths/ticket-module/11_ticket_diary.spec.js
index 10b05363d..f5bb6fbc7 100644
--- a/e2e/paths/ticket-module/11_ticket_diary.spec.js
+++ b/e2e/paths/ticket-module/11_ticket_diary.spec.js
@@ -12,9 +12,8 @@ describe('Ticket diary path', () => {
it('should search for a specific ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:1')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:1')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
diff --git a/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js b/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js
index 47951b608..5dc2903e9 100644
--- a/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js
+++ b/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js
@@ -11,9 +11,8 @@ describe('Ticket descriptor path', () => {
it('should search for a specific ticket', async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:17')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:17')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@@ -49,9 +48,8 @@ describe('Ticket descriptor path', () => {
it(`should search for the deleted ticket and check it's date`, async() => {
const result = await nightmare
- .wait(selectors.ticketsIndex.searchTicketInput)
- .type(selectors.ticketsIndex.searchTicketInput, 'id:17')
- .click(selectors.ticketsIndex.searchButton)
+ .write(selectors.ticketsIndex.searchTicketInput, 'id:17')
+ .waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.wait(selectors.ticketsIndex.searchResultDate)
.waitToGetProperty(selectors.ticketsIndex.searchResultDate, 'innerText');
diff --git a/e2e/paths/ticket-module/13_create_ticket_services.spec.js b/e2e/paths/ticket-module/13_create_ticket_services.spec.js
index 378c85ac8..14a1f3d7e 100644
--- a/e2e/paths/ticket-module/13_create_ticket_services.spec.js
+++ b/e2e/paths/ticket-module/13_create_ticket_services.spec.js
@@ -24,14 +24,17 @@ describe('Ticket services path', () => {
.waitToClick(selectors.ticketService.saveServiceButton)
.waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
+ expect(result).toEqual('¡Datos guardados!');
+
+ // #1051 Traducciones que fallan
+ // expect(result).toEqual('Data saved!');
});
it('should confirm the service description was edited correctly', async() => {
const result = await nightmare
.waitToClick(selectors.ticketBasicData.basicDataButton)
.wait(selectors.ticketBasicData.clientAutocomplete)
- .click(selectors.ticketService.serviceButton)
+ .waitToClick(selectors.ticketService.serviceButton)
.waitToGetProperty(selectors.ticketService.firstDescriptionInput, 'value');
expect(result).toEqual('my service');
@@ -64,14 +67,17 @@ describe('Ticket services path', () => {
.waitToClick(selectors.ticketService.saveServiceButton)
.waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
+ expect(result).toEqual('¡Datos guardados!');
+
+ // #1051 Traducciones que fallan
+ // expect(result).toEqual('Data saved!');
});
it('should confirm the service was sucessfully removed', async() => {
const result = await nightmare
.waitToClick(selectors.ticketBasicData.basicDataButton)
.wait(selectors.ticketBasicData.clientAutocomplete)
- .click(selectors.ticketService.serviceButton)
+ .waitToClick(selectors.ticketService.serviceButton)
.waitForNumberOfElements(selectors.ticketService.serviceLine, 0)
.countElement(selectors.ticketService.serviceLine);
diff --git a/e2e/paths/ticket-module/14_create_ticket.spec.js b/e2e/paths/ticket-module/14_create_ticket.spec.js
index b308cabf4..3fca25c38 100644
--- a/e2e/paths/ticket-module/14_create_ticket.spec.js
+++ b/e2e/paths/ticket-module/14_create_ticket.spec.js
@@ -31,7 +31,7 @@ describe('Ticket create path', () => {
expect(result).toEqual(`You can't create a ticket for a inactive client`);
});
- it('should suceed to create a ticket for a valid client', async() => {
+ it('should succeed to create a ticket for a valid client', async() => {
const result = await nightmare
.autocompleteSearch(selectors.createTicketView.clientAutocomplete, 'Tony Stark')
.autocompleteSearch(selectors.createTicketView.addressAutocomplete, 'Tony Stark')
@@ -41,7 +41,10 @@ describe('Ticket create path', () => {
.waitToClick(selectors.createTicketView.createButton)
.waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
+ expect(result).toEqual('¡Datos guardados!');
+
+ // #1051 Traducciones que fallan
+ // expect(result).toEqual('Data saved!');
});
it('should check the url is now the summary of the ticket', async() => {
diff --git a/e2e/smokes/01_client_path.spec.js b/e2e/smokes/01_client_path.spec.js
index b83b6d423..2c70ae959 100644
--- a/e2e/smokes/01_client_path.spec.js
+++ b/e2e/smokes/01_client_path.spec.js
@@ -9,16 +9,16 @@ describe('create client path', () => {
.loginAndModule('employee', 'client');
});
- it('should access to the create client view by clicking the create-client floating button', async () => {
+ it('should access to the create client view by clicking the create-client floating button', async() => {
let url = await nightmare
- .click(selectors.clientsIndex.createClientButton)
+ .waitToClick(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton)
.parsedUrl();
expect(url.hash).toEqual('#!/client/create');
});
- it('should cancel the client creation to go back to clients index', async () => {
+ it('should cancel the client creation to go back to clients index', async() => {
let url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton)
.waitToClick(selectors.globalItems.clientsButton)
diff --git a/front/core/components/dialog/style.scss b/front/core/components/dialog/style.scss
index a2f11b25d..5a8457b87 100644
--- a/front/core/components/dialog/style.scss
+++ b/front/core/components/dialog/style.scss
@@ -33,17 +33,12 @@
display: block;
width: 20em;
}
- button,
- input[type="button"],
- input[type="submit"],
- input[type="reset"] {
+ & > button.close {
@extend %clickable;
text-transform: uppercase;
background-color: transparent;
border: none;
border-radius: .1em;
- }
- & > button.close {
position: absolute;
top: 0;
right: 0;
@@ -62,6 +57,11 @@
input[type="button"],
input[type="submit"],
input[type="reset"] {
+ @extend %clickable;
+ text-transform: uppercase;
+ background-color: transparent;
+ border: none;
+ border-radius: .1em;
color: $main-01;
font-family: vn-font-bold;
padding: .7em;
diff --git a/front/core/components/fetched-tags/index.html b/front/core/components/fetched-tags/index.html
index 49232862a..3b1dc54f6 100644
--- a/front/core/components/fetched-tags/index.html
+++ b/front/core/components/fetched-tags/index.html
@@ -1,5 +1,5 @@
{{$t('dearClient')}},
+ Claimable sales from ticket {{$ctrl.claim.ticketFk}}
- Claimable sales from ticket {{$ctrl.claim.ticketFk}}
+
+ {{::sale.quantity}}
{{::sale.price | currency:'€':2}}
{{::sale.discount}} %
diff --git a/modules/ticket/front/tracking/edit/index.html b/modules/ticket/front/tracking/edit/index.html
index b2ca12e43..1d26e08dc 100644
--- a/modules/ticket/front/tracking/edit/index.html
+++ b/modules/ticket/front/tracking/edit/index.html
@@ -1,9 +1,8 @@
-{{ $t('title') }}
+
{{$t('sections.howToBuy.description')}}
+{{$t('sections.howToBuy.stock')}}
+{{$t('sections.howToBuy.delivery')}}
+ +{{$t('sections.howToPay.description')}}
+{{$t('sections.toConsider.description')}}
+ +{{$t('sections.claimsPolicy.description')}}
+ + +
+
{{ $t('sections.introduction.description') }}
+{{ $t('sections.introduction.terms') }}
+ ++ {{ $t('sections.payMethod.description') }}: +
+ {{ $t('sections.legalAction.description') }}: +
+
{{ $t('sections.introduction.description') }}
+ +{{ $t('checkExtract') }}
+{{ $t('checkValidData') }}
+{{ $t('payMethod') }}
+{{ $t('conclusion') }}
+ ++
+
+ {{ $t('sections.pay.cardImplicates') }} +
+ +{{ $t('notifyAnError') }}
+{{$t('description.dear')}},
+{{$t('description.instructions')}}
+ + + +{{$t('sections.QLabel.description')}}:
+{{$t('sections.help.description')}}
+ + + +
+