@deque/axe-appium3-webdriveragent 1.7.1 → 2.0.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/README.md +1 -1
- package/WebDriverAgent.xcodeproj/project.pbxproj +61 -3
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +4 -1
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +35 -2
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.h +6 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +100 -23
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m +8 -3
- package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.h +7 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +20 -0
- package/WebDriverAgentLib/Commands/AxeAuthCommands.h +4 -0
- package/WebDriverAgentLib/Commands/AxeAuthCommands.m +113 -56
- package/WebDriverAgentLib/Commands/AxeAutoScanCommands.m +1 -7
- package/WebDriverAgentLib/Commands/AxeScanCommands.m +57 -315
- package/WebDriverAgentLib/Commands/FBCustomCommands.m +8 -0
- package/WebDriverAgentLib/Commands/FBElementCommands.m +12 -5
- package/WebDriverAgentLib/Commands/FBSessionCommands.m +1 -1
- package/WebDriverAgentLib/Info.plist +2 -2
- package/WebDriverAgentLib/Routing/FBSession.m +2 -2
- package/WebDriverAgentLib/Utilities/FBConfiguration.h +2 -0
- package/WebDriverAgentLib/Utilities/FBConfiguration.m +1 -0
- package/WebDriverAgentLib/Utilities/FBHIDOperations.h +41 -0
- package/WebDriverAgentLib/Utilities/FBHIDOperations.m +244 -0
- package/WebDriverAgentLib/Utilities/FBSettings.h +1 -0
- package/WebDriverAgentLib/Utilities/FBSettings.m +1 -0
- package/WebDriverAgentLib/Utilities/FBSettingsHandler.m +26 -2
- package/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m +11 -7
- package/WebDriverAgentTests/IntegrationTests/FBElementAttributeTests.m +44 -0
- package/WebDriverAgentTests/IntegrationTests/FBTypingTest.m +33 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +111 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceHelperTests.m +97 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceRotationTests.m +53 -0
- package/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFocusIntegrationTests.m +21 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAAppLifecycleIntegrationTests.swift +12 -0
- package/axeDevToolsXCUI.xcframework/Info.plist +3 -3
- package/axeDevToolsXCUI.xcframework/LICENSE-3RD-PARTY-axe-devtools-ios.md +1 -1
- package/axeDevToolsXCUI.xcframework/{axe-devtools-ios-4.3.1.cdx.json → axe-devtools-ios-5.0.0.cdx.json} +6 -6
- package/axeDevToolsXCUI.xcframework/{axe-devtools-ios-4.3.1.spdx.json → axe-devtools-ios-5.0.0.spdx.json} +5 -5
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/AxeTestBundleObserver.h +0 -1
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI-Swift.h +82 -228
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Info.plist +4 -4
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.abi.json +3120 -5759
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.private.swiftinterface +53 -168
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.swiftinterface +53 -168
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/axeDevToolsXCUI +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/AxeTestBundleObserver.h +0 -1
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI-Swift.h +164 -456
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Info.plist +4 -4
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.abi.json +3120 -5759
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +53 -168
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +53 -168
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +3120 -5759
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +53 -168
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +53 -168
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/_CodeSignature/CodeResources +25 -25
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/axeDevToolsXCUI +0 -0
- package/build/lib/webdriveragent.d.ts.map +1 -1
- package/build/lib/webdriveragent.js +1 -2
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/webdriveragent.ts +1 -2
- package/package.json +8 -10
|
@@ -9,15 +9,29 @@
|
|
|
9
9
|
#import <XCTest/XCTest.h>
|
|
10
10
|
|
|
11
11
|
#import <mach/mach_time.h>
|
|
12
|
+
#import <math.h>
|
|
12
13
|
|
|
13
14
|
#import "FBIntegrationTestCase.h"
|
|
14
15
|
#import "FBElement.h"
|
|
16
|
+
#import "FBSession.h"
|
|
17
|
+
#import "FBSessionCommands.h"
|
|
15
18
|
#import "FBMacros.h"
|
|
16
19
|
#import "FBTestMacros.h"
|
|
17
20
|
#import "XCUIApplication.h"
|
|
18
21
|
#import "XCUIApplication+FBHelpers.h"
|
|
19
22
|
#import "XCUIElement+FBIsVisible.h"
|
|
20
23
|
#import "FBXCodeCompatibility.h"
|
|
24
|
+
#import "FBConfiguration.h"
|
|
25
|
+
#import "FBScreen.h"
|
|
26
|
+
#import "FBRunLoopSpinner.h"
|
|
27
|
+
#import "XCUIDevice+FBHinge.h"
|
|
28
|
+
|
|
29
|
+
// Exercise the session-start resume path without creating a second session.
|
|
30
|
+
@interface FBSessionCommands (FBActivationTests)
|
|
31
|
+
+ (id)activateBackgroundApplication:(XCUIApplication *)app
|
|
32
|
+
bundleID:(NSString *)bundleID
|
|
33
|
+
initialUrl:(nullable NSString *)initialUrl;
|
|
34
|
+
@end
|
|
21
35
|
|
|
22
36
|
void calculateMaxTreeDepth(NSDictionary *tree, NSNumber *currentDepth, NSNumber** maxDepth) {
|
|
23
37
|
if (nil == maxDepth) {
|
|
@@ -83,6 +97,103 @@ void calculateMaxTreeDepth(NSDictionary *tree, NSNumber *currentDepth, NSNumber*
|
|
|
83
97
|
XCTAssertTrue(self.testedApplication.buttons[@"Alerts"].exists);
|
|
84
98
|
}
|
|
85
99
|
|
|
100
|
+
- (void)testInputAfterDeactivate
|
|
101
|
+
{
|
|
102
|
+
[self verifyInputAfterBackgroundWithMode:0];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
- (void)testInputAfterSessionActivate
|
|
106
|
+
{
|
|
107
|
+
[self verifyInputAfterBackgroundWithMode:1];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
- (void)testInputAfterSessionLaunch
|
|
111
|
+
{
|
|
112
|
+
[self verifyInputAfterBackgroundWithMode:2];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
- (void)testInputAfterSessionStartActivate
|
|
116
|
+
{
|
|
117
|
+
[self verifyInputAfterBackgroundWithMode:3];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
- (void)verifyInputAfterBackgroundWithMode:(NSUInteger)mode
|
|
121
|
+
{
|
|
122
|
+
XCTSkipIf(self.class.isRunningInCI, @"Immediate input after activation is unreliable on slow CI hosts");
|
|
123
|
+
XCUIDevice *device = XCUIDevice.sharedDevice;
|
|
124
|
+
BOOL canFold = NO;
|
|
125
|
+
#if TARGET_OS_SIMULATOR
|
|
126
|
+
canFold = device.fb_canAttemptSimulatedHingeAngleInjection;
|
|
127
|
+
#endif
|
|
128
|
+
NSNumber *originalAngle = canFold ? [device fb_getSimulatedHingeAngle:nil] : nil;
|
|
129
|
+
NSNumber *originalDisplay = FBConfiguration.sharedInstance.currentDisplayId;
|
|
130
|
+
if (canFold) {
|
|
131
|
+
XCTAssertNotNil(originalAngle);
|
|
132
|
+
}
|
|
133
|
+
BOOL (^setAngleAndWait)(NSNumber *) = ^BOOL(NSNumber *angle) {
|
|
134
|
+
if (![device fb_setSimulatedHingeAngle:angle.doubleValue error:nil]) {
|
|
135
|
+
return NO;
|
|
136
|
+
}
|
|
137
|
+
return [[[FBRunLoopSpinner new] timeout:5] spinUntilTrue:^BOOL{
|
|
138
|
+
NSNumber *reading = [device fb_getSimulatedHingeAngle:nil];
|
|
139
|
+
return nil != reading && fabs(reading.doubleValue - angle.doubleValue) < 1;
|
|
140
|
+
}];
|
|
141
|
+
};
|
|
142
|
+
FBSession *session = mode != 0 ? [FBSession initWithApplication:self.testedApplication] : nil;
|
|
143
|
+
@try {
|
|
144
|
+
for (NSNumber *angle in (canFold ? @[@0, @90, @180] : @[@0])) {
|
|
145
|
+
if (canFold) {
|
|
146
|
+
XCTAssertTrue(setAngleAndWait(angle), @"Hinge did not reach %@ degrees", angle);
|
|
147
|
+
for (NSDictionary *screen in [FBScreen screensWithError:nil]) {
|
|
148
|
+
if ([screen[@"isMain"] boolValue] == (angle.intValue == 0)) {
|
|
149
|
+
FBConfiguration.sharedInstance.currentDisplayId = screen[@"displayId"];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
for (NSNumber *duration in @[@0, @2]) {
|
|
154
|
+
[self launchApplication];
|
|
155
|
+
NSError *error = nil;
|
|
156
|
+
if (mode != 0) {
|
|
157
|
+
XCTAssertTrue([device fb_goToHomescreenWithError:&error]);
|
|
158
|
+
XCTAssertTrue([[[FBRunLoopSpinner new] timeout:5] spinUntilTrue:^BOOL{
|
|
159
|
+
XCUIApplicationState state = self.testedApplication.state;
|
|
160
|
+
return state == XCUIApplicationStateRunningBackground
|
|
161
|
+
|| state == XCUIApplicationStateRunningBackgroundSuspended;
|
|
162
|
+
}]);
|
|
163
|
+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:duration.doubleValue]];
|
|
164
|
+
XCUIApplicationState state = self.testedApplication.state;
|
|
165
|
+
XCTAssertTrue(state == XCUIApplicationStateRunningBackground
|
|
166
|
+
|| state == XCUIApplicationStateRunningBackgroundSuspended,
|
|
167
|
+
@"Expected a background app before activation (angle %@, duration %@), got %lu",
|
|
168
|
+
angle, duration, (unsigned long)state);
|
|
169
|
+
if (mode == 1) {
|
|
170
|
+
[session activateApplicationWithBundleId:self.testedApplication.bundleID];
|
|
171
|
+
} else if (mode == 2) {
|
|
172
|
+
[session launchApplicationWithBundleId:self.testedApplication.bundleID
|
|
173
|
+
shouldWaitForQuiescence:nil arguments:nil environment:nil];
|
|
174
|
+
} else {
|
|
175
|
+
XCTAssertNil([FBSessionCommands activateBackgroundApplication:self.testedApplication
|
|
176
|
+
bundleID:self.testedApplication.bundleID
|
|
177
|
+
initialUrl:nil]);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
XCTAssertTrue([self.testedApplication fb_deactivateWithDuration:duration.doubleValue error:&error]);
|
|
181
|
+
}
|
|
182
|
+
XCTAssertNil(error);
|
|
183
|
+
// Existence/foreground checks alone miss lost input. Do not add a
|
|
184
|
+
// delay or retry: this first tap must actually open the alerts page.
|
|
185
|
+
[self.testedApplication.buttons[@"Alerts"] tap];
|
|
186
|
+
XCTAssertTrue([self.testedApplication.buttons[FBShowAlertButtonName] waitForExistenceWithTimeout:2]);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
} @finally {
|
|
190
|
+
[session kill];
|
|
191
|
+
BOOL restored = nil == originalAngle || setAngleAndWait(originalAngle);
|
|
192
|
+
FBConfiguration.sharedInstance.currentDisplayId = originalDisplay;
|
|
193
|
+
XCTAssertTrue(restored, @"Hinge did not return to %@ degrees", originalAngle);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
86
197
|
- (void)testActiveApplication
|
|
87
198
|
{
|
|
88
199
|
XCUIApplication *systemApp = XCUIApplication.fb_systemApplication;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
#import <XCTest/XCTest.h>
|
|
10
|
+
#import <math.h>
|
|
10
11
|
|
|
11
12
|
#import "FBIntegrationTestCase.h"
|
|
12
13
|
#import "FBImageUtils.h"
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
#import "XCUIApplication.h"
|
|
16
17
|
#import "XCUIApplication+FBHelpers.h"
|
|
17
18
|
#import "XCUIDevice+FBHelpers.h"
|
|
19
|
+
#import "XCUIDevice+FBHinge.h"
|
|
18
20
|
#import "XCUIDevice+FBRotation.h"
|
|
19
21
|
#import "XCUIScreen.h"
|
|
20
22
|
|
|
@@ -104,6 +106,53 @@
|
|
|
104
106
|
FBAssertWaitTillBecomesTrue([XCUIApplication fb_activeApplication].icons[@"Safari"].exists);
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
- (void)testHomeButtonBackgroundsApplication
|
|
110
|
+
{
|
|
111
|
+
XCUIDevice *device = XCUIDevice.sharedDevice;
|
|
112
|
+
BOOL hasHinge = NO;
|
|
113
|
+
#if TARGET_OS_SIMULATOR
|
|
114
|
+
hasHinge = device.fb_canAttemptSimulatedHingeAngleInjection;
|
|
115
|
+
#endif
|
|
116
|
+
NSNumber *originalAngle = hasHinge ? [device fb_getSimulatedHingeAngle:nil] : nil;
|
|
117
|
+
if (hasHinge && nil == originalAngle) {
|
|
118
|
+
XCTFail(@"Cannot read the original hinge angle");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
BOOL (^setAngleAndWait)(NSNumber *) = ^BOOL(NSNumber *angle) {
|
|
122
|
+
return [device fb_setSimulatedHingeAngle:angle.doubleValue error:nil]
|
|
123
|
+
&& [[[FBRunLoopSpinner new] timeout:5] spinUntilTrue:^BOOL{
|
|
124
|
+
NSNumber *reading = [device fb_getSimulatedHingeAngle:nil];
|
|
125
|
+
return nil != reading && fabs(reading.doubleValue - angle.doubleValue) < 1;
|
|
126
|
+
}];
|
|
127
|
+
};
|
|
128
|
+
@try {
|
|
129
|
+
for (NSNumber *angle in (hasHinge ? @[@0, @180] : @[@0])) {
|
|
130
|
+
if (hasHinge) {
|
|
131
|
+
if (!setAngleAndWait(angle)) {
|
|
132
|
+
XCTFail(@"Hinge angle did not reach %@", angle);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (NSUInteger attempt = 0; attempt < 2; attempt++) {
|
|
137
|
+
[self.testedApplication activate];
|
|
138
|
+
XCTAssertEqual(self.testedApplication.state, XCUIApplicationStateRunningForeground);
|
|
139
|
+
NSError *error = nil;
|
|
140
|
+
XCTAssertTrue([device fb_pressButton:@"home" forDuration:nil error:&error]);
|
|
141
|
+
XCTAssertNil(error);
|
|
142
|
+
XCTAssertTrue([[[FBRunLoopSpinner new] timeout:5] spinUntilTrue:^BOOL{
|
|
143
|
+
return self.testedApplication.state == XCUIApplicationStateRunningBackground
|
|
144
|
+
|| self.testedApplication.state == XCUIApplicationStateRunningBackgroundSuspended;
|
|
145
|
+
}]);
|
|
146
|
+
XCTAssertTrue([XCUIApplication.fb_activeApplication.bundleID isEqualToString:@"com.apple.springboard"]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
} @finally {
|
|
150
|
+
if (nil != originalAngle) {
|
|
151
|
+
XCTAssertTrue(setAngleAndWait(originalAngle));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
107
156
|
- (void)testLockUnlockScreen
|
|
108
157
|
{
|
|
109
158
|
XCTAssertFalse([[XCUIDevice sharedDevice] fb_isScreenLocked]);
|
|
@@ -116,6 +165,54 @@
|
|
|
116
165
|
XCTAssertNil(error);
|
|
117
166
|
}
|
|
118
167
|
|
|
168
|
+
- (void)testRepeatedLockUnlockAcrossHingePoses
|
|
169
|
+
{
|
|
170
|
+
XCTSkipIf(self.class.isRunningInCI, @"Repeated lock/unlock is unreliable on slow CI hosts");
|
|
171
|
+
XCUIDevice *device = XCUIDevice.sharedDevice;
|
|
172
|
+
BOOL hasHinge = NO;
|
|
173
|
+
#if TARGET_OS_SIMULATOR
|
|
174
|
+
hasHinge = device.fb_canAttemptSimulatedHingeAngleInjection;
|
|
175
|
+
#endif
|
|
176
|
+
NSNumber *originalAngle = hasHinge ? [device fb_getSimulatedHingeAngle:nil] : nil;
|
|
177
|
+
if (hasHinge) {
|
|
178
|
+
XCTAssertNotNil(originalAngle);
|
|
179
|
+
}
|
|
180
|
+
BOOL (^setAngleAndWait)(NSNumber *) = ^BOOL(NSNumber *angle) {
|
|
181
|
+
return [device fb_setSimulatedHingeAngle:angle.doubleValue error:nil]
|
|
182
|
+
&& [[[FBRunLoopSpinner new] timeout:5] spinUntilTrue:^BOOL{
|
|
183
|
+
NSNumber *reading = [device fb_getSimulatedHingeAngle:nil];
|
|
184
|
+
return nil != reading && fabs(reading.doubleValue - angle.doubleValue) < 1;
|
|
185
|
+
}];
|
|
186
|
+
};
|
|
187
|
+
@try {
|
|
188
|
+
for (NSNumber *angle in (hasHinge ? @[@0, @90, @180] : @[@0])) {
|
|
189
|
+
if (hasHinge) {
|
|
190
|
+
XCTAssertTrue(setAngleAndWait(angle));
|
|
191
|
+
}
|
|
192
|
+
for (NSUInteger attempt = 0; attempt < 3; attempt++) {
|
|
193
|
+
XCTAssertFalse(device.fb_isScreenLocked);
|
|
194
|
+
NSError *error = nil;
|
|
195
|
+
XCTAssertTrue([device fb_lockScreen:&error]);
|
|
196
|
+
XCTAssertNil(error);
|
|
197
|
+
XCTAssertTrue(device.fb_isScreenLocked);
|
|
198
|
+
// Repeating lock must not toggle the screen back to unlocked.
|
|
199
|
+
XCTAssertTrue([device fb_lockScreen:&error]);
|
|
200
|
+
XCTAssertTrue(device.fb_isScreenLocked);
|
|
201
|
+
XCTAssertTrue([device fb_unlockScreen:&error]);
|
|
202
|
+
XCTAssertNil(error);
|
|
203
|
+
XCTAssertFalse(device.fb_isScreenLocked);
|
|
204
|
+
XCTAssertTrue([device fb_unlockScreen:&error]);
|
|
205
|
+
XCTAssertFalse(device.fb_isScreenLocked);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} @finally {
|
|
209
|
+
[device fb_unlockScreen:nil];
|
|
210
|
+
if (nil != originalAngle) {
|
|
211
|
+
XCTAssertTrue(setAngleAndWait(originalAngle));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
119
216
|
- (void)testUrlSchemeActivation
|
|
120
217
|
{
|
|
121
218
|
if (SYSTEM_VERSION_LESS_THAN(@"16.4")) {
|
|
@@ -10,8 +10,13 @@
|
|
|
10
10
|
#import <UIKit/UIKit.h>
|
|
11
11
|
#import "FBIntegrationTestCase.h"
|
|
12
12
|
#import "XCUIDevice+FBRotation.h"
|
|
13
|
+
#import "XCUIDevice+FBHinge.h"
|
|
14
|
+
#import "FBConfiguration.h"
|
|
15
|
+
#import "FBScreen.h"
|
|
16
|
+
#import "FBSession.h"
|
|
13
17
|
|
|
14
18
|
@interface XCUIDeviceRotationTests : FBIntegrationTestCase
|
|
19
|
+
@property (nonatomic, strong) FBSession *session;
|
|
15
20
|
|
|
16
21
|
@end
|
|
17
22
|
|
|
@@ -21,11 +26,13 @@
|
|
|
21
26
|
{
|
|
22
27
|
[super setUp];
|
|
23
28
|
[self launchApplication];
|
|
29
|
+
self.session = [FBSession initWithApplication:self.testedApplication];
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
- (void)tearDown
|
|
27
33
|
{
|
|
28
34
|
[self resetOrientation];
|
|
35
|
+
[self.session kill];
|
|
29
36
|
[super tearDown];
|
|
30
37
|
}
|
|
31
38
|
|
|
@@ -102,4 +109,50 @@
|
|
|
102
109
|
XCTAssertEqual(currentRotation, [XCUIDevice sharedDevice].orientation, @"Device doesnt support tilt, should be at previous orientation");
|
|
103
110
|
}
|
|
104
111
|
|
|
112
|
+
- (void)testRotationOnSelectedDuoDisplay
|
|
113
|
+
{
|
|
114
|
+
#if TARGET_OS_SIMULATOR
|
|
115
|
+
XCUIDevice *device = XCUIDevice.sharedDevice;
|
|
116
|
+
XCTSkipIf(!device.fb_supportsHingeAngleReading || !device.fb_canAttemptSimulatedHingeAngleInjection,
|
|
117
|
+
@"Requires hinge angle reading and injection support");
|
|
118
|
+
NSNumber *originalDisplay = FBConfiguration.sharedInstance.currentDisplayId;
|
|
119
|
+
NSNumber *originalAngle = [device fb_getSimulatedHingeAngle:nil];
|
|
120
|
+
XCTAssertNotNil(originalAngle);
|
|
121
|
+
@try {
|
|
122
|
+
for (NSNumber *angle in @[@0, @90, @180]) {
|
|
123
|
+
XCTAssertTrue([device fb_setSimulatedHingeAngle:angle.doubleValue error:nil]);
|
|
124
|
+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:3]];
|
|
125
|
+
for (NSDictionary *screen in [FBScreen screensWithError:nil]) {
|
|
126
|
+
if ([screen[@"isMain"] boolValue] == (angle.intValue == 0)) {
|
|
127
|
+
FBConfiguration.sharedInstance.currentDisplayId = screen[@"displayId"];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
[self.testedApplication activate];
|
|
131
|
+
NSArray *orientations = @[@(UIDeviceOrientationLandscapeLeft),
|
|
132
|
+
@(UIDeviceOrientationLandscapeRight),
|
|
133
|
+
@(UIDeviceOrientationPortrait)];
|
|
134
|
+
NSArray *labels = @[@"LandscapeRight", @"LandscapeLeft", @"Portrait"];
|
|
135
|
+
for (NSUInteger i = 0; i < orientations.count; i++) {
|
|
136
|
+
UIDeviceOrientation orientation = [orientations[i] integerValue];
|
|
137
|
+
XCTAssertTrue([device fb_setDeviceInterfaceOrientation:orientation]);
|
|
138
|
+
XCTAssertTrue([self.testedApplication.staticTexts[labels[i]] waitForExistenceWithTimeout:5]);
|
|
139
|
+
XCTAssertEqual(device.orientation, orientation);
|
|
140
|
+
}
|
|
141
|
+
BOOL rotated = [device fb_setDeviceRotation:@{@"x": @0, @"y": @0, @"z": @270}];
|
|
142
|
+
XCTAssertTrue(rotated);
|
|
143
|
+
XCTAssertTrue(self.testedApplication.staticTexts[@"LandscapeRight"].exists);
|
|
144
|
+
}
|
|
145
|
+
} @finally {
|
|
146
|
+
[device fb_setSimulatedHingeAngle:0 error:nil];
|
|
147
|
+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:3]];
|
|
148
|
+
FBConfiguration.sharedInstance.currentDisplayId = nil;
|
|
149
|
+
[device fb_setDeviceInterfaceOrientation:UIDeviceOrientationPortrait];
|
|
150
|
+
if (nil != originalAngle) {
|
|
151
|
+
[device fb_setSimulatedHingeAngle:originalAngle.doubleValue error:nil];
|
|
152
|
+
}
|
|
153
|
+
FBConfiguration.sharedInstance.currentDisplayId = originalDisplay;
|
|
154
|
+
}
|
|
155
|
+
#endif
|
|
156
|
+
}
|
|
157
|
+
|
|
105
158
|
@end
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
#import <XCTest/XCTest.h>
|
|
10
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
11
|
+
#import "XCUIDevice+FBHelpers.h"
|
|
10
12
|
|
|
11
13
|
#if TARGET_OS_TV
|
|
12
14
|
|
|
@@ -79,6 +81,25 @@
|
|
|
79
81
|
XCTAssertFalse(disabled.hasFocus);
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
- (void)testHomeAndInputAfterDeactivate
|
|
85
|
+
{
|
|
86
|
+
NSError *error = nil;
|
|
87
|
+
XCTAssertTrue([XCUIDevice.sharedDevice fb_goToHomescreenWithError:&error], @"%@", error);
|
|
88
|
+
XCTAssertNotEqual(self.app.state, XCUIApplicationStateRunningForeground);
|
|
89
|
+
XCTAssertEqual(XCUIApplication.fb_systemApplication.state, XCUIApplicationStateRunningForeground);
|
|
90
|
+
[self.app activate];
|
|
91
|
+
for (NSNumber *duration in @[@0, @2]) {
|
|
92
|
+
[self.app launch];
|
|
93
|
+
XCTAssertTrue([self.app fb_deactivateWithDuration:duration.doubleValue error:&error], @"%@", error);
|
|
94
|
+
XCTAssertEqual(self.app.state, XCUIApplicationStateRunningForeground);
|
|
95
|
+
XCTAssertTrue([self.app.buttons[@"cell_1_2"] fb_selectWithError:&error], @"%@", error);
|
|
96
|
+
XCTNSPredicateExpectation *updated = [[XCTNSPredicateExpectation alloc]
|
|
97
|
+
initWithPredicate:[NSPredicate predicateWithFormat:@"label == %@", @"cell_1_2"]
|
|
98
|
+
object:self.app.staticTexts[@"lastSelectedLabel"]];
|
|
99
|
+
[self waitForExpectations:@[updated] timeout:5];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
82
103
|
@end
|
|
83
104
|
|
|
84
105
|
#endif
|
|
@@ -34,4 +34,16 @@ final class WDAAppLifecycleIntegrationTests: WDAWatchInProcessTestCase {
|
|
|
34
34
|
app.activate()
|
|
35
35
|
XCTAssertEqual(app.state, .runningForeground)
|
|
36
36
|
}
|
|
37
|
+
func testHomeAndDeactivate() throws {
|
|
38
|
+
try XCUIDevice.shared.fb_goToHomescreen()
|
|
39
|
+
XCTAssertNotEqual(app.state, .runningForeground)
|
|
40
|
+
try XCUIDevice.shared.fb_goToHomescreen()
|
|
41
|
+
XCTAssertNotEqual(app.state, .runningForeground)
|
|
42
|
+
for duration in [0.0, 2.0] {
|
|
43
|
+
app.activate()
|
|
44
|
+
try app.fb_deactivate(withDuration: duration)
|
|
45
|
+
XCTAssertEqual(app.state, .runningForeground)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
}
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
40
40
|
<string>XFWK</string>
|
|
41
41
|
<key>CFBundleShortVersionString</key>
|
|
42
|
-
<string>
|
|
42
|
+
<string>5.0.0</string>
|
|
43
43
|
<key>CFBundleVersion</key>
|
|
44
|
-
<string>
|
|
44
|
+
<string>5.0.0</string>
|
|
45
45
|
<key>DequeMeta</key>
|
|
46
|
-
<string>
|
|
46
|
+
<string>5.0.0</string>
|
|
47
47
|
<key>XCFrameworkFormatVersion</key>
|
|
48
48
|
<string>1.0</string>
|
|
49
49
|
</dict>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bomFormat": "CycloneDX",
|
|
3
3
|
"specVersion": "1.6",
|
|
4
|
-
"serialNumber": "urn:uuid:
|
|
4
|
+
"serialNumber": "urn:uuid:f0c0aed8-7a9b-4642-8563-85747108ed0d",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
|
-
"timestamp": "2026-
|
|
7
|
+
"timestamp": "2026-11-03T17:48:25Z",
|
|
8
8
|
"tools": {
|
|
9
9
|
"components": [
|
|
10
10
|
{
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"component": {
|
|
37
37
|
"group": "",
|
|
38
38
|
"name": "axe-devtools-ios",
|
|
39
|
-
"version": "
|
|
39
|
+
"version": "5.0.0",
|
|
40
40
|
"type": "library",
|
|
41
|
-
"bom-ref": "pkg:swift/github.com/dequelabs/axe-devtools-ios@
|
|
42
|
-
"purl": "pkg:swift/github.com/dequelabs/axe-devtools-ios@
|
|
41
|
+
"bom-ref": "pkg:swift/github.com/dequelabs/axe-devtools-ios@5.0.0",
|
|
42
|
+
"purl": "pkg:swift/github.com/dequelabs/axe-devtools-ios@5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"properties": []
|
|
45
45
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
],
|
|
63
63
|
"dependencies": [
|
|
64
64
|
{
|
|
65
|
-
"ref": "pkg:swift/github.com/dequelabs/axe-devtools-ios@
|
|
65
|
+
"ref": "pkg:swift/github.com/dequelabs/axe-devtools-ios@5.0.0",
|
|
66
66
|
"dependsOn": [
|
|
67
67
|
"pkg:swift/github.com/1024jp/GzipSwift@5.2.0"
|
|
68
68
|
]
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
5
|
"name": "axe-devtools-ios",
|
|
6
|
-
"documentNamespace": "https://anchore.com/syft/dir/axe-devtools-ios-
|
|
6
|
+
"documentNamespace": "https://anchore.com/syft/dir/axe-devtools-ios-52e6fe68-5a34-4ac9-a407-007e1dbd19d3",
|
|
7
7
|
"creationInfo": {
|
|
8
8
|
"licenseListVersion": "3.29",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Organization: Anchore, Inc",
|
|
11
|
-
"Tool: syft-1.
|
|
11
|
+
"Tool: syft-1.55.0"
|
|
12
12
|
],
|
|
13
|
-
"created": "2026-
|
|
13
|
+
"created": "2026-11-03T17:48:26Z"
|
|
14
14
|
},
|
|
15
15
|
"packages": [
|
|
16
16
|
{
|
|
17
17
|
"name": "axe-devtools-ios",
|
|
18
18
|
"SPDXID": "SPDXRef-DocumentRoot-Directory-axe-devtools-ios",
|
|
19
|
-
"versionInfo": "
|
|
19
|
+
"versionInfo": "5.0.0",
|
|
20
20
|
"supplier": "NOASSERTION",
|
|
21
21
|
"downloadLocation": "NOASSERTION",
|
|
22
22
|
"filesAnalyzed": false,
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{
|
|
29
29
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
30
30
|
"referenceType": "purl",
|
|
31
|
-
"referenceLocator": "pkg:swift/github.com/dequelabs/axe-devtools-ios@
|
|
31
|
+
"referenceLocator": "pkg:swift/github.com/dequelabs/axe-devtools-ios@5.0.0"
|
|
32
32
|
}
|
|
33
33
|
]
|
|
34
34
|
},
|
|
@@ -18,7 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
18
18
|
/// The observer automatically registers itself when the class is loaded if XCTest is available.
|
|
19
19
|
/// To receive callbacks, set the onBundleStart and onBundleFinish blocks as early as possible,
|
|
20
20
|
/// ideally in a +load method of your test class.
|
|
21
|
-
API_AVAILABLE(ios(16.0))
|
|
22
21
|
@interface AxeTestBundleObserver : NSObject
|
|
23
22
|
|
|
24
23
|
/// Shared singleton instance
|