mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
### Description <!-- Describe your changes. --> Integrate react native e2e test framework with detox. https://wix.github.io/Detox/ Good build in CI: https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=946695&view=results ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Write cross-platform end-to-end tests in JavaScript. Resolve flaky e2e tests in react native ci pipelines. --------- Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net> Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
27 lines
No EOL
849 B
JavaScript
27 lines
No EOL
849 B
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
/* Initial Simple Detox Test Setup. Can potentially add more unit tests. */
|
|
|
|
describe('OnnxruntimeModuleExample', () => {
|
|
beforeAll(async () => {
|
|
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');
|
|
}
|
|
if (device.getPlatform() === 'android') {
|
|
await expect(element(by.label('output'))).toHaveText('Result: 3');
|
|
}
|
|
});
|
|
}); |