expo / with-detox-tests Goto Github PK
View Code? Open in Web Editor NEWThis template is no longer maintained! See https://github.com/yaron1m/expo-detox-typescript-example instead
This template is no longer maintained! See https://github.com/yaron1m/expo-detox-typescript-example instead
I have my e2e
test structured just like your example here (only difference is I'm using my Exponent.app
) but the issue I'm running into is when I run detox test
it installs my app into the simulator & then gets into what looks like an infinite loop of attempting to relaunch
the app.
System logs show: (UIKitApplication:com.vivintsolar.hea[0xb217][36260][36509]): Program specified by service does not contain any valid architectures for this system.
Any ideas or insight into why this might be or if I'm doing anything wrong?
package.json
"detox": {
"configurations": {
"ios.sim.debug": {
"binaryPath": "bin/Exponent.app",
"build": "",
"type": "ios.simulator",
"name": "iPhone 7"
}
}
},
e2e/firstTest.spec.js
const { reloadApp } = require('detox-expo-helpers');
describe('Example', () => {
beforeEach(async () => {
await reloadApp();
});
it('should have welcome screen', async () => {
await expect(element(by.label('Login'))).toBeVisible();
});
});
e2e/init.js
require('babel-polyfill');
const detox = require('detox');
const config = require('../package.json').detox;
before(async () => {
await detox.init(config);
});
after(async () => {
await detox.cleanup();
});
versions
detox: 6.0.2
detox-expo-helpers: 0.2.0
expo: 23.0.0
node: 8.6.0
(This is a standalone app that's built with CRNA)
Not working at all.
Maybe it's because I have not running an Expo app in production yet, and only tried running from the expo app, but how do I do this?
This repo contains a bin//Exponent-1.19.0.app
directory, where does that come from? Can I use e2e testing with the Expo app in the iOS emulator?
I hope someone can enlighten me.
I tried this example and got this error
Error: Error: Cannot find UI Element.
Exception with Assertion: {
"Assertion Criteria" : "assertWithMatcher:matcherForSufficientlyVisible(>=0.750000)",
"Element Matcher" : "(((respondsToSelector(accessibilityIdentifier) && accessibilityID('welcome')) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('welcome')) && kindOfClass('RCTScrollView'))))))",
"Recovery Suggestion" : "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element."
}
Error Trace: [
{
"Description" : "Interaction cannot continue because the desired element was not found.",
"Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
"Error Code" : "0",
"File Name" : "GREYElementInteraction.m",
"Function Name" : "-[GREYElementInteraction matchedElementsWithTimeout:error:]",
"Line" : "124"
}
]
This troubleshoot doesn't help
I also tried to upgrade all package, but got same error
"dependencies": {
"expo": "^24.0.2",
"react": "16.2.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz"
},
"devDependencies": {
"detox": "^6.0.4",
"detox-expo-helpers": "^0.2.0",
"mocha": "^4.1.0"
},
I am trying to implement Detox for an Ejected Expo RN app.
Currently, I am failing at the last step, i.e while running the detox test.
Verisions Used:
React Native 0.59.8
Detox : 1.15.1
Expo Kit: 35
Error:
ReferenceError: device is not defined
` describe("Example", () => {
beforeEach(async () => {
await device.reloadReactNative();
^
});
it("should have welcome screen", async () => {
at Object._callee$ (firstTest.spec.js:5:11)
at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:114:21)`
ReferenceError: element is not defined
` 6 | });
7 |
> 8 | it("should have welcome screen", async () => {
| ^
9 | await expect(element(by.id("welcome"))).toBeVisible();
10 | });
11 |
at Object._callee2$ (firstTest.spec.js:8:36)
at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:152:20)
at ../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:187:11
at callInvokeWithMethodAndArg (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:186:16)`
Can you please let me know if we need to use detox expo helpers as we use with detox tests for Expo RN app.
Any plans to add an android configuration?
Looks like the latest version opens the Expo App but it then hangs and doesn't take you to the App screen. You get stuck on the Expo SDK UI screen.
Update:
yarn e2e
you need to wait about 5-10 seconds. Then it takes you to the app.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.