diff --git a/.github/workflows/e2e-harness-android.yml b/.github/workflows/e2e-harness-android.yml index 4e8f55794c..e4bca32ce6 100644 --- a/.github/workflows/e2e-harness-android.yml +++ b/.github/workflows/e2e-harness-android.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-harness-android: @@ -31,12 +31,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/app-harness && yarn build:android-test + cd packages/app-harness && yarn run:android-test & sleep 180 - name: E2E run: | - cd packages/app-harness && yarn e2e:android + cd packages/app-harness && yarn e2e:android && kill $(lsof -t -i:8083) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-harness-androidtv.yml b/.github/workflows/e2e-harness-androidtv.yml index 90e0baad19..336a6d5750 100644 --- a/.github/workflows/e2e-harness-androidtv.yml +++ b/.github/workflows/e2e-harness-androidtv.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-harness-androidtv: @@ -31,12 +31,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/app-harness && yarn build:androidtv-test + cd packages/app-harness && yarn run:androidtv-test & sleep 180 - name: E2E run: | - cd packages/app-harness && yarn e2e:androidtv + cd packages/app-harness && yarn e2e:androidtv && kill $(lsof -t -i:8084) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-harness-ios.yml b/.github/workflows/e2e-harness-ios.yml index 303f88edba..e3bdd87ad9 100644 --- a/.github/workflows/e2e-harness-ios.yml +++ b/.github/workflows/e2e-harness-ios.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-harness-ios: @@ -32,12 +32,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/app-harness && yarn build:ios-test + cd packages/app-harness && yarn run:ios-test & sleep 1200 - name: E2E run: | - cd packages/app-harness && yarn e2e:ios + cd packages/app-harness && yarn e2e:ios && kill $(lsof -t -i:8082) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-harness-macos.yml b/.github/workflows/e2e-harness-macos.yml index 48e81cb235..d87641275d 100644 --- a/.github/workflows/e2e-harness-macos.yml +++ b/.github/workflows/e2e-harness-macos.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-harness-macos: diff --git a/.github/workflows/e2e-harness-tvos.yml b/.github/workflows/e2e-harness-tvos.yml index 69b0420c22..5d854aff81 100644 --- a/.github/workflows/e2e-harness-tvos.yml +++ b/.github/workflows/e2e-harness-tvos.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-harness-tvos: @@ -32,12 +32,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/app-harness && yarn build:tvos-test + cd packages/app-harness && yarn run:tvos-test & sleep 1200 - name: E2E run: | - cd packages/app-harness && yarn e2e:tvos + cd packages/app-harness && yarn e2e:tvos && kill $(lsof -t -i:8089) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-harness-web.yml b/.github/workflows/e2e-harness-web.yml index ed45d6d715..04882bb0c2 100644 --- a/.github/workflows/e2e-harness-web.yml +++ b/.github/workflows/e2e-harness-web.yml @@ -5,17 +5,17 @@ defaults: shell: zsh -l {0} on: workflow_dispatch: - # push: - # branches: - # - main - # - 'release/**' - # paths-ignore: - # - 'docs/**' - # - '**/README.md' - # - '**/lerna.json' - # - '**/metadata.json' - # - '**/renative.json' - # - '**/package.json' + push: + branches: + - main + - 'release/**' + paths-ignore: + - 'docs/**' + - '**/README.md' + - '**/lerna.json' + - '**/metadata.json' + - '**/renative.json' + - '**/package.json' pull_request: types: [labeled] diff --git a/.github/workflows/e2e-template-android.yml b/.github/workflows/e2e-template-android.yml index f3d1ce8b03..490f5ee8a9 100644 --- a/.github/workflows/e2e-template-android.yml +++ b/.github/workflows/e2e-template-android.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-template-android: @@ -31,12 +31,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/template-starter && yarn build:android-test + cd packages/template-starter && yarn run:android-test & sleep 180 - name: E2E run: | - cd packages/template-starter && yarn e2e:android + cd packages/template-starter && yarn e2e:android && kill $(lsof -t -i:8083) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-template-androidtv.yml b/.github/workflows/e2e-template-androidtv.yml index 94ec686e0b..93a62d246f 100644 --- a/.github/workflows/e2e-template-androidtv.yml +++ b/.github/workflows/e2e-template-androidtv.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-template-androidtv: @@ -31,12 +31,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/template-starter && yarn build:androidtv-test + cd packages/template-starter && yarn run:androidtv-test & sleep 180 - name: E2E run: | - cd packages/template-starter && yarn e2e:androidtv + cd packages/template-starter && yarn e2e:androidtv && kill $(lsof -t -i:8084) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-template-ios.yml b/.github/workflows/e2e-template-ios.yml index df93de486a..f7a835d396 100644 --- a/.github/workflows/e2e-template-ios.yml +++ b/.github/workflows/e2e-template-ios.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-template-ios: @@ -32,12 +32,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/template-starter && yarn build:ios-test + cd packages/template-starter && yarn run:ios-test & sleep 1200 - name: E2E run: | - cd packages/template-starter && yarn e2e:ios + cd packages/template-starter && yarn e2e:ios && kill $(lsof -t -i:8082) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-template-macos.yml b/.github/workflows/e2e-template-macos.yml index 6e2141eee8..0ad1988d7c 100644 --- a/.github/workflows/e2e-template-macos.yml +++ b/.github/workflows/e2e-template-macos.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-template-macos: diff --git a/.github/workflows/e2e-template-tvos.yml b/.github/workflows/e2e-template-tvos.yml index 45b4f49338..b1fd7decf1 100644 --- a/.github/workflows/e2e-template-tvos.yml +++ b/.github/workflows/e2e-template-tvos.yml @@ -16,8 +16,8 @@ on: # - '**/metadata.json' # - '**/renative.json' # - '**/package.json' - pull_request: - types: [labeled] + # pull_request: + # types: [labeled] jobs: e2e-template-tvos: @@ -32,12 +32,12 @@ jobs: - name: Bootstrap run: | yarn bootstrap-clean - - name: Build + - name: Run run: | - cd packages/template-starter && yarn build:tvos-test + cd packages/template-starter && yarn run:tvos-test & sleep 1200 - name: E2E run: | - cd packages/template-starter && yarn e2e:tvos + cd packages/template-starter && yarn e2e:tvos && kill $(lsof -t -i:8089) # Commented because e2e tests would fail due to minion issues # - name: Post message to Slack via Webhook # if: ${{ github.event_name == 'push' && failure() }} diff --git a/.github/workflows/e2e-template-web.yml b/.github/workflows/e2e-template-web.yml index 290afb2d36..dc846da536 100644 --- a/.github/workflows/e2e-template-web.yml +++ b/.github/workflows/e2e-template-web.yml @@ -5,17 +5,17 @@ defaults: shell: zsh -l {0} on: workflow_dispatch: - # push: - # branches: - # - main - # - 'release/**' - # paths-ignore: - # - 'docs/**' - # - '**/README.md' - # - '**/lerna.json' - # - '**/metadata.json' - # - '**/renative.json' - # - '**/package.json' + push: + branches: + - main + - 'release/**' + paths-ignore: + - 'docs/**' + - '**/README.md' + - '**/lerna.json' + - '**/metadata.json' + - '**/renative.json' + - '**/package.json' pull_request: types: [labeled] diff --git a/packages/app-harness/appConfigs/base/renative.json b/packages/app-harness/appConfigs/base/renative.json index 2c10beebb4..2e4b918147 100644 --- a/packages/app-harness/appConfigs/base/renative.json +++ b/packages/app-harness/appConfigs/base/renative.json @@ -93,7 +93,7 @@ }, "test": { "runScheme": "Debug", - "bundleAssets": true, + "bundleAssets": false, "sdk": "iphonesimulator" }, "release": { @@ -120,7 +120,7 @@ }, "test": { "runScheme": "Debug", - "bundleAssets": true, + "bundleAssets": false, "sdk": "appletvsimulator" }, "release": { @@ -173,7 +173,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "canary": { "signingConfig": "Release", @@ -206,7 +206,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "release": { "signingConfig": "Release", @@ -233,7 +233,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "release": { "signingConfig": "Release", @@ -260,7 +260,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "release": { "signingConfig": "Release", diff --git a/packages/app-harness/package.json b/packages/app-harness/package.json index 7c29a70023..a7f148b8aa 100644 --- a/packages/app-harness/package.json +++ b/packages/app-harness/package.json @@ -21,6 +21,10 @@ "build:ios-test": "npx rnv build -p ios -s test --packageManager yarn --ci -r", "build:macos-test": "npx rnv build -p macos -s test --packageManager yarn --ci -r", "build:tvos-test": "npx rnv build -p tvos -s test --packageManager yarn --ci -r", + "run:android-test": "npx rnv run -p android -s test --packageManager yarn --ci -r", + "run:androidtv-test": "npx rnv run -p androidtv -s test --packageManager yarn --ci -r", + "run:ios-test": "npx rnv run -p ios -s test --packageManager yarn --ci -r", + "run:tvos-test": "npx rnv run -p tvos -s test --packageManager yarn --ci -r", "e2e:android": "APPIUM_HOME=./ PLATFORM=android JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.cjs", "e2e:androidtv": "APPIUM_HOME=./ PLATFORM=androidtv JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.cjs", "e2e:ios": "APPIUM_HOME=./ PLATFORM=ios wdio wdio.conf.cjs", diff --git a/packages/app-harness/src/app/index.tsx b/packages/app-harness/src/app/index.tsx index 80e0a5743a..0c9438b7b9 100644 --- a/packages/app-harness/src/app/index.tsx +++ b/packages/app-harness/src/app/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect } from 'react'; import { Text, View } from 'react-native'; +import { testProps } from '../config'; import SplashScreen from 'react-native-splash-screen'; const App = () => { @@ -8,7 +9,7 @@ const App = () => { }, []); return ( - ReNative Harness + ReNative Harness {`hermes: ${typeof HermesInternal === 'object' && HermesInternal !== null ? 'yes' : 'no'}`} ); diff --git a/packages/app-harness/src/app/index.web.tsx b/packages/app-harness/src/app/index.web.tsx index a4685e0290..d77e79f1d1 100644 --- a/packages/app-harness/src/app/index.web.tsx +++ b/packages/app-harness/src/app/index.web.tsx @@ -1,10 +1,11 @@ import React from 'react'; +import { testProps } from '../config'; import { Text, View } from 'react-native'; const App = () => { return ( - ReNative Harness + ReNative Harness {`hermes: ${typeof HermesInternal === 'object' && HermesInternal !== null ? 'yes' : 'no'}`} ); diff --git a/packages/app-harness/src/config.tsx b/packages/app-harness/src/config.tsx index 5593b052d0..32e34b2e12 100644 --- a/packages/app-harness/src/config.tsx +++ b/packages/app-harness/src/config.tsx @@ -1,7 +1,19 @@ // @ts-ignore +import { isPlatformIos, isPlatformMacos, isPlatformTvos, isPlatformWeb } from '@rnv/renative'; import CONFIG from '../platformAssets/renative.runtime.json'; import '../platformAssets/runtime/fontManager'; +export function testProps(testId: string | undefined) { + if (!testId) { + return; + } + const isApplePlatform = isPlatformIos || isPlatformTvos || isPlatformMacos; + if (isApplePlatform || isPlatformWeb) { + return { testID: testId }; + } + return { accessibilityLabel: testId, accessible: true }; +} + if (!global.performance) { // @ts-expect-error Performance needs to be typed global.performance = {}; diff --git a/packages/app-harness/test/specs/e2e.cjs b/packages/app-harness/test/specs/e2e.cjs index c183f81a6f..d1fa07c02b 100644 --- a/packages/app-harness/test/specs/e2e.cjs +++ b/packages/app-harness/test/specs/e2e.cjs @@ -1,7 +1,11 @@ const FlexnRunner = require('@flexn/graybox').default; -describe('Test Template Starter', () => { +describe('Test App Harness', () => { before(() => { FlexnRunner.launchApp(); }); + + it('--> check if element has correct text in Home Page', async () => { + await FlexnRunner.expectToHaveTextById('app-harness-home-screen-intro-text', 'ReNative Harness'); + }); }); diff --git a/packages/app-harness/wdio.conf.cjs b/packages/app-harness/wdio.conf.cjs index f31c046758..f456188826 100644 --- a/packages/app-harness/wdio.conf.cjs +++ b/packages/app-harness/wdio.conf.cjs @@ -21,7 +21,7 @@ const capabilities = { 'appium:platformVersion': '16.4', 'appium:automationName': 'XCUITest', 'appium:bundleId': 'renative.harness.test', - 'appium:app': 'platformBuilds/harness_ios/build/RNVApp/Build/Products/Debug-iphonesimulator/RNVApp.app', + // 'appium:app': 'platformBuilds/harness_ios/build/RNVApp/Build/Products/Debug-iphonesimulator/RNVApp.app', }, ], tvos: [ @@ -31,8 +31,8 @@ const capabilities = { 'appium:platformVersion': '16.4', 'appium:automationName': 'XCUITest', 'appium:bundleId': 'renative.harness.test', - 'appium:app': - 'platformBuilds/harness_tvos/build/RNVApp/Build/Products/Debug-appletvsimulator/RNVApp-tvOS.app', + // 'appium:app': + // 'platformBuilds/harness_tvos/build/RNVApp/Build/Products/Debug-appletvsimulator/RNVApp-tvOS.app', }, ], android: [ @@ -43,7 +43,7 @@ const capabilities = { 'appium:automationName': 'UiAutomator2', 'appium:appPackage': 'renative.harness.test', 'appium:appActivity': 'renative.harness.test.MainActivity', - 'appium:app': 'platformBuilds/harness_android/app/build/outputs/apk/debug/app-debug.apk', + // 'appium:app': 'platformBuilds/harness_android/app/build/outputs/apk/debug/app-debug.apk', }, ], androidtv: [ @@ -54,7 +54,7 @@ const capabilities = { 'appium:automationName': 'UiAutomator2', 'appium:appPackage': 'renative.harness.test', 'appium:appActivity': 'renative.harness.test.MainActivity', - 'appium:app': 'platformBuilds/harness_androidtv/app/build/outputs/apk/debug/app-debug.apk', + // 'appium:app': 'platformBuilds/harness_androidtv/app/build/outputs/apk/debug/app-debug.apk', }, ], macos: [ @@ -105,7 +105,7 @@ exports.config = { // then the current working directory is where your `package.json` resides, so `wdio` // will be called from there. // - specs: ['./test/specs/playground.cjs'], + specs: ['./test/specs/e2e.cjs'], // Patterns to exclude. exclude: [ // 'path/to/excluded/files' diff --git a/packages/template-starter/appConfigs/base/renative.json b/packages/template-starter/appConfigs/base/renative.json index 48ab296034..1cce4e2a5c 100644 --- a/packages/template-starter/appConfigs/base/renative.json +++ b/packages/template-starter/appConfigs/base/renative.json @@ -76,7 +76,7 @@ }, "test": { "runScheme": "Debug", - "bundleAssets": true, + "bundleAssets": false, "sdk": "iphonesimulator" }, "release": { @@ -100,7 +100,7 @@ }, "test": { "runScheme": "Debug", - "bundleAssets": true, + "bundleAssets": false, "sdk": "appletvsimulator" }, "release": { @@ -174,7 +174,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "release": { "signingConfig": "Release", @@ -198,7 +198,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "release": { "signingConfig": "Release", @@ -222,7 +222,7 @@ }, "test": { "signingConfig": "Debug", - "bundleAssets": true + "bundleAssets": false }, "release": { "signingConfig": "Release", diff --git a/packages/template-starter/package.json b/packages/template-starter/package.json index 991f865a9d..2f2d16fba1 100644 --- a/packages/template-starter/package.json +++ b/packages/template-starter/package.json @@ -74,6 +74,10 @@ "build:ios-test": "npx rnv build -p ios -s test -c template --packageManager yarn --ci -r", "build:macos-test": "npx rnv build -p macos -s test -c template --packageManager yarn --ci -r", "build:tvos-test": "npx rnv build -p tvos -s test -c template --packageManager yarn --ci -r", + "run:android-test": "npx rnv run -p android -s test -c template --packageManager yarn --ci -r", + "run:androidtv-test": "npx rnv run -p androidtv -s test -c template --packageManager yarn --ci -r", + "run:ios-test": "npx rnv run -p ios -s test -c template --packageManager yarn --ci -r", + "run:tvos-test": "npx rnv run -p tvos -s test -c template --packageManager yarn --ci -r", "e2e:android": "APPIUM_HOME=./ PLATFORM=android JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.cjs", "e2e:androidtv": "APPIUM_HOME=./ PLATFORM=androidtv JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.cjs", "e2e:ios": "APPIUM_HOME=./ PLATFORM=ios wdio wdio.conf.cjs", diff --git a/packages/template-starter/wdio.conf.cjs b/packages/template-starter/wdio.conf.cjs index eaa67a94ce..71d670c2e1 100644 --- a/packages/template-starter/wdio.conf.cjs +++ b/packages/template-starter/wdio.conf.cjs @@ -21,7 +21,7 @@ const capabilities = { 'appium:platformVersion': '16.4', 'appium:automationName': 'XCUITest', 'appium:bundleId': 'renative.helloworld.test', - 'appium:app': 'platformBuilds/template_ios/build/RNVApp/Build/Products/Debug-iphonesimulator/RNVApp.app', + // 'appium:app': 'platformBuilds/template_ios/build/RNVApp/Build/Products/Debug-iphonesimulator/RNVApp.app', }, ], tvos: [ @@ -31,8 +31,8 @@ const capabilities = { 'appium:platformVersion': '16.4', 'appium:automationName': 'XCUITest', 'appium:bundleId': 'renative.helloworld.test', - 'appium:app': - 'platformBuilds/template_tvos/build/RNVApp/Build/Products/Debug-appletvsimulator/RNVApp-tvOS.app', + // 'appium:app': + // 'platformBuilds/template_tvos/build/RNVApp/Build/Products/Debug-appletvsimulator/RNVApp-tvOS.app', }, ], android: [ @@ -43,7 +43,7 @@ const capabilities = { 'appium:automationName': 'UiAutomator2', 'appium:appPackage': 'renative.helloworld.test', 'appium:appActivity': 'renative.helloworld.test.MainActivity', - 'appium:app': 'platformBuilds/template_android/app/build/outputs/apk/debug/app-debug.apk', + // 'appium:app': 'platformBuilds/template_android/app/build/outputs/apk/debug/app-debug.apk', }, ], androidtv: [ @@ -54,7 +54,7 @@ const capabilities = { 'appium:automationName': 'UiAutomator2', 'appium:appPackage': 'renative.helloworld.test', 'appium:appActivity': 'renative.helloworld.test.MainActivity', - 'appium:app': 'platformBuilds/template_androidtv/app/build/outputs/apk/debug/app-debug.apk', + // 'appium:app': 'platformBuilds/template_androidtv/app/build/outputs/apk/debug/app-debug.apk', }, ], macos: [ @@ -105,7 +105,7 @@ exports.config = { // then the current working directory is where your `package.json` resides, so `wdio` // will be called from there. // - specs: ['./test/specs/playground.cjs'], + specs: ['./test/specs/e2e.cjs'], // Patterns to exclude. exclude: [ // 'path/to/excluded/files'