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
ee98003e
Unverified
Commit
ee98003e
authored
Aug 30, 2022
by
hellohuanlin
Committed by
GitHub
Aug 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[platform_view]add timeout for alert buttons and a few other changes to fix a test flake (#110516)
parent
99372ba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
PlatformViewUITests.m
..._view_tests/ios/PlatformViewUITests/PlatformViewUITests.m
+21
-8
No files found.
dev/integration_tests/ios_platform_view_tests/ios/PlatformViewUITests/PlatformViewUITests.m
View file @
ee98003e
...
@@ -36,17 +36,30 @@ static const CGFloat kStandardTimeOut = 60.0;
...
@@ -36,17 +36,30 @@ static const CGFloat kStandardTimeOut = 60.0;
if
([
appIcon
waitForExistenceWithTimeout
:
kStandardTimeOut
])
{
if
([
appIcon
waitForExistenceWithTimeout
:
kStandardTimeOut
])
{
NSLog
(
@"Deleting previously installed app."
);
NSLog
(
@"Deleting previously installed app."
);
// Make icons wiggle
// It's possible that app icon is not hittable yet.
[
appIcon
pressForDuration
:
3
];
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 "x" button
[
appIcon
.
buttons
[
@"DeleteButton"
]
tap
];
// Tap the delete confirmation
// Tap the delete confirmation
[
springboard
.
alerts
.
buttons
[
@"Delete App"
]
tap
];
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
// Tap the second delete confirmation
[
springboard
.
alerts
.
buttons
[
@"Delete"
]
tap
];
XCUIElement
*
secondDeleteConfirmationButton
=
springboard
.
alerts
.
buttons
[
@"Delete"
];
// Press home button to stop wiggling
XCTAssert
([
secondDeleteConfirmationButton
waitForExistenceWithTimeout
:
kStandardTimeOut
],
@"The second delete confirmation button must appear."
);
[
XCUIDevice
.
sharedDevice
pressButton
:
XCUIDeviceButtonHome
];
[
secondDeleteConfirmationButton
tap
];
[
NSThread
sleepForTimeInterval
:
3
];
[
NSThread
sleepForTimeInterval
:
3
];
}
else
{
}
else
{
NSLog
(
@"No previously installed app found."
);
NSLog
(
@"No previously installed app found."
);
...
...
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