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
3955276e
Unverified
Commit
3955276e
authored
Apr 21, 2021
by
Jenn Magder
Committed by
GitHub
Apr 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate ios_add2app_life_cycle to earlgrey 2 and latest iOS SDK (#80822)
parent
63ba1b23
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
179 additions
and
207 deletions
+179
-207
Podfile
dev/integration_tests/ios_add2app_life_cycle/Podfile
+2
-2
build_and_test.sh
...ntegration_tests/ios_add2app_life_cycle/build_and_test.sh
+3
-5
project.pbxproj
..._add2app_life_cycle/ios_add2app.xcodeproj/project.pbxproj
+130
-162
ios_add2app.xcscheme
...app.xcodeproj/xcshareddata/xcschemes/ios_add2app.xcscheme
+10
-14
AppDelegate.h
...on_tests/ios_add2app_life_cycle/ios_add2app/AppDelegate.h
+10
-2
AppDelegate.m
...on_tests/ios_add2app_life_cycle/ios_add2app/AppDelegate.m
+8
-0
Info.plist
..._tests/ios_add2app_life_cycle/ios_add2appTests/Info.plist
+1
-1
IntegrationTests.m
...os_add2app_life_cycle/ios_add2appTests/IntegrationTests.m
+15
-21
No files found.
dev/integration_tests/ios_add2app_life_cycle/Podfile
View file @
3955276e
...
@@ -6,10 +6,10 @@ load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
...
@@ -6,10 +6,10 @@ load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target
'ios_add2app'
do
target
'ios_add2app'
do
install_all_flutter_pods
(
flutter_application_path
)
install_all_flutter_pods
(
flutter_application_path
)
pod
'EarlGreyApp'
end
end
target
'ios_add2appTests'
do
target
'ios_add2appTests'
do
inherit!
:search_paths
install_flutter_engine_pod
install_flutter_engine_pod
pod
'EarlGrey'
pod
'EarlGrey
Test
'
end
end
dev/integration_tests/ios_add2app_life_cycle/build_and_test.sh
View file @
3955276e
...
@@ -12,11 +12,9 @@ pushd flutterapp
...
@@ -12,11 +12,9 @@ pushd flutterapp
popd
popd
pod
install
pod
install
os_version
=
$(
xcrun
--show-sdk-version
--sdk
iphonesimulator
)
xcrun xcodebuild
\
xcodebuild
\
-workspace
ios_add2app.xcworkspace
\
-workspace
ios_add2app.xcworkspace
\
-scheme
ios_add2app
\
-scheme
ios_add2app
\
-sdk
"iphonesimulator
$os_version
"
\
-sdk
"iphonesimulator"
\
-destination
"OS=
$os_version
,name=iPhone X
"
test
-destination
"OS=
latest,name=iPhone 12
"
test
dev/integration_tests/ios_add2app_life_cycle/ios_add2app.xcodeproj/project.pbxproj
View file @
3955276e
This diff is collapsed.
Click to expand it.
dev/integration_tests/ios_add2app_life_cycle/ios_add2app.xcodeproj/xcshareddata/xcschemes/ios_add2app.xcscheme
View file @
3955276e
...
@@ -27,29 +27,27 @@
...
@@ -27,29 +27,27 @@
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"24E221B421A28A0B008ADF09"
BuildableName =
"ios_add2app.app"
BlueprintName =
"ios_add2app"
ReferencedContainer =
"container:ios_add2app.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<Testables>
<Testables>
<TestableReference
<TestableReference
skipped =
"NO"
>
skipped =
"NO"
>
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
24D2933421A29627008787A5
"
BlueprintIdentifier =
"
F73B66AC262F6F87002080A0
"
BuildableName =
"ios_add2appTests.xctest"
BuildableName =
"ios_add2appTests.xctest"
BlueprintName =
"ios_add2appTests"
BlueprintName =
"ios_add2appTests"
ReferencedContainer =
"container:ios_add2app.xcodeproj"
>
ReferencedContainer =
"container:ios_add2app.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</TestableReference>
</TestableReference>
</Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"24E221B421A28A0B008ADF09"
BuildableName =
"ios_add2app.app"
BlueprintName =
"ios_add2app"
ReferencedContainer =
"container:ios_add2app.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
</TestAction>
<LaunchAction
<LaunchAction
buildConfiguration =
"Debug"
buildConfiguration =
"Debug"
...
@@ -71,8 +69,6 @@
...
@@ -71,8 +69,6 @@
ReferencedContainer =
"container:ios_add2app.xcodeproj"
>
ReferencedContainer =
"container:ios_add2app.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildableProductRunnable>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
</LaunchAction>
<ProfileAction
<ProfileAction
buildConfiguration =
"Release"
buildConfiguration =
"Release"
...
...
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/AppDelegate.h
View file @
3955276e
...
@@ -5,8 +5,16 @@
...
@@ -5,8 +5,16 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import <Flutter/Flutter.h>
#import <Flutter/Flutter.h>
@interface
AppDelegate
:
FlutterAppDelegate
#import <EarlGreyTest/GREYHostApplicationDistantObject.h>
@property
(
nonatomic
,
strong
,
readonly
)
FlutterEngine
*
engine
;
NS_ASSUME_NONNULL_BEGIN
@interface
GREYHostApplicationDistantObject
(
AppDelegate
)
-
(
NSNotificationCenter
*
)
notificationCenter
;
@end
@end
@interface
AppDelegate
:
FlutterAppDelegate
@property
(
nonatomic
,
strong
,
readonly
)
FlutterEngine
*
engine
;
@end
NS_ASSUME_NONNULL_END
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/AppDelegate.m
View file @
3955276e
...
@@ -5,6 +5,14 @@
...
@@ -5,6 +5,14 @@
#import "AppDelegate.h"
#import "AppDelegate.h"
#import "MainViewController.h"
#import "MainViewController.h"
@implementation
GREYHostApplicationDistantObject
(
AppDelegate
)
-
(
NSNotificationCenter
*
)
notificationCenter
{
return
[
NSNotificationCenter
defaultCenter
];
}
@end
@interface
AppDelegate
()
@interface
AppDelegate
()
@property
(
nonatomic
,
strong
,
readwrite
)
FlutterEngine
*
engine
;
@property
(
nonatomic
,
strong
,
readwrite
)
FlutterEngine
*
engine
;
...
...
dev/integration_tests/ios_add2app_life_cycle/ios_add2appTests/Info.plist
View file @
3955276e
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
$
(
PRODUCT_NAME
)<
/string
>
<
string
>
$
(
PRODUCT_NAME
)<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
BNDL
<
/string
>
<
string
>
$
(
PRODUCT_BUNDLE_PACKAGE_TYPE
)
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
...
...
dev/integration_tests/ios_add2app_life_cycle/ios_add2appTests/IntegrationTests.m
View file @
3955276e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
#import <EarlGrey/EarlGrey.h>
#import <EarlGrey
Test
/EarlGrey.h>
#import <XCTest/XCTest.h>
#import <XCTest/XCTest.h>
#import "AppDelegate.h"
#import "AppDelegate.h"
...
@@ -13,33 +13,27 @@
...
@@ -13,33 +13,27 @@
@implementation
FlutterTests
@implementation
FlutterTests
-
(
void
)
expectSemanticsNotification
:(
UIViewController
*
)
viewController
-
(
void
)
setUp
{
engine
:(
FlutterEngine
*
)
engine
{
self
.
continueAfterFailure
=
NO
;
// Flutter app will only send semantics update if test passes in main.dart.
XCUIApplication
*
app
=
[[
XCUIApplication
alloc
]
init
];
[
self
expectationForNotification
:
FlutterSemanticsUpdateNotification
object
:
viewController
handler
:
nil
];
[
app
launch
];
[
self
waitForExpectationsWithTimeout
:
30
.
0
handler
:
nil
];
}
-
(
void
)
checkAppConnection
{
FlutterEngine
*
engine
=
[((
AppDelegate
*
)[[
UIApplication
sharedApplication
]
delegate
])
engine
];
UINavigationController
*
navController
=
(
UINavigationController
*
)((
AppDelegate
*
)
[[
UIApplication
sharedApplication
]
delegate
])
.
window
.
rootViewController
;
__weak
UIViewController
*
weakViewController
=
navController
.
visibleViewController
;
[
self
expectSemanticsNotification
:
weakViewController
engine
:
engine
];
GREYAssertNotNil
(
weakViewController
,
@"Expected non-nil FullScreenViewController."
);
}
}
-
(
void
)
testFullScreenCanPop
{
-
(
void
)
testFullScreenCanPop
{
XCTestExpectation
*
notificationReceived
=
[
self
expectationWithDescription
:
@"Remote semantics notification"
];
NSNotificationCenter
*
notificationCenter
=
[[
GREYHostApplicationDistantObject
sharedInstance
]
notificationCenter
];
id
observer
=
[
notificationCenter
addObserverForName
:
FlutterSemanticsUpdateNotification
object
:
nil
queue
:
nil
usingBlock
:^
(
NSNotification
*
notification
)
{
XCTAssertTrue
([
notification
.
object
isKindOfClass
:
GREY_REMOTE_CLASS_IN_APP
(
FullScreenViewController
)]);
[
notificationReceived
fulfill
];
}];
[[
EarlGrey
selectElementWithMatcher
:
grey_keyWindow
()]
[[
EarlGrey
selectElementWithMatcher
:
grey_keyWindow
()]
assertWithMatcher
:
grey_sufficientlyVisible
()];
assertWithMatcher
:
grey_sufficientlyVisible
()];
[[
EarlGrey
selectElementWithMatcher
:
grey_buttonTitle
(
@"Full Screen (Cold)"
)]
[[
EarlGrey
selectElementWithMatcher
:
grey_buttonTitle
(
@"Full Screen (Cold)"
)]
performAction
:
grey_tap
()];
performAction
:
grey_tap
()];
[
self
checkAppConnection
];
[
self
waitForExpectationsWithTimeout
:
30
.
0
handler
:
nil
];
[
notificationCenter
removeObserver
:
observer
];
}
}
@end
@end
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