Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.6.7+15

* Fix element type in XCUITests to look for staticText type when searching for texts.
* See https://github.com/flutter/flutter/issues/71927
* Minor update in XCUITests to search for different elements on iOS 14 and above.

## 0.6.7+14

* Set up XCUITests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,33 @@ - (void)setUp {
self.continueAfterFailure = NO;
self.app = [[XCUIApplication alloc] init];
[self.app launch];
__weak typeof(self) weakSelf = self;
[self addUIInterruptionMonitorWithDescription:@"Permission popups"
handler:^BOOL(XCUIElement* _Nonnull interruptingElement) {
XCUIElement* ok = interruptingElement.buttons[@"OK"];
if (ok.exists) {
[ok tap];
}
// iOS 14.
XCUIElement* allPhotoPermission =
interruptingElement
.buttons[@"Allow Access to All Photos"];
if (allPhotoPermission.exists) {
if (@available(iOS 14, *)) {
XCUIElement* allPhotoPermission =
interruptingElement
.buttons[@"Allow Access to All Photos"];
if (![allPhotoPermission waitForExistenceWithTimeout:
kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@",
self.app.debugDescription);
XCTFail(@"Failed due to not able to find "
@"allPhotoPermission button with %@ seconds",
@(kElementWaitingTime));
}
[allPhotoPermission tap];
} else {
XCUIElement* ok = interruptingElement.buttons[@"OK"];
if (![ok waitForExistenceWithTimeout:
kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@",
self.app.debugDescription);
XCTFail(@"Failed due to not able to find ok button "
@"with %@ seconds",
@(kElementWaitingTime));
}
[ok tap];
}
return YES;
}];
Expand Down Expand Up @@ -92,10 +107,21 @@ - (void)launchPickerAndCancel {
[cancelButton tap];

// Find the "not picked image text".
XCUIElement* imageNotPickedText = [self.app.otherElements
XCUIElement* imageNotPickedText = [self.app.staticTexts
elementMatchingPredicate:[NSPredicate
predicateWithFormat:@"label == %@",
@"You have not yet picked an image."]];
if (![imageNotPickedText waitForExistenceWithTimeout:kElementWaitingTime]) {
// Before https://github.com/flutter/engine/pull/22811 the label's a11y type was otherElements.
// TODO(cyanglaz): Remove this after
// https://github.com/flutter/flutter/commit/057e8230743ec96f33b73948ccd6b80081e3615e rolled to
// stable.
// https://github.com/flutter/flutter/issues/71927
imageNotPickedText = [self.app.otherElements
elementMatchingPredicate:[NSPredicate
predicateWithFormat:@"label == %@",
@"You have not yet picked an image."]];
}
if (![imageNotPickedText waitForExistenceWithTimeout:kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@", self.app.debugDescription);
XCTFail(@"Failed due to not able to find imageNotPickedText with %@ seconds",
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker
description: Flutter plugin for selecting images from the Android and iOS image
library, and taking new pictures with the camera.
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
version: 0.6.7+14
version: 0.6.7+15

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions packages/integration_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

* Remove usages of deprecated `List` constructor.

## 1.0.0

* Public stable release of plugin.
Expand Down
4 changes: 2 additions & 2 deletions packages/integration_test/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Response {

/// Create a list of Strings from [_failureDetails].
List<String> _failureDetailsAsString() {
final List<String> list = List<String>();
final List<String> list = <String>[];
if (_failureDetails == null || _failureDetails.isEmpty) {
return list;
}
Expand All @@ -100,7 +100,7 @@ class Response {

/// Creates a [Failure] list using a json response.
static List<Failure> _failureDetailsFromJson(List<dynamic> list) {
final List<Failure> failureList = List<Failure>();
final List<Failure> failureList = <Failure>[];
list.forEach((s) {
final String failure = s as String;
failureList.add(Failure.fromJsonString(failure));
Expand Down
2 changes: 1 addition & 1 deletion packages/integration_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: integration_test
description: Runs tests that use the flutter_test API as integration tests.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test

environment:
Expand Down