FormidableLabs / FormidableLabs/react-native-owl

[ios] Test hangs up

Offen
#178 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
TypeScript
Sterne
694
Forks
27
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit e2e/tests/screenshot/homeScreen.owl.ts und owl.config.ts und reproduziere dann den Hänger mit `yarn owl test --platform ios`. Verfolge die Aufrufe von `press` und `takeScreenshot` zusammen mit der gemeldeten WebSocket- und Jest-Ausgabe zu offenen Handles. Erledigt ist es, wenn die iOS-Aktionstests abgeschlossen werden, Screenshots wie erwartet ausgewertet werden und der Testprozess ohne Ctrl+C beendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, react-native, typescript
Bereich
mobile, testing-qa
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.