Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: _init doesn't appear to initialize in time for other helpers' _beforeSuite #39

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ name: e2e-android
on:
push:
branches:
- main
- master
pull_request:
branches:
- '**'
- disabled

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
35 changes: 23 additions & 12 deletions Detox.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,26 +151,37 @@ class Detox extends Helper {

async _beforeSuite() {
const { reuse, launchApp } = this.options;
await internalDetox.init({
argv: {
configuration: this.options.configuration,
},
testRunnerArgv: {
reuse,
launchApp,
require,
},
});

// running within _init doesn't appear to initialize Helpers['Detox'] in time for other helpers' _beforeSuite
if (internalDetox.getStatus() == 'inactive') {
await internalDetox.init({
argv: {
configuration: this.options.configuration,
...(!this.options.loglevel ? {} : {
loglevel: this.options.loglevel,
}),
...(!this.options.debugSynchronization ? {} : {
'debug-synchronization': this.options.debugSynchronization,
}),
},
testRunnerArgv: {
reuse,
launchApp,
require,
}
});
}

if (this.options.reloadReactNative) {
return this.device.launchApp({ newInstance: true });
}
}

async _afterSuite() {
async _finishTest() {
await internalDetox.cleanup();
}

async _before(test) {
async _before() {
if (this.options.reloadReactNative) {
await this.device.reloadReactNative();
} else {
Expand Down
Loading