Detox not working [Info.plist does not contain CFBundleShortVersionString] - react-native

package.json
"detox": {
"test-runner": "jest",
"configurations": {
"ios.sim": {
"build": "xcodebuild -workspace ios/lamunchies.xcworkspace -scheme lamunchies -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"binaryPath": "ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app",
"type": "ios.simulator",
"name": "iPhone 8"
}
}
}
firstTestSpecs.js
describe('Example', () => {
beforeEach(async () => {
await device.reloadReactNative()
})
it('should have welcome screen', async () => {
await expect(element(by.id('Settings'))).toBeVisible()
})
})
logs
detox[38188] ERROR: [exec.js/EXEC_FAIL, #3] An error was encountered processing the command (domain=NSPOSIXErrorDo
main, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
detox[38188] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
{ ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/j
ordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (/Users/jordeguevara/Desktop/LAMunchies/node_modules/child-process-promise/lib/index.js:33:27)
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
name: 'ChildProcessError',
code: 22,
childProcess:
{ ChildProcess: { [Function: ChildProcess] super_: [Function] },
fork: [Function: fork],
_forkChild: [Function: _forkChild],
exec: [Function: exec],
execFile: [Function: execFile],
spawn: [Function: spawn],
spawnSync: [Function: spawnSync],
execFileSync: [Function: execFileSync],
execSync: [Function: execSync] },
stdout: '',
stderr:
'An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe application\'s Info.plist does not contain CFBundleShortVersionString.\nEnsure your bundle contains a CFBundleShortVersionString.\n' }
Example: should have welcome screen
Example: should have welcome screen [FAIL]
FAIL e2e/firstTest.spec.js (6.516s)
Example
✕ should have welcome screen (4ms)
● Example › should have welcome screen
ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/......../ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/...../ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (../node_modules/child-process-promise/lib/index.js:33:27)
● Example › should have welcome screen
ReferenceError: device is not defined
1 | describe('Example', () => {
2 | beforeEach(async () => {
> 3 | await device.reloadReactNative()
| ^
4 | })
5 |
6 | it('should have welcome screen', async () => {
at _callee$ (firstTest.spec.js:3:11)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:192:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at Object.<anonymous>.exports.async (../node_modules/regenerator-runtime/runtime.js:216:14)
at Object._callee (firstTest.spec.js:2:14)
● Example › should have welcome screen
ReferenceError: element is not defined
4 | })
5 |
> 6 | it('should have welcome screen', async () => {
| ^
7 | await expect(element(by.id('Settings'))).toBeVisible()
8 | })
9 | })
at _callee2$ (firstTest.spec.js:6:36)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:192:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at Object.<anonymous>.exports.async (../node_modules/regenerator-runtime/runtime.js:216:14)
at Object._callee2 (firstTest.spec.js:6:36)
detox[38187] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePat
tern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 62BBE686-316C-4D6E-9625-E8D21F60CE97 "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (../node_modules/child-process-promise/lib/index.js:33:27)
detox[37766] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePat
tern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
MacBook-Pro-9:LAMunchies jordeguevara$ detox test
detox[37982] INFO: [test.js] configuration="ios.sim" reportSpecs=true DETOX_START_TIMESTAMP=1579315003125 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
detox[37983] INFO: [DetoxServer.js] server listening on localhost:55101...
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] "/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/
Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"" f
ailed with code = 22, stdout and stderr:
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6]
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=NSPOSIXErrorDo
main, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
detox[37983] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
{ ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/j
ordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (/Users/jordeguevara/Desktop/LAMunchies/node_modules/child-process-promise/lib/index.js:33:27)
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
name: 'ChildProcessError',
code: 22,
childProcess:
{ ChildProcess: { [Function: ChildProcess] super_: [Function] },
fork: [Function: fork],
_forkChild: [Function: _forkChild],
exec: [Function: exec],
execFile: [Function: execFile],
spawn: [Function: spawn],
spawnSync: [Function: spawnSync],
execFileSync: [Function: execFileSync],
execSync: [Function: execSync] },
stdout: '',
stderr:
'An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe application\'s Info.plist does not contain CFBundleShortVersionString.\nEnsure your bundle contains a CFBundleShortVersionString.\n' }
I was trying to set up Detox on my reat native project via CLI but ran into some trouble.
I tried adding CFBundleShortVersionString to InfoList but it was already there.
I followed the steps to set up detox in this article : https://blog.expo.io/testing-expo-apps-with-detox-and-react-native-testing-library-7fbdbb82ac87
Any help would be appreciated

