@percy/webdriver-utils 1.32.12-beta.2 → 1.32.12-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,11 +10,23 @@ export default class AutomateProvider extends GenericProvider {
|
|
|
10
10
|
static supports(commandExecutorUrl) {
|
|
11
11
|
return commandExecutorUrl.includes(process.env.AA_DOMAIN || 'browserstack');
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
// Automate capture reads the screen size, DPR and regions through JavaScript, which a
|
|
15
|
+
// native app context cannot run (App Automate answers 405 Method Not Allowed). Browser
|
|
16
|
+
// sessions always carry a browserName; native ones carry an app identifier instead.
|
|
17
|
+
static isNativeAppSession(caps) {
|
|
18
|
+
if (!caps || caps.browserName) return false;
|
|
19
|
+
const desired = caps.desired || {};
|
|
20
|
+
return ['app', 'appium:app', 'appPackage', 'bundleId', 'bundleID'].some(key => caps[key] || desired[key]);
|
|
21
|
+
}
|
|
13
22
|
async createDriver() {
|
|
14
23
|
this.driver = new Driver(this.sessionId, this.commandExecutorUrl, this.capabilities);
|
|
15
24
|
log.debug(`Passed capabilities -> ${JSON.stringify(this.capabilities)}`);
|
|
16
25
|
const caps = await this.driver.getCapabilites();
|
|
17
26
|
log.debug(`Fetched capabilities -> ${JSON.stringify(caps)}`);
|
|
27
|
+
if (AutomateProvider.isNativeAppSession(caps)) {
|
|
28
|
+
throw new Error('Percy on Automate captures browser sessions; this is a native app session. ' + 'Use App Percy for native apps (an app project token with `percy app:exec`).');
|
|
29
|
+
}
|
|
18
30
|
this.metaData = MetaDataResolver.resolve(this.driver, caps, this.capabilities);
|
|
19
31
|
}
|
|
20
32
|
async screenshot(name, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/webdriver-utils",
|
|
3
|
-
"version": "1.32.12-beta.
|
|
3
|
+
"version": "1.32.12-beta.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test:coverage": "yarn test --coverage"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@percy/config": "1.32.12-beta.
|
|
33
|
-
"@percy/sdk-utils": "1.32.12-beta.
|
|
32
|
+
"@percy/config": "1.32.12-beta.4",
|
|
33
|
+
"@percy/sdk-utils": "1.32.12-beta.4"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "916cdcd8854848b48c3d658d9d01779176feb2d0"
|
|
36
36
|
}
|