Skip to content

Commit 15c10b9

Browse files
author
Krzysztof Borowy
committed
ios working
1 parent 7749258 commit 15c10b9

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

example/android/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

example/android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ allprojects {
5656
if(androidExtension != null && project.name == 'app') {
5757
// android extension from test-app pacakge
5858
androidExtension.defaultConfig {
59+
applicationId 'com.microsoft.ReactTestApp'
5960
ndk {
6061
abiFilters 'arm64-v8a', 'x86', 'x86_64'
6162
}

example/examples/Functional.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React, { useEffect, useState } from 'react';
44
import isEqual from 'lodash/isEqual';
55
import {
66
NativeModules,
7+
Platform,
78
ScrollView,
89
StyleSheet,
910
Text,
@@ -77,6 +78,16 @@ async function execute(steps: TestStep[]): Promise<void> {
7778
}
7879
}
7980

81+
const testProp = (id: string) =>
82+
Platform.select({
83+
android: {
84+
accessibilityLabel: id,
85+
},
86+
ios: {
87+
testID: id,
88+
},
89+
});
90+
8091
function Functional(): JSX.Element {
8192
const [results, setResults] = useState<[string, TestResult?][]>([]);
8293
useEffect(() => {
@@ -141,7 +152,7 @@ function Functional(): JSX.Element {
141152
return (
142153
<View key={name} style={styles.passed}>
143154
<Text style={styles.testLabel}>{name}</Text>
144-
<Text accessibilityLabel={testID} style={styles.testResult}>
155+
<Text {...testProp(testID)} style={styles.testResult}>
145156
Pass
146157
</Text>
147158
</View>
@@ -152,7 +163,7 @@ function Functional(): JSX.Element {
152163
return (
153164
<View key={name} style={styles.skipped}>
154165
<Text style={styles.testLabel}>{name}</Text>
155-
<Text accessibilityLabel={testID} style={styles.testResult}>
166+
<Text {...testProp(testID)} style={styles.testResult}>
156167
Skip
157168
</Text>
158169
</View>
@@ -161,7 +172,9 @@ function Functional(): JSX.Element {
161172

162173
return (
163174
<View key={name} style={styles.failed}>
164-
<Text style={styles.testLabel}>{name}</Text>
175+
<Text {...testProp(testID)} style={styles.testLabel}>
176+
{name}
177+
</Text>
165178
<View>
166179
<Text style={styles.testResult}>{`Step: ${
167180
result.step + 1

example/jest.setup.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const Capabilities = {
1010
'example/android/app/build/outputs/apk/release/app-release.apk',
1111
'appium:automationName': 'UiAutomator2',
1212
'appium:newCommandTimeout': 240,
13+
'appium:appWaitActivity':
14+
'com.microsoft.reacttestapp.component.ComponentActivity',
1315
},
1416
ios: {
1517
platformName: 'iOS',

0 commit comments

Comments
 (0)