client: replace deprecated vue-resource with axios, lint more file

This commit is contained in:
Matteo Pagliazzi
2017-01-15 20:49:15 +01:00
parent caa546eb62
commit bbffa9830b
21 changed files with 189 additions and 181 deletions

View File

@@ -7,7 +7,7 @@
// for how to write custom assertions see
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = 'Testing if element <' + selector + '> has count: ' + count;
this.message = `Testing if element <${selector}> has count: ${count}`;
this.expected = count;
this.pass = function (val) {
return val === this.expected;
@@ -16,11 +16,10 @@ exports.assertion = function (selector, count) {
return res.value;
};
this.command = function (cb) {
var self = this;
return this.api.execute(function (selector) {
return document.querySelectorAll(selector).length;
}, [selector], function (res) {
cb.call(self, res);
return this.api.execute((el) => {
return document.querySelectorAll(el).length;
}, [selector], (res) => {
cb.call(this, res);
});
};
};