-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85e07e3
commit 6aeb889
Showing
13 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+102 KB
detox/e2e/assets/android/e2e_emulator/AwareScrollViewFirstInputFocused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89.6 KB
detox/e2e/assets/android/e2e_emulator/AwareScrollViewFirstInputGrown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.9 KB
detox/e2e/assets/android/e2e_emulator/AwareScrollViewInputChanged.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.9 KB
detox/e2e/assets/android/e2e_emulator/AwareScrollViewKeyboardClosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+183 KB
detox/e2e/assets/ios/iPhone 13 Pro/AwareScrollViewFirstInputFocused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import waitForExpect from 'wait-for-expect'; | ||
|
||
import { expectBitmapsToBeEqual } from './asserts'; | ||
import { waitAndReplace, waitAndTap, waitAndType } from './helpers'; | ||
import setDemoMode from './utils/setDemoMode'; | ||
|
||
const BLINKING_CURSOR = 0.35; | ||
|
||
describe('AwareScrollView test cases', () => { | ||
beforeAll(async () => { | ||
await setDemoMode(); | ||
await device.launchApp(); | ||
}); | ||
|
||
it('should push input above keyboard on focus', async () => { | ||
await waitAndTap('aware_scroll_view'); | ||
await waitAndTap('TextInput#3'); | ||
await waitForExpect(async () => { | ||
await expectBitmapsToBeEqual( | ||
'AwareScrollViewFirstInputFocused', | ||
BLINKING_CURSOR | ||
); | ||
}); | ||
}); | ||
|
||
it('should detect TextInput growth', async () => { | ||
await waitAndType('TextInput#3', '\n\n\n\n'); | ||
await waitForExpect(async () => { | ||
await expectBitmapsToBeEqual( | ||
'AwareScrollViewFirstInputGrown', | ||
BLINKING_CURSOR | ||
); | ||
}); | ||
}); | ||
|
||
it('should auto-scroll when new input gets focused', async () => { | ||
// scroll while keeping a focus is not working: https://github.com/wix/Detox/issues/174 | ||
// but we may use `await element(by.id('TextInput#3')).swipe('up');` (currently focused input as event receiver) | ||
await waitAndReplace('TextInput#3', '\n\n'); | ||
await waitAndTap('TextInput#4'); | ||
await waitForExpect(async () => { | ||
await expectBitmapsToBeEqual( | ||
'AwareScrollViewInputChanged', | ||
BLINKING_CURSOR | ||
); | ||
}); | ||
}); | ||
|
||
it('should scroll back when keyboard dismissed', async () => { | ||
// tap outside of input to close a keyboard | ||
await waitAndTap('TextInput#4', { x: 0, y: -10 }); | ||
await waitForExpect(async () => { | ||
await expectBitmapsToBeEqual( | ||
'AwareScrollViewKeyboardClosed', | ||
BLINKING_CURSOR | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters