-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: consistent tests across platforms (#690)
## 📜 Description Made e2e tests better 🙂 ## 💡 Motivation and Context The main motivation to do that was to have `device.tap()` method - it would allow us to test switch to emoji keyboard. I added this, but then realized, that flag `SOFT_CHECK` doesn't satisfy for previous goals, so I decided to create `devicePreferences` mechanism. Then I tried to enable `OverKeyboardView` tests and suddenly they started to work 😲 Last piece was updating `KeyboardToolbar` tests 🙂 ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### E2E - enable emoji keyboard tests on iOS; - enable `OverKeyboardView` tests on iOS; - update detox to latest version; - fix `KeyboardToolbar` incompatibility with new Detox version; - add `getDevicePreference` method; - generate missing assets; ## 🤔 How Has This Been Tested? Tested on CI. ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
- Loading branch information
1 parent
c334a33
commit 7d02596
Showing
38 changed files
with
114 additions
and
52 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
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
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
Binary file added
BIN
+86.5 KB
e2e/kit/assets/android/e2e_emulator_28/KeyboardAnimationEmojiKeyboard.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.
Binary file added
BIN
+147 KB
e2e/kit/assets/ios/iPhone 13 Pro/OverKeyboardViewHiddenWithKeyboard.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.
Binary file added
BIN
+135 KB
e2e/kit/assets/ios/iPhone 13 Pro/OverKeyboardViewShownWithKeyboard.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.
Binary file added
BIN
+155 KB
e2e/kit/assets/ios/iPhone 14 Pro/OverKeyboardViewHiddenWithKeyboard.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.
Binary file added
BIN
+143 KB
e2e/kit/assets/ios/iPhone 14 Pro/OverKeyboardViewShownWithKeyboard.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.
Binary file added
BIN
+154 KB
e2e/kit/assets/ios/iPhone 15 Pro/OverKeyboardViewHiddenWithKeyboard.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.
Binary file added
BIN
+142 KB
e2e/kit/assets/ios/iPhone 15 Pro/OverKeyboardViewShownWithKeyboard.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.
Binary file added
BIN
+162 KB
e2e/kit/assets/ios/iPhone 16 Pro/OverKeyboardViewHiddenWithKeyboard.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.
Binary file added
BIN
+149 KB
e2e/kit/assets/ios/iPhone 16 Pro/OverKeyboardViewShownWithKeyboard.png
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import parseDeviceName from "../../utils/parseDeviceName"; | ||
|
||
type Preference = { | ||
emojiButtonCoordinates?: { x: number; y: number }; | ||
width: number; | ||
height: number; | ||
}; | ||
|
||
const DEVICE_PREFERENCES: Record<string, Preference> = { | ||
"e2e_emulator_28": { | ||
emojiButtonCoordinates: undefined, | ||
width: 1080, | ||
height: 1920, | ||
}, | ||
"e2e_emulator_31": { | ||
emojiButtonCoordinates: { x: 324, y: 1704 }, | ||
width: 1080, | ||
height: 1920, | ||
}, | ||
"iPhone 16 Pro": { | ||
emojiButtonCoordinates: { x: 40, y: 830 }, | ||
width: 393, | ||
height: 852, | ||
}, | ||
"iPhone 15 Pro": { | ||
emojiButtonCoordinates: { x: 40, y: 830 }, | ||
width: 393, | ||
height: 852, | ||
}, | ||
"iPhone 14 Pro": { | ||
emojiButtonCoordinates: { x: 40, y: 830 }, | ||
width: 393, | ||
height: 852, | ||
}, | ||
"iPhone 13 Pro": { | ||
emojiButtonCoordinates: { x: 40, y: 830 }, | ||
width: 390, | ||
height: 844, | ||
}, | ||
}; | ||
|
||
export const getDevicePreference = (): Preference => { | ||
const deviceName = parseDeviceName(device.name); | ||
|
||
if (!deviceName) { | ||
throw new Error(`Device name is not found`); | ||
} | ||
|
||
const preference = DEVICE_PREFERENCES[deviceName]; | ||
|
||
if (!preference) { | ||
throw new Error(`Device preference for ${deviceName} is not found`); | ||
} | ||
|
||
return preference; | ||
}; |
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,4 @@ | ||
const parseDeviceName = (name: string) => | ||
name.split("(").pop()?.replace(")", ""); | ||
|
||
export default parseDeviceName; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1114,17 +1114,23 @@ detect-newline@^3.0.0: | |
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" | ||
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== | ||
|
||
[email protected]: | ||
version "20.23.1" | ||
resolved "https://registry.yarnpkg.com/detox/-/detox-20.23.1.tgz#57970c4bd7bdfc35f395c98106bbfb4be1c65150" | ||
integrity sha512-K3UWCatYokzQStXxBTqrWzX0pLUBUCngNY3jGL61q6b1UH37vXPziGtOjWmKZ9zDQlxWC/HT7QWSiJqHn81DwA== | ||
detox-copilot@^0.0.24: | ||
version "0.0.24" | ||
resolved "https://registry.yarnpkg.com/detox-copilot/-/detox-copilot-0.0.24.tgz#e505073866d1f4ff00641f2e48ef441a4dff6bbc" | ||
integrity sha512-42g0QyJS31URl28YRxc4hGozSXhbbB1sKwzxEjZR9WtLoSx6WYDsQkQD8+yP5t1NExiSCZAfvNmBw8PYQwDKwg== | ||
|
||
[email protected]: | ||
version "20.28.0" | ||
resolved "https://registry.yarnpkg.com/detox/-/detox-20.28.0.tgz#7ae848e8df028c17d65cd0672040cd1c18338b25" | ||
integrity sha512-JeUkWNnYE7lqby3S9AeYJP3ttCBKH+qZWACjWXwvSbe3tm6JeXvecVUYkzSoNfC4IzTX5p+rWvG0IPsfOsZSFw== | ||
dependencies: | ||
ajv "^8.6.3" | ||
bunyan "^1.8.12" | ||
bunyan-debug-stream "^3.1.0" | ||
caf "^15.0.1" | ||
chalk "^4.0.0" | ||
child-process-promise "^2.2.0" | ||
detox-copilot "^0.0.24" | ||
execa "^5.1.1" | ||
find-up "^5.0.0" | ||
fs-extra "^11.0.0" | ||
|