Giter VIP home page Giter VIP logo

detox-expo-helpers's Issues

[Windows 10] 'shasum' is not recognized as an internal or external command.

I'm trying to run this on android and windows but I'm facing this isssue : the shasum command doesn't exist on windows ...

I thinks this is the only little first problem i'll encounter trying to make this work on android ...

Is this even possible ? This issue hasn't got any news since 1 year ...

Command failed: (echo "1.0.10" && xcodebuild -version) | shasum | awk '{print $1}'
    'shasum' is not recognized as an internal or external command.

      3 | describe('Example', () => {
      4 |   beforeEach(async () => {
    > 5 |     await reloadApp();
        |           ^
      6 |   });

reloadApp not working for detox version above 7.2.0

When running command detox test, reloadApp() not working for detox version above 7.2.0.
Less than 7.2.0, It works normally.

"dependencies": {
    "expo": "^29.0.0",
    "react": "16.2.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz"
  },
  "devDependencies": {
    "detox": "7.3.0",
    "detox-expo-helpers": "^0.2.0",
    "mocha": "^4.0.1"
  },

I want to enable artifacts such as device logs, device screenshots and screen recordings, but it does not correspond to detox 7.2.0 or lower.
https://github.com/wix/Detox/blob/master/docs/APIRef.Artifacts.md
Is there any solution?

reloadApp is slow

I'm running a simple assert on my first screen and it takes around 80-90 seconds to run my test.

I had to move reloadApp to a beforeAll section instead of beforeEach because it takes a lot of time to reload it. Every test case takes around 50 seconds if I do a reloadApp.

Is that expected? It seems like most of the time it's just waiting because I can see in a simulator that the app is ready.

My test cases:

const { reloadApp } = require('detox-expo-helpers')

describe('Example', () => {
  beforeEach(async () => {
    await reloadApp()
  })

  it('should show feed on a first screen', async () => {
    await expect(element(by.id('FeaturedFeed'))).toBeVisible()
  })

  it('should switch to a write screen', async () => {
    await element(by.id('GoToWrite')).atIndex(0).tap()
    await expect(element(by.id('LoginProposition').withAncestor(by.id('WriteScreen')))).toBeVisible()
  })
})

Results in something like that:

 PASS  e2e/firstTest.spec.js (169.461s)
  Example
    ✓ should show feed on a first screen (88747ms)
    ✓ should switch to a write screen (59989ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        169.513s

Environment:

    "detox": "^9.1.2",
    "detox-expo-helpers": "^0.6.0",
    "expo-detox-hook": "^1.0.10",

I'm running iOS simulator on macOS 10.14.2

app not starts on ios 13.4 simulator

after xcode update me app simply not boot in simulator

detox[786] INFO: [AppleSimUtils.js] host.exp.Exponent launched. To watch simulator logs, run:
/usr/bin/xcrun simctl spawn E1398E70-FD09-4206-8CCC-9D41C0096DFB log stream --level debug --style compact --predicate 'process == Exponent'
detox[786] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=171438a2-e5b9-920c-daaf-ccfe9324f4a4)

Detox e2e testing and app permissions

I'm referencing this issue opened on the expo main repo, especially the last part about random simulators opening if I pass parameters to reloadApp

expo/expo#5790

Has any of you encountered this very strange behavior before ?

Exponent-1.20.2.app not working with detox

Hello,
See the log of the simulator:

2017-09-26 21:45:40.636 Exponent[31137:24977855] Crash handler setup started.
2017-09-26 21:45:40.637 Exponent[31137:24977855] Crash handler setup completed.
2017-09-26 21:45:40.637 Exponent[31137:24977855] Enabling accessibility for automation on Simulator.
2017-09-26 21:45:40.775 Exponent[31137:24977855] initialize
2017-09-26 21:45:40.907 Exponent[31137:24977855] initialize
2017-09-26 21:45:41.080 Exponent[31137:24977855] [Crashlytics] Version 3.8.5 (123)
2017-09-26 21:45:41.097 Exponent[31137:24977855] Falling back to loading access token from NSUserDefaults because of simulator bug
2017-09-26 21:45:41.097 Exponent[31137:24977855] Falling back to storing access token in NSUserDefaults because of simulator bug
2017-09-26 21:45:41.099 Exponent[31137:24977855] Falling back to loading access token from NSUserDefaults because of simulator bug
2017-09-26 21:45:41.100 Exponent[31137:24977855] Falling back to storing access token in NSUserDefaults because of simulator bug
2017-09-26 21:45:41.100 Exponent[31137:24977855] Falling back to loading access token from NSUserDefaults because of simulator bug
2017-09-26 21:45:41.100 Exponent[31137:24977855] Falling back to storing access token in NSUserDefaults because of simulator bug
2017-09-26 21:45:41.132 Exponent[31137:24977855] Expo iOS Client Version 1.20.2.109827
2017-09-26 21:45:41.143 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.DevLoadingViewQueue[0x6000000fae00]>
2017-09-26 21:45:41.143 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.AsyncLocalStorageQueue[0x6080000f7c80]>
2017-09-26 21:45:41.143 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentMagnetometerUncalibratedQueue[0x6180000f7d00]>
2017-09-26 21:45:41.144 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentDeviceMotionQueue[0x6100000f8880]>
2017-09-26 21:45:41.144 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentErrorRecoveryQueue[0x6080000f8480]>
2017-09-26 21:45:41.144 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.LinkingManagerQueue[0x6000000fb380]>
2017-09-26 21:45:41.144 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentGyroscopeQueue[0x6100000f8c80]>
2017-09-26 21:45:41.144 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentMagnetometerQueue[0x6000000fac80]>
2017-09-26 21:45:41.145 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentNotificationsQueue[0x6080000f7e80]>
2017-09-26 21:45:41.145 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentFileSystemQueue[0x6080000f8200]>
2017-09-26 21:45:41.145 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentSecureStoreQueue[0x6100000f8f00]>
2017-09-26 21:45:41.145 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentAccelerometerQueue[0x6100000f8f80]>
2017-09-26 21:45:41.146 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.AccessibilityManagerQueue[0x6000000fb280]>
2017-09-26 21:45:41.147 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExceptionsManagerQueue[0x6100000f9000]>
2017-09-26 21:45:41.147 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.ExponentKernelQueue[0x6080000f7a00]>
2017-09-26 21:45:41.147 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.DevMenuQueue[0x6000000fb200]>
2017-09-26 21:45:41.147 Exponent[31137:24977855] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.RedBoxQueue[0x6080000f8180]>
2017-09-26 21:45:41.154 Exponent[31137:24977855] EXCachedResource: Using cached resource at /Users/carpentierxqvier/Library/Developer/CoreSimulator/Devices/97CC4163-86F6-4016-B525-01E6092CEFE0/data/Containers/Bundle/Application/3F768FF0-B854-4591-9B62-D74149EA6969/Exponent-1.20.2.app/kernel.ios.bundle...
libc++abi.dylib: terminating with unexpected exception of type std::__1::bad_function_call```

Support hostType lan

I noticed detox with expo works only with hostType tunnel, which is slower than lan,
any chance you will support lan?

ReferenceError: device is not defined

was trying to run detox sample test on my app, which is using:

Expo
Typescript
Jest
And I always get the following error:

ReferenceError: device is not defined
    at Object.reloadApp (../node_modules/detox-expo-helpers/index.js:68:3)

When I added the following require:
const { device } = require('detox');
The issue was solved.

node-forge dependency needs to be updated

Running yarn run improved-yarn-audit --min-severity moderate:

Improved Yarn Audit - v2.3.2
Minimum severity level to report: moderate
Running yarn audit...
Found 1 vulnerabilities
Vulnerability Found:
  Severity: HIGH    
  Modules: detox-expo-helpers>xdl>node-forge
  URL: https://npmjs.com/advisories/1561

Typescript support

When I do import { reloadApp } from 'detox-expo-helpers', I get "TS7016: Could not find a declaration file for module 'detox-expo-helpers' [...]".

It would be nice if type definitions were provided. They could be provided either as part of this package or as a "@types/detox-expo-helpers" package. This would avoid every developer and project needing to declare them themselves.

reloadApp() hangs in Expo SDK 36

Not working with Expo SDK 36

Debugging reveals that it's hanging on await device.launchApp() in reloadApp()

package.json

`"scripts": {
    "e2e": "detox test --configuration ios.sim",
},
"devDependencies": {
    "babel-eslint": "^10.0.3",
    "babel-preset-expo": "^7.0.0",
    "detox": "^15.2.2",
    "detox-expo-helpers": "^0.6.0",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-config-prettier": "^6.7.0",
    "eslint-plugin-prettier": "^3.1.1",
    "expo-detox-hook": "^1.0.10",
    "jest-expo": "^35.0.0",
    "pusher-js-mock": "^0.2.0",
    "react-native-testing-library": "^1.12.0",
    "react-test-renderer": "^16.12.0"
},
"private": true,
"detox": {
    "configurations": {
        "ios.sim": {
            "binaryPath": "bin/Exponent.app",
            "type": "ios.simulator",
            "name": "iPhone 11"
        }
    },
    "test-runner": "jest"
}`

Even if I bypass the hanging promise via
function timeout(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } beforeEach(async () => { reloadApp(); await timeout(12000); });
It hangs on await expect(element(by.id('welcome'))).toBeVisible();

Expo Go app is opening with wrong server URL when calling `await reloadApp()`

When I call

await reloadApp();

it is opening the app with the wrong Metro server URL

CleanShot 2023-02-05 at 17 02 29@2x

As you can see the URL is trying to connect to port :80, which is incorrect, it should be port :19000.

A quick look inside the library reveals that it is calling constructManifestUrlAsync, which returns the right URL with right LAN IP, but not the right port.

CleanShot 2023-02-05 at 17 03 45

Forcefully set the url works correctly

CleanShot 2023-02-05 at 17 04 35


Maybe something have changed with newer version of Expo? Upgrading @expo/xdl doesn't fix this issue so maybe we have to update some logic inside this library?

Cant find element by testID in IOS

I have a very complex app that I'm starting to test at the moment I'm testing the dev code the app is made with EXPO and at lunching the app I have the console debugger I figured out how to close that but now I'm using test id on an input and my test is failing I need some help

This is the original text input

THIS IS MY TEST

import { device, element, by, waitFor } from 'detox';

describe('player app Activation screen', () => {
beforeAll(async () => {
//new instance makes to close the app and start it again

await device.launchApp({ newInstance: true });

//{
//       newInstance: true
//     }

await device.openURL({
  url: `exp+next11-reaxt-native-v2://expo-development-client/?url=${encodeURIComponent(
    `http://localhost:8081`
  )}`
});

});
beforeEach(async () => {
// await device.reloadReactNative();
});

it('set up for the development console ', async () => {
await waitFor(element(by.text('Got It')))
.toBeVisible()
.withTimeout(3000);

await element(by.text('Got It')).tap();
await element(by.text('Connected to:')).swipe('down');

});

it('should have a title Welcome', async () => {
await expect(element(by.text('Welcome!'))).toBeVisible();
});

const typedText = '45689';

it('should have an input activation code and accept input', async () => {
await element(by.id('emailField')).typeText('[email protected]');
});
});

THIS IS THE ERROR IM GETTING IN MY CONSOLE

e2e/playerAppLoginScreen.test.js (37.985 s)
player app Activation screen
✓ set up for the development console (14812 ms)
✓ should have a title Welcome (334 ms)
✕ should have an input activation code and accept input (187 ms)

● player app Activation screen › should have an input activation code and accept input

Test Failed: No elements found for “MATCHER(id == “emailField”)”

HINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.

  56 |     //   .toBeVisible()
  57 |     //   .withTimeout(2000);
> 58 |     await element(by.id('emailField')).typeText('[email protected]');
     |                                        ^
  59 |
  60 |     // const input = element(by.id('input'));
  61 |     // await input.tap();

  at Object.typeText (e2e/playerAppLoginScreen.test.js:58:40)
  at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)
  at node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7
  at Object.<anonymous> (node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:12)

Test Suites: 1 failed, 1 total
Tests: 1 failed, 2 passed, 3 total
Snapshots: 0 total
Time: 38.583 s, estimated 40 s
Ran all test suites.
15:58:26.238 detox[24733] E Command failed with exit code = 1:
jest --config e2e/jest.config.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.