I am using aurelia-materialize-bridge with my Aurelia application. It is a UI toolkit. I configured it according to the Aurelia-Cli installation instructions in the guide with some success. Pages load correctly and most components seem to work.
When I run the unit tests au test, I get a handfull of 404 errors.
19 10 2016 19:51:18.049:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
19 10 2016 19:51:18.065:INFO [launcher]: Starting browser Chrome
19 10 2016 19:51:19.284:INFO [Chrome 53.0.2785 (Windows 10 0.0.0)]: Connected on socket /#ONnYj7PlSdj5wYRyAAAA with id 80681297
19 10 2016 19:51:19.510:WARN [web-server]: 404: /base/src/jquery.hammer.js
19 10 2016 19:51:19.511:WARN [web-server]: 404: /base/src/jquery.timeago.js
19 10 2016 19:51:19.512:WARN [web-server]: 404: /base/src/picker.js
19 10 2016 19:51:19.513:WARN [web-server]: 404: /base/src/picker.date.js
19 10 2016 19:51:19.513:WARN [web-server]: 404: /base/src/velocity.js
Chrome 53.0.2785 (Windows 10 0.0.0) ERROR
Uncaught Error: Script error for "jquery.hammer"
http://requirejs.org/docs/errors.html#scripterror
at F:/Oct2016/I Know Sports Too/scripts/vendor-bundle.js:3763
How can I get past these 404 errors and run tests? The missing scripts all can be found in the materialize-css.js file in the root.
In karma.config.js, I was added two lines to splice in the materialize-bundle after the entryBundle.
let otherBundle = path.join(output, 'materialize-bundle.js');
let entryBundle = appSrc.splice(entryIndex, 1)[0];
let files = [entryBundle, otherBundle].concat(testSrc).concat(appSrc);
It sems to work. Post your answers if you've got a better way.
Adding the materialize-bundle (which seems to already be pulled in by project.build.bundles on #12) seems to cause a new problem:
Chrome 54.0.2840 (Windows 10 0.0.0) ERROR
Uncaught Error: Mismatched anonymous define() module: function (){return t(e)}
http://requirejs.org/docs/errors.html#mismatch
at c:/Users/shart/Projects/federal-identity/newton/scripts/vendor-bundle.js:10423
Hopefully someone else out there has experienced this. If anyone finds a solution please post.
Related
Is there a way to suppress output from the web driver - e.g.
Feb 09, 2023 1:22:13 PM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.7.2` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
Feb 09, 2023 1:22:14 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find CDP implementation matching 110
Feb 09, 2023 1:22:14 PM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.7.2` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
If this is really what you want:
Add a setUp Thread Group to your Test Plan
Add JSR223 Sampler to the Thread Group
Put the following code into "Script" area:
java.util.logging.LogManager.getLogManager().reset()
def globalLogger = java.util.logging.Logger.getLogger(java.util.logging.Logger.GLOBAL_LOGGER_NAME)
globalLogger.setLevel(java.util.logging.Level.OFF)
Next time you run your test all Selenium-related logging will go away.
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 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?
I am trying to resolve a cobbler issue, request your help/guidance on the same. we have spacewalk with cobbler. when I add a new host and do a cobbler sync, i am getting the below error and TASK FAILED.
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
Exception occured: <class 'cexceptions.CX'>
Exception value: 'Error templating file, check cobbler.log for more details'
when I cross check the cobbler.log, these entries were recorded...
Mon Apr 25 14:44:45 2016 - WARNING | errors were encountered rendering the template
Mon Apr 25 14:44:45 2016 - WARNING |
[{'code': u'VFFSL(SL,"net0",True)/mac',
'exc_val': NotFound("cannot find 'net0'",),
'lineCol': (2, 11),
'rawCode': u'${net0/mac}',
'time': 'Mon Apr 25 14:44:45 2016'}]
Thanks
Nandakumar
we found its was a profile with the system Profile with a wrong name, which was stopping creating the dhcpd.conf file. After removing the particular system profile, everything works well.
Thanks
Nandakumar
With the new karma launcher for phantomJS, I am getting an annoying "Waiting 15 seconds" every time I run the tests.
The only page remotely relevant to this problem is here: https://github.com/karma-runner/karma/issues/1545
I've swapped node and karma versions a few times to try to get it to work without success. Has anyone encountered this issue?
Here's the combination of tools I'm using:
Node version: v0.10.40
karma: 0.13.15
karma-chrome-launcher: 0.2.2
karma-jasmine: 0.3.6
karma-phantomjs-launcher: 0.2.1
26 01 2016 15:06:21.897:INFO [karma]: Karma v0.13.15 server started at http://localhost:9877/karma/
26 01 2016 15:06:21.897:INFO [launcher]: Starting browser PhantomJS
26 01 2016 15:06:21.905:INFO [phantomjs.launcher]: ACTION REQUIRED:
26 01 2016 15:06:21.905:INFO [phantomjs.launcher]:
26 01 2016 15:06:21.905:INFO [phantomjs.launcher]: Launch browser at
26 01 2016 15:06:21.905:INFO [phantomjs.launcher]: http://localhost:9000/webkit/inspector/inspector.html?page=2
26 01 2016 15:06:21.905:INFO [phantomjs.launcher]:
26 01 2016 15:06:21.906:INFO [phantomjs.launcher]: Waiting 15 seconds ...
I'm using the karma-phantomjs2-launcher and you get the "waiting 15 seconds" message when debug setting is set to true. Flicking it to false got rid of the message in my case.
I would not recommend to use phantomJS. People report that its functionality can differ from Chrome or other browsers. Also you need to download it, which may fail to resume on errors.
It is more robust and reliable to use Chrome and any other real browsers you want to support. In fact, it is the main strength of Karma that you run your tests in real browsers.
Here is a minimal setup I wrote to get your started quickly, that you can also add to your current project with the single command
npm install min-karma -D
It uses Chrome but you can add any other supported browser.
It definitely will not let you wait more than a second.