FormidableLabs / FormidableLabs/react-native-owl

[ios] Test hangs up

オープン
#178 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
694
フォーク
27
PR マージ指標
30日以内にマージされた PR はありません

説明

### 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",

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

e2e/tests/screenshot/homeScreen.owl.ts と owl.config.ts から始め、`yarn owl test --platform ios` でハングを再現します。報告されている WebSocket と Jest の open-handle 出力と合わせて、`press` と `takeScreenshot` の呼び出しを追跡します。iOS アクションテストが完了し、スクリーンショットが期待どおりに評価され、テストプロセスが Ctrl+C なしで終了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ios, react-native, typescript
領域
mobile, testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。