mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 09:34:19 +08:00
chore(snapshot): add support for ios platform and passing a folder (#13635)
* chore(snapshot): adds support for multiple platforms and passing folder * test(e2e): update e2e tests for multiple platforms * test(e2e): fix failing backdrop tests * chore(snapshot): remove console logs
This commit is contained in:
@ -91,6 +91,12 @@ class Snapshot {
|
||||
.setSize(this.width, this.height);
|
||||
}
|
||||
|
||||
_getQueryString(field, url) {
|
||||
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
|
||||
var string = reg.exec(url);
|
||||
return string ? string[1] : null;
|
||||
};
|
||||
|
||||
async _takeScreenshot(driver, options) {
|
||||
const capabilities = await driver.getCapabilities();
|
||||
|
||||
@ -100,12 +106,14 @@ class Snapshot {
|
||||
// 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/', '');
|
||||
if (url.indexOf('ionicplatform') > -1) {
|
||||
platform = this._getQueryString('ionicplatform', url);
|
||||
}
|
||||
|
||||
let replacedUrl = url.replace('3333', '8876').replace('src/components', '/e2e').replace('test/', '').replace(`?ionicplatform=${platform}`, '');
|
||||
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,
|
||||
|
Reference in New Issue
Block a user