appium-webdriveragent 5.1.2 → 5.1.3

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,10 @@
1
+ ## [5.1.3](https://github.com/appium/WebDriverAgent/compare/v5.1.2...v5.1.3) (2023-05-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Revert "fix: Assert app is installed before launching or activating it ([#704](https://github.com/appium/WebDriverAgent/issues/704))" ([#705](https://github.com/appium/WebDriverAgent/issues/705)) ([00baeb2](https://github.com/appium/WebDriverAgent/commit/00baeb2045b9aac98d27fe2e96cedce0dde5e8be))
7
+
1
8
  ## [5.1.2](https://github.com/appium/WebDriverAgent/compare/v5.1.1...v5.1.2) (2023-05-15)
2
9
 
3
10
 
@@ -44,16 +44,6 @@ NS_ASSUME_NONNULL_BEGIN
44
44
  */
45
45
  + (BOOL)fb_switchToSystemApplicationWithError:(NSError **)error;
46
46
 
47
- /**
48
- Returns the bundle indentifier of the system app (ususally Springboard)
49
- */
50
- + (NSString *)fb_systemApplicationBundleID;
51
-
52
- /**
53
- Checks if the app is installed on the device under test.
54
- */
55
- - (BOOL)fb_isInstalled;
56
-
57
47
  @end
58
48
 
59
49
  NS_ASSUME_NONNULL_END
@@ -9,7 +9,6 @@
9
9
 
10
10
  #import "FBApplication.h"
11
11
 
12
- #import "FBExceptions.h"
13
12
  #import "FBXCAccessibilityElement.h"
14
13
  #import "FBLogger.h"
15
14
  #import "FBRunLoopSpinner.h"
@@ -17,7 +16,6 @@
17
16
  #import "FBActiveAppDetectionPoint.h"
18
17
  #import "FBXCodeCompatibility.h"
19
18
  #import "FBXCTestDaemonsProxy.h"
20
- #import "LSApplicationWorkspace.h"
21
19
  #import "XCUIApplication.h"
22
20
  #import "XCUIApplication+FBHelpers.h"
23
21
  #import "XCUIApplicationImpl.h"
@@ -135,16 +133,6 @@ static const NSTimeInterval APP_STATE_CHANGE_TIMEOUT = 5.0;
135
133
  [[FBXCAXClientProxy.sharedClient systemApplication] processIdentifier]];
136
134
  }
137
135
 
138
- + (NSString *)fb_systemApplicationBundleID
139
- {
140
- static dispatch_once_t onceToken;
141
- static NSString *systemAppBundleID;
142
- dispatch_once(&onceToken, ^{
143
- systemAppBundleID = [[self.class fb_systemApplication] bundleID];
144
- });
145
- return systemAppBundleID;
146
- }
147
-
148
136
  + (instancetype)applicationWithPID:(pid_t)processID
149
137
  {
150
138
  if ([NSProcessInfo processInfo].processIdentifier == processID) {
@@ -153,33 +141,14 @@ static const NSTimeInterval APP_STATE_CHANGE_TIMEOUT = 5.0;
153
141
  return (FBApplication *)[FBXCAXClientProxy.sharedClient monitoredApplicationWithProcessIdentifier:processID];
154
142
  }
155
143
 
156
- /**
157
- https://github.com/appium/WebDriverAgent/issues/702
158
- */
159
- - (void)fb_assertInstalledByAction:(NSString *)action
160
- {
161
- if (![self.bundleID isEqualToString:[self.class fb_systemApplicationBundleID]] && !self.fb_isInstalled) {
162
- NSString *message = [NSString stringWithFormat:@"The application '%@' cannot be %@ because it is not installed on the device under test",
163
- self.bundleID, action];
164
- [[NSException exceptionWithName:FBApplicationMissingException reason:message userInfo:nil] raise];
165
- }
166
- }
167
-
168
144
  - (void)launch
169
145
  {
170
- [self fb_assertInstalledByAction:@"launched"];
171
146
  [super launch];
172
147
  if (![self fb_waitForAppElement:APP_STATE_CHANGE_TIMEOUT]) {
173
148
  [FBLogger logFmt:@"The application '%@' is not running in foreground after %.2f seconds", self.bundleID, APP_STATE_CHANGE_TIMEOUT];
174
149
  }
175
150
  }
176
151
 
177
- - (void)activate
178
- {
179
- [self fb_assertInstalledByAction:@"activated"];
180
- [super activate];
181
- }
182
-
183
152
  - (void)terminate
184
153
  {
185
154
  [super terminate];
@@ -212,9 +181,4 @@ static const NSTimeInterval APP_STATE_CHANGE_TIMEOUT = 5.0;
212
181
  error:error];
213
182
  }
