mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-10 17:37:14 +00:00
Improve stability of Android ReactNative E2E test (#21969)
- Remove redundant `OnnxruntimeModuleExampleE2ETest CheckOutputComponentExists` test - Attempt to close any Application Not Responding (ANR) dialog prior to running Android test - Add `--take-screenshots failing` option to detox test commands to save screenshots on failure
This commit is contained in:
parent
d4290f6e7f
commit
cbf3c50d75
3 changed files with 15 additions and 11 deletions
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
package com.example.reactnativeonnxruntimemodule;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.wix.detox.Detox;
|
||||
import com.wix.detox.config.DetoxConfig;
|
||||
|
||||
|
|
@ -11,6 +13,7 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.filters.LargeTest;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
|
|
@ -23,6 +26,9 @@ public class DetoxTest {
|
|||
|
||||
@Test
|
||||
public void runDetoxTests() {
|
||||
// try to close any existing ANR dialog which will interfere with the UI tests
|
||||
ApplicationProvider.getApplicationContext().sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
|
||||
|
||||
DetoxConfig detoxConfig = new DetoxConfig();
|
||||
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
|
||||
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
|
||||
|
|
@ -30,4 +36,4 @@ public class DetoxTest {
|
|||
|
||||
Detox.runTests(mActivityRule, detoxConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,6 @@ describe('OnnxruntimeModuleExample', () => {
|
|||
await device.launchApp();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await device.launchApp({ newInstance: true });
|
||||
});
|
||||
|
||||
it('OnnxruntimeModuleExampleE2ETest CheckOutputComponentExists', async () => {
|
||||
await element(by.label('output'));
|
||||
});
|
||||
|
||||
it('OnnxruntimeModuleExampleE2ETest CheckInferenceResultValueIsCorrect', async () => {
|
||||
if (device.getPlatform() === 'ios') {
|
||||
await expect(element(by.label('output')).atIndex(1)).toHaveText('Result: 3');
|
||||
|
|
|
|||
|
|
@ -267,7 +267,10 @@ stages:
|
|||
|
||||
- script: |
|
||||
JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml \
|
||||
detox test --record-logs all --configuration android.emu.release --loglevel trace
|
||||
detox test --record-logs all \
|
||||
--configuration android.emu.release \
|
||||
--loglevel trace \
|
||||
--take-screenshots failing
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e'
|
||||
displayName: Run React Native Detox Android e2e Tests
|
||||
|
||||
|
|
@ -318,7 +321,10 @@ stages:
|
|||
|
||||
- script: |
|
||||
JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \
|
||||
detox test --record-logs all --configuration ios.sim.release --loglevel trace
|
||||
detox test --record-logs all \
|
||||
--configuration ios.sim.release \
|
||||
--loglevel trace \
|
||||
--take-screenshots failing
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e'
|
||||
displayName: Run React Native Detox iOS e2e Tests
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue