updated integration tests

This commit is contained in:
Lorenzo Pichilli 2022-04-18 02:59:46 +02:00
parent 75c7473e3e
commit 83dae97fda
7 changed files with 34 additions and 57 deletions

View File

@ -1 +1 @@
final environment = {"NODE_SERVER_IP":"192.168.1.129"};
final environment = {"NODE_SERVER_IP":"192.168.1.123"};

View File

@ -397,7 +397,7 @@ void main() {
late File fileJs;
setUpAll(() async {
appSupportDir = (await getApplicationSupportDirectory())!;
appSupportDir = (await getApplicationSupportDirectory());
final Directory htmlFolder = Directory('${appSupportDir.path}/html/');
if (!await htmlFolder.exists()) {
@ -476,7 +476,7 @@ void main() {
}, skip: !Platform.isIOS);
testWidgets(
'loadUrl with file:// scheme and iosAllowingReadAccessTo argument',
'loadUrl with file:// scheme and allowingReadAccessTo argument',
(WidgetTester tester) async {
final Completer<ConsoleMessage?> consoleMessageShouldNotComplete =
Completer<ConsoleMessage?>();
@ -511,7 +511,7 @@ void main() {
controller.loadUrl(
urlRequest:
URLRequest(url: Uri.parse('file://${fileHtml.path}')),
iosAllowingReadAccessTo:
allowingReadAccessTo:
Uri.parse('file://${appSupportDir.path}/'));
},
onConsoleMessage: (controller, consoleMessage) {
@ -1558,6 +1558,7 @@ void main() {
onWebViewCreated: (controller) {
controllerCompleter.complete(controller);
},
initialUrlRequest: URLRequest(url: Uri.parse("about:blank")),
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
javaScriptEnabled: true,
@ -3804,7 +3805,7 @@ setTimeout(function() {
""",
encoding: 'utf-8',
mimeType: 'text/html',
androidHistoryUrl: Uri.parse("https://flutter.dev"),
historyUrl: Uri.parse("https://flutter.dev"),
baseUrl: Uri.parse("https://flutter.dev"));
await pageLoads.stream.first;
@ -4550,7 +4551,7 @@ setTimeout(function() {
await pageLoaded.future;
await expectLater(
controller.zoomBy(zoomFactor: 3.0, iosAnimated: true), completes);
controller.zoomBy(zoomFactor: 3.0, animated: true), completes);
});
testWidgets('getZoomScale', (WidgetTester tester) async {
@ -4853,7 +4854,7 @@ setTimeout(function() {
fileName = fileName + WebArchiveFormat.WEBARCHIVE.toValue();
}
var fullPath = supportDir!.path + Platform.pathSeparator + fileName;
var fullPath = supportDir.path + Platform.pathSeparator + fileName;
var path = await controller.saveWebArchive(filePath: fullPath);
expect(path, isNotNull);
expect(path, endsWith(fileName));

View File

@ -1,18 +0,0 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
# This is a generated file; do not edit or check into version control.
#
Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '9.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end

View File

@ -3,12 +3,11 @@
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/2.10.4"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
export "PACKAGE_CONFIG=.packages"

View File

@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */
020EF14E4245221B2C22ACE5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0FC2CF7A6002799890B3102 /* Pods_Runner.framework */; };
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
25A517508F43E58C47090625 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
25A517508F43E58C47090625 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
61FF730023634CA10069C557 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61FF72FF23634CA10069C557 /* libsqlite3.tbd */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
@ -58,7 +58,7 @@
buildActionMask = 2147483647;
files = (
61FF730023634CA10069C557 /* libsqlite3.tbd in Frameworks */,
25A517508F43E58C47090625 /* BuildFile in Frameworks */,
25A517508F43E58C47090625 /* (null) in Frameworks */,
020EF14E4245221B2C22ACE5 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -451,15 +451,12 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "flutter-inappwebviewExample";
PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -482,15 +479,12 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.pichillilorenzo.flutter_inappwebviewExample;
PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;

View File

@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSDocumentsFolderUsageDescription</key>
<string>InAppWebView requires access to documents folder</string>
<key>NSMicrophoneUsageDescription</key>
<string>InAppWebView requires access to mic.</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@ -28,19 +24,31 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSBonjourServices</key>
<array>
<string>_dartobservatory._tcp</string>
</array>
<key>NSCameraUsageDescription</key>
<string>InAppWebView requires access to cam.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>InAppWebView requires access to documents folder</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Allow Flutter tools on your computer to connect and debug your application.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Need location</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Need location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Need location</string>
<key>NSMicrophoneUsageDescription</key>
<string>InAppWebView requires access to mic.</string>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
@ -63,15 +71,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSBonjourServices</key>
<array>
<string>_dartobservatory._tcp</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSCameraUsageDescription</key>
<string>InAppWebView requires access to cam.</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Allow Flutter tools on your computer to connect and debug your application.</string>
</dict>
</plist>

View File

@ -7,8 +7,8 @@ function error() {
echo "$@" 1>&2
}
# on macOS local IP can be found using $(ipconfig getifaddr en0)
# on linux local IP can be found using $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') or $(ip route get 1 | awk '{print $NF;exit}')
# on macOS local IP can be found using something like $(ipconfig getifaddr en0)
# on linux local IP can be found using something like $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') or $(ip route get 1 | awk '{print $NF;exit}')
export NODE_SERVER_IP=$1
FAILED=0
@ -17,6 +17,7 @@ dart $PROJECT_DIR/tool/env.dart
cd $PROJECT_DIR/nodejs_server_test_auth_basic_and_ssl
node index.js &
flutter --version
flutter clean
cd $PROJECT_DIR/example
flutter clean