The tests appear to run in the simulator because an app launches briefly with text that says "Testing in Progress" then "Total: 0, Passed: 0, Failed: 0" (took a video of the simulator window).
This is a NativeScript Angular project using TypeScript. I have tried an example as both src/app/tests/example.js and src/app/tests/example.ts with the following:
// A sample Jasmine test
describe('A suite', () => {
it('contains spec with an expectation', () => {
expect(true).toBe(true);
});
});
Last few lines of log after running tns test ios.
Skipping prepare.
Successfully transferred all files.
Refreshing application...
Successfully synced application [redacted] on device CFB71B33-F348-452D-8069-E846D46A246D.
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:54:28: NSUTR: fetching http://127.0.0.1:9876/context.json
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:54:28: NSUTR: fetching http://10.0.1.15:9876/context.json
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:60:32: NSUTR: found karma at 127.0.0.1
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:97:20: NSUTR: connecting to karma at http://127.0.0.1:9876
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:60:32: NSUTR: found karma at 10.0.1.15
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:116:24: NSUTR: successfully connected to karma
08 10 2018 15:56:45.224:INFO [NativeScript / 11.4 (11.4; iPhone)]: Connected on socket 1gPBBxKC1KDaVXesAAAA with id NativeScriptUnit-3023
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:159:20: NSUTR: downloading http://127.0.0.1:9876/context.json
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:200:32: NSUTR: eval script /base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?a1eb923d36d1ca53b93387cb5312668373ad9ef2
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:200:32: NSUTR: eval script /base/node_modules/karma-jasmine/lib/boot.js?945a38bf4e45ad2770eb94868231905a04a0bd3e
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:200:32: NSUTR: eval script /base/node_modules/karma-jasmine/lib/adapter.js?6cf71867f538f40db053c1775b2c56a83696375c
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:212:24: NSUTR: beginning test run
NativeScript / 11.4 (11.4; iPhone): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
NativeScript / 11.4 (11.4; iPhone): Executed 0 of 0 ERROR (0.006 secs / 0 secs)
CONSOLE LOG file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:258:24: NSUTR: completeAck
NativeScript / 11.4 (11.4; iPhone) ERROR
Disconnectedclient disconnected from CONNECTED state
NativeScript / 11.4 (11.4; iPhone): Executed 0 of 0 ERROR (0.006 secs / 0 secs)
Package.json versions:
"nativescript-unit-test-runner": "^0.3.4",
"#types/jasmine": "~2.8.9",
"jasmine-core": "3.2.1",
"karma": "3.0.0",
"karma-jasmine": "1.1.2",
"karma-nativescript-launcher": "0.4.0",
EDIT Happens on Android as well.
I had the tests in the wrong folder. Tried src/tests and src/app/tests. Noticed app/tests was mentioned but thought it meant src/app.
N.B. tns test init did not create any files in app/tests.
Related
In my nativescript app, I have a problem about using nativescript ui autocomplete. I compile my mobile application to android apps. It has an error as below
<======-------> 50% CONFIGURING [3s]
<====---------> 35% EXECUTING [13s]
<======-------> 51% EXECUTING [20s]
Exception in thread "main" java.lang.ClassNotFoundException: Class: com.telerik.widget.autocomplete.ShowSuggestionListListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:776)
at org.nativescript.staticbindinggenerator.Generator.collectInterfaceMethods(Generator.java:703)
at org.nativescript.staticbindinggenerator.Generator.getPublicApi(Generator.java:227)und 0 errors. Watching for file changes.
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:342)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:133)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:172)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:90)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:66)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:47)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:runSbg'.
Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
10:34:24 - Found 0 errors. Watching for file changes.
Unable to apply changes on device: 192.168.80.101:5555. Error is: Command ./gradlew failed with exit code 1.
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-webpack.js
Stopping webpack watch
delete node_modules, platforms, hooks folders and package-lock.json file
run
npm i
rebuild the project ->
tns run android
or
tns build android
I am trying to run the Amazon app on an iPhone 6 simulator using Xcode.
The app is getting installed in the iPhone Simulator, but not able to interact with its elements.
Appium version - 1.7.2
Xcode Version 9.2
Platform Mac- 10.12.6
Downloaded the app - i.e. xxx.app.ipa
Logs:
[Xcode] 2018-02-13 21:23:08.009 xcodebuild[9868:75242] Error Domain=IDEFoundationErrorDomain Code=1 "Cannot launch simulated executable: no file found at /Applications/Xcode.app/Contents/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app" UserInfo={NSLocalizedDescription=Cannot launch simulated executable: no file found at /Applications/Xcode.app/Contents/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app} [Xcode] 2018-02-13 21:23:08.009 xcodebuild[9868:75242]
Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted} [Xcode] [Xcode] 2018-02-13 21:23:08.010 xcodebuild[9868:75259] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled
[Xcode] ** TEST EXECUTE FAILED ** [Xcode] [Xcode] 2018-02-13 21:23:08.011 xcodebuild[9868:75318] Error saving test log:
Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSFilePath=/Applications/Xcode.app/Contents/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/921A213D-B7E4-4994-9443-F73DDE5FBD4D.xcactivitylog, NSLocalizedDescription=No such file or directory} | User info: { [Xcode] NSFilePath = "/Applications/Xcode.app/Contents/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/921A213D-B7E4-4994-9443-F73DDE5FBD4D.xcactivitylog"; [Xcode] NSLocalizedDescription = "No such file or directory"; [Xcode] } [Xcode]
[XCUITest] xcodebuild exited with code '65' and signal 'null' [BaseDriver] Event 'wdaStartFailed' logged at 1518585788035 (21:23:08 GMT-0800 (PST)) [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: "xcodebuild failed with code 65". [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [XCUITest] Removing WDA application from device [XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: "xcodebuild failed with code 65". at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:375:13) at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at Error: Unable to launch WebDriverAgent because of xcodebuild failure: "xcodebuild failed with code 65". at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:375:13) at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [XCUITest] Killing running processes 'xcodebuild.B720A212-489B-4A48-BBDB-7119C9763406, B720A212-489B-4A48-BBDB-7119C9763406.*XCTRunner' for the device B720A212-489B-4A48-BBDB-7119C9763406... [XCUITest] 'pgrep -nif xcodebuild.*B720A212-489B-4A48-BBDB-7119C9763406' didn't detect any matching processes. Return code: 1 [XCUITest] 'pgrep -nif B720A212-489B-4A48-BBDB-7119C9763406.XCTRunner' didn't detect any matching processes. Return code: 1 [XCUITest] Deleting simulator created for this run (udid: 'B720A212-489B-4A48-BBDB-7119C9763406') [iOSLog] Stopping iOS log capture
It's saying it can't find the WebDriver app. Can you confirm its existence in /Applications/Xcode.app/Contents/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphonesimulator/?
If it doesn't exist, there is something wrong with your Appium install so I'd recommend reinstalling npm uninstall -g appium and npm install -g appium. Probably safe to do that anyway.
Also make sure you restart your device and uninstalling any existing WebDriver app on the device.
Error clear shows -- /Applications/Xcode.app/Contents/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app}
Webdriver agent need to be successfully running on device
Try to configure Webdriver agent and Developer ID ::
Open the existing the WebDriver Agent (double click on WebDriverAgent.xcodeproj)
On top of Xcode you File > New> File , then you will an pop up something like this
Select OSX->.Other-> Select Configuration settings file.
Paste the following things in newly created file.
DEVELOPMENT_TEAM = xxxxxxxxx
CODE_SIGN_IDENTITY = iPhone Developer
Development team is Team ID which your developer should be able to provide . Dont change the CODE_SIGN_IDENTITY.
In device.propoerties file add this
xcodeConfigFile=/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig
In ConfigCapa.java file add this
capabilities.setCapability(“xcodeConfigFile”,emulatorProp.getProperty(“xcodeConfigFile”));
Open terminal go to
$ cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/
$ mkdir -p Resources/WebDriverAgent.bundle
sh ./Scripts/bootstrap.sh –d
Go to terminal type
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=DeviceID’ test Last line on build output above command should be Listening on USB. Then you are all set!
brew install libimobiledevice –HEAD
To run appium type appium &
To find version type appium — v
when I try to build a prod profile war, with mvn -Pprod package, I am getting this gulp error :
TypeError: undefined is not an object (evaluating '$httpBackend.verifyNoOutstandingExpectation') in /home/myapp/dev/workspace/applicationRh/src/test/javascript/spec/app/services/auth/auth.services.spec.js (line 9)
/home/myapp/dev/workspace/applicationRh/src/test/javascript/spec/app/services/auth/auth.services.spec.js:9:1596
PhantomJS 2.1.1 (Linux 0.0.0): Executed 64 of 64 (64 FAILED) (0 secs / 1.231 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 64 of 64 (64 FAILED) ERROR (2.671 secs / 1.231 secs)
[22:28:40] 'test' errored after 9.84 s
[22:28:40] Error: 1
at formatError (/usr/lib/node_modules/gulp/bin/gulp.js:169:10)
Does anyone know about this issue?
You can't package your app in production if it has test failures. Run grunt test to see which test fail, and correct that test.
Of course, if you don't want to be bothered with tests, just delete them :-)
I have config and specs files at shared folder of remote server. I run tests from local machine via console:
C:\Users\User>protractor \remoteServer\AutoSPA\config\protractor.conf.js
With jasmine framework all works good, but if I set framework: 'jasmine2' in protractor.conf.js tests don`t run:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://10.17.175.168:50910/wd/hub
Started
No specs found
Finished in 0.001 seconds
Uncaught exception: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
[launcher] Process exited with error code 1
EXAMPLE:
conf.js:
exports.config = {
specs: ['./test.js'],
capabilities : {'browserName' : 'chrome'},
framework: 'jasmine2',
jasmineNodeOpts: {showColors: true}
};
test.js in the same folder:
describe("test", function(){
it("navigate", function(){
browser.get("https://angularjs.org/")
})
});
if it's local folder it works correctly, but if it's remote folder it doesn't find spec test.js.
I investigated and debug a little bit more and found out that Jasmine 1.3 used FS and Path for specs search, but Jasmine 2 used GLOB. Glob doesn't work with remote paths.
I have installed latests Genymotion version 2.4.0 and Virtual Box 4.3.26 r98988.
When i run genymotion from Jenkins or command line on MacOSX Yosemite:
/Applications/Genymotion.app/Contents/MacOS/player --vm-name "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920"
i have this issues:
Logging activities to file: .Genymobile/genymotion.log
Logging activities to file: .Genymobile/Genymotion/deployed/Google Nexus 5 - 4.4.4 - API 19 - 1080x1920/genymotion-player.log
OpenGL connected to 192.168.56.101:25000
Port 22468 will be used for OpenGL data connections
Unknown TCPCLI command 1003
Jenkins waits indefinitely and the calabash tests are not running.
Logs of genymotion have no particular errors, but virtualbox's log (VBoxSVC.log) have this error:
00:00:00.130196 nspr-2 HostDnsMonitorProxy::notify
00:00:00.130211 nspr-2 HostDnsMonitorProxy: Host's DNS information updated:
00:00:00.130214 nspr-2 server 1: 10.10.0.30
00:00:00.130217 nspr-2 server 2: 10.10.0.31
00:00:00.130221 nspr-2 no search string entries
00:00:00.130223 nspr-2 no domain set
00:00:00.134010 nspr-2 failed to create vboxnet0, error (0x80004005)
00:00:00.134189 nspr-2 VDInit finished
You may want to try "--quiet" while running the player.
I have the same error "Unknown TCPCLI command 1003" but it still seems to work fine.
This is how I run mine.
File: run.sh
vboxmanage snapshot "Google Nexus S - 2.3.7 - API 10 - 480x800" restore "factory"
/Applications/Genymotion.app/Contents/MacOS/player --quiet --vm-name "Google Nexus S - 2.3.7 - API 10 - 480x800" &
echo "going to sleep"
sleep 30
echo "wake up"