mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
feat(snapshot): add better reporting
This commit is contained in:
@ -7,7 +7,6 @@ class Snapshot {
|
|||||||
this.appId = (options && options.appId) || 'test_app';
|
this.appId = (options && options.appId) || 'test_app';
|
||||||
this.domain = (options && options.domain) || 'localhost:8080';
|
this.domain = (options && options.domain) || 'localhost:8080';
|
||||||
this.groupId = (options && options.groupId) || 'test_group';
|
this.groupId = (options && options.groupId) || 'test_group';
|
||||||
this.testId = options && options.testId;
|
|
||||||
this.sleepTime = (options && options.sleepBetweenSpecs) || 500;
|
this.sleepTime = (options && options.sleepBetweenSpecs) || 500;
|
||||||
this.totalSpecs = options && options.totalSpecs;
|
this.totalSpecs = options && options.totalSpecs;
|
||||||
this.accessKey = options && options.accessKey;
|
this.accessKey = options && options.accessKey;
|
||||||
@ -22,6 +21,17 @@ class Snapshot {
|
|||||||
this.height =
|
this.height =
|
||||||
(options && options.platformDefaults && options.platformDefaults.params && options.platformDefaults.params.height) || -1;
|
(options && options.platformDefaults && options.platformDefaults.params && options.platformDefaults.params.height) || -1;
|
||||||
|
|
||||||
|
this.start(options && options.testId);
|
||||||
|
}
|
||||||
|
|
||||||
|
async finish() {
|
||||||
|
console.log('waiting for uploads to complete');
|
||||||
|
await Promise.all(this.queue);
|
||||||
|
console.log(`done processing ${this.queue.length} screenshots`);
|
||||||
|
}
|
||||||
|
|
||||||
|
start(testId) {
|
||||||
|
this.testId = testId;
|
||||||
this.queue = [];
|
this.queue = [];
|
||||||
this.highestMismatch = 0;
|
this.highestMismatch = 0;
|
||||||
this.mismatches = [];
|
this.mismatches = [];
|
||||||
@ -65,6 +75,7 @@ class Snapshot {
|
|||||||
this.mismatches.push(resultKey);
|
this.mismatches.push(resultKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
resolve(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.queue.push(p);
|
this.queue.push(p);
|
||||||
|
@ -94,7 +94,7 @@ async function run() {
|
|||||||
testId: generateTestId(),
|
testId: generateTestId(),
|
||||||
domain: 'ionic-snapshot-go.appspot.com',
|
domain: 'ionic-snapshot-go.appspot.com',
|
||||||
// domain: 'localhost:8080',
|
// domain: 'localhost:8080',
|
||||||
sleepBetweenSpecs: 300,
|
sleepBetweenSpecs: 750,
|
||||||
totalSpecs: getTotalTests(mocha.suite),
|
totalSpecs: getTotalTests(mocha.suite),
|
||||||
platformDefaults: {
|
platformDefaults: {
|
||||||
browser: 'chrome',
|
browser: 'chrome',
|
||||||
@ -114,6 +114,9 @@ async function run() {
|
|||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
process.exit(failures); // exit with non-zero status if there were failures
|
process.exit(failures); // exit with non-zero status if there were failures
|
||||||
});
|
});
|
||||||
|
if (takeScreenshots) {
|
||||||
|
snapshot.finish();
|
||||||
|
}
|
||||||
devServer.close();
|
devServer.close();
|
||||||
driver.quit();
|
driver.quit();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user