mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
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:
@ -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++
|
||||
});
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user