FormidableLabs / FormidableLabs/react-native-owl
[ios] Test hangs up
- Lenguaje dominante
- TypeScript
- Estrellas
- 694
- Forks
- 27
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
### Code Sandbox link
_No response_
### Bug report
Hey!
I have an issue running owl tests
test doesn't perform actions (like press or scroll) and hangs up if test contains one of those
here is the test:
```
import { press, takeScreenshot } from 'react-native-owl'
import { homeScreen } from '../../testIdsProxy'
describe('App.tsx', () => {
it('takes a screenshot of the first screen', async () => {
await press(homeScreen.voteButton)
const screen = await takeScreenshot('homescreen')
expect(screen).toMatchBaseline()
})
it('presses a button, then takes a screenshot', async () => {
const screen = await takeScreenshot('afterButtonPress')
expect(screen).toMatchBaseline()
})
})
```
Here is the log:
```
romankudravcev@MacBook-Pro-3 sweat-wallet % yarn owl test --platform ios
[OWL - CLI] Starting websocket server.
[OWL - CLI] Running tests on ios.
[OWL - WebSocket] Listening on port 8123.
com.sweateconomy.wallet: 68963
[OWL - CLI] (Tests mode) Will compare latest images with the baseline.
[OWL - CLI] Will set the jest root to /Users/romankudravcev/Documents/Projects/sweat-wallet.
● Validation Warning:
Unknown option "node" with value ">=18" was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
● Validation Warning:
Unknown option "node" with value ">=18" was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
console.info
[OWL - CLI] Will run the screenshot command: xcrun simctl io iPhone\ 15 screenshot afterButtonPress.png.
at Logger.Object..Logger.info (node_modules/react-native-owl/dist/logger.js:25:26)
RUNS e2e/tests/screenshot/homeScreen.owl.ts
console.info
[OWL - CLI] Screenshot saved to /Users/romankudravcev/Documents/Projects/sweat-wallet/.owl/latest/ios/afterButtonPress.png.
at Logger.Object..Logger.info (node_modules/react-native-owl/dist/logger.js:25:26)
FAIL e2e/tests/screenshot/homeScreen.owl.ts (25.987 s)
App.tsx
✕ takes a screenshot of the first screen (5003 ms)
✕ presses a button, then takes a screenshot (17653 ms)
● App.tsx › takes a screenshot of the first screen
thrown: "Exceeded timeout of 5000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
3 |
4 | describe('App.tsx', () => {
> 5 | it('takes a screenshot of the first screen', async () => {
| ^
6 | await press(homeScreen.voteButton)
7 | const screen = await takeScreenshot('homescreen')
8 |
at e2e/tests/screenshot/homeScreen.owl.ts:5:3
at Object. (e2e/tests/screenshot/homeScreen.owl.ts:4:1)
● App.tsx › presses a button, then takes a screenshot
Compared screenshot to match baseline. 891693 were different.
13 | const screen = await takeScreenshot('afterButtonPress')
14 |
> 15 | expect(screen).toMatchBaseline()
| ^
16 | })
17 | })
18 |
at Object. (e2e/tests/screenshot/homeScreen.owl.ts:15:20)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: 26.029 s, estimated 27 s
Ran all test suites.
Test results written to: .owl/report/jest-report.json
Jest did not exit one second after the test run has completed.
'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
```
And proccess in terminal doesn't stop after the end. i need to stop it myself (ctrl+c)
owl.config.ts
```
{
"ios": {
"workspace": "ios/SweatWallet.xcworkspace",
"scheme": "SweatWallet",
"configuration": "Debug",
"device": "iPhone 15",
"quiet": true
},
"android": {
"packageName": "com.sweatwallet",
"buildType": "Debug"
},
"debug": true,
"report": true
}
```
"react-native": "0.73.6",
Guía de contribución
Línea de trabajo
Empieza con e2e/tests/screenshot/homeScreen.owl.ts y owl.config.ts, y luego reproduce el bloqueo con `yarn owl test --platform ios`. Rastrea las llamadas a `press` y `takeScreenshot` junto con la salida reportada de WebSocket y Jest sobre handles abiertos. Se considera terminado cuando las pruebas de acciones de iOS se completan, las capturas de pantalla se evalúan como se espera y el proceso de pruebas termina sin Ctrl+C.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- ios, react-native, typescript
- Área
- mobile, testing-qa
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100