Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8e2333dc
Unverified
Commit
8e2333dc
authored
Sep 07, 2022
by
hellohuanlin
Committed by
GitHub
Sep 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[platform_view]use cmd to uninstall the app (#111139)
parent
c10164c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
39 deletions
+11
-39
native_platform_view_ui_tests_ios.dart
...evicelab/bin/tasks/native_platform_view_ui_tests_ios.dart
+11
-0
PlatformViewUITests.m
..._view_tests/ios/PlatformViewUITests/PlatformViewUITests.m
+0
-39
No files found.
dev/devicelab/bin/tasks/native_platform_view_ui_tests_ios.dart
View file @
8e2333dc
...
...
@@ -15,6 +15,17 @@ Future<void> main() async {
final
String
projectDirectory
=
'
${flutterDirectory.path}
/dev/integration_tests/ios_platform_view_tests'
;
await
inDirectory
(
projectDirectory
,
()
async
{
// To address "Failed to terminate" failure.
section
(
'Uninstall previously installed app'
);
await
flutter
(
'install'
,
options:
<
String
>[
'--uninstall-only'
,
],
);
section
(
'Build clean'
);
await
flutter
(
'clean'
);
...
...
dev/integration_tests/ios_platform_view_tests/ios/PlatformViewUITests/PlatformViewUITests.m
View file @
8e2333dc
...
...
@@ -26,45 +26,6 @@ static const CGFloat kStandardTimeOut = 60.0;
[
super
setUp
];
self
.
continueAfterFailure
=
NO
;
// Delete the previously installed app if needed before running.
// This is to address "Failed to terminate" failure.
// The solution is based on https://stackoverflow.com/questions/50016018/uitest-failed-to-terminate-com-test-abc3708-after-60-0s-state-is-still-runnin
XCUIApplication
*
springboard
=
[[
XCUIApplication
alloc
]
initWithBundleIdentifier
:
@"com.apple.springboard"
];
[
springboard
activate
];
XCUIElement
*
appIcon
=
springboard
.
icons
[
@"ios_platform_view_tests"
];
if
([
appIcon
waitForExistenceWithTimeout
:
kStandardTimeOut
])
{
NSLog
(
@"Deleting previously installed app."
);
// It's possible that app icon is not hittable yet.
NSPredicate
*
hittable
=
[
NSPredicate
predicateWithFormat
:
@"exists == YES AND hittable == YES"
];
[
self
expectationForPredicate
:
hittable
evaluatedWithObject
:
appIcon
handler
:
nil
];
[
self
waitForExpectationsWithTimeout
:
kStandardTimeOut
handler
:
nil
];
// Pressing for 2 seconds will bring up context menu.
// Pressing for 3 seconds will dismiss the context menu and make icons wiggle.
[
appIcon
pressForDuration
:
2
];
// The "Remove App" button in context menu.
XCUIElement
*
contextMenuRemoveButton
=
springboard
.
buttons
[
@"Remove App"
];
XCTAssert
([
contextMenuRemoveButton
waitForExistenceWithTimeout
:
kStandardTimeOut
],
@"The context menu remove app button must appear."
);
[
contextMenuRemoveButton
tap
];
// Tap the delete confirmation
XCUIElement
*
deleteConfirmationButton
=
springboard
.
alerts
.
buttons
[
@"Delete App"
];
XCTAssert
([
deleteConfirmationButton
waitForExistenceWithTimeout
:
kStandardTimeOut
],
@"The first delete confirmation button must appear."
);
[
deleteConfirmationButton
tap
];
// Tap the second delete confirmation
XCUIElement
*
secondDeleteConfirmationButton
=
springboard
.
alerts
.
buttons
[
@"Delete"
];
XCTAssert
([
secondDeleteConfirmationButton
waitForExistenceWithTimeout
:
kStandardTimeOut
],
@"The second delete confirmation button must appear."
);
[
secondDeleteConfirmationButton
tap
];
[
NSThread
sleepForTimeInterval
:
3
];
}
else
{
NSLog
(
@"No previously installed app found."
);
}
self
.
app
=
[[
XCUIApplication
alloc
]
init
];
[
self
.
app
launch
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment