File tree Expand file tree Collapse file tree 8 files changed +296
-40
lines changed Expand file tree Collapse file tree 8 files changed +296
-40
lines changed Original file line number Diff line number Diff line change 1
1
import { e2e } from '../jest.setup' ;
2
2
3
- const testAppId = 'com.microsoft.reacttestapp ' ;
3
+ const testAppId = 'com.microsoft.ReactTestApp ' ;
4
4
5
5
export const commands = {
6
6
restartApp : async ( ) => {
7
7
await e2e . terminateApp ( testAppId ) ;
8
8
await e2e . activateApp ( testAppId ) ;
9
9
} ,
10
10
elementByLabel : async ( id : string ) => await e2e . $ ( `~${ id } ` ) ,
11
- elementByLabelBy : async ( id : string ) => await e2e . $ ( `aria/${ id } ` ) ,
12
11
} ;
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <manifest
3
+ package =" com.microsoft.ReactTestApp"
4
+ />
Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ allprojects {
77
77
matchingFallbacks = [" debug" , " release" ]
78
78
}
79
79
}
80
- androidExtension. testBuildType = ' release'
81
- androidExtension. sourceSets. androidTest. java. srcDirs + = " $rootDir /app/src/androidTest/java"
82
80
83
81
project. dependencies {
84
82
def hermesDir = file(' ../../node_modules/hermes-engine/android' ). absolutePath
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ function Functional(): JSX.Element {
162
162
return (
163
163
< View key = { name } style = { styles . failed } >
164
164
< Text style = { styles . testLabel } > { name } </ Text >
165
- < View accessibilityLabelledBy = "Fail" accessibilityLabel = { testID } >
165
+ < View >
166
166
< Text style = { styles . testResult } > { `Step: ${
167
167
result . step + 1
168
168
} `} </ Text >
Original file line number Diff line number Diff line change @@ -11,7 +11,14 @@ const Capabilities = {
11
11
'appium:automationName' : 'UiAutomator2' ,
12
12
'appium:newCommandTimeout' : 240 ,
13
13
} ,
14
- ios : { } ,
14
+ ios : {
15
+ platformName : 'iOS' ,
16
+ 'appium:platformVersion' : '16.4' ,
17
+ 'appium:deviceName' : 'iPhone 14' ,
18
+ 'appium:automationName' : 'XCUITest' ,
19
+ 'appium:app' :
20
+ 'example/ios/build/Build/Products/Release-iphonesimulator/ReactTestApp.app' ,
21
+ } ,
15
22
} ;
16
23
17
24
let client : WebdriverIO . Browser ;
Original file line number Diff line number Diff line change 77
77
"@types/react" : " ^18.0.0" ,
78
78
"appium" : " 2.0.0-rc.3" ,
79
79
"appium-uiautomator2-driver" : " ^2.26.2" ,
80
+ "appium-xcuitest-driver" : " ^4.32.5" ,
80
81
"concurrently" : " ^6.4.0" ,
81
82
"eslint" : " ^8.0.0" ,
82
83
"expo" : " ^48.0.0" ,
Original file line number Diff line number Diff line change @@ -55,6 +55,27 @@ bundle_js() {
55
55
react-native bundle --entry-file index.ts --platform ios --bundle-output example/index.ios.jsbundle $extraArgs
56
56
}
57
57
58
+ assert_appium_server_running () {
59
+ RES=$( curl -Is " http://0.0.0.0:4723/status" | grep HTTP | cut -d ' ' -f2)
60
+
61
+ if [ " $RES " != " 200" ]; then
62
+ echo " [iOS E2E] Appium server not running! Try starting it:"
63
+ echo
64
+ echo " yarn appium --config example/appium.config.js"
65
+ echo
66
+ exit 2
67
+ fi ;
68
+ }
69
+
70
+ run_e2e_test () {
71
+ export NODE_OPTIONS=--experimental-vm-modules
72
+ export E2E_PLATFORM=ios
73
+ assert_appium_server_running
74
+
75
+ echo " [iOS E2E] Running tests"
76
+ jest --config example/jest.config.ts --roots=$PWD
77
+ }
78
+
58
79
59
80
case $1 in
60
81
build)
@@ -66,6 +87,9 @@ case $1 in
66
87
bundle)
67
88
shift ; bundle_js $@
68
89
;;
90
+ test)
91
+ run_e2e_test
92
+ ;;
69
93
* )
70
94
echo -n " Unknown argument: $1 "
71
95
;;
You can’t perform that action at this time.
0 commit comments