appium-mac2-driver 1.7.3 → 1.8.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.8.0](https://github.com/appium/appium-mac2-driver/compare/v1.7.4...v1.8.0) (2023-09-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * add appPath to handleCreateSession ([#230](https://github.com/appium/appium-mac2-driver/issues/230)) ([7b7cc17](https://github.com/appium/appium-mac2-driver/commit/7b7cc17f267e909f38fd210dea6652281679d662))
7
+
8
+ ## [1.7.4](https://github.com/appium/appium-mac2-driver/compare/v1.7.3...v1.7.4) (2023-08-28)
9
+
10
+
11
+ ### Miscellaneous Chores
12
+
13
+ * **deps-dev:** bump conventional-changelog-conventionalcommits ([#226](https://github.com/appium/appium-mac2-driver/issues/226)) ([6417dc6](https://github.com/appium/appium-mac2-driver/commit/6417dc6b24461a0f83e2e9ae156f323d999f767b))
14
+
1
15
  ## [1.7.3](https://github.com/appium/appium-mac2-driver/compare/v1.7.2...v1.7.3) (2023-08-25)
2
16
 
3
17
 
package/README.md CHANGED
@@ -24,6 +24,7 @@ On top of standard Appium requirements Mac2 driver also expects the following pr
24
24
  - macOS 10.15 or later
25
25
  - macOS 11.3 or later and less than macOS 12, and Xcode 12 combination does not work as the build failure
26
26
  - Xcode 12 or later should be installed
27
+ - `xcode-select` should be pointing to `<full_path_to_xcode_app>/Contents/Developer` developer directory instead of `/Library/Developer/CommandLineTools` to run `xcodebuild` commands
27
28
  - Xcode Helper app should be enabled for Accessibility access. The app itself could be usually found at `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/Xcode Helper.app`. In order to enable Accessibility access for it simply open the parent folder in Finder: `open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/` and drag & drop the `Xcode Helper` app to `Security & Privacy -> Privacy -> Accessibility` list of your `System Preferences`. This action must only be done once.
28
29
  - `testmanagerd` proccess requires UIAutomation authentication since macOS 12. `automationmodetool enable-automationmode-without-authentication` command may help to disable it. This may be particularly useful in CI environments. [Apple forum thread](https://developer.apple.com/forums/thread/693850).
29
30
 
@@ -47,6 +48,7 @@ appium:skipAppKill | Whether to skip the termination of the application under te
47
48
  appium:prerun | An object containing either `script` or `command` key. The value of each key must be a valid AppleScript script or command to be executed prior to the Mac2Driver session startup. See [AppleScript commands execution](#applescript-commands-execution) for more details. Example: `{command: 'do shell script "echo hello"'}`
48
49
  appium:postrun | An object containing either `script` or `command` key. The value of each key must be a valid AppleScript script or command to be executed after Mac2Driver session is stopped. See [AppleScript commands execution](#applescript-commands-execution) for more details.
49
50
  appium:noReset | Whether to restart the app whose bundle identifier was passed to capabilities as `bundleId` value if it was already running on the session startup (`false`, the default value) or just pick it up without changing the app state (`true`). Note that neither of `arguments` or `environment` capabilities will take effect if the app did not restart.
51
+ appium:appPath | The path to the application to automate, for example `/Applications/MyAppName.app`. This is an optional capability, but it requires `bundleId` to be present. If `bundleId` is empty, `appPath` will be ignored. If the path is invalid or application is damaged/incomplete then an error will be thrown on session startup. This capability could be usefull when you have multiple builds of the same application with the same bundleId on your machine (for example one production build in /Applications/ and several dev builds). If you provide bundleId only, the operating system could open any of these builds. By providing `appPath` you have a guarantee that the specified .app will be launched, rather than a random one.
50
52
 
51
53
 
52
54
  ## Element Attributes
@@ -17,6 +17,7 @@
17
17
  #import "FBRouteRequest.h"
18
18
  #import "FBSession.h"
19
19
  #import "FBRuntimeUtils.h"
20
+ #import "XCUIApplication.h"
20
21
  #import "XCUIApplication+AMHelpers.h"
21
22
  #import "XCUIApplication+AMUIInterruptions.h"
22
23
 
@@ -87,7 +88,10 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
87
88
  if (nil == bundleID) {
88
89
  session = [FBSession initWithApplication:nil];
89
90
  } else {
90
- XCUIApplication *app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
91
+ NSString *appPath = requirements[AM_APP_PATH_CAPABILITY];
92
+ XCUIApplication *app = appPath == nil ?
93
+ [[XCUIApplication alloc] initWithBundleIdentifier:bundleID] :
94
+ [[XCUIApplication alloc] initPrivateWithPath:appPath bundleID:bundleID];
91
95
  session = [FBSession initWithApplication:app];
92
96
  if (noReset && app.state > XCUIApplicationStateNotRunning) {
93
97
  [app activate];
@@ -0,0 +1,12 @@
1
+
2
+ #import <XCTest/XCTest.h>
3
+
4
+ NS_ASSUME_NONNULL_BEGIN
5
+
6
+ @interface XCUIApplication (InitPrivateWithPath)
7
+
8
+ - (id)initPrivateWithPath:(id)path bundleID:(id)bundleId;
9
+
10
+ @end
11
+
12
+ NS_ASSUME_NONNULL_END
@@ -23,5 +23,6 @@ extern NSString* const AM_APP_ARGUMENTS_CAPABILITY;
23
23
  extern NSString* const AM_APP_ENVIRONMENT_CAPABILITY;
24
24
  extern NSString* const AM_SKIP_APP_KILL_CAPABILITY;
25
25
  extern NSString* const AM_NO_RESET_CAPABILITY;
26
+ extern NSString* const AM_APP_PATH_CAPABILITY;
26
27
 
27
28
  NS_ASSUME_NONNULL_END
@@ -21,3 +21,4 @@ NSString* const AM_APP_ARGUMENTS_CAPABILITY = @"arguments";
21
21
  NSString* const AM_APP_ENVIRONMENT_CAPABILITY = @"environment";
22
22
  NSString* const AM_SKIP_APP_KILL_CAPABILITY = @"skipAppKill";
23
23
  NSString* const AM_NO_RESET_CAPABILITY = @"noReset";
24
+ NSString* const AM_APP_PATH_CAPABILITY = @"appPath";
@@ -190,6 +190,7 @@
190
190
  71B8B68126726369009CE50C /* AMSwipeHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B8B67F26726369009CE50C /* AMSwipeHelpers.h */; };
191
191
  71B8B68226726369009CE50C /* AMSwipeHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B8B68026726369009CE50C /* AMSwipeHelpers.m */; };
192
192
  71B8B684267265D7009CE50C /* AMVariousElementTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B8B683267265D7009CE50C /* AMVariousElementTests.m */; };
193
+ C68B934B2AA892CF009F00F2 /* XCUIApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = C68B934A2AA892CF009F00F2 /* XCUIApplication.h */; };
193
194
  /* End PBXBuildFile section */
194
195
 
195
196
  /* Begin PBXContainerItemProxy section */
@@ -424,6 +425,7 @@
424
425
  71B8B67F26726369009CE50C /* AMSwipeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AMSwipeHelpers.h; sourceTree = "<group>"; };
425
426
  71B8B68026726369009CE50C /* AMSwipeHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AMSwipeHelpers.m; sourceTree = "<group>"; };
426
427
  71B8B683267265D7009CE50C /* AMVariousElementTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AMVariousElementTests.m; sourceTree = "<group>"; };
428
+ C68B934A2AA892CF009F00F2 /* XCUIApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCUIApplication.h; sourceTree = "<group>"; };
427
429
  /* End PBXFileReference section */
428
430
 
429
431
  /* Begin PBXFrameworksBuildPhase section */
@@ -766,6 +768,7 @@
766
768
  7180C1E6257A94F3008FA870 /* XCPointerEventPath.h */,
767
769
  7180C1EC257A95C2008FA870 /* XCSynthesizedEventRecord.h */,
768
770
  7180C1F6257A9896008FA870 /* XCUIEventSynthesizing-Protocol.h */,
771
+ C68B934A2AA892CF009F00F2 /* XCUIApplication.h */,
769
772
  );
770
773
  path = XCTest;
771
774
  sourceTree = "<group>";
@@ -875,6 +878,7 @@
875
878
  7109C0532565B5EA006BFD13 /* HTTPErrorResponse.h in Headers */,
876
879
  7180C1E9257A94F4008FA870 /* XCPointerEvent.h in Headers */,
877
880
  712FA091288BD68100976DA8 /* AMWindowCommands.h in Headers */,
881
+ C68B934B2AA892CF009F00F2 /* XCUIApplication.h in Headers */,
878
882
  7180C1ED257A95C2008FA870 /* XCSynthesizedEventRecord.h in Headers */,
879
883
  718D2C322567FED3005F533B /* AMSessionCapabilities.h in Headers */,
880
884
  7109BFE02565B536006BFD13 /* FBCommandHandler.h in Headers */,
@@ -46,5 +46,9 @@ export namespace desiredCapConstraints {
46
46
  let isString_3: boolean;
47
47
  export { isString_3 as isString };
48
48
  }
49
+ namespace appPath {
50
+ let isString_4: boolean;
51
+ export { isString_4 as isString };
52
+ }
49
53
  }
50
54
  //# sourceMappingURL=desired-caps.d.ts.map
@@ -40,6 +40,9 @@ const desiredCapConstraints = {
40
40
  },
41
41
  webDriverAgentMacUrl: {
42
42
  isString: true
43
+ },
44
+ appPath: {
45
+ isString: true
43
46
  }
44
47
  };
45
48
  exports.desiredCapConstraints = desiredCapConstraints;
@@ -1 +1 @@
1
- {"version":3,"file":"desired-caps.js","sourceRoot":"","sources":["../../lib/desired-caps.js"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB,GAAG;IAC5B,UAAU,EAAE;QACV,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,IAAI;KACf;IACD,cAAc,EAAE;QACd,SAAS,EAAE,IAAI;KAChB;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,IAAI;KACf;IACD,oBAAoB,EAAE;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;KACd;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,SAAS,EAAE,IAAI;KAChB;IACD,WAAW,EAAE;QACX,SAAS,EAAE,IAAI;KAChB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,IAAI;KACf;IACD,oBAAoB,EAAE;QACpB,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEO,sDAAqB"}
1
+ {"version":3,"file":"desired-caps.js","sourceRoot":"","sources":["../../lib/desired-caps.js"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB,GAAG;IAC5B,UAAU,EAAE;QACV,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,IAAI;KACf;IACD,cAAc,EAAE;QACd,SAAS,EAAE,IAAI;KAChB;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,IAAI;KACf;IACD,oBAAoB,EAAE;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;KACd;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,SAAS,EAAE,IAAI;KAChB;IACD,WAAW,EAAE;QACX,SAAS,EAAE,IAAI;KAChB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,IAAI;KACf;IACD,oBAAoB,EAAE;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEO,sDAAqB"}
@@ -67,6 +67,9 @@ export class Mac2Driver extends BaseDriver<any, import("@appium/types").StringRe
67
67
  webDriverAgentMacUrl: {
68
68
  isString: boolean;
69
69
  };
70
+ appPath: {
71
+ isString: boolean;
72
+ };
70
73
  };
71
74
  settings: DeviceSettings<{}>;
72
75
  onSettingsUpdate(key: any, value: any): Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";;AAoBA;IAOE;;;;;;;;;;;;;;;;;MAAmC;IAEnC,uBAyBC;IAjCD,sBAAsB;IACtB,eADW,OAAO,CACJ;IAEd,8EAA8E;IAC9E,8BADmB;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,KAAK,QAAQ,MAAM,CAAC,CACrD;IAOnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkD;IAiBlD,6BAAwE;IAO1E,yDAIC;IAED,mBAKC;IAJC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAe;IACf,iBAAuB;IAEvB,qBAA2B;IAI7B,qCAEC;IAGD,0EAEC;IAED,oBAEC;IAED,mEAEC;IAGD,8BAEC;IAGD,6FAwBC;IAED,+BAwBC;CACF;;2BA/I0C,eAAe;+BAAf,eAAe"}
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";;AAoBA;IAOE;;;;;;;;;;;;;;;;;MAAmC;IAEnC,uBAyBC;IAjCD,sBAAsB;IACtB,eADW,OAAO,CACJ;IAEd,8EAA8E;IAC9E,8BADmB;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,KAAK,QAAQ,MAAM,CAAC,CACrD;IAOnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkD;IAiBlD,6BAAwE;IAO1E,yDAIC;IAED,mBAKC;IAJC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAe;IACf,iBAAuB;IAEvB,qBAA2B;IAI7B,qCAEC;IAGD,0EAEC;IAED,oBAEC;IAED,mEAEC;IAGD,8BAEC;IAGD,6FAwBC;IAED,+BAwBC;CACF;;2BA/I0C,eAAe;+BAAf,eAAe"}
@@ -37,6 +37,9 @@ const desiredCapConstraints = {
37
37
  },
38
38
  webDriverAgentMacUrl: {
39
39
  isString: true
40
+ },
41
+ appPath: {
42
+ isString: true
40
43
  }
41
44
  };
42
45
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "mac",
7
7
  "XCTest"
8
8
  ],
9
- "version": "1.7.3",
9
+ "version": "1.8.0",
10
10
  "author": "Appium Contributors",
11
11
  "license": "Apache-2.0",
12
12
  "repository": {
@@ -90,7 +90,7 @@
90
90
  "@typescript-eslint/parser": "^5.62.0",
91
91
  "chai": "^4.1.2",
92
92
  "chai-as-promised": "^7.1.1",
93
- "conventional-changelog-conventionalcommits": "^6.0.0",
93
+ "conventional-changelog-conventionalcommits": "^7.0.1",
94
94
  "eslint": "^8.46.0",
95
95
  "eslint-config-prettier": "^8.9.0",
96
96
  "eslint-import-resolver-typescript": "^3.5.5",