Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: tune testCameraRollAlert for CI env #828

Merged
merged 3 commits into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions WebDriverAgentTests/IntegrationTests/FBAlertTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,22 @@ - (void)testNotificationAlert
XCTAssertTrue([alert.text containsString:@"Notifications may include"]);
}

// It worked locally but CI did not.
// This test case depends on the local app permission state.
- (void)testCameraRollAlert
{
XCTSkip(@"The alert depends on the permission condition. Azure CI env might have an issue to handle permission.");

FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication];
XCTAssertNil(alert.text);

[self.testedApplication.buttons[@"Create Camera Roll Alert"] tap];
FBAssertWaitTillBecomesTrue(alert.isPresent);

XCTAssertTrue([alert.text containsString:@"Would Like to Access Your Photos"]);
// "Would Like to Access Your Photos" or "Would Like to Access Your Photo Library" displayes on the alert button.
XCTAssertTrue([alert.text containsString:@"Would Like to Access Your Photo"]);
// iOS 15 has different UI flow
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"15.0")) {
[[FBAlert alertWithApplication:self.testedApplication] dismissWithError:nil];
// CI env could take longer time to show up the button, thus it needs to wait a bit.
XCTAssertTrue([self.testedApplication.buttons[@"Cancel"] waitForExistenceWithTimeout:30.0]);
[self.testedApplication.buttons[@"Cancel"] tap];
}
}
Expand Down