chore(snapshot): get snapshot comparisons with v3 working

http://ionic-snapshot-go.appspot.com/ionic-core/snapshots/v3-master/hbe/
chrome_400x800
This commit is contained in:
Brandy Carney
2017-12-08 18:14:55 -05:00
parent 6c302a05c5
commit c30a6629cd
3 changed files with 15 additions and 4 deletions

View File

@ -59,7 +59,7 @@ function registerE2ETest(desc, tst) {
await tst(driver);
if (takeScreenshots) {
await snapshot.takeScreenshot(driver, {
name: this.test.fullTitle(),
name: this.test.fullTitle().replace(/(^[\w-]+\/[\w-]+)/, '$1:'),
specIndex: specIndex++
});
}

View File

@ -93,13 +93,24 @@ class Snapshot {
async _takeScreenshot(driver, options) {
const capabilities = await driver.getCapabilities();
const png = await driver.takeScreenshot();
const url = await driver.getCurrentUrl();
let url = await driver.getCurrentUrl();
// TODO remove the modified url/description once we're happy with the comparison to v3
let platform = 'android';
let replacedUrl = url.replace('3333', '8876').replace('src/components', '/e2e').replace('test/', '');
url = replacedUrl + `/index.html?ionicplatform=${platform}&ionicOverlayCreatedDiff=0&snapshot=true`;
console.log('url', url);
let description = options.name.replace(': ', `: ${platform} `) + '.';
console.log('description', description);
return Promise.resolve({
app_id: this.appId,
group_id: this.groupId,
description: options.name,
description: description,
spec_index: options.specIndex,
total_specs: this.totalSpecs,
test_id: this.testId,

View File

@ -5,7 +5,7 @@ const { register, Page } = require('../../../../../scripts/e2e');
class ActionSheetE2ETestPage extends Page {
constructor(driver) {
super(driver, 'http://localhost:3333/src/components/action-sheet/test/basic/index.html');
super(driver, 'http://localhost:3333/src/components/action-sheet/test/basic');
}
present(buttonId) {