diff --git a/.github/scripts/determine-widget-scope.sh b/.github/scripts/determine-widget-scope.sh index f57a6452c..333ca4e56 100644 --- a/.github/scripts/determine-widget-scope.sh +++ b/.github/scripts/determine-widget-scope.sh @@ -39,10 +39,13 @@ if [ "$event_name" == "pull_request" ]; then echo "widgets=${all_widgets}" >> $GITHUB_OUTPUT fi else - if [ -n "$input_workspace" ] && [ "$input_workspace" != "*-native" ]; then + if [ -n "$input_workspace" ] && [ "$input_workspace" != "*-native" ] && [ "$input_workspace" != "js-actions" ]; then selected_workspaces=$(echo "$input_workspace" | sed 's/,/ /g') echo "scope=--all --include '${selected_workspaces}'" >> $GITHUB_OUTPUT echo "widgets=[\"$input_workspace\"]" >> $GITHUB_OUTPUT + elif [ "$input_workspace" == "js-actions" ]; then + echo "scope=--all --include 'mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT + echo "widgets=[\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT else echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT echo "widgets=${all_widgets}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 74363061c..f86d6999f 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -18,6 +18,7 @@ on: type: choice options: - "*-native" + - js-actions - accordion-native - activity-indicator-native - animation-native @@ -83,7 +84,7 @@ jobs: - name: "Debug Scope Output" run: | echo "Scope is: ${{ steps.scope.outputs.scope }}" - echo "Widgets are: ${{ steps.scope.outputs.widgets }}" + echo "Widgets or js actions are: ${{ steps.scope.outputs.widgets }}" mendix-version: runs-on: ubuntu-22.04 outputs: @@ -196,14 +197,35 @@ jobs: run: yarn install --immutable - name: "Force rebuild resources" run: | - yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build # Ensure all resources are rebuilt + # Build JS actions if needed + if [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \ + [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \ + [ "${{ github.event_name }}" = "schedule" ]; then + yarn workspace mobile-resources-native run build + yarn workspace nanoflow-actions-native run build + fi + + # Build widgets if needed (any specific widget, *-native, or nightly) + if [ "${{ github.event.inputs.workspace }}" != "js-actions" ] || \ + [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \ + [ "${{ github.event_name }}" = "schedule" ]; then + widgets=$(echo '${{ needs.scope.outputs.widgets }}' | jq -r '.[]') + for w in $widgets; do + yarn workspace $w run build + done + fi - name: "Unit test" run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test - - name: "Run build for development" - run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build - env: - NODE_OPTIONS: --max_old_space_size=6144 - - name: "Upload resources artifact" + - name: "Upload JS actions resources artifact" + if: ${{ github.event.inputs.workspace == 'js-actions' }} + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + with: + name: resources + path: | + packages/jsActions/mobile-resources-native/dist/**/* + packages/jsActions/nanoflow-actions-native/dist/**/* + - name: "Upload widget and JS actions resources artifact" + if: ${{ github.event.inputs.workspace != 'js-actions' }} uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 with: name: resources @@ -238,6 +260,7 @@ jobs: - name: "List resources" run: ls -R resources - name: "Move widgets" + if: ${{ github.event.inputs.workspace != 'js-actions' }} shell: bash run: | if compgen -G 'resources/pluggableWidgets/**/dist/*/*.mpk' > /dev/null; then @@ -436,8 +459,9 @@ jobs: name: ios-app path: native-template/ios/build/Build/Products/**/*.app - android-tests: + android-widget-tests: needs: [scope, mendix-version, project, android-app] + if: ${{ github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule' }} runs-on: ubuntu-22.04 timeout-minutes: 60 strategy: @@ -518,7 +542,7 @@ jobs: echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: "Run the android tests" + - name: "Run android tests" uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.0.0 with: api-level: 30 @@ -529,9 +553,9 @@ jobs: disable-animations: true script: | chmod +x maestro/helpers/prepare_android.sh - chmod +x maestro/run_maestro_tests.sh + chmod +x maestro/run_maestro_widget_tests.sh bash maestro/helpers/prepare_android.sh - bash maestro/run_maestro_tests.sh android "${{ matrix.widget }}" + bash maestro/run_maestro_widget_tests.sh android "${{ matrix.widget }}" - name: "Archive runtime logs" uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 @@ -555,8 +579,9 @@ jobs: path: packages/pluggableWidgets/**/artifacts/ if-no-files-found: ignore - ios-tests: + ios-widget-tests: needs: [scope, mendix-version, project, ios-app] + if: ${{ github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule' }} runs-on: macos-15 timeout-minutes: 60 strategy: @@ -645,9 +670,9 @@ jobs: - name: "Run iOS tests" run: | chmod +x maestro/helpers/prepare_ios.sh - chmod +x maestro/run_maestro_tests.sh + chmod +x maestro/run_maestro_widget_tests.sh bash maestro/helpers/prepare_ios.sh - bash maestro/run_maestro_tests.sh ios "${{ matrix.widget }}" + bash maestro/run_maestro_widget_tests.sh ios "${{ matrix.widget }}" - name: "Archive runtime logs" uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 @@ -671,8 +696,176 @@ jobs: path: packages/pluggableWidgets/**/artifacts/ if-no-files-found: ignore + android-js-tests: + if: ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}} + needs: [mendix-version, project, android-app] + runs-on: ubuntu-22.04 + timeout-minutes: 90 + steps: + - name: "Check out code" + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + - name: "Set up node" + uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 + with: + node-version-file: .nvmrc + cache: yarn + - name: "Install dependencies" + run: yarn install --immutable + - name: "Download project MDA file" + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: mda + - name: "Download Android app" + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: android-app + path: android-app + - name: "Start runtime" + uses: ./.github/actions/start-runtime + with: + mda-file: automation.mda + mendix-version: ${{ needs.mendix-version.outputs.mendix_version }} + - name: "Install Maestro" + run: | + mkdir -p $HOME/.local/bin + curl -L "https://github.com/mobile-dev-inc/maestro/releases/latest/download/maestro.zip" -o maestro.zip + unzip maestro.zip -d $HOME/.local/bin + chmod +x $HOME/.local/bin/maestro/bin/maestro + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Verify maestro + run: $HOME/.local/bin/maestro/bin/maestro --version + - name: Set up Android SDK + run: echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: "Run android tests" + uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.0.0 + with: + api-level: 30 + target: google_apis + arch: x86_64 + profile: pixel + emulator-options: "-no-window -gpu swiftshader_indirect -no-boot-anim -no-snapshot -memory 4096 -cores 4" + disable-animations: true + script: | + chmod +x maestro/helpers/prepare_android.sh + chmod +x maestro/run_maestro_jsactions_tests.sh + bash maestro/helpers/prepare_android.sh + bash maestro/run_maestro_jsactions_tests.sh android + + - name: "Archive runtime logs" + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + if: always() + with: + name: android-runtime-logs-js-actions + path: log/*.log + if-no-files-found: ignore + - name: "Archive test screenshots" + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + if: always() + with: + name: android-screenshots-js-actions + path: ${{ github.workspace }}/maestro/images/actual/android/**/*.png + if-no-files-found: ignore + - name: "Archive artifacts" + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + if: always() + with: + name: android-artifacts-js-actions + path: packages/pluggableWidgets/**/artifacts/ + if-no-files-found: ignore + + ios-js-tests: + if: ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}} + needs: [mendix-version, project, ios-app] + runs-on: macos-15 + timeout-minutes: 90 + steps: + - name: "Check out code" + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + - name: "Set up node" + uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 + with: + node-version-file: .nvmrc + cache: yarn + - name: "Install dependencies" + run: | + yarn cache clean + yarn install --immutable + - name: "Download project MDA file" + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: mda + - name: "Start runtime" + uses: ./.github/actions/start-runtime + with: + mda-file: automation.mda + mendix-version: ${{ needs.mendix-version.outputs.mendix_version }} + + - name: "Download iOS app" + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: ios-app + path: ios-app + - name: Check iOS App Path + run: ls ios-app + + - name: "Verify Xcode CLI Tools" + run: | + if ! xcode-select --print-path; then + echo "Xcode CLI tools not set. Setting them now." + sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer + else + echo "Xcode CLI tools are already configured." + fi + - name: "Install Maestro" + run: | + mkdir -p $HOME/.local/bin + curl -L "https://github.com/mobile-dev-inc/maestro/releases/latest/download/maestro.zip" -o maestro.zip + unzip maestro.zip -d $HOME/.local/bin + chmod +x $HOME/.local/bin/maestro/bin/maestro + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: "Verify maestro" + run: $HOME/.local/bin/maestro/bin/maestro --version + - name: "List Available Simulators" + run: xcrun simctl list devices + - name: "Run iOS tests" + run: | + chmod +x maestro/helpers/prepare_ios.sh + chmod +x maestro/run_maestro_jsactions_tests.sh + bash maestro/helpers/prepare_ios.sh + bash maestro/run_maestro_jsactions_tests.sh ios + + - name: "Archive runtime logs" + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + if: always() + with: + name: ios-runtime-logs-js-actions + path: log/*.log + if-no-files-found: ignore + - name: "Archive test screenshots" + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + if: always() + with: + name: ios-screenshots-js-actions + path: ${{ github.workspace }}/maestro/images/actual/ios/**/*.png + if-no-files-found: ignore + - name: "Archive artifacts" + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4 + if: always() + with: + name: ios-artifacts-js-actions + path: packages/pluggableWidgets/**/artifacts/ + if-no-files-found: ignore compare-screenshots: - needs: [scope, android-tests, ios-tests] + needs: [scope, android-widget-tests, ios-widget-tests, android-js-tests, ios-js-tests] runs-on: ubuntu-latest if: always() env: @@ -690,6 +883,10 @@ jobs: gh run download ${{ github.run_id }} --name android-screenshots-${widget} --dir images/actual/android/ || true ls -l images/actual/android/ done + # Download JS actions screenshots + echo "Downloading android-screenshots-js-actions" + gh run download ${{ github.run_id }} --name android-screenshots-js-actions --dir images/actual/android/ || true + ls -l images/actual/android/ - name: "Download iOS screenshots" run: | @@ -700,8 +897,11 @@ jobs: gh run download ${{ github.run_id }} --name ios-screenshots-${widget} --dir images/actual/ios/ || true ls -l images/actual/ios/ done + # Download JS actions screenshots + echo "Downloading ios-screenshots-js-actions" + gh run download ${{ github.run_id }} --name ios-screenshots-js-actions --dir images/actual/ios/ || true + ls -l images/actual/ios/ - - name: "Set up node" uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 with: diff --git a/maestro/images/expected/android/authentication.png b/maestro/images/expected/android/authentication.png new file mode 100644 index 000000000..6cbd9375f Binary files /dev/null and b/maestro/images/expected/android/authentication.png differ diff --git a/maestro/images/expected/android/clipboard.png b/maestro/images/expected/android/clipboard.png new file mode 100644 index 000000000..a11de62ae Binary files /dev/null and b/maestro/images/expected/android/clipboard.png differ diff --git a/maestro/images/expected/android/device_info.png b/maestro/images/expected/android/device_info.png new file mode 100644 index 000000000..3e9e0914f Binary files /dev/null and b/maestro/images/expected/android/device_info.png differ diff --git a/maestro/images/expected/android/toggle_sidebar.png b/maestro/images/expected/android/toggle_sidebar.png new file mode 100644 index 000000000..91af73a1f Binary files /dev/null and b/maestro/images/expected/android/toggle_sidebar.png differ diff --git a/maestro/images/expected/ios/authentication.png b/maestro/images/expected/ios/authentication.png new file mode 100644 index 000000000..4d01f5f1f Binary files /dev/null and b/maestro/images/expected/ios/authentication.png differ diff --git a/maestro/images/expected/ios/bg_image_dynamic_svg.png b/maestro/images/expected/ios/bg_image_dynamic_svg.png deleted file mode 100644 index 04c75add6..000000000 Binary files a/maestro/images/expected/ios/bg_image_dynamic_svg.png and /dev/null differ diff --git a/maestro/images/expected/ios/clipboard.png b/maestro/images/expected/ios/clipboard.png new file mode 100644 index 000000000..fb19225fd Binary files /dev/null and b/maestro/images/expected/ios/clipboard.png differ diff --git a/maestro/images/expected/ios/toggle_sidebar.png b/maestro/images/expected/ios/toggle_sidebar.png new file mode 100644 index 000000000..e324279a3 Binary files /dev/null and b/maestro/images/expected/ios/toggle_sidebar.png differ diff --git a/maestro/maestro/images/actual/ios/authentication.png b/maestro/maestro/images/actual/ios/authentication.png new file mode 100644 index 000000000..235b9e00a Binary files /dev/null and b/maestro/maestro/images/actual/ios/authentication.png differ diff --git a/maestro/maestro/images/actual/ios/clipboard.png b/maestro/maestro/images/actual/ios/clipboard.png new file mode 100644 index 000000000..ed3ed3d93 Binary files /dev/null and b/maestro/maestro/images/actual/ios/clipboard.png differ diff --git a/maestro/maestro/images/actual/ios/device_info.png b/maestro/maestro/images/actual/ios/device_info.png new file mode 100644 index 000000000..e906d88a6 Binary files /dev/null and b/maestro/maestro/images/actual/ios/device_info.png differ diff --git a/maestro/maestro/images/actual/ios/toggle_sidebar.png b/maestro/maestro/images/actual/ios/toggle_sidebar.png new file mode 100644 index 000000000..362cc34eb Binary files /dev/null and b/maestro/maestro/images/actual/ios/toggle_sidebar.png differ diff --git a/maestro/run_maestro_jsactions_tests.sh b/maestro/run_maestro_jsactions_tests.sh new file mode 100644 index 000000000..204c5c59e --- /dev/null +++ b/maestro/run_maestro_jsactions_tests.sh @@ -0,0 +1,105 @@ +# Function to run jsActions tests (mobile-resources-native and nanoflow-actions-native) +#!/bin/bash + +# Get the directory of the current script +SCRIPT_DIR=$(dirname "$0") + +# Source the helpers.sh script from the script's directory +source "$SCRIPT_DIR/helpers/helpers.sh" || { echo "Failed to source helpers.sh"; exit 1; } + +# Check if run_tests function is available +command -v run_tests >/dev/null 2>&1 || { echo "run_tests function not found"; exit 1; } + +if [ "$1" == "android" ]; then + APP_ID="com.mendix.nativetemplate" + PLATFORM="android" +elif [ "$1" == "ios" ]; then + APP_ID="com.mendix.native.template" + PLATFORM="ios" + IOS_DEVICE="iPhone 16" +else + echo "Usage: $0 [android|ios]" + exit 1 +fi + +passed_tests=() +failed_tests=() +final_failed_tests=() + +run_jsactions_tests() { + local jsactions_paths=( + "packages/jsActions/mobile-resources-native/e2e/specs/maestro" + "packages/jsActions/nanoflow-actions-native/e2e/specs/maestro" + ) + local all_yaml_files=() + for path in "${jsactions_paths[@]}"; do + if [ -d "$path" ]; then + local yaml_files=( $(find "$path" -type f -name "*.yaml" ! -name "*_ios.yaml" ! -name "*_android.yaml") ) + all_yaml_files+=("${yaml_files[@]}") + fi + done + if [ ${#all_yaml_files[@]} -eq 0 ]; then + echo "No jsActions Maestro YAML tests found." + return 0 + fi + + passed_tests=() + failed_tests=() + final_failed_tests=() + + run_tests "${all_yaml_files[@]}" + + echo + echo "📊 Initial Test Execution Summary for jsActions:" + echo "-----------------------" + if [ ${#passed_tests[@]} -gt 0 ]; then + echo "✅ Passed Tests:" + for test in "${passed_tests[@]}"; do + echo " - $(basename "$test")" + done + else + echo "No tests passed." + fi + + if [ ${#failed_tests[@]} -gt 0 ]; then + echo "❌ Failed Tests:" + for test in "${failed_tests[@]}"; do + echo " - $(basename "$test")" + done + else + echo "No tests failed." + fi + + if [ ${#failed_tests[@]} -gt 0 ]; then + rerun_failed_tests "${failed_tests[@]}" + fi + + echo + echo "📊 Final Test Execution Summary for jsActions:" + echo "-----------------------" + if [ ${#passed_tests[@]} -gt 0 ]; then + echo "✅ Passed Tests:" + for test in "${passed_tests[@]}"; do + echo " - $(basename "$test")" + done + else + echo "No tests passed." + fi + + if [ ${#final_failed_tests[@]} -gt 0 ]; then + echo "❌ Failed Tests:" + for test in "${final_failed_tests[@]}"; do + echo " - $(basename "$test")" + done + return 1 + else + echo "All jsActions tests passed!" + return 0 + fi +} + +# Run jsActions tests +run_jsactions_tests +if [ $? -ne 0 ]; then + exit 1 +fi \ No newline at end of file diff --git a/maestro/run_maestro_jsactions_tests_local.sh b/maestro/run_maestro_jsactions_tests_local.sh new file mode 100644 index 000000000..b0a351205 --- /dev/null +++ b/maestro/run_maestro_jsactions_tests_local.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Update DEVICE_ID and path to the yaml file according to needs +# Use command like: ./run_maestro_tests_local.sh android/ios proggress-circle-native + +if [ "$1" == "android" ]; then + APP_ID="com.mendix.nativetemplate" + DEVICE_ID="emulator-5554" + PLATFORM="android" +elif [ "$1" == "ios" ]; then + APP_ID="com.mendix.native.template" + DEVICE_ID="731B4851-2AB4-40D7-A586-6BAC6381674D" + PLATFORM="ios" +else + echo "Usage: $0 [android|ios] [action]" + exit 1 +fi + +ACTION=${2:-*-native} + +# Determine the search path based on the widget selection +if [ "$ACTION" == "*-native" ]; then + search_path="../packages/jsActions" +else + search_path="../packages/jsActions/$ACTION" +fi + +# Find all .yaml files under the determined search path, excluding platform-specific files +for yaml_test_file in $(find $search_path -type f -path "*/maestro/*.yaml" ! -name "*_ios.yaml" ! -name "*_android.yaml"); do + echo "Running test: $yaml_test_file" + maestro --device $DEVICE_ID test --env APP_ID=$APP_ID --env PLATFORM=$PLATFORM "$yaml_test_file" +done \ No newline at end of file diff --git a/maestro/run_maestro_tests.sh b/maestro/run_maestro_widget_tests.sh similarity index 100% rename from maestro/run_maestro_tests.sh rename to maestro/run_maestro_widget_tests.sh diff --git a/maestro/run_maestro_tests_local.sh b/maestro/run_maestro_widget_tests_local.sh similarity index 100% rename from maestro/run_maestro_tests_local.sh rename to maestro/run_maestro_widget_tests_local.sh diff --git a/package.json b/package.json index 75792534d..60d66e2ab 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,10 @@ "setup-mobile": "yarn setup-android && yarn setup-ios", "patch-package": "sh ./scripts/patch/patch-package.sh", "build:widgets": "node ./scripts/widget/buildWidgets.js", - "test:maestro:ios": "bash maestro/run_maestro_tests.sh ios", - "test:maestro:android": "bash maestro/run_maestro_tests.sh android" + "test_widgets:maestro:ios": "bash maestro/run_maestro_widget_tests.sh ios", + "test_widgets:maestro:android": "bash maestro/run_maestro_widget_tests.sh android", + "test_jsactions:maestro:ios": "bash maestro/run_maestro_jsactions_tests.sh ios", + "test_jsactions:maestro:android": "bash maestro/run_maestro_jsactions_tests.sh android" }, "workspaces": { "packages": [ diff --git a/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Authentication.yaml b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Authentication.yaml new file mode 100644 index 000000000..ca1fa7aef --- /dev/null +++ b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Authentication.yaml @@ -0,0 +1,21 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "JS Actions" +- tapOn: + text: "Authentication" +- tapOn: + text: "Is biometric authentication supported?" +# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible +- extendedWaitUntil: + visible: randText # Any random text that does not exist in the UI + optional: true # This should be true so that the test won't fail + timeout: 5000 # 5 seconds +- takeScreenshot: + path: "maestro/images/actual/${PLATFORM}/authentication" + + diff --git a/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Clipboard.yaml b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Clipboard.yaml new file mode 100644 index 000000000..5ca416f79 --- /dev/null +++ b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Clipboard.yaml @@ -0,0 +1,16 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "JS Actions" +- tapOn: + text: "Clipboard" +- tapOn: + text: "Set clipboard content to 'Hi there'" +- tapOn: + text: "Get clipboard content" +- takeScreenshot: + path: "maestro/images/actual/${PLATFORM}/clipboard" diff --git a/packages/jsActions/mobile-resources-native/e2e/specs/maestro/DeepLink.yaml b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/DeepLink.yaml new file mode 100644 index 000000000..1aba9a3a7 --- /dev/null +++ b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/DeepLink.yaml @@ -0,0 +1,18 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "Deep Link" +- tapOn: + text: "Test Parse" +- assertVisible: "Your Deeplink callback URL \"https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top\"\ + + path 1 = forum + + path 2 = questions" + + + diff --git a/packages/jsActions/mobile-resources-native/e2e/specs/maestro/DeviceInfo.yaml b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/DeviceInfo.yaml new file mode 100644 index 000000000..4a92c6324 --- /dev/null +++ b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/DeviceInfo.yaml @@ -0,0 +1,19 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "JS Actions" +- tapOn: + text: "Mobile" +- tapOn: + text: "Device info" +# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible +- extendedWaitUntil: + visible: randText # Any random text that does not exist in the UI + optional: true # This should be true so that the test won't fail + timeout: 20000 # 20 seconds +- takeScreenshot: + path: "maestro/images/actual/${PLATFORM}/device_info" \ No newline at end of file diff --git a/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Network.yaml b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Network.yaml new file mode 100644 index 000000000..82c1df2aa --- /dev/null +++ b/packages/jsActions/mobile-resources-native/e2e/specs/maestro/Network.yaml @@ -0,0 +1,28 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "JS Actions" +- tapOn: + text: "Network" +- tapOn: + text: "Is connected?" +- assertVisible: + text: "Yes" +- tapOn: + text: "OK" +- tapOn: + text: "Is wifi connection?" +- assertVisible: + text: "Yes" +- tapOn: + text: "OK" +- tapOn: + text: "Is cellular connection?" +- assertVisible: + text: "No" +- tapOn: + text: "OK" diff --git a/packages/jsActions/mobile-resources-native/src/e2e/specs/maestro/Actions.yaml b/packages/jsActions/mobile-resources-native/src/e2e/specs/maestro/Actions.yaml deleted file mode 100644 index 9c82734bc..000000000 --- a/packages/jsActions/mobile-resources-native/src/e2e/specs/maestro/Actions.yaml +++ /dev/null @@ -1,78 +0,0 @@ -appId: "${APP_ID}" ---- -- runFlow: - file: "../../../../../../../maestro/Precondition.yaml" -- tapOn: - point: "37%,94%" -# Authentication -- tapOn: - text: "Authentication" -- tapOn: - text: "Is biometric authentication supported?" -# - assertVisible: -# text: "Information" -- tapOn: - text: "OK" -- tapOn: "Go back" - - -# Clipboard -- tapOn: - text: "Clipboard" -- tapOn: - text: "Set clipboard content to 'Hi there'" -- tapOn: - text: "Get clipboard content" -- tapOn: "Go back" - -# Network -- tapOn: - text: "Network" -- tapOn: - text: "Is connected?" -- assertVisible: - text: "Information" -- tapOn: - text: "OK" -- tapOn: - text: "Is wifi connected?" -- assertVisible: - text: "Information" -- tapOn: - text: "OK" -- tapOn: - text: "Is cellular connected?" -- assertVisible: - text: "Information" -- tapOn: - text: "OK" -- tapOn: "Go back" - -# Notifications -- tapOn: - text: "Notifications" -- tapOn: - text: "Has permission?" -- assertVisible: - text: "Information" -- tapOn: - text: "OK" -- tapOn: - text: "Request permission" -- assertVisible: - text: "Permission was granted" -- tapOn: - text: "OK" -- tapOn: - text: "Display notification" -- assertVisible: - text: "Title" -- tapOn: "Go back" - -# Mobile -- tapOn: - text: "Mobile" -- tapOn: - text: "Device info" -- assertVisible: - text: "Device info" \ No newline at end of file diff --git a/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/Confirmation.yaml b/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/Confirmation.yaml new file mode 100644 index 000000000..7a9600401 --- /dev/null +++ b/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/Confirmation.yaml @@ -0,0 +1,22 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "NanoflowCommons" +- tapOn: + text: "Client activities" +- tapOn: + text: "Confirmation" +- tapOn: + id: "container1" +- inputText: "11" +- tapOn: "Show confirmation " +- assertVisible: "Yolo" +- assertVisible: "11" +- tapOn: "OK" +- assertVisible: "Confirmed!" + + diff --git a/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/GetPlatform.yaml b/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/GetPlatform.yaml new file mode 100644 index 000000000..8f56cb4c4 --- /dev/null +++ b/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/GetPlatform.yaml @@ -0,0 +1,24 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "NanoflowCommons" +- tapOn: + text: "Other activities" +- tapOn: + text: "Get platform" +- assertVisible: "Current platform: Native" +- tapOn: "OK" +- tapOn: "Wait 3s" +- extendedWaitUntil: + visible: "Done!" + timeout: 10000 + + + + + + diff --git a/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/ToggleSidebar.yaml b/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/ToggleSidebar.yaml new file mode 100644 index 000000000..1fc54daab --- /dev/null +++ b/packages/jsActions/nanoflow-actions-native/e2e/specs/maestro/ToggleSidebar.yaml @@ -0,0 +1,23 @@ +appId: "${APP_ID}" +--- +- runFlow: + file: "../../../../../../maestro/Precondition.yaml" +- tapOn: + text: "J" +- tapOn: + text: "NanoflowCommons" +- tapOn: + text: "Client activities" +- tapOn: + text: "Toggle sidebar" +- tapOn: + id: "actionButton1" +# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be complete +- extendedWaitUntil: + visible: randText # Any random text that does not exist in the UI + optional: true # This should be true so that the test won't fail + timeout: 5000 # 5 seconds +- takeScreenshot: + path: "maestro/images/actual/${PLATFORM}/toggle_sidebar" + + diff --git a/packages/pluggableWidgets/bar-chart-native/e2e/specs/maestro/Bar_Chart.yaml b/packages/pluggableWidgets/bar-chart-native/e2e/specs/maestro/Bar_Chart.yaml index cf25bf12d..56939851a 100644 --- a/packages/pluggableWidgets/bar-chart-native/e2e/specs/maestro/Bar_Chart.yaml +++ b/packages/pluggableWidgets/bar-chart-native/e2e/specs/maestro/Bar_Chart.yaml @@ -10,6 +10,11 @@ appId: "${APP_ID}" text: "Bar chart" - assertVisible: id: "container1" +# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible +- extendedWaitUntil: + visible: randText # Any random text that does not exist in the UI + optional: true # This should be true so that the test won't fail + timeout: 15000 # 15 seconds - takeScreenshot: path: "maestro/images/actual/${PLATFORM}/bar_chart" diff --git a/packages/pluggableWidgets/column-chart-native/e2e/specs/maestro/Column_chart_native.yaml b/packages/pluggableWidgets/column-chart-native/e2e/specs/maestro/Column_chart_native.yaml index 888110a12..4edb88ddf 100644 --- a/packages/pluggableWidgets/column-chart-native/e2e/specs/maestro/Column_chart_native.yaml +++ b/packages/pluggableWidgets/column-chart-native/e2e/specs/maestro/Column_chart_native.yaml @@ -10,6 +10,11 @@ appId: "${APP_ID}" text: "Column chart" - assertVisible: id: "container1" +# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible +- extendedWaitUntil: + visible: randText # Any random text that does not exist in the UI + optional: true # This should be true so that the test won't fail + timeout: 15000 # 15 seconds - takeScreenshot: path: "maestro/images/actual/${PLATFORM}/column_chart"