mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-29 03:53:43 +03:00
Run e2e on full APIs guru list only on tags
This commit is contained in:
parent
f64d4180a6
commit
528b1c4728
|
@ -82,9 +82,21 @@ function fixFFTest(done) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* picks each n-th property from object */
|
||||||
|
function eachNth(obj, n) {
|
||||||
|
let res = {};
|
||||||
|
Object.keys(obj).forEach((k, idx) => {
|
||||||
|
if (idx % n === 0) {
|
||||||
|
res[k] = obj[k];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadJson: loadJson,
|
loadJson: loadJson,
|
||||||
verifyNoBrowserErrors: verifyNoBrowserErrors,
|
verifyNoBrowserErrors: verifyNoBrowserErrors,
|
||||||
scrollToEl: scrollToEl,
|
scrollToEl: scrollToEl,
|
||||||
fixFFTest: fixFFTest
|
fixFFTest: fixFFTest,
|
||||||
|
eachNth: eachNth
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors;
|
const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors;
|
||||||
const scrollToEl = require('./helpers').scrollToEl;
|
const scrollToEl = require('./helpers').scrollToEl;
|
||||||
const fixFFTest = require('./helpers').fixFFTest;
|
const fixFFTest = require('./helpers').fixFFTest;
|
||||||
|
const eachNth = require('./helpers').eachNth;
|
||||||
|
|
||||||
const URL = 'index.html';
|
const URL = 'index.html';
|
||||||
|
|
||||||
|
@ -59,6 +60,14 @@ describe('APIs.guru specs test', ()=> {
|
||||||
delete apisGuruList['googleapis.com:mirror']; // bad urls in images
|
delete apisGuruList['googleapis.com:mirror']; // bad urls in images
|
||||||
delete apisGuruList['googleapis.com:discovery']; // non-string references
|
delete apisGuruList['googleapis.com:discovery']; // non-string references
|
||||||
|
|
||||||
|
// run quick version of e2e test on all builds except releases
|
||||||
|
if (process.env.TRAVIS && !process.env.TRAVIS_TAG) {
|
||||||
|
console.log('Running on short APIs guru list');
|
||||||
|
apisGuruList = eachNth(apisGuruList, 10);
|
||||||
|
} else {
|
||||||
|
console.log('Running on full APIs guru list')
|
||||||
|
}
|
||||||
|
|
||||||
for (let apiName of Object.keys(apisGuruList)) {
|
for (let apiName of Object.keys(apisGuruList)) {
|
||||||
let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred];
|
let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred];
|
||||||
let url = apiInfo.swaggerUrl;
|
let url = apiInfo.swaggerUrl;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user