mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
added support for skipping tests
This commit is contained in:
@@ -49,11 +49,15 @@ describe('Advanced HTTP e2e test suite', function () {
|
||||
});
|
||||
|
||||
const defineTestForMocha = (test, index) => {
|
||||
it(index + ': ' + test.description, async () => {
|
||||
it(index + ': ' + test.description, async function() {
|
||||
await clickNext(driver);
|
||||
await validateTestIndex(driver, index);
|
||||
await validateTestTitle(driver, test.description);
|
||||
await waitToBeFinished(driver, test.timeout || 10000);
|
||||
var skipped = await checkSkipped(driver);
|
||||
if(skipped){
|
||||
this.skip();
|
||||
}
|
||||
await validateResult(driver, test.validationFunc, targetInfo);
|
||||
});
|
||||
};
|
||||
@@ -117,6 +121,11 @@ async function validateResult(driver, validationFunc, targetInfo) {
|
||||
validationFunc(driver, result, targetInfo);
|
||||
}
|
||||
|
||||
async function checkSkipped(driver) {
|
||||
const result = await driver.safeExecute('app.lastResult');
|
||||
return result.type === 'skipped';
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user