-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS: perform actions on UIPickerView #605
Changes from 4 commits
f708294
41e6034
2eaabda
1b7cb17
79bf393
1a4d56f
363bc2b
bd01ad0
e9a7abe
cb87e43
604b1ff
b6db95d
ae1d48e
02526c9
0a9d71d
46c5702
073140e
98d3eb7
087d2ba
a22bbeb
6770cd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"eslint.enable": false | ||
"eslint.enable": false, | ||
"git.ignoreLimitWarning": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe('DatePicker', () => { | ||
beforeEach(async () => { | ||
await device.reloadReactNative(); | ||
}); | ||
|
||
beforeEach(async () => { | ||
await element(by.text('DatePicker')).tap(); | ||
}); | ||
|
||
it('check and scroll datePicker', async () => { | ||
await expect(element(by.type('UIPickerView'))).toBeVisible(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should be wrapped with |
||
await expect(element(by.type('UIPickerView')).setColumnToValue(1,"6")); | ||
await expect(element(by.type('UIPickerView')).setColumnToValue(2,"34")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expect should not be on actions. Should be something like
|
||
}); | ||
|
||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,6 +300,34 @@ | |
remoteGlobalIDString = 58B5119B1A9E6C1200147676; | ||
remoteInfo = RCTText; | ||
}; | ||
D58447AF204E9C6000248543 /* PBXContainerItemProxy */ = { | ||
isa = PBXContainerItemProxy; | ||
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; | ||
proxyType = 2; | ||
remoteGlobalIDString = EBF21BDC1FC498900052F4D5; | ||
remoteInfo = jsinspector; | ||
}; | ||
D58447B1204E9C6000248543 /* PBXContainerItemProxy */ = { | ||
isa = PBXContainerItemProxy; | ||
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; | ||
proxyType = 2; | ||
remoteGlobalIDString = EBF21BFA1FC4989A0052F4D5; | ||
remoteInfo = "jsinspector-tvOS"; | ||
}; | ||
D58447B3204E9C6000248543 /* PBXContainerItemProxy */ = { | ||
isa = PBXContainerItemProxy; | ||
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; | ||
proxyType = 2; | ||
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04; | ||
remoteInfo = privatedata; | ||
}; | ||
D58447B5204E9C6000248543 /* PBXContainerItemProxy */ = { | ||
isa = PBXContainerItemProxy; | ||
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; | ||
proxyType = 2; | ||
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04; | ||
remoteInfo = "privatedata-tvOS"; | ||
}; | ||
/* End PBXContainerItemProxy section */ | ||
|
||
/* Begin PBXCopyFilesBuildPhase section */ | ||
|
@@ -491,10 +519,14 @@ | |
39A34C5D1E30ED3600BEBB59 /* libcxxreact.a */, | ||
39A34C5F1E30ED3600BEBB59 /* libjschelpers.a */, | ||
39A34C611E30ED3600BEBB59 /* libjschelpers.a */, | ||
D58447B0204E9C6000248543 /* libjsinspector.a */, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? What will happen if old RN is used? In CI, we have an RN matrix that changes RN versions on the fly. Currently we are testing RN 51 and 53.3 |
||
D58447B2204E9C6000248543 /* libjsinspector-tvOS.a */, | ||
4644B8651F897583003223D4 /* libthird-party.a */, | ||
4644B8671F897583003223D4 /* libthird-party.a */, | ||
4644B8691F897583003223D4 /* libdouble-conversion.a */, | ||
4644B86B1F897583003223D4 /* libdouble-conversion.a */, | ||
D58447B4204E9C6000248543 /* libprivatedata.a */, | ||
D58447B6204E9C6000248543 /* libprivatedata-tvOS.a */, | ||
); | ||
name = Products; | ||
sourceTree = "<group>"; | ||
|
@@ -972,6 +1004,34 @@ | |
remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; | ||
sourceTree = BUILT_PRODUCTS_DIR; | ||
}; | ||
D58447B0204E9C6000248543 /* libjsinspector.a */ = { | ||
isa = PBXReferenceProxy; | ||
fileType = archive.ar; | ||
path = libjsinspector.a; | ||
remoteRef = D58447AF204E9C6000248543 /* PBXContainerItemProxy */; | ||
sourceTree = BUILT_PRODUCTS_DIR; | ||
}; | ||
D58447B2204E9C6000248543 /* libjsinspector-tvOS.a */ = { | ||
isa = PBXReferenceProxy; | ||
fileType = archive.ar; | ||
path = "libjsinspector-tvOS.a"; | ||
remoteRef = D58447B1204E9C6000248543 /* PBXContainerItemProxy */; | ||
sourceTree = BUILT_PRODUCTS_DIR; | ||
}; | ||
D58447B4204E9C6000248543 /* libprivatedata.a */ = { | ||
isa = PBXReferenceProxy; | ||
fileType = archive.ar; | ||
path = libprivatedata.a; | ||
remoteRef = D58447B3204E9C6000248543 /* PBXContainerItemProxy */; | ||
sourceTree = BUILT_PRODUCTS_DIR; | ||
}; | ||
D58447B6204E9C6000248543 /* libprivatedata-tvOS.a */ = { | ||
isa = PBXReferenceProxy; | ||
fileType = archive.ar; | ||
path = "libprivatedata-tvOS.a"; | ||
remoteRef = D58447B5204E9C6000248543 /* PBXContainerItemProxy */; | ||
sourceTree = BUILT_PRODUCTS_DIR; | ||
}; | ||
/* End PBXReferenceProxy section */ | ||
|
||
/* Begin PBXResourcesBuildPhase section */ | ||
|
@@ -1085,7 +1145,7 @@ | |
"-ObjC", | ||
"-lc++", | ||
); | ||
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; | ||
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.example; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this change necessary? |
||
PRODUCT_NAME = example; | ||
}; | ||
name = Debug; | ||
|
@@ -1102,7 +1162,7 @@ | |
"-ObjC", | ||
"-lc++", | ||
); | ||
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; | ||
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.example; | ||
PRODUCT_NAME = example; | ||
}; | ||
name = Release; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { Component } from 'react'; | ||
import { | ||
Text, | ||
View, | ||
StyleSheet, | ||
DatePickerIOS | ||
} from 'react-native'; | ||
|
||
export default class DatePickerScreen extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return ( | ||
<View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}> | ||
<DatePickerIOS | ||
style = {styles.datePicker} | ||
date = {new Date()} | ||
/> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
datePicker: { | ||
width:'100%', | ||
height:200, | ||
backgroundColor:'green', | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why by type and not by id? Does it not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIPickerView have not accessibility ID, testID = {'CustomDatePicker'} need to be deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a problem. If user has more than one pickers, the API will break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIPickerView
is aUIView
, so it can have an accessibility ID. Are you seeing thatUIDatePicker
does not forward that ID?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked that UI element via AccessebilityInspector (from Xcode Instruments), and now I found only one way to get element by type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't work on android
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We know. We want to hone down iOS support first, then we will implement Android as well.