mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
This PR brings DeviceRegistry, an entity which synchronizes device distribution across processes, enabling parallel test execution on any supported test runner.
24 lines
572 B
JavaScript
24 lines
572 B
JavaScript
describe('Async and Callbacks', () => {
|
|
beforeEach(async () => {
|
|
await device.reloadReactNative();
|
|
await element(by.text('Sanity')).tap();
|
|
});
|
|
|
|
it('should handle done() callback', (done) => {
|
|
expect(element(by.text('Welcome'))).toBeVisible().then(() => {
|
|
setTimeout(() => {
|
|
done();
|
|
}, 1000);
|
|
});
|
|
});
|
|
|
|
it('should handle async await', async () => {
|
|
await timeout(1);
|
|
await expect(element(by.text('Welcome'))).toBeVisible();
|
|
});
|
|
});
|
|
|
|
function timeout(ms) {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
}
|