So hopefully this helps someone
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
it told me it my CFBundleShortVersionString already it existed but I just changed it to a different number in my Info.plist
and it worked from there

Related

heroku cli login 'thow err'

I am trying to login to heroku in terminal, so i type:heroku login -i
Then type in my email and get this response after:
C:\Program Files\heroku\client\node_modules\cli-ux\node_modules\#oclif\errors\lib\index.js:42
throw err;
^
CLIError: timed out
at Object.error (C:\Program Files\heroku\client\node_modules\cli-ux\node_modules\#oclif\errors\lib\index.js:26:15)
at Timeout._onTimeout (C:\Program Files\heroku\client\node_modules\#heroku-cli\command\lib\login.js:27:38)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7) {
oclif: { exit: 2 },
code: undefined
}
does anyone know how to fix this?

How to resolve mochawesome reports in webdriver.io framework getting error TypeError: ReporterClass is not a constructor

I have added the below dev dependencies for mochawesome reports in my webdriver.io framework.
"wdio-dot-reporter": "0.0.10",
"wdio-mochawesome-reporter": "^4.0.0"
My wdio.conf file looks like below
reporters: [
'dot',
[
'mochawesome',
{
outputDir: './Results',
},
],
],
When I am trying to run my tests getting the below error:
[0-0] 2021-12-24T09:20:57.498Z ERROR #wdio/local-runner: Failed launching test session: TypeError: ReporterClass is not a constructor
at BaseReporter.initReporter (/Users/id856795/myproximus-rn/node_modules/#wdio/runner/build/reporter.js:101:20)
at Array.map (<anonymous>)
at new BaseReporter (/Users/id856795/myproximus-rn/node_modules/#wdio/runner/build/reporter.js:21:50)
at Runner.run (/Users/id856795/myproximus-rn/node_modules/#wdio/runner/build/index.js:45:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
/Users/id856795/myproximus-rn/node_modules/#wdio/cli/build/interface.js:127
throw new Error('Could not find job');
^
Error: Could not find job

heroku login issue on windows powershell

When I login Heroku in windows powershell,I am getting the following error:
C:\Program Files\heroku\client\node_modules\#oclif\errors\lib\index.js:29
throw err;
^t
CLIError: timed out
at Object.error (C:\Program Files\heroku\client\node_modules\#oclif\errors\lib\index.js:22:17)
at Timeout._onTimeout (C:\Program Files\heroku\client\node_modules\#heroku-cli\command\lib\login.js:27:38)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7) {
oclif: { exit: 2 },
code: undefined
}
What does it mean and how can I get rid of it?

"ReferenceError: device is not defined" when using detox+Jest in React Native for android

App is working fine both in Android and iOS simulators. I am trying to setup Detox with Jest for end to end testing my react-native app. In simulator I can see some movement but app is not launched and I get following errors(apart from "device not defined" I am also getting "app-debug-androidTest.apk: No such file or directory" error, so not sure what is the root cause here).
Console
>detox test --configuration android.emu.debug
node_modules/.bin/jest e2e --config=e2e/config.json --runInBand
server listening on localhost:64281...
(node:75639) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
console.log e2e/firstTest.spec.js:3
**********before each called
console.log e2e/firstTest.spec.js:9
***************first test
FAIL e2e/firstTest.spec.js (123.358s)
Example
✕ should have welcome screen (120009ms)
● Example › should have welcome screen
ChildProcessError: Command failed: /Users/xxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk
adb: failed to stat /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk: No such file or directory
`/Users/xxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk` (exited with error code 1)
at callback (../node_modules/child-process-promise/lib/index.js:33:27)
● Example › should have welcome screen
ReferenceError: device is not defined
2 | beforeEach(async () => {
3 | console.log('**********before each called');
> 4 | await device.reloadReactNative();
5 | console.log('**********before each end');
6 | });
7 |
at Object._callee$ (firstTest.spec.js:4:1)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
at ../node_modules/regenerator-runtime/runtime.js:195:11
at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
at Object.<anonymous>.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
at Object._callee (firstTest.spec.js:2:57)
● Example › should have welcome screen
Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.
at ../node_modules/jest-jasmine2/build/queue_runner.js:72:21
at Timeout.callback [as _onTimeout] (../node_modules/jsdom/lib/jsdom/browser/Window.js:592:19)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 123.919s, estimated 241s
Ran all test suites matching /e2e/i.
child_process.js:644
throw err;
^
Error: Command failed: node_modules/.bin/jest e2e --config=e2e/config.json --runInBand
at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at runJest (/Users/xxx/Projects/xxxxxx/node_modules/detox/local-cli/detox-test.js:69:6)
at Object.<anonymous> (/Users/xxx/Projects/xxxxxx/node_modules/detox/local-cli/detox-test.js:42:5)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
firstTest.spec.js:
describe('Example', () => {
beforeEach(async () => {
console.log('**********before each called');
await device.reloadReactNative();
console.log('**********before each end');
});
it('should have welcome screen', async () => {
console.log('***************first test');
await expect(element(by.id('welcome'))).toBeVisible();
console.log('***************first test end');
});
})
package.json
"dependencies": {
"react": "16.0.0",
"react-native": "0.51.0",
....
},
"devDependencies": {
"babel-jest": "22.0.3",
"babel-preset-react-native": "4.0.0",
"detox": "^6.0.4",
"jest": "22.0.3",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native",
"setupTestFrameworkScriptFile": "./e2e/init.js"
},
"detox": {
"specs": "e2e",
"test-runner": "jest",
"runner-config": "e2e/config.json",
"configurations": {
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/app-debug.apk",
"build": "pushd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && popd",
"type": "android.emulator",
"name": "Pixel_API_27"
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"name": "Pixel_API_27"
}
}
}
init.js
const detox = require('detox');
const config = require('../package.json').detox;
// Set the default timeout
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;
beforeAll(async () => {
await detox.init(config);
});
afterAll(async () => {
await detox.cleanup();
});
Following is the view while running the test command
I was able to solve the issue by following this example from detox. Followed the android project config and made some changes in app/build.gradle. Basically made it same as in the example code.
Waiting for detox to officially start supporting Android with clear setup steps. There are still issues while using gradle 3.

Error: no writecb in Transform class.?

Good day. Help me please.
There are some versions.
npm v3.10.6
node v4.5.
"gulp-file-include": "^0.14.0",
"gulp-remove-html": "^1.1.2"
There is part of gulpfile.js
fileinclude = require('gulp-file-include'),
gulpRemoveHtml = require('gulp-remove-html')
gulp.task('buildhtml', function() {
gulp.src(['app/*.html'])
.pipe(fileinclude({
prefix: '##'
}))
.pipe(gulpRemoveHtml())
.pipe(gulp.dest('dist/'));
});
There is result after running "gulp buildhtml". The problem appears today.
[11:31:46] Starting 'buildhtml'... [11:31:46] Finished 'buildhtml' after 8.83 ms events.js:141
throw er; // Unhandled 'error' event
^
Error: no writecb in Transform class
at afterTransform (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:74:40)
at TransformState.afterTransform (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:58:12)
at DestroyableTransform.fileInclude [as _transform] (C:\Projects\Projects\project1\node_modules\gulp-file-include\lib\index.js:49:9)
at DestroyableTransform.Transform._read (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:159:10)
at DestroyableTransform.Transform._write (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:147:83)
at doWrite (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:313:64)
at writeOrBuffer (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:302:5)
at DestroyableTransform.Writable.write (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:241:11)
at write (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:623:24)
at flow (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:664:5)
at emitNone (events.js:67:13)
at DestroyableTransform.emit (events.js:166:7)
at emitReadable_ (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:448:10)
at emitReadable (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:444:5)
at readableAddChunk (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:187:9)
If you use Gulp 4.0 alpha 3, Downgrade to Gulp 4.0 alpha 2 with
npm install -S gulpjs/gulp#6d71a65