Skip to content

Conversation

@robwalkerco
Copy link
Contributor

This PR adds a new reload method that terminates then relaunches the app, so that it's easier to split tests up into separate batches that each can start from a fresh app state.

@robwalkerco robwalkerco requested a review from manosim September 2, 2022 12:09
@github-actions github-actions bot temporarily deployed to staging-114 September 2, 2022 12:11 Inactive
@github-actions github-actions bot temporarily deployed to staging-114 September 2, 2022 12:36 Inactive
@github-actions github-actions bot temporarily deployed to staging-114 September 3, 2022 06:54 Inactive
`--config=${jestConfigPath}`,
`--roots=${cwd}`,
'--runInBand',
`--globals='${JSON.stringify({ OWL_CLI_ARGS: args })}'`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the Owl config as a global variable, so that it can be accessed from the refresh method during the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also considering adding a __OWL__ or similar global here so that it can easily be used in the app to swap to using mock data etc during tests.
A good use case would be to show a Story Book type screen during Owl tests only, so that all components can be easily tested.

Comment on lines +11 to +18
import { adbInstall, adbLaunch } from '../utils/adb';
import {
xcrunInstall,
xcrunLaunch,
xcrunRestore,
xcrunStatusBar,
xcrunUi,
} from '../utils/xcrun';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the separate build and run steps that use either ADB or xcrun have been refactored out into separate util functions. This is so that the same functions can be easily reused at other times, such as using xcrunLaunch or adbLaunch during testing as part of the reload method.

@robwalkerco robwalkerco requested a review from ceceppa September 7, 2022 09:37
@github-actions github-actions bot temporarily deployed to staging-114 September 8, 2022 10:28 Inactive
@github-actions github-actions bot temporarily deployed to staging-114 September 8, 2022 10:40 Inactive
@robwalkerco robwalkerco changed the title feature: reload feature: add reload method to easily reset app state during tests Sep 8, 2022
@robwalkerco robwalkerco merged commit 883deb2 into main Sep 12, 2022
@robwalkerco robwalkerco deleted the feature/reload branch September 12, 2022 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants