appium-webdriveragent 4.10.22 → 4.10.24

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
+ ## [4.10.24](https://github.com/appium/WebDriverAgent/compare/v4.10.23...v4.10.24) (2023-02-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Catch unexpected exceptions thrown by the alerts monitor ([#660](https://github.com/appium/WebDriverAgent/issues/660)) ([aa22555](https://github.com/appium/WebDriverAgent/commit/aa22555f0dcf98de43c95cb20be73e911a97741e))
7
+
8
+ ## [4.10.23](https://github.com/appium/WebDriverAgent/compare/v4.10.22...v4.10.23) (2023-02-05)
9
+
10
+
11
+ ### Miscellaneous Chores
12
+
13
+ * bundle:tv for tvOS ([#657](https://github.com/appium/WebDriverAgent/issues/657)) ([9d2d047](https://github.com/appium/WebDriverAgent/commit/9d2d047fba57a33787c66a1e8a8449b9538c67be))
14
+
1
15
  ## [4.10.22](https://github.com/appium/WebDriverAgent/compare/v4.10.21...v4.10.22) (2023-01-30)
2
16
 
3
17
 
package/README.md CHANGED
@@ -36,7 +36,7 @@ If you want to help us out, you are more than welcome to. However please make su
36
36
 
37
37
  `npm run bundle`
38
38
 
39
- Then, you will find `WebDriverAgentRunner-Runner-Sim-<version>.zip` file in the current directory.
39
+ Then, you find `WebDriverAgentRunner-Runner-sim-<version>.zip` for iOS and `WebDriverAgentRunner-Runner-tv_sim-<version>.zip` for tvOS files in the current directory.
40
40
 
41
41
  ## License
42
42
 
@@ -10,7 +10,25 @@ const DERIVED_DATA_PATH = `${ROOT_DIR}/wdaBuild`;
10
10
  const WDA_BUNDLE = 'WebDriverAgentRunner-Runner.app';
11
11
  const WDA_BUNDLE_PATH = path.join(DERIVED_DATA_PATH, 'Build', 'Products', 'Debug-iphonesimulator');
12
12
 
13
+ const WDA_BUNDLE_TV = 'WebDriverAgentRunner_tvOS-Runner.app';
14
+ const WDA_BUNDLE_TV_PATH = path.join(DERIVED_DATA_PATH, 'Build', 'Products', 'Debug-appletvsimulator');
15
+
16
+ const TARGETS = ['runner', 'tv_runner'];
17
+ const SDKS = ['sim', 'tv_sim'];
18
+
13
19
  async function buildWebDriverAgent (xcodeVersion) {
20
+ const target = process.env.TARGET;
21
+ const sdk = process.env.SDK;
22
+
23
+ if (!TARGETS.includes(target)) {
24
+ throw Error(`Please set TARGETS environment variable from the supported targets ${JSON.stringify(TARGETS)}`);
25
+ }
26
+
27
+ if (!SDKS.includes(sdk)) {
28
+ throw Error(`Please set SDK environment variable from the supported SDKs ${JSON.stringify(SDKS)}`);
29
+ }
30
+
31
+
14
32
  LOG.info(`Cleaning ${DERIVED_DATA_PATH} if exists`);
15
33
  try {
16
34
  await exec('xcodebuild', ['clean', '-derivedDataPath', DERIVED_DATA_PATH, '-scheme', 'WebDriverAgentRunner'], {
@@ -25,7 +43,7 @@ async function buildWebDriverAgent (xcodeVersion) {
25
43
  // Clean and build
26
44
  try {
27
45
  await exec('/bin/bash', ['./Scripts/build.sh'], {
28
- env: {TARGET: 'runner', SDK: 'sim', DERIVED_DATA_PATH},
46
+ env: {TARGET: target, SDK: sdk, DERIVED_DATA_PATH},
29
47
  cwd: ROOT_DIR
30
48
  });
31
49
  } catch (e) {
@@ -34,14 +52,18 @@ async function buildWebDriverAgent (xcodeVersion) {
34
52
  throw e;
35
53
  }
36
54
 
37
- const zipName = `WebDriverAgentRunner-Runner-Sim-${xcodeVersion}.zip`;
38
- LOG.info(`Creating ${zipName} which includes ${WDA_BUNDLE}`);
55
+ const isTv = target === 'tv_runner';
56
+ const bundle = isTv ? WDA_BUNDLE_TV : WDA_BUNDLE;
57
+ const bundle_path = isTv ? WDA_BUNDLE_TV_PATH : WDA_BUNDLE_PATH;
58
+
59
+ const zipName = `WebDriverAgentRunner-Runner-${sdk}-${xcodeVersion}.zip`;
60
+ LOG.info(`Creating ${zipName} which includes ${bundle}`);
39
61
  const appBundleZipPath = path.join(ROOT_DIR, zipName);
40
62
  await fs.rimraf(appBundleZipPath);
41
63
  LOG.info(`Created './${zipName}'`);
42
64
  try {
43
- await exec('xattr', ['-cr', WDA_BUNDLE], {cwd: WDA_BUNDLE_PATH});
44
- await exec('zip', ['-qr', appBundleZipPath, WDA_BUNDLE], {cwd: WDA_BUNDLE_PATH});
65
+ await exec('xattr', ['-cr', bundle], {cwd: bundle_path});
66
+ await exec('zip', ['-qr', appBundleZipPath, bundle], {cwd: bundle_path});
45
67
  } catch (e) {
46
68
  LOG.error(`===FAILED TO ZIP ARCHIVE`);
47
69
  LOG.error(e.stderr);
@@ -11,6 +11,7 @@
11
11
 
12
12
  #import "FBAlert.h"
13
13
  #import "FBApplication.h"
14
+ #import "FBLogger.h"
14
15
  #import "XCUIApplication+FBAlert.h"
15
16
 
16
17
  static const NSTimeInterval FB_MONTORING_INTERVAL = 2.0;
@@ -50,9 +51,16 @@ static const NSTimeInterval FB_MONTORING_INTERVAL = 2.0;
50
51
  dispatch_async(dispatch_get_main_queue(), ^{
51
52
  NSArray<FBApplication *> *activeApps = FBApplication.fb_activeApplications;
52
53
  for (FBApplication *activeApp in activeApps) {
53
- XCUIElement *alertElement = activeApp.fb_alertElement;
54
+ XCUIElement *alertElement = nil;
55
+ @try {
56
+ alertElement = activeApp.fb_alertElement;
57
+ if (nil != alertElement) {
58
+ [self.delegate didDetectAlert:[FBAlert alertWithElement:alertElement]];
59
+ }
60
+ } @catch (NSException *e) {
61
+ [FBLogger logFmt:@"Got an unexpected exception while monitoring alerts: %@\n%@", e.reason, e.callStackSymbols];
62
+ }
54
63
  if (nil != alertElement) {
55
- [self.delegate didDetectAlert:[FBAlert alertWithElement:alertElement]];
56
64
  break;
57
65
  }
58
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "4.10.22",
3
+ "version": "4.10.24",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -13,7 +13,9 @@
13
13
  "prepare": "npm run build",
14
14
  "test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.js\"",
15
15
  "e2e-test": "mocha --exit --timeout 10m \"./test/functional/**/*-specs.js\"",
16
- "bundle": "node ./Scripts/build-webdriveragent.js",
16
+ "bundle": "npm run bundle:ios && npm run bundle:tv",
17
+ "bundle:ios": "TARGET=runner SDK=sim node ./Scripts/build-webdriveragent.js",
18
+ "bundle:tv": "TARGET=tv_runner SDK=tv_sim node ./Scripts/build-webdriveragent.js",
17
19
  "fetch-prebuilt-wda": "node ./Scripts/fetch-prebuilt-wda.js"
18
20
  },
19
21
  "engines": {