-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Add e2e tests, bug fixes for testIDs #22537
Conversation
this.state.date.toLocaleTimeString()} | ||
this.state.date.toLocaleTimeString([], { | ||
hour: '2-digit', | ||
minute: '2-digit', |
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 switched the formatting here since having seconds is non-deterministic
RNTester/e2e/config.json
Outdated
@@ -1,5 +1,5 @@ | |||
{ | |||
"setupTestFrameworkScriptFile" : "./test-init.js", | |||
"setupFilesAfterEnv" : ["./test-init.js"], |
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 Jest change that was printing a warning
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.
Can you do that in a separate commit?
it is surprising to me that each example in the DatePickerIOS suite is so slow, more than twice as long as the other tests: Is
|
RNTester/js/RNTesterPage.js
Outdated
@@ -41,7 +41,10 @@ class RNTesterPage extends React.Component<Props> { | |||
return ( | |||
<View style={styles.container}> | |||
{title} | |||
<ContentWrapper style={styles.wrapper} {...wrapperProps}> | |||
<ContentWrapper | |||
testID="scroll-view" |
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.
Should this have a more specific testID
?
Based on the video it seems like scrolling to the bottom could glitch out if the place it puts the cursor down is in the middle of the picker, scrolling the picker instead of the scrollview. Not sure if that is how detox works though. Can you see if you can cause that issue, if it can then it would be a footgun we'll for sure hit later when running this on a different device size or changing the contents of the view. |
I think it's slow in aggregate because they have 6 or 7 actions/assertion, each taking a good amount of time. Here's an analysis of work time per statement in the first test block (note I ran the analysis multiple times with similar results). Legend for the statements tested: // 0, no actions/assertions
await expect(indicator).toBeVisible(); // 1
await expect(testElement).toBeVisible(); // 2
await testElement.setColumnToValue(0, 'Dec 4'); // 3
await testElement.setColumnToValue(1, '4'); // 4
await testElement.setColumnToValue(2, '10'); // 5
await testElement.setColumnToValue(3, 'AM'); // 6
await expect(indicator).toHaveText('12/4/2005 4:10 AM'); // 7 Results:
|
@TheSavior good find on the scroll issue, here's what happens I removed the test for now, but will revisit a generic filtering strategy to use on every test page instead of scrolling 👍 |
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.
@rickhanlonii has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@rickhanlonii has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@rickhanlonii has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@rickhanlonii has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@rickhanlonii merged commit 9fdbf60 into |
Summary: This PR adds e2e tests for the Picker and DatePicker components. While writing these tests, I also found and fixed two bugs where we wern't passing the `testID` down to the native components, so detox couldn't look them up. This confirms what was mentioned by rotemmiz [here](wix/Detox#798 (comment)) Pull Request resolved: #22537 Reviewed By: cpojer Differential Revision: D13371307 Pulled By: rickhanlonii fbshipit-source-id: a4dfcdb5913645bceca0c7353328eeb9ad0f6558
Summary: This PR adds e2e tests for the Picker and DatePicker components. While writing these tests, I also found and fixed two bugs where we wern't passing the `testID` down to the native components, so detox couldn't look them up. This confirms what was mentioned by rotemmiz [here](wix/Detox#798 (comment)) Pull Request resolved: facebook#22537 Reviewed By: cpojer Differential Revision: D13371307 Pulled By: rickhanlonii fbshipit-source-id: a4dfcdb5913645bceca0c7353328eeb9ad0f6558
Summary: This PR adds e2e tests for the Picker and DatePicker components. While writing these tests, I also found and fixed two bugs where we wern't passing the `testID` down to the native components, so detox couldn't look them up. This confirms what was mentioned by rotemmiz [here](wix/Detox#798 (comment)) Pull Request resolved: facebook/react-native#22537 Reviewed By: cpojer Differential Revision: D13371307 Pulled By: rickhanlonii fbshipit-source-id: a4dfcdb5913645bceca0c7353328eeb9ad0f6558
Overview
This PR adds e2e tests for the Picker and DatePicker components.
While writing these tests, I also found and fixed two bugs where we wern't passing the
testID
down to the native components, so detox couldn't look them up. This confirms what was mentioned by @rotemmiz hereTest Plan:
Changelog:
[General] [Fixed] - Fix testIDs not being passed in Picker and DatePicker