Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/home.spec.js
/** | /** | ||||
* Copyright (C) 2019 The Software Heritage developers | * Copyright (C) 2019 The Software Heritage developers | ||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
const url = '/'; | |||||
const $ = Cypress.$; | const $ = Cypress.$; | ||||
const url = '/'; | |||||
describe('Home Page Tests', function() { | describe('Home Page Tests', function() { | ||||
it('should display positive stats for each category', function() { | it('should display positive stats for each category', function() { | ||||
cy.visit(url) | cy.visit(url) | ||||
.wait(3000) // wait counters request result | .wait(3000) // wait counters request result | ||||
.get('.swh-counter') | .get('.swh-counter') | ||||
.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); | ||||
} | } | ||||
}); | }); | ||||
}); | }); | ||||
}); | }); |