-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
caps.js
64 lines (58 loc) · 1.43 KB
/
caps.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Internal dependencies
*/
import {
ios as iOSConfig,
android as androidConfig,
} from './device-config.json';
const ios = {
deviceOrientation: 'portrait',
automationName: 'XCUITest',
processArguments: {
args: [ 'uitesting' ],
},
autoLaunch: false,
};
exports.iosLocal = ( { iPadDevice = false } ) => ( {
...ios,
deviceName: ! iPadDevice
? iOSConfig.local.deviceName
: iOSConfig.local.deviceTabletName,
platformVersion: iOSConfig.local.platformVersion,
pixelRatio: ! iPadDevice
? iOSConfig.pixelRatio.iPhone
: iOSConfig.pixelRatio.iPad,
usePrebuiltWDA: true,
} );
exports.iosServer = ( { iPadDevice = false } ) => ( {
...ios,
deviceName: ! iPadDevice
? iOSConfig.saucelabs.deviceName
: iOSConfig.saucelabs.deviceTabletName,
platformVersion: iOSConfig.local.platformVersion,
pixelRatio: ! iPadDevice
? iOSConfig.pixelRatio.iPhone
: iOSConfig.pixelRatio.iPad,
} );
exports.android = {
platformVersion: androidConfig.local.platformVersion,
deviceName: androidConfig.saucelabs.deviceName,
automationName: 'UiAutomator2',
appPackage: 'com.gutenberg',
appActivity: 'com.gutenberg.MainActivity',
deviceOrientation: 'portrait',
disableWindowAnimation: true,
autoLaunch: false,
};
// SauceLabs config
exports.sauceOptions = {
appiumVersion: '2.0.0',
};
exports.prefixKeysWithAppium = ( obj ) => {
return Object.fromEntries(
Object.entries( obj ).map( ( [ key, value ] ) => [
`appium:${ key }`,
value,
] )
);
};