Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/home.spec.js
Show All 25 Lines | cy.visit(url) | ||||
.then((counters) => { | .then((counters) => { | ||||
for (let counter of counters) { | for (let counter of counters) { | ||||
let innerText = $(counter).text(); | let innerText = $(counter).text(); | ||||
const value = parseInt(innerText.replace(/,/g, '')); | const value = parseInt(innerText.replace(/,/g, '')); | ||||
assert.isAbove(value, 0); | assert.isAbove(value, 0); | ||||
} | } | ||||
}); | }); | ||||
}); | }); | ||||
it('should display null counters when storage is empty', function() { | |||||
cy.server(); | |||||
cy.route({ | |||||
method: 'GET', | |||||
url: this.Urls.stat_counters(), | |||||
response: { | |||||
'stat_counters': {}, | |||||
'stat_counters_history': {} | |||||
} | |||||
}).as('getStatCounters'); | |||||
cy.visit(url) | |||||
.wait('@getStatCounters') | |||||
.wait(500) | |||||
.get('.swh-counter') | |||||
.then((counters) => { | |||||
for (let counter of counters) { | |||||
const value = parseInt($(counter).text()); | |||||
assert.equal(value, 0); | |||||
} | |||||
}); | |||||
}); | |||||
}); | }); |