214
183
 
215
- - (BOOL)fb_isInstalled
216
- {
217
- return [[LSApplicationWorkspace defaultWorkspace] applicationIsInstalled:self.bundleID];
218
- }
219
-
220
184
  @end
@@ -24,8 +24,7 @@
24
24
  commandStatus = [FBCommandStatus noSuchDriverErrorWithMessage:exception.reason
25
25
  traceback:traceback];
26
26
  } else if ([exception.name isEqualToString:FBInvalidArgumentException]
27
- || [exception.name isEqualToString:FBElementAttributeUnknownException]
28
- || [exception.name isEqualToString:FBApplicationMissingException]) {
27
+ || [exception.name isEqualToString:FBElementAttributeUnknownException]) {
29
28
  commandStatus = [FBCommandStatus invalidArgumentErrorWithMessage:exception.reason
30
29
  traceback:traceback];
31
30
  } else if ([exception.name isEqualToString:FBApplicationCrashedException]
@@ -49,7 +49,4 @@ extern NSString *const FBClassChainQueryParseException;
49
49
  /*! Exception used to notify about application crash */
50
50
  extern NSString *const FBApplicationCrashedException;
51
51
 
52
- /*! Exception used to notify about the application is not installed */
53
- extern NSString *const FBApplicationMissingException;
54
-
55
52
  NS_ASSUME_NONNULL_END
@@ -20,4 +20,3 @@ NSString *const FBInvalidXPathException = @"FBInvalidXPathException";
20
20
  NSString *const FBXPathQueryEvaluationException = @"FBXPathQueryEvaluationException";
21
21
  NSString *const FBClassChainQueryParseException = @"FBClassChainQueryParseException";
22
22
  NSString *const FBApplicationCrashedException = @"FBApplicationCrashedException";
23
- NSString *const FBApplicationMissingException = @"FBApplicationMissingException";
@@ -11,7 +11,6 @@
11
11
 
12
12
  #import "FBIntegrationTestCase.h"
13
13
  #import "FBApplication.h"
14
- #import "FBExceptions.h"
15
14
  #import "FBMacros.h"
16
15
  #import "FBSession.h"
17
16
  #import "FBXCodeCompatibility.h"
@@ -101,34 +100,6 @@ static NSString *const SETTINGS_BUNDLE_ID = @"com.apple.Preferences";
101
100
  FBAssertWaitTillBecomesTrue([self.session.activeApplication.bundleID isEqualToString:testedApp.bundleID]);
102
101
  }
103
102
 
104
- - (void)testAppWithInvalidBundleIDCannotBeStarted
105
- {
106
- FBApplication *testedApp = [[FBApplication alloc] initWithBundleIdentifier:@"yolo"];
107
- @try {
108
- [testedApp launch];
109
- XCTFail(@"An exception is expected to be thrown");
110
- } @catch (NSException *exception) {
111
- XCTAssertEqualObjects(FBApplicationMissingException, exception.name);
112
- }
113
- }
114
-
115
- - (void)testAppWithInvalidBundleIDCannotBeActivated
116
- {
117
- FBApplication *testedApp = [[FBApplication alloc] initWithBundleIdentifier:@"yolo"];
118
- @try {
119
- [testedApp activate];
120
- XCTFail(@"An exception is expected to be thrown");
121
- } @catch (NSException *exception) {
122
- XCTAssertEqualObjects(FBApplicationMissingException, exception.name);
123
- }
124
- }
125
-
126
- - (void)testAppWithInvalidBundleIDCannotBeTerminated
127
- {
128
- FBApplication *testedApp = [[FBApplication alloc] initWithBundleIdentifier:@"yolo"];
129
- [testedApp terminate];
130
- }
131
-
132
103
  - (void)testLaunchUnattachedApp
133
104
  {
134
105
  [FBUnattachedAppLauncher launchAppWithBundleId:SETTINGS_BUNDLE_ID];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {