diff --git a/plugin/e2e-tests/.env.example b/example-app/.env.example similarity index 100% rename from plugin/e2e-tests/.env.example rename to example-app/.env.example diff --git a/plugin/e2e-tests/.gitignore b/example-app/.gitignore similarity index 88% rename from plugin/e2e-tests/.gitignore rename to example-app/.gitignore index 3b0b1aea..e36333d8 100644 --- a/plugin/e2e-tests/.gitignore +++ b/example-app/.gitignore @@ -26,7 +26,3 @@ yarn-error.log* # Optional eslint cache .eslintcache - -.ionic/* -!.ionic/e2e.env -!.ionic/wdio.config.ts diff --git a/plugin/e2e-tests/.npmrc b/example-app/.npmrc similarity index 100% rename from plugin/e2e-tests/.npmrc rename to example-app/.npmrc diff --git a/example-app/CHANGELOG.md b/example-app/CHANGELOG.md new file mode 100644 index 00000000..767840ad --- /dev/null +++ b/example-app/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + diff --git a/plugin/e2e-tests/android/.gitignore b/example-app/android/.gitignore similarity index 100% rename from plugin/e2e-tests/android/.gitignore rename to example-app/android/.gitignore diff --git a/plugin/e2e-tests/android/app/.gitignore b/example-app/android/app/.gitignore similarity index 100% rename from plugin/e2e-tests/android/app/.gitignore rename to example-app/android/app/.gitignore diff --git a/plugin/e2e-tests/android/app/build.gradle b/example-app/android/app/build.gradle similarity index 77% rename from plugin/e2e-tests/android/app/build.gradle rename to example-app/android/app/build.gradle index f8a8988d..577b6595 100644 --- a/plugin/e2e-tests/android/app/build.gradle +++ b/example-app/android/app/build.gradle @@ -6,22 +6,20 @@ apply plugin: 'com.android.application' def getApiKey() { Properties properties = new Properties() - if (project.rootProject.file('local.properties').canRead()) { - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - - if(properties.containsKey("REACT_APP_GOOGLE_MAPS_API_KEY")) { - return properties['REACT_APP_GOOGLE_MAPS_API_KEY'] - } - } - return System.getenv('REACT_APP_GOOGLE_MAPS_API_KEY') - } - + if (project.rootProject.file('local.properties').canRead()) { + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + if(properties.containsKey("REACT_APP_GOOGLE_MAPS_API_KEY")) { + return properties['REACT_APP_GOOGLE_MAPS_API_KEY'] + } + } + return System.getenv('REACT_APP_GOOGLE_MAPS_API_KEY') +} android { - namespace "io.ionic.starter" - compileSdkVersion rootProject.ext.compileSdkVersion + namespace = "com.capacitorjs.maps" + compileSdk = rootProject.ext.compileSdkVersion defaultConfig { - applicationId "io.ionic.starter" + applicationId "com.capacitorjs.maps" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 @@ -30,7 +28,7 @@ android { aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 - ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' + ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' } manifestPlaceholders = [MAPS_API_KEY:"${getApiKey()}"] } diff --git a/plugin/e2e-tests/android/app/capacitor.build.gradle b/example-app/android/app/capacitor.build.gradle similarity index 100% rename from plugin/e2e-tests/android/app/capacitor.build.gradle rename to example-app/android/app/capacitor.build.gradle diff --git a/plugin/e2e-tests/android/app/proguard-rules.pro b/example-app/android/app/proguard-rules.pro similarity index 100% rename from plugin/e2e-tests/android/app/proguard-rules.pro rename to example-app/android/app/proguard-rules.pro diff --git a/plugin/e2e-tests/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/example-app/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java similarity index 100% rename from plugin/e2e-tests/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java rename to example-app/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java diff --git a/plugin/e2e-tests/android/app/src/main/AndroidManifest.xml b/example-app/android/app/src/main/AndroidManifest.xml similarity index 95% rename from plugin/e2e-tests/android/app/src/main/AndroidManifest.xml rename to example-app/android/app/src/main/AndroidManifest.xml index bd137e1f..7108f606 100644 --- a/plugin/e2e-tests/android/app/src/main/AndroidManifest.xml +++ b/example-app/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - - - + + example-app + example-app + com.capacitorjs.maps + com.capacitorjs.maps + diff --git a/plugin/e2e-tests/android/app/src/main/res/values/styles.xml b/example-app/android/app/src/main/res/values/styles.xml similarity index 100% rename from plugin/e2e-tests/android/app/src/main/res/values/styles.xml rename to example-app/android/app/src/main/res/values/styles.xml diff --git a/plugin/e2e-tests/android/app/src/main/res/xml/file_paths.xml b/example-app/android/app/src/main/res/xml/file_paths.xml similarity index 100% rename from plugin/e2e-tests/android/app/src/main/res/xml/file_paths.xml rename to example-app/android/app/src/main/res/xml/file_paths.xml diff --git a/plugin/e2e-tests/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/example-app/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java similarity index 100% rename from plugin/e2e-tests/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java rename to example-app/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java diff --git a/plugin/e2e-tests/android/build.gradle b/example-app/android/build.gradle similarity index 84% rename from plugin/e2e-tests/android/build.gradle rename to example-app/android/build.gradle index 75a44853..3bbbf978 100644 --- a/plugin/e2e-tests/android/build.gradle +++ b/example-app/android/build.gradle @@ -7,10 +7,9 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.7.2' - classpath 'com.google.gms:google-services:4.4.2' + classpath 'com.android.tools.build:gradle:8.13.0' + classpath 'com.google.gms:google-services:4.4.4' classpath 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1' - // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/example-app/android/capacitor.settings.gradle b/example-app/android/capacitor.settings.gradle new file mode 100644 index 00000000..8a28d3aa --- /dev/null +++ b/example-app/android/capacitor.settings.gradle @@ -0,0 +1,18 @@ +// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN +include ':capacitor-android' +project(':capacitor-android').projectDir = new File('../../node_modules/.pnpm/@capacitor+android@8.0.1_@capacitor+core@8.0.1/node_modules/@capacitor/android/capacitor') + +include ':capacitor-app' +project(':capacitor-app').projectDir = new File('../../node_modules/.pnpm/@capacitor+app@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/app/android') + +include ':capacitor-google-maps' +project(':capacitor-google-maps').projectDir = new File('../../plugin/android') + +include ':capacitor-haptics' +project(':capacitor-haptics').projectDir = new File('../../node_modules/.pnpm/@capacitor+haptics@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/haptics/android') + +include ':capacitor-keyboard' +project(':capacitor-keyboard').projectDir = new File('../../node_modules/.pnpm/@capacitor+keyboard@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/keyboard/android') + +include ':capacitor-status-bar' +project(':capacitor-status-bar').projectDir = new File('../../node_modules/.pnpm/@capacitor+status-bar@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/status-bar/android') diff --git a/plugin/e2e-tests/android/gradle.properties b/example-app/android/gradle.properties similarity index 99% rename from plugin/e2e-tests/android/gradle.properties rename to example-app/android/gradle.properties index 92710f31..2e87c52f 100644 --- a/plugin/e2e-tests/android/gradle.properties +++ b/example-app/android/gradle.properties @@ -20,4 +20,3 @@ org.gradle.jvmargs=-Xmx1536m # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true - diff --git a/example-app/android/gradle/wrapper/gradle-wrapper.jar b/example-app/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..1b33c55b Binary files /dev/null and b/example-app/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/plugin/e2e-tests/android/gradle/wrapper/gradle-wrapper.properties b/example-app/android/gradle/wrapper/gradle-wrapper.properties similarity index 93% rename from plugin/e2e-tests/android/gradle/wrapper/gradle-wrapper.properties rename to example-app/android/gradle/wrapper/gradle-wrapper.properties index c1d5e018..7705927e 100644 --- a/plugin/e2e-tests/android/gradle/wrapper/gradle-wrapper.properties +++ b/example-app/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/plugin/e2e-tests/android/gradlew b/example-app/android/gradlew similarity index 96% rename from plugin/e2e-tests/android/gradlew rename to example-app/android/gradlew index f5feea6d..23d15a93 100755 --- a/plugin/e2e-tests/android/gradlew +++ b/example-app/android/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -115,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -206,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/plugin/e2e-tests/android/gradlew.bat b/example-app/android/gradlew.bat similarity index 91% rename from plugin/e2e-tests/android/gradlew.bat rename to example-app/android/gradlew.bat index 9b42019c..5eed7ee8 100644 --- a/plugin/e2e-tests/android/gradlew.bat +++ b/example-app/android/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/plugin/e2e-tests/android/settings.gradle b/example-app/android/settings.gradle similarity index 100% rename from plugin/e2e-tests/android/settings.gradle rename to example-app/android/settings.gradle diff --git a/example-app/android/variables.gradle b/example-app/android/variables.gradle new file mode 100644 index 00000000..ee4ba41c --- /dev/null +++ b/example-app/android/variables.gradle @@ -0,0 +1,16 @@ +ext { + minSdkVersion = 24 + compileSdkVersion = 36 + targetSdkVersion = 36 + androidxActivityVersion = '1.11.0' + androidxAppCompatVersion = '1.7.1' + androidxCoordinatorLayoutVersion = '1.3.0' + androidxCoreVersion = '1.17.0' + androidxFragmentVersion = '1.8.9' + coreSplashScreenVersion = '1.2.0' + androidxWebkitVersion = '1.14.0' + junitVersion = '4.13.2' + androidxJunitVersion = '1.3.0' + androidxEspressoCoreVersion = '3.7.0' + cordovaAndroidVersion = '14.0.1' +} \ No newline at end of file diff --git a/example-app/capacitor.config.json b/example-app/capacitor.config.json new file mode 100644 index 00000000..052487cd --- /dev/null +++ b/example-app/capacitor.config.json @@ -0,0 +1,5 @@ +{ + "appId": "com.capacitorjs.maps", + "appName": "example-app", + "webDir": "build" +} diff --git a/plugin/e2e-tests/ionic.config.json b/example-app/ionic.config.json similarity index 72% rename from plugin/e2e-tests/ionic.config.json rename to example-app/ionic.config.json index 43bec272..95507d29 100644 --- a/plugin/e2e-tests/ionic.config.json +++ b/example-app/ionic.config.json @@ -1,5 +1,5 @@ { - "name": "e2e-tests", + "name": "example-app", "integrations": { "capacitor": {} }, diff --git a/plugin/e2e-tests/ios/.gitignore b/example-app/ios/.gitignore similarity index 58% rename from plugin/e2e-tests/ios/.gitignore rename to example-app/ios/.gitignore index 01ad5202..f4702997 100644 --- a/plugin/e2e-tests/ios/.gitignore +++ b/example-app/ios/.gitignore @@ -1,5 +1,6 @@ App/build App/Pods +App/output App/App/public DerivedData xcuserdata @@ -7,3 +8,6 @@ xcuserdata # Cordova plugins for Capacitor capacitor-cordova-ios-plugins +# Generated Config files +App/App/capacitor.config.json +App/App/config.xml diff --git a/plugin/e2e-tests/ios/App/App.xcodeproj/project.pbxproj b/example-app/ios/App/App.xcodeproj/project.pbxproj similarity index 97% rename from plugin/e2e-tests/ios/App/App.xcodeproj/project.pbxproj rename to example-app/ios/App/App.xcodeproj/project.pbxproj index 16ae88e2..81ae2d8c 100644 --- a/plugin/e2e-tests/ios/App/App.xcodeproj/project.pbxproj +++ b/example-app/ios/App/App.xcodeproj/project.pbxproj @@ -106,7 +106,7 @@ 504EC3011FED79650016851F /* Frameworks */, 504EC3021FED79650016851F /* Resources */, 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */, - 1EB4CF9A9223BA57362D699F /* [CP] Copy Pods Resources */, + 2D952172D5DA84B0F266FD58 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -168,7 +168,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1EB4CF9A9223BA57362D699F /* [CP] Copy Pods Resources */ = { + 2D952172D5DA84B0F266FD58 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -362,12 +362,13 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 9YN2HU59K8; + CURRENT_PROJECT_VERSION = 1; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MARKETING_VERSION = 1.0; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.googlemaps; + PRODUCT_BUNDLE_IDENTIFIER = com.capacitorjs.maps; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; @@ -381,11 +382,12 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 9YN2HU59K8; + CURRENT_PROJECT_VERSION = 1; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.googlemaps; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.capacitorjs.maps; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; SWIFT_VERSION = 5.0; diff --git a/plugin/e2e-tests/ios/App/App.xcworkspace/contents.xcworkspacedata b/example-app/ios/App/App.xcworkspace/contents.xcworkspacedata similarity index 100% rename from plugin/e2e-tests/ios/App/App.xcworkspace/contents.xcworkspacedata rename to example-app/ios/App/App.xcworkspace/contents.xcworkspacedata diff --git a/plugin/e2e-tests/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example-app/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from plugin/e2e-tests/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to example-app/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/plugin/e2e-tests/ios/App/App/AppDelegate.swift b/example-app/ios/App/App/AppDelegate.swift similarity index 87% rename from plugin/e2e-tests/ios/App/App/AppDelegate.swift rename to example-app/ios/App/App/AppDelegate.swift index 53e37603..c3cd83b5 100644 --- a/plugin/e2e-tests/ios/App/App/AppDelegate.swift +++ b/example-app/ios/App/App/AppDelegate.swift @@ -46,15 +46,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler) } - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - super.touchesBegan(touches, with: event) - - let statusBarRect = UIApplication.shared.statusBarFrame - guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return } - - if statusBarRect.contains(touchPoint) { - NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil) - } - } - } diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/example-app/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png similarity index 100% rename from plugin/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png rename to example-app/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png diff --git a/example-app/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/example-app/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9b7d382d --- /dev/null +++ b/example-app/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "AppIcon-512@2x.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/Contents.json b/example-app/ios/App/App/Assets.xcassets/Contents.json similarity index 100% rename from plugin/e2e-tests/ios/App/App/Assets.xcassets/Contents.json rename to example-app/ios/App/App/Assets.xcassets/Contents.json diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/example-app/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json similarity index 100% rename from plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json rename to example-app/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/example-app/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png similarity index 100% rename from plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png rename to example-app/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/example-app/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png similarity index 100% rename from plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png rename to example-app/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/example-app/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png similarity index 100% rename from plugin/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png rename to example-app/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png diff --git a/plugin/e2e-tests/ios/App/App/Base.lproj/LaunchScreen.storyboard b/example-app/ios/App/App/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from plugin/e2e-tests/ios/App/App/Base.lproj/LaunchScreen.storyboard rename to example-app/ios/App/App/Base.lproj/LaunchScreen.storyboard diff --git a/plugin/e2e-tests/ios/App/App/Base.lproj/Main.storyboard b/example-app/ios/App/App/Base.lproj/Main.storyboard similarity index 100% rename from plugin/e2e-tests/ios/App/App/Base.lproj/Main.storyboard rename to example-app/ios/App/App/Base.lproj/Main.storyboard diff --git a/plugin/e2e-tests/ios/App/App/Info.plist b/example-app/ios/App/App/Info.plist similarity index 90% rename from plugin/e2e-tests/ios/App/App/Info.plist rename to example-app/ios/App/App/Info.plist index 578b0a47..dcdbbe00 100644 --- a/plugin/e2e-tests/ios/App/App/Info.plist +++ b/example-app/ios/App/App/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - e2e-tests + example-app CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -17,16 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - NSLocationWhenInUseUsageDescription Using Test App Location UILaunchStoryboardName diff --git a/example-app/ios/App/Podfile b/example-app/ios/App/Podfile new file mode 100644 index 00000000..480f43eb --- /dev/null +++ b/example-app/ios/App/Podfile @@ -0,0 +1,28 @@ +require_relative '../../../node_modules/.pnpm/@capacitor+ios@8.0.1_@capacitor+core@8.0.1/node_modules/@capacitor/ios/scripts/pods_helpers' + +platform :ios, '15.0' +use_frameworks! + +# workaround to avoid Xcode caching of Pods that requires +# Product -> Clean Build Folder after new Cordova plugins installed +# Requires CocoaPods 1.6 or newer +install! 'cocoapods', :disable_input_output_paths => true + +def capacitor_pods + pod 'Capacitor', :path => '../../../node_modules/.pnpm/@capacitor+ios@8.0.1_@capacitor+core@8.0.1/node_modules/@capacitor/ios' + pod 'CapacitorCordova', :path => '../../../node_modules/.pnpm/@capacitor+ios@8.0.1_@capacitor+core@8.0.1/node_modules/@capacitor/ios' + pod 'CapacitorApp', :path => '../../../node_modules/.pnpm/@capacitor+app@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/app' + pod 'CapacitorGoogleMaps', :path => '../../../plugin' + pod 'CapacitorHaptics', :path => '../../../node_modules/.pnpm/@capacitor+haptics@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/haptics' + pod 'CapacitorKeyboard', :path => '../../../node_modules/.pnpm/@capacitor+keyboard@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/keyboard' + pod 'CapacitorStatusBar', :path => '../../../node_modules/.pnpm/@capacitor+status-bar@8.0.0_@capacitor+core@8.0.1/node_modules/@capacitor/status-bar' +end + +target 'App' do + capacitor_pods + # Add your Pods here +end + +post_install do |installer| + assertDeploymentTarget(installer) +end diff --git a/example-app/package.json b/example-app/package.json new file mode 100644 index 00000000..74ed9a63 --- /dev/null +++ b/example-app/package.json @@ -0,0 +1,75 @@ +{ + "name": "example-app", + "version": "0.1.0", + "private": true, + "dependencies": { + "@capacitor/android": "^8.0.0", + "@capacitor/app": "^8.0.0", + "@capacitor/core": "^8.0.0", + "@capacitor/google-maps": "workspace:*", + "@capacitor/haptics": "^8.0.0", + "@capacitor/ios": "^8.0.0", + "@capacitor/keyboard": "^8.0.0", + "@capacitor/status-bar": "^8.0.0", + "@ionic/react": "^8.7.11", + "@ionic/react-router": "^8.7.11", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.0", + "@testing-library/user-event": "^14.6.1", + "@types/google.maps": "~3.58.1", + "@types/jest": "^30.0.0", + "@types/node": "^24.10.2", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@types/react-router": "^5.1.20", + "@types/react-router-dom": "^5.3.3", + "ionicons": "^8.0.13", + "react": "^19.2.1", + "react-dom": "^19.2.1", + "react-router": "^5.3.4", + "react-router-dom": "^5.3.4", + "react-scripts": "^5.0.1", + "typescript": "^5.9.3", + "web-vitals": "^5.1.0", + "workbox-background-sync": "^7.4.0", + "workbox-broadcast-update": "^7.4.0", + "workbox-cacheable-response": "^7.4.0", + "workbox-core": "^7.4.0", + "workbox-expiration": "^7.4.0", + "workbox-google-analytics": "^7.4.0", + "workbox-navigation-preload": "^7.4.0", + "workbox-precaching": "^7.4.0", + "workbox-range-requests": "^7.4.0", + "workbox-routing": "^7.4.0", + "workbox-strategies": "^7.4.0", + "workbox-streams": "^7.4.0" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "eject": "react-scripts eject", + "sync": "npm run build && npx cap sync" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@capacitor/cli": "^8.0.0" + }, + "description": "An Ionic project" +} \ No newline at end of file diff --git a/plugin/e2e-tests/public/assets/icon/favicon.png b/example-app/public/assets/icon/favicon.png similarity index 100% rename from plugin/e2e-tests/public/assets/icon/favicon.png rename to example-app/public/assets/icon/favicon.png diff --git a/plugin/e2e-tests/public/assets/icon/icon.png b/example-app/public/assets/icon/icon.png similarity index 100% rename from plugin/e2e-tests/public/assets/icon/icon.png rename to example-app/public/assets/icon/icon.png diff --git a/plugin/e2e-tests/public/assets/icon/marker.svg b/example-app/public/assets/icon/marker.svg similarity index 100% rename from plugin/e2e-tests/public/assets/icon/marker.svg rename to example-app/public/assets/icon/marker.svg diff --git a/plugin/e2e-tests/public/assets/icon/pin.png b/example-app/public/assets/icon/pin.png similarity index 100% rename from plugin/e2e-tests/public/assets/icon/pin.png rename to example-app/public/assets/icon/pin.png diff --git a/plugin/e2e-tests/public/assets/shapes.svg b/example-app/public/assets/shapes.svg similarity index 100% rename from plugin/e2e-tests/public/assets/shapes.svg rename to example-app/public/assets/shapes.svg diff --git a/plugin/e2e-tests/public/index.html b/example-app/public/index.html similarity index 100% rename from plugin/e2e-tests/public/index.html rename to example-app/public/index.html diff --git a/plugin/e2e-tests/public/manifest.json b/example-app/public/manifest.json similarity index 100% rename from plugin/e2e-tests/public/manifest.json rename to example-app/public/manifest.json diff --git a/plugin/e2e-tests/src/App.test.tsx b/example-app/src/App.test.tsx similarity index 100% rename from plugin/e2e-tests/src/App.test.tsx rename to example-app/src/App.test.tsx diff --git a/plugin/e2e-tests/src/App.tsx b/example-app/src/App.tsx similarity index 100% rename from plugin/e2e-tests/src/App.tsx rename to example-app/src/App.tsx diff --git a/plugin/e2e-tests/src/components/BaseTestingPage.tsx b/example-app/src/components/BaseTestingPage.tsx similarity index 100% rename from plugin/e2e-tests/src/components/BaseTestingPage.tsx rename to example-app/src/components/BaseTestingPage.tsx diff --git a/plugin/e2e-tests/src/components/Menu.css b/example-app/src/components/Menu.css similarity index 100% rename from plugin/e2e-tests/src/components/Menu.css rename to example-app/src/components/Menu.css diff --git a/plugin/e2e-tests/src/components/Menu.tsx b/example-app/src/components/Menu.tsx similarity index 100% rename from plugin/e2e-tests/src/components/Menu.tsx rename to example-app/src/components/Menu.tsx diff --git a/example-app/src/custom-elements.d.ts b/example-app/src/custom-elements.d.ts new file mode 100644 index 00000000..c4d79a05 --- /dev/null +++ b/example-app/src/custom-elements.d.ts @@ -0,0 +1,12 @@ +declare module "react" { + namespace JSX { + interface IntrinsicElements { + "capacitor-google-map": React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLElement + >; + } + } +} + +export {}; diff --git a/plugin/e2e-tests/src/index.tsx b/example-app/src/index.tsx similarity index 73% rename from plugin/e2e-tests/src/index.tsx rename to example-app/src/index.tsx index c421f457..b7913839 100644 --- a/plugin/e2e-tests/src/index.tsx +++ b/example-app/src/index.tsx @@ -1,15 +1,18 @@ import React from 'react'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import App from './App'; import * as serviceWorkerRegistration from './serviceWorkerRegistration'; import reportWebVitals from './reportWebVitals'; -ReactDOM.render( - - - , - document.getElementById('root') -); +const container = document.getElementById('root'); +if (container) { + const root = createRoot(container); + root.render( + + + + ); +} // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. diff --git a/plugin/e2e-tests/src/pages/Drawing/Circles.tsx b/example-app/src/pages/Drawing/Circles.tsx similarity index 99% rename from plugin/e2e-tests/src/pages/Drawing/Circles.tsx rename to example-app/src/pages/Drawing/Circles.tsx index 11fad8ab..4709d88c 100644 --- a/plugin/e2e-tests/src/pages/Drawing/Circles.tsx +++ b/example-app/src/pages/Drawing/Circles.tsx @@ -173,6 +173,7 @@ const CircleMapPage: React.FC = () => { autoGrow={true} > + {/* @ts-ignore - custom element */} + +declare global { + namespace JSX { + interface IntrinsicElements { + 'capacitor-google-map': React.DetailedHTMLProps, HTMLElement>; + } + } +} + +export {}; diff --git a/example-app/src/reportWebVitals.ts b/example-app/src/reportWebVitals.ts new file mode 100644 index 00000000..20a01e68 --- /dev/null +++ b/example-app/src/reportWebVitals.ts @@ -0,0 +1,13 @@ +import { onCLS, onINP, onFCP, onLCP, onTTFB, Metric } from 'web-vitals'; + +const reportWebVitals = (onPerfEntry?: (metric: Metric) => void) => { + if (onPerfEntry && onPerfEntry instanceof Function) { + onCLS(onPerfEntry); + onINP(onPerfEntry); + onFCP(onPerfEntry); + onLCP(onPerfEntry); + onTTFB(onPerfEntry); + } +}; + +export default reportWebVitals; diff --git a/plugin/e2e-tests/src/routes.ts b/example-app/src/routes.ts similarity index 100% rename from plugin/e2e-tests/src/routes.ts rename to example-app/src/routes.ts diff --git a/plugin/e2e-tests/src/service-worker.ts b/example-app/src/service-worker.ts similarity index 100% rename from plugin/e2e-tests/src/service-worker.ts rename to example-app/src/service-worker.ts diff --git a/plugin/e2e-tests/src/serviceWorkerRegistration.ts b/example-app/src/serviceWorkerRegistration.ts similarity index 100% rename from plugin/e2e-tests/src/serviceWorkerRegistration.ts rename to example-app/src/serviceWorkerRegistration.ts diff --git a/plugin/e2e-tests/src/setupTests.ts b/example-app/src/setupTests.ts similarity index 100% rename from plugin/e2e-tests/src/setupTests.ts rename to example-app/src/setupTests.ts diff --git a/plugin/e2e-tests/src/theme/variables.css b/example-app/src/theme/variables.css similarity index 100% rename from plugin/e2e-tests/src/theme/variables.css rename to example-app/src/theme/variables.css diff --git a/plugin/e2e-tests/tsconfig.json b/example-app/tsconfig.json similarity index 94% rename from plugin/e2e-tests/tsconfig.json rename to example-app/tsconfig.json index a273b0cf..9238f72d 100644 --- a/plugin/e2e-tests/tsconfig.json +++ b/example-app/tsconfig.json @@ -21,6 +21,7 @@ "jsx": "react-jsx" }, "include": [ - "src" + "src", + "src/**/*.d.ts" ] } diff --git a/plugin/e2e-tests/.ionic/e2e.env b/plugin/e2e-tests/.ionic/e2e.env deleted file mode 100644 index e8b0746f..00000000 --- a/plugin/e2e-tests/.ionic/e2e.env +++ /dev/null @@ -1,9 +0,0 @@ -E2E_ANDROID_ACTIVITY=io.ionic.starter.MainActivity -E2E_IOS_SIMULATOR_DEVICE_NAME=iPhone 13 Pro Max -E2E_IOS_SIMULATOR_PLATFORM_VERSION=15.0 -E2E_IOS_DEVICE_NAME=iPhone 12 Pro Max -E2E_IOS_DEVICE_PLATFORM_VERSION=15.2 -E2E_ANDROID_EMULATOR_DEVICE_NAME=e2eDevice -E2E_ANDROID_EMULATOR_PLATFORM_VERSION=12 -E2E_ANDROID_DEVICE_NAME=G8X -E2E_ANDROID_DEVICE_PLATFORM_VERSION=11 \ No newline at end of file diff --git a/plugin/e2e-tests/.ionic/wdio.config.ts b/plugin/e2e-tests/.ionic/wdio.config.ts deleted file mode 100644 index d0c57fed..00000000 --- a/plugin/e2e-tests/.ionic/wdio.config.ts +++ /dev/null @@ -1,174 +0,0 @@ -exports.config = { - "autoCompileOpts": { - "autoCompile": true, - "tsNodeOpts": { - "transpileOnly": true - }, - "tsConfigPathsOpts": { - "paths": {}, - "baseUrl": "./" - } - }, - "runner": "local", - "specs": [ - [ - "./tests/specs/**/*.spec.ts" - ] - ], - "logLevel": "trace", - "bail": 0, - "waitforTimeout": 45000, - "connectionRetryTimeout": 120000, - "connectionRetryCount": 3, - "framework": "mocha", - "reporters": [ - "spec" - ], - "mochaOpts": { - "timeout": 1200000 - }, - "services": [ - [ - "appium", - { - "command": "appium", - "args": { - "relaxedSecurity": true - } - } - ], - [ - "chromedriver", - { - "args": [ - "--use-fake-ui-for-media-stream", - "--use-fake-device-for-media-stream" - ] - } - ] - ], - "port": 4723, - "ios:simulator": { - "platformName": "iOS", - "maxInstances": 1, - "appium:isHeadless": true, - "appium:deviceName": "iPhone 13 Pro Max", - "appium:platformVersion": "15.2", - "appium:orientation": "PORTRAIT", - "appium:automationName": "XCUITest", - "appium:app": "./.ionic/App-ios-simulator.zip", - "appium:newCommandTimeout": 240, - "appium:platformName": "iOS", - "appium:wdaLaunchTimeout": 600000 - }, - "ios:device": { - "platformName": "iOS", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "iPhone 12 Pro Max", - "appium:platformVersion": "15.2", - "appium:orientation": "PORTRAIT", - "appium:automationName": "XCUITest", - "appium:app": "./.ionic/App-ios-simulator.zip", - "appium:newCommandTimeout": 240 - }, - "ios:browser": { - "browserName": "safari", - "platformName": "iOS", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "iPhone 13 Pro Max", - "appium:platformVersion": "15.0", - "appium:orientation": "PORTRAIT", - "appium:automationName": "XCUITest", - "appium:newCommandTimeout": 240 - }, - "android:emulator": { - "platformName": "Android", - "maxInstances": 1, - "appium:isHeadless": true, - "appium:deviceName": "e2eDevice", - "appium:platformVersion": "11.0", - "appium:orientation": "PORTRAIT", - "appium:automationName": "UiAutomator2", - "appium:app": "./.ionic/app-debug.apk", - "appium:appWaitActivity": "io.ionic.starter.MainActivity", - "appium:newCommandTimeout": 300, - "appium:platformName": "Android", - "appium:avd": "e2eDevice", - "appium:appPackage": "io.ionic.starter", - "appium:autoGrantPermissions": true, - "appium:allowTestPackages": true, - "appium:appWaitDuration": 60000, - "appium:adbExecTimeout": 300000, - "appium:deviceReadyTimeout": 3000, - "appium:androidDeviceReadyTimeout": 3000, - "appium:avdLaunchTimeout": 300000, - "appium:avdReadyTimeout": 300000, - "appium:appWaitForLaunch": false, - "appium:avdArgs": "-no-window -noaudio -verbose -accel on -no-boot-anim -no-snapshot-save" - }, - "android:device": { - "platformName": "Android", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "G8X", - "appium:platformVersion": "11", - "appium:orientation": "PORTRAIT", - "appium:automationName": "UiAutomator2", - "appium:app": "./.ionic/app-debug.apk", - "appium:appWaitActivity": "io.ionic.starter.MainActivity", - "appium:newCommandTimeout": 240 - }, - "android:browser": { - "platformName": "Android", - "browserName": "chrome", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "e2eDevice", - "appium:platformVersion": "12", - "appium:orientation": "PORTRAIT", - "appium:newCommandTimeout": 240 - }, - "web:chrome": { - "maxInstances": 1, - "browserName": "chrome", - "wdio:devtoolsOptions": { - "headless": true - }, - "goog:chromeOptions": { - "prefs": { - "profile.default_content_setting_values.media_stream_camera": 1, - "profile.default_content_setting_values.media_stream_mic": 1, - "profile.default_content_setting_values.notifications": 1 - } - } - }, - "capabilities": [ - { - "platformName": "Android", - "maxInstances": 1, - "appium:isHeadless": true, - "appium:deviceName": "e2eDevice", - "appium:platformVersion": "11.0", - "appium:orientation": "PORTRAIT", - "appium:automationName": "UiAutomator2", - "appium:app": "./.ionic/app-debug.apk", - "appium:appWaitActivity": "io.ionic.starter.MainActivity", - "appium:newCommandTimeout": 300, - "appium:platformName": "Android", - "appium:avd": "e2eDevice", - "appium:appPackage": "io.ionic.starter", - "appium:autoGrantPermissions": true, - "appium:allowTestPackages": true, - "appium:appWaitDuration": 60000, - "appium:adbExecTimeout": 300000, - "appium:deviceReadyTimeout": 3000, - "appium:androidDeviceReadyTimeout": 3000, - "appium:avdLaunchTimeout": 300000, - "appium:avdReadyTimeout": 300000, - "appium:appWaitForLaunch": false, - "appium:avdArgs": "-no-window -noaudio -verbose -accel on -no-boot-anim -no-snapshot-save" - } - ] - } \ No newline at end of file diff --git a/plugin/e2e-tests/android/app/src/main/res/values/strings.xml b/plugin/e2e-tests/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 9128e157..00000000 --- a/plugin/e2e-tests/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - e2e-tests - e2e-tests - io.ionic.starter - io.ionic.starter - diff --git a/plugin/e2e-tests/android/capacitor.settings.gradle b/plugin/e2e-tests/android/capacitor.settings.gradle deleted file mode 100644 index a0346a2f..00000000 --- a/plugin/e2e-tests/android/capacitor.settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN -include ':capacitor-android' -project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') - -include ':capacitor-app' -project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android') - -include ':capacitor-google-maps' -project(':capacitor-google-maps').projectDir = new File('../../android') - -include ':capacitor-haptics' -project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android') - -include ':capacitor-keyboard' -project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android') - -include ':capacitor-status-bar' -project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android') diff --git a/plugin/e2e-tests/android/gradle/wrapper/gradle-wrapper.jar b/plugin/e2e-tests/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index a4b76b95..00000000 Binary files a/plugin/e2e-tests/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/plugin/e2e-tests/android/variables.gradle b/plugin/e2e-tests/android/variables.gradle deleted file mode 100644 index 14eafdf5..00000000 --- a/plugin/e2e-tests/android/variables.gradle +++ /dev/null @@ -1,16 +0,0 @@ -ext { - minSdkVersion = 23 - compileSdkVersion = 35 - targetSdkVersion = 35 - androidxActivityVersion = '1.9.2' - androidxAppCompatVersion = '1.7.0' - androidxCoordinatorLayoutVersion = '1.2.0' - androidxCoreVersion = '1.15.0' - androidxFragmentVersion = '1.8.4' - androidxWebkitVersion = '1.12.1' - androidxJunitVersion = '1.2.1' - androidxEspressoCoreVersion = '3.6.1' - cordovaAndroidVersion = '10.1.1' - coreSplashScreenVersion = '1.0.1' - junitVersion = '4.13.2' -} \ No newline at end of file diff --git a/plugin/e2e-tests/capacitor.config.json b/plugin/e2e-tests/capacitor.config.json deleted file mode 100644 index a22dfc2b..00000000 --- a/plugin/e2e-tests/capacitor.config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "appId": "io.ionic.starter", - "appName": "e2e-tests", - "webDir": "build", - "bundledWebRuntime": false -} diff --git a/plugin/e2e-tests/ionic.e2e.config.ts b/plugin/e2e-tests/ionic.e2e.config.ts deleted file mode 100644 index 4912652c..00000000 --- a/plugin/e2e-tests/ionic.e2e.config.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* eslint-disable import/no-anonymous-default-export */ -export default { - appRootDir: '.', - wdio: { - logLevel: 'trace', // options are "trace" or "error" - 'ios:simulator': { - 'appium:platformName': 'iOS', - 'appium:deviceName': 'iPhone 13 Pro Max', - 'appium:platformVersion': '15.2', - 'appium:isHeadless': true, - 'appium:wdaLaunchTimeout': 600000, - }, - 'ios:device': {}, - 'android:emulator': { - 'appium:platformName': 'Android', - 'appium:deviceName': 'e2eDevice', - 'appium:avd': 'e2eDevice', - 'appium:isHeadless': true, - 'appium:platformVersion': '11.0', - 'appium:appPackage': 'io.ionic.starter', - 'appium:appWaitActivity': 'io.ionic.starter.MainActivity', - 'appium:autoGrantPermissions': true, - 'appium:allowTestPackages': true, - 'appium:appWaitDuration': 60000, - 'appium:adbExecTimeout': 300000, - 'appium:deviceReadyTimeout': 3000, - 'appium:androidDeviceReadyTimeout': 3000, - 'appium:avdLaunchTimeout': 300000, - 'appium:avdReadyTimeout': 300000, - 'appium:appWaitForLaunch': false, - 'appium:newCommandTimeout': 300, - 'appium:avdArgs': '-no-window -noaudio -verbose -accel on -no-boot-anim -no-snapshot-save', - }, - 'android:device': {}, - }, -}; diff --git a/plugin/e2e-tests/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugin/e2e-tests/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 42daef8a..00000000 --- a/plugin/e2e-tests/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/plugin/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/plugin/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 905798df..00000000 --- a/plugin/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images" : [ - { - "filename" : "AppIcon-512@2x.png", - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} \ No newline at end of file diff --git a/plugin/e2e-tests/ios/App/App/capacitor.config.json b/plugin/e2e-tests/ios/App/App/capacitor.config.json deleted file mode 100644 index a22ac3e6..00000000 --- a/plugin/e2e-tests/ios/App/App/capacitor.config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "appId": "io.ionic.starter", - "appName": "e2e-tests", - "webDir": "build", - "bundledWebRuntime": false, - "packageClassList": [ - "AppPlugin", - "CapacitorGoogleMapsPlugin", - "HapticsPlugin", - "KeyboardPlugin", - "StatusBarPlugin" - ] -} diff --git a/plugin/e2e-tests/ios/App/App/config.xml b/plugin/e2e-tests/ios/App/App/config.xml deleted file mode 100644 index 1b1b0e0d..00000000 --- a/plugin/e2e-tests/ios/App/App/config.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/plugin/e2e-tests/ios/App/Podfile b/plugin/e2e-tests/ios/App/Podfile deleted file mode 100644 index f38bc01a..00000000 --- a/plugin/e2e-tests/ios/App/Podfile +++ /dev/null @@ -1,22 +0,0 @@ -platform :ios, '15.0' -use_frameworks! - -# workaround to avoid Xcode caching of Pods that requires -# Product -> Clean Build Folder after new Cordova plugins installed -# Requires CocoaPods 1.6 or newer -install! 'cocoapods', :disable_input_output_paths => true - -def capacitor_pods - pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' - pod 'CapacitorGoogleMaps', :path => '../../..' - pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' - pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' - pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' -end - -target 'App' do - capacitor_pods - # Add your Pods here -end diff --git a/plugin/e2e-tests/package.json b/plugin/e2e-tests/package.json deleted file mode 100644 index 6757febd..00000000 --- a/plugin/e2e-tests/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "e2e-tests", - "version": "0.0.1", - "private": true, - "dependencies": { - "@capacitor/app": "next", - "@capacitor/android": "next", - "@capacitor/core": "next", - "@capacitor/google-maps": "file:..", - "@capacitor/haptics": "next", - "@capacitor/ios": "next", - "@capacitor/keyboard": "next", - "@capacitor/status-bar": "next", - "@ionic/react": "^8.7.9", - "@ionic/react-router": "^8.7.9", - "@testing-library/jest-dom": "^6.9.1", - "@testing-library/react": "^16.3.0", - "@testing-library/user-event": "^14.6.1", - "@types/jest": "^30.0.0", - "@types/node": "^24.10.1", - "@types/react": "^19.2.6", - "@types/react-dom": "^19.2.3", - "@types/react-router": "^5.1.20", - "@types/react-router-dom": "^5.3.3", - "ionicons": "^8.0.13", - "react": "^19.2.0", - "react-dom": "^19.2.0", - "react-router": "^5.3.4", - "react-router-dom": "^5.3.4", - "react-scripts": "^5.0.1", - "typescript": "^5.9.3", - "web-vitals": "^5.1.0", - "workbox-background-sync": "^7.3.0", - "workbox-broadcast-update": "^7.3.0", - "workbox-cacheable-response": "^7.3.0", - "workbox-core": "^7.3.0", - "workbox-expiration": "^7.3.0", - "workbox-google-analytics": "^7.3.0", - "workbox-navigation-preload": "^7.3.0", - "workbox-precaching": "^7.3.0", - "workbox-range-requests": "^7.3.0", - "workbox-routing": "^7.3.0", - "workbox-strategies": "^7.3.0", - "workbox-streams": "^7.3.0" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'", - "eject": "react-scripts eject", - "sync": "npm run build && npx cap sync", - "ionic-e2e": "ionic-e2e", - "e2e:ios:build": "npm run ionic-e2e build ios:simulator", - "e2e:ios:run": "npm run ionic-e2e run ios:simulator", - "e2e:ios": "E2E_MODE=simulator && npm run sync && npm run e2e:ios:build && npm run e2e:ios:run", - "e2e:android:build": "npm run ionic-e2e build android:emulator", - "e2e:android:run": "npm run ionic-e2e run android:emulator", - "e2e:android": "./scripts/run_Android_E2E.sh", - "e2e:prepare": "./scripts/build_local_package.sh" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@capacitor/cli": "next", - "@ionic/e2e": "0.2.0-next.6", - "@ionic/e2e-components-ionic": "0.2.0-next.6", - "appium": "^1.22.1" - }, - "description": "An Ionic project" -} \ No newline at end of file diff --git a/plugin/e2e-tests/scripts/build_local_package.sh b/plugin/e2e-tests/scripts/build_local_package.sh deleted file mode 100755 index bb97fa3b..00000000 --- a/plugin/e2e-tests/scripts/build_local_package.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd ../ && npm install && npm run pack-local -cd ./e2e-tests && npm install ../capacitor-google-maps.tgz \ No newline at end of file diff --git a/plugin/e2e-tests/scripts/create_E2E_AVD.sh b/plugin/e2e-tests/scripts/create_E2E_AVD.sh deleted file mode 100755 index 3cbbb5c2..00000000 --- a/plugin/e2e-tests/scripts/create_E2E_AVD.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -CPU_ARCH=`uname -p`"" - -SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager -AVDMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager -ABD=$ANDROID_SDK_ROOT/platform-tools/adb -EMU=$ANDROID_SDK_ROOT/emulator/emulator - -E2E_DEVICE_EXISTS=`${EMU} -list-avds | grep -c e2eDevice` - -if [[ $E2E_DEVICE_EXISTS -lt 1 ]]; then - echo "Creating e2eDevice AVD..." - echo "" - - echo "CPU_ARCH: $CPU_ARCH" - echo "JAVA_HOME: $JAVA_HOME" - echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" - echo "" - echo "--------------------------" - echo "" - - echo "Accepting Lics..." - sh -c \yes | ${SDKMANAGER} --licenses > /dev/null - - echo "Installing build-tools..." - ${SDKMANAGER} --install 'build-tools;31.0.0' platform-tools 'platforms;android-31' - echo "Installing emulator..." - ${SDKMANAGER} --install emulator --channel=0 - echo "Installing sys-image..." - - # If we are on arm (m1 mac) use arm images, else use x86_64 - if [ "$CPU_ARCH" = "arm" ]; then - ${SDKMANAGER} --install 'system-images;android-31;google_apis;arm64-v8a' --channel=0 - else - ${SDKMANAGER} --install 'system-images;android-31;google_apis;x86_64' --channel=0 - fi - - echo "Killing all running emulators..." - ${ABD} devices | grep emulator | cut -f1 | while read line; do ${ABD} -s $line emu kill; done; - - echo "Creating AVD..." - if [ "$CPU_ARCH" = "arm" ]; then - ${AVDMANAGER} --verbose create avd -n e2eDevice -k "system-images;android-31;google_apis;arm64-v8a" --device "pixel_3a" - else - ${AVDMANAGER} --verbose create avd -n e2eDevice -k "system-images;android-31;google_apis;x86_64" --device "pixel_3a" - fi - -else - echo "e2eDevice AVD exists!" -fi - -echo "" - - diff --git a/plugin/e2e-tests/scripts/run_Android_E2E.sh b/plugin/e2e-tests/scripts/run_Android_E2E.sh deleted file mode 100755 index b61184b1..00000000 --- a/plugin/e2e-tests/scripts/run_Android_E2E.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -set -e - -if [[ -z "$ANDROID_SDK_ROOT" ]]; then - export ANDROID_SDK_ROOT=~/Library/Android/sdk -fi -if [[ -n "$JAVA_HOME_11_X64" ]]; then - export JAVA_HOME=$JAVA_HOME_11_X64 -else - export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home -fi - -# Check to see if we are not in a Github Action -if [[ -z $GITHUB_ACTION ]]; then - - ABD=$ANDROID_SDK_ROOT/platform-tools/adb - EMU=$ANDROID_SDK_ROOT/emulator/emulator - - echo "Not in GH Action. Checking for e2eDevice Emulator..." - $PWD/scripts/create_E2E_AVD.sh - - set +e - - echo 'Searching for e2eDevice...' - devicesCount=`${ABD} devices | grep -c emulator` - - if [[ $devicesCount =~ 0 ]]; then - echo 'Starting emulator...' - ${EMU} -avd "e2eDevice" -no-window -noaudio -accel on -no-boot-anim -no-snapshot-save & - fi - - bootanim="" - failcounter=0 - timeout_in_sec=360 - - until [[ "$bootanim" =~ "stopped" ]]; do - bootanim=`${ABD} -e shell getprop init.svc.bootanim 2>&1 &` - if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline" - || "$bootanim" =~ "running" ]]; then - let "failcounter += 1" - echo "Waiting for emulator to start" - if [[ $failcounter -gt timeout_in_sec ]]; then - echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator" - exit 1 - fi - fi - sleep 1 - done - - echo "Emulator is ready" - - sleep 4 - - set -e - -fi - -E2E_MODE=simulator - -npm run sync -npm run e2e:android:build -npm run e2e:android:run diff --git a/plugin/e2e-tests/src/react-app-env.d.ts b/plugin/e2e-tests/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5f..00000000 --- a/plugin/e2e-tests/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/plugin/e2e-tests/src/reportWebVitals.ts b/plugin/e2e-tests/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16e..00000000 --- a/plugin/e2e-tests/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/plugin/e2e-tests/tests/pageobjects/basic-echo/basic-echo.page.ts b/plugin/e2e-tests/tests/pageobjects/basic-echo/basic-echo.page.ts deleted file mode 100644 index a41920e4..00000000 --- a/plugin/e2e-tests/tests/pageobjects/basic-echo/basic-echo.page.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IonicButton, IonicInput } from '@ionic/e2e-components-ionic'; - -import Page from '../page'; - -class BasicEchoPage extends Page { - get runEchoButton() { - return new IonicButton('#runEchoButton'); - } - get commandOutputTextarea() { - return new IonicInput('#commandOutput'); - } -} - -export default new BasicEchoPage(); diff --git a/plugin/e2e-tests/tests/pageobjects/map/create-and-destroy.page.ts b/plugin/e2e-tests/tests/pageobjects/map/create-and-destroy.page.ts deleted file mode 100644 index e207d9e9..00000000 --- a/plugin/e2e-tests/tests/pageobjects/map/create-and-destroy.page.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from '../page'; - -class CreateAndDestroyMapPage extends Page { - get createMapButton() { - return new IonicButton("#createMapButton"); - } - get destroyMapButton() { - return new IonicButton("#destroyMapButton"); - } - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); - } -} - -export default new CreateAndDestroyMapPage(); \ No newline at end of file diff --git a/plugin/e2e-tests/tests/pageobjects/markers/add-and-remove.page.ts b/plugin/e2e-tests/tests/pageobjects/markers/add-and-remove.page.ts deleted file mode 100644 index 7f6c47d3..00000000 --- a/plugin/e2e-tests/tests/pageobjects/markers/add-and-remove.page.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from "../page"; - -class AddAndRemoveMarkers extends Page { - get createMapButton() { - return new IonicButton("#createMapButton") - } - get addMarkerButton() { - return new IonicButton("#addMarkerButton") - } - get removeMarkerButton() { - return new IonicButton("#removeMarkerButton") - } - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); - } -} - - -export default new AddAndRemoveMarkers(); \ No newline at end of file diff --git a/plugin/e2e-tests/tests/pageobjects/markers/marker-customization.page.ts b/plugin/e2e-tests/tests/pageobjects/markers/marker-customization.page.ts deleted file mode 100644 index 96925a37..00000000 --- a/plugin/e2e-tests/tests/pageobjects/markers/marker-customization.page.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from '../page'; - -class MarkerCustomizations extends Page { - get createMapButton() { - return new IonicButton('#createMapButton'); - } - - get addMarkerImageButton() { - return new IonicButton('#addMarkerImageButton'); - } - - get addMarkerColorButton() { - return new IonicButton('#addMarkerColorButton'); - } - - get addMultipleImageMarkersButton() { - return new IonicButton('#addMultipleImageMarkersButton'); - } - - get addMultipleColorMarkersButton() { - return new IonicButton('#addMultipleColorMarkersButton'); - } - - get removeAllMarkersButton() { - return new IonicButton('#removeAllMarkersButton'); - } - - get destroyMapButton() { - return new IonicButton('#destroyMapButton'); - } - - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); -} -} - -export default new MarkerCustomizations(); diff --git a/plugin/e2e-tests/tests/pageobjects/markers/multiple-markers.page.ts b/plugin/e2e-tests/tests/pageobjects/markers/multiple-markers.page.ts deleted file mode 100644 index 79f237cd..00000000 --- a/plugin/e2e-tests/tests/pageobjects/markers/multiple-markers.page.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from "../page"; - -class MultipleMarkers extends Page { - get createMapButton() { - return new IonicButton("#createMapButton") - } - get addMarkersButton() { - return new IonicButton("#addMarkersButton") - } - get enableClusteringButton() { - return new IonicButton("#enableClusteringButton") - } - get disableClusteringButton() { - return new IonicButton("#disableClusteringButton") - } - get removeMarkersButton() { - return new IonicButton("#removeMarkersButton") - } - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); - } -} - -export default new MultipleMarkers(); \ No newline at end of file diff --git a/plugin/e2e-tests/tests/pageobjects/page.ts b/plugin/e2e-tests/tests/pageobjects/page.ts deleted file mode 100644 index 137bf5b5..00000000 --- a/plugin/e2e-tests/tests/pageobjects/page.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default class Page { - public async hideToolBars() { - await driver.execute(() => { - for (let i = 0; i < document.getElementsByTagName('ion-toolbar').length; i++) { - const toolbar: HTMLElement | null = document.getElementsByTagName('ion-toolbar').item(i) as HTMLElement; - if (toolbar !== null) { - toolbar.style.display = 'none'; - } - } - }); - } - - public async showToolBars() { - await driver.execute(() => { - for (let i = 0; i < document.getElementsByTagName('ion-toolbar').length; i++) { - const toolbar: HTMLElement | null = document.getElementsByTagName('ion-toolbar').item(i) as HTMLElement; - if (toolbar !== null) { - toolbar.style.display = ''; - } - } - }); - } -} diff --git a/plugin/e2e-tests/tests/specs/basic-echo/basic-echo.spec.ts b/plugin/e2e-tests/tests/specs/basic-echo/basic-echo.spec.ts deleted file mode 100644 index e810261f..00000000 --- a/plugin/e2e-tests/tests/specs/basic-echo/basic-echo.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import SetAndGetValuePage from '../../pageobjects/basic-echo/basic-echo.page'; - -describe.skip('Google Maps - Basic Echo', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/basic-echo/run-basic-echo'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await SetAndGetValuePage.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await SetAndGetValuePage.showToolBars(); - await pause(500); - }); - - it('should run a basic echo from plugin.', async () => { - const runEchoButton = await SetAndGetValuePage.runEchoButton; - const commandOutput = await $((await SetAndGetValuePage.commandOutputTextarea).selector).$('textarea'); - - await runEchoButton.tap(); - await expect(commandOutput).toHaveValue('WOW!'); - }); -}); diff --git a/plugin/e2e-tests/tests/specs/map/create-and-destroy.spec.ts b/plugin/e2e-tests/tests/specs/map/create-and-destroy.spec.ts deleted file mode 100644 index 13aaf26b..00000000 --- a/plugin/e2e-tests/tests/specs/map/create-and-destroy.spec.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import CreateAndDestroyMapPage from '../../pageobjects/map/create-and-destroy.page'; - - -describe('Google Maps - Create and Destroy Map', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/maps/create-and-destroy'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await CreateAndDestroyMapPage.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await CreateAndDestroyMapPage.showToolBars(); - await pause(500); - }); - - it('should create and destroy a map', async function() { - const createMapButton = await CreateAndDestroyMapPage.createMapButton; - const destroyMapButton = await CreateAndDestroyMapPage.destroyMapButton; - const getCommandOutputText = async function() { - return (await CreateAndDestroyMapPage.commandOutputTextarea).getValue(); - } - - await createMapButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toBe('Maps created'); - - await destroyMapButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toBe('Maps destroyed'); - }); - - it('should throw when attempting to destroy a non-existent map', async function() { - const destroyMapButton = await CreateAndDestroyMapPage.destroyMapButton; - const getCommandOutputText = async function() { - return (await CreateAndDestroyMapPage.commandOutputTextarea).getValue(); - } - - await destroyMapButton.tap(); - await pause(100); - await expect(await getCommandOutputText()).toBe('Map not found for provided id.'); - }); - - -}); diff --git a/plugin/e2e-tests/tests/specs/markers/add-and-remove.spec.ts b/plugin/e2e-tests/tests/specs/markers/add-and-remove.spec.ts deleted file mode 100644 index 7b398cc5..00000000 --- a/plugin/e2e-tests/tests/specs/markers/add-and-remove.spec.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import AddAndRemoveMarkers from '../../pageobjects/markers/add-and-remove.page'; - - -describe('Google Maps - Add and Remove Marker', function () { - let createdMarkerId = ""; - - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/markers/add-and-remove'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await AddAndRemoveMarkers.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await AddAndRemoveMarkers.showToolBars(); - await pause(500); - }); - - it("should create a map and add a marker", async function() { - const createMapButton = await AddAndRemoveMarkers.createMapButton; - const addMarkerButton = await AddAndRemoveMarkers.addMarkerButton; - const getCommandOutputText = async function() { - return (await AddAndRemoveMarkers.commandOutputTextarea).getValue(); - } - - await createMapButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toBe('Map created'); - - await addMarkerButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toContain('Marker added: '); - - const markerId = (await getCommandOutputText()).replace("Marker added: ", ""); - await expect(markerId).not.toBeFalsy(); - - createdMarkerId = markerId; - }); - - it("should remove the created marker", async function() { - const removeMarkerButton = await AddAndRemoveMarkers.removeMarkerButton; - const commandOutput = await $((await AddAndRemoveMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining(`Marker removed: ${createdMarkerId}`); - }); - - it("should throw when attempting to remove a non-existent marker", async function() { - const removeMarkerButton = await AddAndRemoveMarkers.removeMarkerButton; - const commandOutput = await $((await AddAndRemoveMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining(`Marker not found for provided id.`); - }); -}); \ No newline at end of file diff --git a/plugin/e2e-tests/tests/specs/markers/marker-customization.spec.ts b/plugin/e2e-tests/tests/specs/markers/marker-customization.spec.ts deleted file mode 100644 index 4d4a80c1..00000000 --- a/plugin/e2e-tests/tests/specs/markers/marker-customization.spec.ts +++ /dev/null @@ -1,125 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import MarkerCustomizations from '../../pageobjects/markers/marker-customization.page'; - -describe('Google Maps - Marker Customization', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/markers/customizations'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await MarkerCustomizations.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await MarkerCustomizations.showToolBars(); - await pause(500); - }); - - it('should create a map and add 1 color marker', async function () { - const createMapButton = await MarkerCustomizations.createMapButton; - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addColorMarkerButton = await MarkerCustomizations.addMarkerColorButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await createMapButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('Map created'); - - await addColorMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 color marker added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 markers removed'); - }); - - it('should create a map and add 1 image marker', async function () { - const createMapButton = await MarkerCustomizations.createMapButton; - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addImageMarkerButton = await MarkerCustomizations.addMarkerImageButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await createMapButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('Map created'); - - await addImageMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 image marker added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 markers removed'); - }); - - it('should add 1 image marker', async function () { - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addImageMarkerButton = await MarkerCustomizations.addMarkerImageButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await addImageMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 image marker added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 markers removed'); - }); - - it('should add 4 image markers', async function () { - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addMultipleImageMarkersButton = await MarkerCustomizations.addMultipleImageMarkersButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await addMultipleImageMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 image markers added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 markers removed'); - }); - - it('should add 4 color markers', async function () { - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addMultipleColorMarkersButton = await MarkerCustomizations.addMultipleColorMarkersButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await addMultipleColorMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 color markers added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 markers removed'); - }); -}); diff --git a/plugin/e2e-tests/tests/specs/markers/multiple-markers.spec.ts b/plugin/e2e-tests/tests/specs/markers/multiple-markers.spec.ts deleted file mode 100644 index f1d2b3e5..00000000 --- a/plugin/e2e-tests/tests/specs/markers/multiple-markers.spec.ts +++ /dev/null @@ -1,71 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import MultipleMarkers from '../../pageobjects/markers/multiple-markers.page'; - -describe('Google Maps - Multiple Markers', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/markers/multiple-markers'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await MultipleMarkers.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await MultipleMarkers.showToolBars(); - await pause(500); - }); - - it("should create a map and add 4 markers", async function() { - const createMapButton = await MultipleMarkers.createMapButton; - const addMarkersButton = await MultipleMarkers.addMarkersButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await createMapButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('Map created'); - - await addMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 markers added'); - }) - - it("should enable and disable clustering", async function() { - const enableClusteringButton = await MultipleMarkers.enableClusteringButton; - const disableClusteringButton = await MultipleMarkers.disableClusteringButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await enableClusteringButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('marker clustering enabled'); - - await disableClusteringButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('marker clustering disabled'); - }) - - it("should remove 4 markers", async function() { - const removeMarkersButton = await MultipleMarkers.removeMarkersButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkersButton.tap() - await pause(500); - await expect(commandOutput).toHaveValue('4 markers removed'); - }) - - it("should throw error when attempting to remove no markers", async function() { - const removeMarkersButton = await MultipleMarkers.removeMarkersButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkersButton.tap() - await pause(500); - await expect(commandOutput).toHaveValue('Invalid Arguments Provided: markerIds requires at least one marker id.'); - }) -}) \ No newline at end of file diff --git a/plugin/eslint.config.cjs b/plugin/eslint.config.cjs index c2a5fb40..c41b832b 100644 --- a/plugin/eslint.config.cjs +++ b/plugin/eslint.config.cjs @@ -5,7 +5,7 @@ const prettierConfig = require('eslint-config-prettier'); module.exports = [ { - ignores: ['node_modules/**', 'dist/**', 'build/**', 'e2e-tests/**', 'unit-tests/**', 'android/**', 'ios/**', 'types/**', 'eslint.config.*'], + ignores: ['node_modules/**', 'dist/**', 'build/**', 'unit-tests/**', 'android/**', 'ios/**', 'types/**', 'eslint.config.*'], }, eslintjs.configs.recommended, { diff --git a/plugin/package.json b/plugin/package.json index 2c52c7a9..ae02bef6 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -45,7 +45,7 @@ "lint": "pnpm run eslint && pnpm run prettier --check && pnpm run swiftlint lint", "fmt": "pnpm run eslint --fix && pnpm run prettier --write && pnpm run swiftlint lint --fix --format", "eslint": "eslint .", - "prettier": "prettier \"**/*.{css,html,ts,js,java}\" \"!e2e-tests/**\" --plugin=prettier-plugin-java", + "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java", "swiftlint": "node-swiftlint", "docgen": "node ../scripts/docgen_updates.js", "build": "pnpm run clean && pnpm run docgen && tsc && rollup -c rollup.config.js && pnpm run downleveldts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4741bb35..b087f5d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,6 +24,133 @@ importers: specifier: ^5.9.3 version: 5.9.3 + example-app: + dependencies: + '@capacitor/android': + specifier: ^8.0.0 + version: 8.0.1(@capacitor/core@8.0.1) + '@capacitor/app': + specifier: ^8.0.0 + version: 8.0.0(@capacitor/core@8.0.1) + '@capacitor/core': + specifier: ^8.0.0 + version: 8.0.1 + '@capacitor/google-maps': + specifier: workspace:* + version: link:../plugin + '@capacitor/haptics': + specifier: ^8.0.0 + version: 8.0.0(@capacitor/core@8.0.1) + '@capacitor/ios': + specifier: ^8.0.0 + version: 8.0.1(@capacitor/core@8.0.1) + '@capacitor/keyboard': + specifier: ^8.0.0 + version: 8.0.0(@capacitor/core@8.0.1) + '@capacitor/status-bar': + specifier: ^8.0.0 + version: 8.0.0(@capacitor/core@8.0.1) + '@ionic/react': + specifier: ^8.7.11 + version: 8.7.16(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@ionic/react-router': + specifier: ^8.7.11 + version: 8.7.16(react-dom@19.2.3(react@19.2.3))(react-router-dom@5.3.4(react@19.2.3))(react-router@5.3.4(react@19.2.3))(react@19.2.3) + '@testing-library/jest-dom': + specifier: ^6.9.1 + version: 6.9.1 + '@testing-library/react': + specifier: ^16.3.0 + version: 16.3.1(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@testing-library/user-event': + specifier: ^14.6.1 + version: 14.6.1(@testing-library/dom@10.4.1) + '@types/google.maps': + specifier: ~3.58.1 + version: 3.58.1 + '@types/jest': + specifier: ^30.0.0 + version: 30.0.0 + '@types/node': + specifier: ^24.10.2 + version: 24.10.8 + '@types/react': + specifier: ^19.2.7 + version: 19.2.8 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.8) + '@types/react-router': + specifier: ^5.1.20 + version: 5.1.20 + '@types/react-router-dom': + specifier: ^5.3.3 + version: 5.3.3 + ionicons: + specifier: ^8.0.13 + version: 8.0.13 + react: + specifier: ^19.2.1 + version: 19.2.3 + react-dom: + specifier: ^19.2.1 + version: 19.2.3(react@19.2.3) + react-router: + specifier: ^5.3.4 + version: 5.3.4(react@19.2.3) + react-router-dom: + specifier: ^5.3.4 + version: 5.3.4(react@19.2.3) + react-scripts: + specifier: ^5.0.1 + version: 5.0.1(@babel/plugin-syntax-flow@7.28.6(@babel/core@7.28.6))(@babel/plugin-transform-react-jsx@7.28.6(@babel/core@7.28.6))(@types/babel__core@7.20.5)(eslint@8.57.1)(react@19.2.3)(type-fest@0.21.3)(typescript@5.9.3)(yaml@2.8.2) + typescript: + specifier: ^5.9.3 + version: 5.9.3 + web-vitals: + specifier: ^5.1.0 + version: 5.1.0 + workbox-background-sync: + specifier: ^7.4.0 + version: 7.4.0 + workbox-broadcast-update: + specifier: ^7.4.0 + version: 7.4.0 + workbox-cacheable-response: + specifier: ^7.4.0 + version: 7.4.0 + workbox-core: + specifier: ^7.4.0 + version: 7.4.0 + workbox-expiration: + specifier: ^7.4.0 + version: 7.4.0 + workbox-google-analytics: + specifier: ^7.4.0 + version: 7.4.0 + workbox-navigation-preload: + specifier: ^7.4.0 + version: 7.4.0 + workbox-precaching: + specifier: ^7.4.0 + version: 7.4.0 + workbox-range-requests: + specifier: ^7.4.0 + version: 7.4.0 + workbox-routing: + specifier: ^7.4.0 + version: 7.4.0 + workbox-strategies: + specifier: ^7.4.0 + version: 7.4.0 + workbox-streams: + specifier: ^7.4.0 + version: 7.4.0 + devDependencies: + '@capacitor/cli': + specifier: ^8.0.0 + version: 8.0.1 + example-app-spm: dependencies: '@capacitor/android': @@ -1617,21 +1744,25 @@ packages: resolution: {integrity: sha512-NmPeCexWIZHW9RM3lDdFENN9C3WtlQ5L4RSNFESIjreS921rgePhulsszYdGnHdcnKPYlBBJnX/NxVsfioBbnQ==} cpu: [arm64] os: [linux] + libc: [glibc] '@nx/nx-linux-arm64-musl@22.3.3': resolution: {integrity: sha512-K02U88Q0dpvCfmSXXvY7KbYQSa1m+mkYeqDBRHp11yHk1GoIqaHp8oEWda7FV4gsriNExPSS5tX1/QGVoLZrCw==} cpu: [arm64] os: [linux] + libc: [musl] '@nx/nx-linux-x64-gnu@22.3.3': resolution: {integrity: sha512-04TEbvgwRaB9ifr39YwJmWh3RuXb4Ry4m84SOJyjNXAfPrepcWgfIQn1VL2ul1Ybq+P023dLO9ME8uqFh6j1YQ==} cpu: [x64] os: [linux] + libc: [glibc] '@nx/nx-linux-x64-musl@22.3.3': resolution: {integrity: sha512-uxBXx5q+S5OGatbYDxnamsKXRKlYn+Eq1nrCAHaf8rIfRoHlDiRV2PqtWuF+O2pxR5FWKpvr+/sZtt9rAf7KMw==} cpu: [x64] os: [linux] + libc: [musl] '@nx/nx-win32-arm64-msvc@22.3.3': resolution: {integrity: sha512-aOwlfD6ZA1K6hjZtbhBSp7s1yi3sHbMpLCa4stXzfhCCpKUv46HU/EdiWdE1N8AsyNFemPZFq81k1VTowcACdg==} @@ -1800,86 +1931,103 @@ packages: resolution: {integrity: sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.55.1': resolution: {integrity: sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.34.9': resolution: {integrity: sha512-6TZjPHjKZUQKmVKMUowF3ewHxctrRR09eYyvT5eFv8w/fXarEra83A2mHTVJLA5xU91aCNOUnM+DWFMSbQ0Nxw==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-gnu@4.55.1': resolution: {integrity: sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.34.9': resolution: {integrity: sha512-LD2fytxZJZ6xzOKnMbIpgzFOuIKlxVOpiMAXawsAZ2mHBPEYOnLRK5TTEsID6z4eM23DuO88X0Tq1mErHMVq0A==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-musl@4.55.1': resolution: {integrity: sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.55.1': resolution: {integrity: sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.55.1': resolution: {integrity: sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==} cpu: [loong64] os: [linux] + libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.55.1': resolution: {integrity: sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.55.1': resolution: {integrity: sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==} cpu: [ppc64] os: [linux] + libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.55.1': resolution: {integrity: sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.55.1': resolution: {integrity: sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.55.1': resolution: {integrity: sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.34.9': resolution: {integrity: sha512-FwBHNSOjUTQLP4MG7y6rR6qbGw4MFeQnIBrMe161QGaQoBQLqSUEKlHIiVgF3g/mb3lxlxzJOpIBhaP+C+KP2A==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.55.1': resolution: {integrity: sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.34.9': resolution: {integrity: sha512-cYRpV4650z2I3/s6+5/LONkjIz8MBeqrk+vPXV10ORBnshpn8S32bPqQ2Utv39jCiDcO2eJTuSlPXpnvmaIgRA==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-linux-x64-musl@4.55.1': resolution: {integrity: sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-openbsd-x64@4.55.1': resolution: {integrity: sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==} @@ -7488,8 +7636,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@6.0.0-dev.20260114: - resolution: {integrity: sha512-ZqwViZ1rbV8YP3lo93PL2IMH9dQ8y2Km8iLgR3H99l84Q5WX/bIPihfwWLzoFbRfMDWe2tCbCKxbpw7dgQR3cg==} + typescript@6.0.0-dev.20260209: + resolution: {integrity: sha512-RpFbUcHOj66J6zbU9GxQedmtGORXCS816wWKRZ3191xcUcE1LPCOu8TRexFlYIhxP6CIhPSkg/2rM4dtksO0yQ==} engines: {node: '>=14.17'} hasBin: true @@ -12023,7 +12171,7 @@ snapshots: dependencies: semver: 7.7.3 shelljs: 0.8.5 - typescript: 6.0.0-dev.20260114 + typescript: 6.0.0-dev.20260209 dunder-proto@1.0.1: dependencies: @@ -16897,7 +17045,7 @@ snapshots: typescript@5.9.3: {} - typescript@6.0.0-dev.20260114: {} + typescript@6.0.0-dev.20260209: {} uglify-js@3.19.3: optional: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e9126800..e759aed2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - 'plugin' + - 'example-app' - 'example-app-spm' \ No newline at end of file