Sto tentando di creare un test automatico con Nightwatch.js per verificare che i collegamenti per il download del software funzionino correttamente. Non voglio scaricare i file, poiché sono piuttosto grandi, voglio solo verificare che il link corrispondente restituisca una risposta HTTP 200 per assicurarsi che i link puntino al posto giusto.Test dei collegamenti di download con Nightwatch.js
Qualche idea su come testare i collegamenti ai file scaricabili con Nightwatch.js?
Ecco quello che ho attualmente:
/**
* Test Software Downloads
*
* Verify that software downloads are working
*/
module.exports = {
"Download redirect links": function (browser) {
// download links
var downloadLinks = {
"software-download-latest-mac": "http://downloads.company.com/mac/latest/",
"software-download-latest-linux": "http://downloads.company.com/linux/latest/",
"software-download-latest-win32": "http://downloads.company.com/windows/32/latest/",
"software-download-latest-win64": "http://downloads.company.com/windows/64/latest/"
};
// loop through download links
for (var key in downloadLinks) {
if (downloadLinks.hasOwnProperty(key)) {
// test each link's status
browser
.url(downloadLinks[key]);
}
}
// end testing
browser.end();
}
};
perfetto, grazie @mrzmyr –