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 1 commit
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
Prev Previous commit
Next Next commit
test ci with simple launch
  • Loading branch information
Chris Yang committed Feb 24, 2021
commit 11c8bc3447828feece7ed4393e7f2fe157ed66cb
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ task:
only_if: $CIRRUS_TAG == ''
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: big-sur-xcode-12.4
image: big-sur-xcode-12.3
upgrade_script:
- sudo gem install cocoapods
- flutter channel stable
Expand All @@ -166,7 +166,7 @@ task:
- git submodule update
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-12 com.apple.CoreSimulator.SimRuntime.iOS-14-4 | xargs xcrun simctl boot
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
matrix:
- name: build_all_plugins_ipa
env:
Expand Down Expand Up @@ -202,7 +202,7 @@ task:
- flutter upgrade
- ./script/incremental_build.sh build-examples --ipa
- ./script/incremental_build.sh drive-examples --ios
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmorgan This is required to successfully run the XCUITests.
We never discovered this because we never had a plugin runs both integration tests and XCUITests. PTAL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=14.4"
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=14.3"

# task:
# # Xcode 11 task
Expand Down
68 changes: 31 additions & 37 deletions packages/quick_actions/example/ios/RunnerUITests/RunnerUITests.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,50 @@ @interface RunnerUITests : XCTestCase
@implementation RunnerUITests

- (void)setUp {
[super setUp];
self.continueAfterFailure = NO;
}

- (void)testQuickAction {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app launch];

XCUIElement *appTitle = app.otherElements[@"quick_actions_example"];
if (![appTitle waitForExistenceWithTimeout:0.01]) {
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
XCTFail(@"Failed due to not able to find the appTitle in the app with %@ seconds",
@(kElementWaitingTime));
}
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to remove this logging (and below).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


XCUIElement *actionsReady = app.otherElements[@"actions ready"];
if (![actionsReady waitForExistenceWithTimeout:0.01]) {
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
XCTFail(@"Failed due to not able to find the actionsReady in the app with %@ seconds",
@(kElementWaitingTime));
}

[[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome];

XCUIApplication *springboard =
[[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"];
XCUIElement *quickActionsAppIcon = springboard.icons[@"quick_actions_example"];
if (![quickActionsAppIcon waitForExistenceWithTimeout:kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@", springboard.debugDescription);
XCTFail(@"Failed due to not able to find the example app from springboard with %@ seconds",
@(kElementWaitingTime));
}

[quickActionsAppIcon pressForDuration:2];
XCUIElement *actionOne = springboard.buttons[@"Action one"];
if (![actionOne waitForExistenceWithTimeout:kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@", springboard.debugDescription);
XCTFail(@"Failed due to not able to find the actionOne button from springboard with %@ seconds",
@(kElementWaitingTime));
}

[actionOne tap];

XCUIElement *actionOneConfirmation = app.otherElements[@"action_one"];
if (![actionOneConfirmation waitForExistenceWithTimeout:kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@", springboard.debugDescription);
XCTFail(@"Failed due to not able to find the actionOneConfirmation in the app with %@ seconds",
@(kElementWaitingTime));
}
XCTAssertTrue(actionOneConfirmation.exists);
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
//
// [[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome];
//
// XCUIApplication *springboard =
// [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"];
// XCUIElement *quickActionsAppIcon = springboard.icons[@"quick_actions_example"];
// if (![quickActionsAppIcon waitForExistenceWithTimeout:kElementWaitingTime]) {
// os_log_error(OS_LOG_DEFAULT, "%@", springboard.debugDescription);
// XCTFail(@"Failed due to not able to find the example app from springboard with %@ seconds",
// @(kElementWaitingTime));
// }
//
// [quickActionsAppIcon pressForDuration:2];
// XCUIElement *actionOne = springboard.buttons[@"Action one"];
// if (![actionOne waitForExistenceWithTimeout:kElementWaitingTime]) {
// os_log_error(OS_LOG_DEFAULT, "%@", springboard.debugDescription);
// XCTFail(@"Failed due to not able to find the actionOne button from springboard with %@ seconds",
// @(kElementWaitingTime));
// }
//
// [actionOne tap];
//
// XCUIElement *actionOneConfirmation = app.otherElements[@"action_one"];
// if (![actionOneConfirmation waitForExistenceWithTimeout:kElementWaitingTime]) {
// os_log_error(OS_LOG_DEFAULT, "%@", springboard.debugDescription);
// XCTFail(@"Failed due to not able to find the actionOneConfirmation in the app with %@ seconds",
// @(kElementWaitingTime));
// }
// XCTAssertTrue(actionOneConfirmation.exists);
}

@end