I am following the Aurelia docs for Production setup and I am encountering an issue with the the Running The Unit Tests section.
I have the app running with no issues. I open a new terminal window and successfully installed karma-cli 3.9.3. But when I run gulp test I get the following error:
31 05 2016 15:58:09.929:INFO [Chrome 51.0.2704 (Mac OS X 10.11.5)]: Connected on socket /#kJiah_Vi_OxBaoMGAAAA with id 68824261
Chrome 51.0.2704 (Mac OS X 10.11.5) ERROR
Uncaught TypeError: Cannot read property 'config' of undefined
at /Users/XXX/Documents/Websites/Aurelia/Production/node_modules/karma-jspm/src/adapter.js:18
I know enough that I should not be editing any source files in node_modules, so how do I go about fixing this?
Related
I was testing my electron app with mocha and got this error several times (and I'm still getting it!). Every time I run the program it returns with the error
> Executing task: npm run test <
> forte#1.0.0 test PATH TO PROJECT
> mocha ./tests/test.js
0 passing (3ms)
Test failed Failed to create session.
unknown error: Chrome failed to start: was killed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location \node_modules\spectron\lib\launcher.bat is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)
Just in case this is important, the part which says (The process started from chrome location \node_modules... actually had the whole path, not just that.
In my test.js file I have the code from the spectron home page, which you can view here. What is wrong with the test files?
I'm stuck trying to get my Selenium script running on my raspberry Pi 4 running with raspbian.
The script is running fine on my mac.
The problem is with setting up the webdriver. I tried installing several webdrivers, including chromedriver, geckodriver, operadriver and phantomjsdriver.
Whenever I'm trying to run the script (which I of course changed to the corresponding drivers) I'm greeted with the following error:
OSError: [Errno 8] Exec format error: 'operadriver'
Also trying to open the driver directly from the shell is resulting in an error:
pi#raspberrypi:/home/shares/users $ chromedriver
bash: /usr/local/bin/chromedriver: cannot execute binary file: Exec format error
My research found some people who got it to work, but all the posts seemed quite old. Some where suggesting the error is pointing to the cpu architecture which is armv7l/armhf in my case.
So is it at all possible to get Selenium running on a pi these days? Has anyone got this to work?
This error message with operadriver...
OSError: [Errno 8] Exec format error: 'operadriver'
and this error message with chromedriver...
ash: /usr/local/bin/chromedriver: cannot execute binary file: Exec format error
...implies that the respective OperaDriver and the ChromeDriver binaries which were invoked was not in proper format.
On your macos system you have used the following WebDriver variants:
GeckoDriver: geckodriver-v0.26.0-macos.tar.gz
ChromeDriver: chromedriver_mac64.tar.gz
where the WebDriver variants matched the underlying os architecture.
Now as you are using armv7 architecture, you have to download and use the relevant format and version of executables downloading it from WebDriver driver for the Chromium Browser
Note: It is to be noted that from geckodriver v0.24.0 onwards:
Removed
Turned off builds for arm7hf, which will no longer be released but can still be built from the source.
References
You can find a couple of relevant discussions in:
OSError: [Errno 8] Exec format error with GeckoDriver and Selenium on MacOS
WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited on Raspberry-Pi with ChromeDriver and Selenium
I have a large number of files that I run through Karma and Jasmine for testing†. In the middle of the process I get an uncaught error which halts the project. This means that I cannot easily determine which file is causing the fatal error. Is there a way to print out the name of a file as it is being tested or get similar information that I can analyze?
†More specifically, I am running an Angular project using Angular CLI, which employs Karma and Jasmine.
Edit:
I have been asked for screenshots and code, but there's not much to show. When I run karma I get this response:
19 09 2017 00:04:18.279:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
19 09 2017 00:04:18.281:INFO [launcher]: Launching browser Chrome with unlimited concurrency
19 09 2017 00:04:18.285:INFO [launcher]: Starting browser Chrome
19 09 2017 00:04:42.723:INFO [Chrome 61.0.3163 (Mac OS X 10.12.6)]: Connected on socket Ml1MJK4zgJuXwLyxAAAA with id 34080921
................................................................................
................................................................................
................................................................................
.....................................................Chrome 61.0.3163 (Mac OS X 10.12.6) ERROR
Uncaught Error: No component factory found for FooComponent. Did you add it to #NgModule.entryComponents?
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:8310
Chrome 61.0.3163 (Mac OS X 10.12.6) ERROR
Uncaught Error: No component factory found for FooComponent. Did you add it to #NgModule.entryComponents?
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:8310
Chrome 61.0.3163 (Mac OS X 10.12.6): Executed 293 of 739 (skipped 44) ERROR (10.515 secs / 1.461 secs)
I am running 739 unit tests and the process halts after 293. I cannot find the file causing the FooComponent error (it's something subtle and cannot be identified with a keyword search). This is why I need to know the name of the file, or the test, or the something that is causing the error.
You could use a custom Karma reporter to view more details on which tests are failing etc.
One option is karma-spec-reporter.
Installation and usage is simple (copied from the github README):
npm install karma-spec-reporter --save-dev
Then add 'spec' to reporters in karma.conf.js, e.g.
reporters: ['spec']
There are also other options for Karma reporters.
Karma-mocha-reporter is one option.
If you're after a bit of a laugh, you could also look at the karma-nyan-reporter for a bit of nyan-cat relief. Perhaps surprisingly, it also seems to give some useful error logging as well.
I am building a set of Protractor scripts to evaluate the performance of a web app.
A month ago, the tests were running in both Edge and Chrome. I stepped away from the project for two weeks, and performed a Windows OS update on my return. Since then, when running the test in Microsoft Edge, I get alternating results between 1) an unknown error where the browser never even launches (I will post the cmd output from this result below), and 2) having the Edge browser open but not visiting the base URL it is supposed to (where I am getting a timeout error after being on the Edge homescreen for 10 seconds). I unfortunately did not have the opportunity to run the script before the Windows update, so I am not certain if that is the cause, but I think it is likely. The tests continue to run correctly when operating in Chrome.
I have tried reinstalling Edge's webdriver several times and have chekced its path. I would like to roll back Windows but think this would be a hassle with our IT department, so I am wondering if anyone has found a different solution to this problem?
This is the error when the browser fails to open:
\Browser Tests>protractor edge_conf
[13:32:48] I/launcher - Running 1 instances of WebDriver
[13:32:48] I/hosted - Using the selenium server at http://localhost:17556
[13:32:48] E/launcher - Unknown error
[13:32:48] E/launcher - WebDriverError: Unknown error
at WebDriverError (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:27:5)
at Object.checkLegacyResponse (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:505:15)
at parseHttpResponse (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
at Function.createSession (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
at createDriver (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\index.js:167:33)
at Builder.build (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\index.js:632:14)
at Hosted.getNewDriver (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\driverProvider.ts:60:29)
at Runner.createBrowser (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\lib\runner.ts:225:39)
at q.then.then (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\lib\runner.ts:391:27)
at _fulfilled (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at C:\Users\jarlan\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
[13:32:48] E/launcher - Process exited with error code 199
I wound up pushing Windows to version 1703 (Build 15063.540), which was easier to get approved than rolling back.
After reinstalling the appropriate WebDriver, everything is working properly with Edge. Still unclear what was causing the problem, but this seems to have worked around it.
I'm the PM for WebDriver at Microsoft. It sounds like you need to get the proper version for your build of Windows.
You can find all the releases of WebDriver here. To see what build of Windows you have just hit [Windows Key] + [R] and type "winver".
Just a few days ago I could both run (in the simulator and on my iphone device) and package my iOS app for the iOS iTunes Store. But now I cannot get past this error during package:
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Validate build/Release-iphoneos/Trivia\ Rain.app
[ERROR] : (1 failure)
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess.<anonymous> (/Users/natej/.appcelerator/install/4.1.2/package/node_modules/appc-cli-titanium/plugins/run.js:84:66)
at ChildProcess.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
Since a few days ago when the package worked perfectly, I have changed nothing related to my keychains, keystore, profiles, certificates, etc. I have made a few code changes, but after my changes, the app compiled fine, runs in simulator, and deploys/runs on my iphone 6 device. I have double checked that my certs and distribution profiles are all valid, and nothing has changed from a few days ago.
I have cleaned my project, restarted Appcelerator Studio, restarted my mac. Still I cannot get past this error.
Any ideas?
I came back 4 days later after having these problems, having changed nothing (no code, no settings, no Appcelerator updates)...and it simply worked this time.
In summary, Appcelerator is buggy. :-|