karma-runner / karma Goto Github PK
View Code? Open in Web Editor NEWSpectacular Test Runner for JavaScript
Home Page: http://karma-runner.github.io
License: MIT License
Spectacular Test Runner for JavaScript
Home Page: http://karma-runner.github.io
License: MIT License
The following does not work in the configuration file:
...
files = [
JASMINE,
JASMINE_ADAPTER,
'http://code.jquery.com/jquery-1.7.2.js',
...
];
...
The resolver tries to find the file relative to the base directory. Can we add in this external absolute format?
When I try to install testacular with the command: "npm -g install testacular", I get the following output:. I am runnning Windows 7 Professional and my Node version is 0.8.8
npm http GET https://registry.npmjs.org/testacular
npm http 304 https://registry.npmjs.org/testacular
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/chokidar
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/glob
> [email protected] postinstall C:\Users\clewis\AppData\Roaming\npm\node_modules\testacular\node_modules\chokidar
> node setup.js postinstall
The system cannot find the path specified.
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/socket.io-client/0.9.10
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.7.2
npm ERR! [email protected] postinstall: `node setup.js postinstall`
npm ERR! `cmd "/c" "node setup.js postinstall"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the chokidar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node setup.js postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls chokidar
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install" "testacul
ar"
npm ERR! cwd C:\Users\clewis
npm ERR! node -v v0.8.8
npm ERR! npm -v 1.1.59
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.10
npm http 304 https://registry.npmjs.org/redis/0.7.2
npm http GET https://registry.npmjs.org/hiredis
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/hiredis
npm WARN package.json [email protected] No README.md file found!
> [email protected] preinstall C:\Users\clewis\AppData\Roaming\npm\node_modules\testacular\node_modules\socket.io\node_modules\redis\node_modules\hi
redis
> make || gmake
The system cannot find the path specified.
'make' is not recognized as an internal or external command,
operable program or batch file.
'gmake' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional dep failed, continuing [email protected]
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/options
> [email protected] install C:\Users\clewis\AppData\Roaming\npm\node_modules\testacular\node_modules\socket.io\node_modules\socket.io-client\node_modules
\ws
> node install.js
The system cannot find the path specified.
[ws v0.4.21] Attempting to compile blazing fast native extensions.
[ws v0.4.21] Native code compile failed (but the module will still work):
[ws v0.4.21] The native extensions are faster, but not required.
[ws v0.4.21] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.21] On Unix, native extensions require Python, make and a C++ compiler.
[ws v0.4.21] Start npm with --ws:verbose to show compilation output (if any).
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\clewis\npm-debug.log
npm ERR! not ok code 0
latest canay 0.3.8 does abort a run if a browser fails to start, but there is no indication as to which browser failed and with what error:
info: Testacular server started at http://localhost:9876/
info (launcher): Starting browser "Chrome"
info (launcher): Starting browser "Firefox"
info (launcher): Starting browser "Opera"
info (launcher): Starting browser "/Users/jenkins/bin/safari.sh"
info (launcher): Starting browser "/Users/jenkins/bin/ie8.sh"
info (launcher): Starting browser "/Users/jenkins/bin/ie9.sh"
info: Disconnecting all browsers
ideally, I'd like to see an error log statying that e.g. ie9.sh exited before a browser was captured and that the exit code was 12. or maybe even print the actual error message from stderr if there is anything there.
$ testacular start
info: Web server started at http://localhost:8080/
info (launcher): Starting browser "PhantomJS"
info (watcher): Watching "/usr/local/share/npm/lib/node_modules/testacular/adapter/lib/jasmine.js"
info (watcher): Watching "/usr/local/share/npm/lib/node_modules/testacular/adapter/jasmine.js"
info (watcher): Watching "/Users/marknadig/Code/kona/test/lib/angular-mocks.js"
info (watcher): Watching "/Users/marknadig/Code/kona/app/scripts"
info (watcher): Watching "/Users/marknadig/Code/kona/test/spec"
warn (cfJp1JaDS3Aqb71TSllo): Disconnected
$node -v
v0.8.9
$npm -v
1.1.61
$phantomjs --version
1.7.0
$testacular --version
Testacular version: 0.2.0
I never see "info (PhantomJS 1.7): Connnected on socket id โฆโฆ" as my teammate sees as it runs the tests.
any help appreciated
Note: In one shell I ran 'testacular start' and then opened another and ran it again and it runs fine...seems it is falling back to another port:
nadig-mbpro:kona[master*]$ testacular start
warn: Port 8080 in use
warn: Port 9100 in use
info (watcher): Watching "/usr/local/share/npm/lib/node_modules/testacular/adapter/lib/jasmine.js"
info (watcher): Watching "/usr/local/share/npm/lib/node_modules/testacular/adapter/jasmine.js"
info (watcher): Watching "/Users/marknadig/Code/kona/test/lib/angular-mocks.js"
info (watcher): Watching "/Users/marknadig/Code/kona/app/scripts"
info (watcher): Watching "/Users/marknadig/Code/kona/test/spec"
info: Web server started at http://localhost:8081/
info (launcher): Starting browser "PhantomJS"
info: To run via this server, use "testacular run --runner-port 9101"
info (PhantomJS 1.7): Connected on socket id Tp26dgSP5f94WNxWVKj4
So, I confirmed if I change my testacular.conf.js to use port 8081, it works. Not seems a conflict on 8080 but... not seeing what that could be.
As I understand from some recent commits it is possible to use testacular for e2e testing. If I understand correctly, please could you provide some example or documentation to configure this on a angular-seed project?
Also, is the source code used in the youtube tutorial available anywhere?
thanks.
Which could override any default settings.
Based on discussion in #55.
I'm not sure if I'm doing something wrong, when I run the following spec (using the angular scenario adapter), no error is ever displayed.
describe("the home page", function() {
beforeEach(function() {
return browser().navigateTo('/');
});
it("should redirect to /#/", function() {
expect(false).toBe(true)
});
});
If I throw a breakpoint on this line I see that spec.name === "should redirect to /#/"
and spec.steps
is an empty array, so failedStep
is null and accessing failedStep.name
causes the runner to error out.
This seems like a bug to me, but the entire set up is new to me so if I'm doing something wrong let me know.
based on http://ci.angularjs.org/job/angular.js-igor-testacular/584/console
this is my interpretation of what happened:
If a browser launched by Testacular is taking a long time to start and a startup timeout is reached, Testacular will kill it. If however, between the kill command is issued and the browser is actually killed the browser connects, Testacular will hang.
If a testing library outputs TAP it should be trivial to pipe that TAP output into your framework.
I'm having two separate issues it would appear...Windows 7 x64, Node 0.8.11.
0.2.0
, Chrome Canary launches process + UI just fine, but the appended ?id=1
doesn't serve up any content.0.3..7
, Chrome Canary launches the process, but it's running headless somehow. I verified this multiple times just to make sure I wasn't seeing things (including reboots, etc)I can launch a new browser instance, and plug in the id for the url that it was launched with and I get nothing. No content is served.
Note that I've configured testacular to use both PhantomJS
and Canary
So if I take the id that's supposed to be used by PhantomJS
and I plug that into the browser -- everything loads up. I can see in my shell that Testacular starts serving everything properly (I'm running with LOG_DEBUG)
I'm not going to worry about 0.2.0
.. and I'll focus on 0.3.7
. So to recap on those issues
I should hopefully be able to figure out why chrome.exe is spawn
d without a UI ... was wondering if anyone had encountered the other issue with bad Ids?
I can't see how testaculat integrates with jenkins.
We can put singleRun = true in config, right?
And then testacular can just say if all tests pass or not through exit status?
I mean, you can't really see in jenkins which tests failed right?
Because, it would need to have some kind of xml output which jenkins can parse.
When using testacular to launch browsers (via browsers
option), testacular should start a test run as soon as individual browsers connect โ currently testacular waits for all browsers to connect and only then it starts test runs in all the browsers.
Similarly, when singleRun
option is used, testacular should shut down browsers as they complete running tests. This will release OS resources speeding up the remaining browsers.
I'd like to point out that I'm getting the same issue when I run it under Fedora Linux. The startup is fine, when it comes time to run, it throws the exceptions:
ReferenceError: Can't find variable: JASMINE
ReferenceError: Can't find variable: JASMINE_ADAPTER
Both the Linux and Windows environments consist of: Node 0.8.8, Testacular latest release installed via npm, phantomjs latest release.
When Firefox is not running, testacular appears to create a new profile and open up the browser with that. However, when Firefox is running, the profile creation fails and testacular opens up in the profile that's already open.
Adding the "--new-instance" parameter to the firefox command line when the profile is created will make it possible to create the new profile even if firefox is already running (unless, I suppose, it's running with that profile). Adding it to the command line when the browser is actually opened will also ensure that it runs in a separate process from the already running instance, and that it will open up in the expected profile.
(The above tested by running command lines against Firefox 15.0.1 on Ubuntu, but to my knowledge this is the way it's been for years -- on Linux and Windows -- at least).
The config option
browsers = ['Chrome', 'Firefox'];
failed to auto-open Firefox. This is because the script launcher.js assumes the default installation of Firefox which, in my case, is not so.
I verified this by manually setting the Firefox exe location in the launcher.js script in a horrible way, but now Firefox opens.
I am sorry for two things:
But I don't think an assumption of the default installation location is robust.
When using testacular on Windows the wildcard patterns are not being recognized:
warn (config): Pattern "C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\test\unit\app\*.js" does not match any file
Here's the config settings:
files = [
JASMINE,
JASMINE_ADAPTER,
'_public/js/vendor.js',
'_public/js/app.js',
'test/vendor/angular/angular-mocks.js',
'test/unit/app/*.js'
];
Full trace:
Kyle Finley@WIN-EKJFQUMNRPN /cygdrive/c/Users/Kyle Finley/Downloads/scotch-angular-brunch-seed
$ ./scripts/test.sh
info: Web server started at http://localhost:3334
info: To run via this server, use "testacular-run --runner-port 3335"
warn (config): Pattern "C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\test\unit\app\*.js" does not match any file
debug (config): Resolved file C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\node_modules\testacular\adapter\lib\jasmine.js
debug (config): Resolved file C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\node_modules\testacular\adapter\jasmine.js
debug (config): Resolved file C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\_public\js\vendor.js
debug (config): Resolved file C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\_public\js\app.js
debug (config): Resolved file C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\test\vendor\angular\angular-mocks.js
debug (config): Watching C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\node_modules\testacular\adapter\lib\jasmine.js
debug (config): Watching C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\node_modules\testacular\adapter\jasmine.js
debug (config): Watching C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\_public\js\vendor.js
debug (config): Watching C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\_public\js\app.js
debug (config): Watching C:\Users\Kyle Finley\Downloads\scotch-angular-brunch-seed\test\vendor\angular\angular-mocks.js
debug: New browser has connected on socket 17415615711820254411
info (Chrome 20.0): Connected on socket id 17415615711820254411
Here's the complete app angular-brunch-seed
The same code works perfectly on OS X, so I'm wondering if Windows does not recognize the wildcard. Any ideas on how to resolve this?
Thanks,
-Kyle
using 0.1.2 when a test fails, I'm getting the error message twice... can anybody else confirm this?
When started Opera occasionally prompts the user to opt into collection of usage statistics. This prompt window currently causes Testacular to stall and wait indefinitely. If the prompt dialog is not manually closed, test run will never make a progress.
There doesn't seem to be a command line switch to suppress this behavior, but I'm guessing that if the setting is explicitly set to either yes or no (likely no
is a better option since we don't really use the browser in a normal way), the dialog will not show up. To set this option, we'll have to generate or edit the opera profile ini file when creating a profile for the run.
When using the auto-watch: true
I get the following error
$ Error: ENOENT, stat '/Users/dignifiedquire/play/github/yaas/test/unit/directives/.#version.spec.coffee'
This is caused because Emacs creates these lock files while editing. Adding these to the exclude
list doesn't work.
I've created an issue here and already got an answer. So maybe this could be used for fixing this.
wouldn't it be possible to run it within the sublime console?
Hi...I'm receiving this error..I'm using linux mint, the latest npm and node version...what can I do??..thanks!!!!
info (watcher): Watching "/"
info: Web server started at http://localhost:8080/
info (launcher): Starting browser "Firefox"
events.js:66
throw arguments[1]; // Unhandled 'error' event
^
Error: ENOENT, stat '/etc/blkid.tab'
You mention that you provide mocha and jasmine adapters, but I can't figure out how to run jasmine or mocha tests with testacular and display results on command line.
If a file is explicitly listed in the includes and excludes list Testacular prints a falsy warning:
warn (watcher): Pattern "/Users/iminar/Development/angular/angular.js/test/jquery_alias.js" does not match any file.
I have follow the video tutorial to set up testacular on my angularjs project, with jasmine.
My config file is
basePath = '../';
files = [
JASMINE,
JASMINE_ADAPTER,
'app/lib/angular/angular.js',
'app/lib/angular/angular-*.js',
'test/lib/angular/angular-mocks.js',
'app/js/**/*.js',
'test/unit/controllersSpec.js'
];
colors = true;
autoWatch = true;
browsers = ['Chrome'];
junitReporter = {
outputFile: 'test_out/unit.xml',
suite: 'unit'
};
And the code in controllersSpec.js is:
'use strict';
/* jasmine specs for controllers go here */
describe('StatusBarCtrl', function(){
it('should ....', function() {
expect(false).toBe(true);
});
});
I use 'testacular testacular.conf.js' in the command line. The server launch well.
When I modify a file, it is shown in the terminal, but the test are not executed : 'Executed 0 of 0 SUCCESS'.
Any idea ?
If we configure testacular to launch Chrome automatically and set to singleRun to true, the browser doesn't closes itself. The same for Firefox. Is this intentionally? Could you add some kind of a flag for this behavior?
Because we want to execute testacular on a CI server and we need to have it closed after a build.
Thanks and regards,
Guy
When running Testacular as a Node subprocess in Windows XP, Testacular sometimes exits before it's done writing its output. Here's code to reproduce the issue:
function monitorEvent(name, emitter, event) {
emitter.on(event, function(arg) {
arg = arg ? ": " + arg : "";
console.log("> " + name + " " + event + arg);
});
}
function monitorStream(name, stream, out) {
stream.on("data", function(chunk) {
out.write(chunk);
});
monitorEvent(name, stream, "end");
monitorEvent(name, stream, "error");
monitorEvent(name, stream, "close");
}
function sh(command, args, callback) {
console.log("> " + command + " " + args.join(" "));
var child = require("child_process").spawn(command, args, { stdio: "pipe" });
monitorStream("child.STDOUT", child.stdout, process.stdout);
monitorStream("child.STDERR", child.stderr, process.stderr);
monitorEvent("CHILD", child, "exit");
monitorEvent("CHILD", child, "close");
monitorEvent("CHILD", child, "disconnect");
monitorEvent("CHILD", child, "message");
child.on("close", function() {
callback();
});
}
sh("node", ["node_modules/testacular/bin/testacular", "run"], function() {
console.log("> Testacular complete.");
});
The output of four runs of this code is:
C:\projects\testacular_windows_stdout>node parent.js
> node node_modules/testacular/bin/testacular run
> child.STDERR end
> child.STDERR close
> child.STDOUT end
> child.STDOUT close
> CHILD exit
> CHILD close
> Testacular complete.
C:\projects\testacular_windows_stdout>node parent.js
> node node_modules/testacular/bin/testacular run
IE 8.0: Executed 1 of 1
> child.STDERR end
> child.STDERR close
> child.STDOUT end
> child.STDOUT close
> CHILD exit
> CHILD close
> Testacular complete.
C:\projects\testacular_windows_stdout>node parent.js
> node node_modules/testacular/bin/testacular run
> child.STDERR end
> child.STDERR close
> child.STDOUT end
> child.STDOUT close
> CHILD exit
> CHILD close
> Testacular complete.
C:\projects\testacular_windows_stdout>node parent.js
> node node_modules/testacular/bin/testacular run
IE 8.0: Executed 1 of 1
> child.STDERR end
> child.STDERR close
> child.STDOUT end
> child.STDOUT close
> CHILD exit
> CHILD close
> Testacular complete.
Note that Testacular's output only appears in half of these runs, and it's truncated when it does.
Here's the expected output:
C:\projects\testacular_windows_stdout>node node_modules/testacular/bin/testacular run
IE 8.0: Executed 1 of 1 SUCCESS (0.047 secs / 0 secs)
Testacular version: 0.2.1
Reproduced on Node versions: 0.8.10, 0.8.11
(Why am I doing this? I'm running Testacular from a Jake build script. The script parses Testacular's output to see if all of my supported browsers were tested. If not, the build fails.)
https://github.com/vojtajina/testacular/blob/master/lib/browser.js#L83
log.warn('Diconnected');
should be
log.warn('Disconnected');
I am trying to figure out why I'm getting this error when I try to run grunt test on the angular-ui project. It seems to be narrowed down to one mac but not the other, and no one online seems to have more info.
Does this error make any sense to you? I only get it when I try to run tests. I was hoping it was referenced in this code or if I should try looking inside jasmine? It's completely halted all testing for me and is quite frustrating.
When testacular starts (without single-run
mode, with file watching enabled), wait for capturing browsers and execute without file changing.
is possible to proxy external file like json.
jstetdriver do it with
gateway:
or buster.js do
var config = module.exports;
config["My tests"] = {
resources: {
"/app": "http://192.168.1.200:3030"
}
}
On a fresh install from npm
$ testacular init
error (config): Config file does not exist!
The init command create a sample config file? or I need to create first from scratch?
Hi,
we have a CI environment where we run multiple projects and each one has e webapp running for the tests. Now we have some kind of logic which searches a free port to start the server and tell the application on which port the server is running. Now i just found out that I could override the port setting in the config by starting testacular with this command line argument:
--port=1234
But I can't create objects in the command line to use for example for the proxies property. Is there a possibility to add them via command line arguments or system properties ?
Thanks and regards,
Guy
Hi, i try to run testacular tests on windows7 64bit.
But any test tasks doesn't work on windows.
I works on master branch.
At first
npm install which
and modify tasks/test.js like the below
grunt.registerMultiTask('test', 'Run tests.', function() {
var specDone = this.async();
var which = require('which').sync;
....SNIP...
// UNIT tests
else if (this.target === 'unit') {
exec(which('jasmine-node'), ['--coffee', this.data], 'Unit tests failed.');
}
// CLIENT unit tests
else if (this.target === 'client') {
exec(which('testacular'), ['start', this.data, '--single-run', '--no-auto-watch', '--reporters=dots',
'--browsers=' + BROWSERS], 'Client unit tests failed.');
}
i want to hack testacular on windows7.
any suggestions ?
http://ci.angularjs.org/job/angular.js-igor-testacular/466/console
notice the logs at the end... Chrome's websocket loses the connection, but socket.io quickly recreates it, Testacular however doesn't recognize that and fails the build.
It seems to get into a weird state - note the log "info: Delaying execution, these browsers are not ready: Firefox 15.0"
Pretty much all the current tools instrument JS code, by adding statements like visitLine(1,5);
. We might use one of them to preprocess files (using Testacular's preprocessor) and report the coverage.
We need to be able to run the code in browser.
Note, that "line" coverage is nice, but it would better to do at least decision coverage (see http://en.wikipedia.org/wiki/Code_coverage#Coverage_criteria). Might be interesting to compute coverage of all permutations (of decisions and values) as well.
https://github.com/piuccio/node-coverage
https://github.com/coveraje/coveraje
This looks super promising. Have you guys put in any thought into supporting AMD? Like RequireJS?
Nice work!
Would be great to have some doc on this :
Tried this .travis.yml
language: node_js
node_js:
- 0.8
- 0.6
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
script:
- testacular start ./testacular.conf.js --single-run --browsers PhantomJS
with no luck, i get :
error (config): Config file does not exist!
You can check the job there : http://travis-ci.org/#!/mgcrea/angular-strap/jobs/2375506
I tried without the file, without the ./
, etc.
Any idea on how I could fix this?
Are the supported glob patterns for config's files
variable documented?
I'm trying some relatively common patterns to get arbitrarily-deep wildcards and they aren't working.
For instance, if my config is in config/test.js
, I'd expect '../spec/**/*.js'
to match ../spec/foo/bar.js
, but instead warn (config): Pattern "<project_root>/spec/**/*.js" does not match any file
.
I can't get any other patterns to match files in unnamed nested directories, either. Is it currently not possible?
Proxy support currently only works for the most basic URL renaming situations. Anything more exotic, like
proxies = [
'/': 'http://other.host.example.local'
]
will generally fail, because the underlying HTTP Proxy isn't correctly configured to change origin, etc. I propose an extended syntax for proxies:
proxies = [
'/path': '/rewrite/local/path',
'/remote': {
server: 'other.host.example.local',
port: 80,
path: '/app/dir'
}
]
with path being the minimum required; with no other options, 'url'
and {path:'url'}
would be equivalent.
I've started using testacular recently at work and for side projects and I really love using it. But the documentation isn't really in a great state. I would be willing to write some basic instructions for configuration and stuff but wanted to here first if there is anything planned or if you have some specifics in mind how you want the documentation to be written.
Relevant output.. basically I'm replicating on my dev machine a build server
style launch, where only PhantomJS is used and the test run output is written using the junit
reporter.
To my surprise, it started establishing socket IO connections to browsers from previous watch
modes. (These are all the hidden Chrome Canary windows)
Running "spec:once" (spec) task
3 Oct 10:24:40 - Starting testacular with arguments:'{"basePath":"..","files":["C:\\\\source\\\\AngularCoffeeLessDemo\\\\generated\\\\lib\\\\chai.js","C:\\\\source\\\\AngularCoffeeLessDemo\\\\generated\\\\test\\\\chai-adapter.js","C:\\\\source\\\\AngularCoffeeLessDemo\\\\generated\\\\lib\\\\mocha.js","C:\\\\source\\\\AngularCoffeeLessDemo\\\\generated\\\\lib\\\\mocha-adapter.js","generated/lib/require.js","generated/app.js","generated/specs.js"],"reporters":["junit"],"browsers":["PhantomJS"],"autoWatch":false,"singleRun":true,"configFile":"C:\\\\source\\\\AngularCoffeeLessDemo\\\\config\\\\testacular.conf.js","assertionLib":"chai","adapter":"mocha","junitReporter":{"outputFile":"../dist/test-results.xml","suite":""},"logLevel":4,"reportSlowerThan":500}'
info: Testacular server started at http://localhost:9876/
debug (launcher): Creating temp dir at C:\Users\EPS\AppData\Local\Temp\testacular-59961876
info (launcher): Starting browser "PhantomJS"
debug (launcher): C:\Program Files (x86)\PhantomJS\phantomjs.exe C:\Users\EPS\AppData\Local\Temp\testacular-59961876/capture.js
debug (watcher): Resolved files:
C:/source/AngularCoffeeLessDemo/generated/lib/chai.js
C:/source/AngularCoffeeLessDemo/generated/test/chai-adapter.js
C:/source/AngularCoffeeLessDemo/generated/lib/mocha.js
C:/source/AngularCoffeeLessDemo/generated/lib/mocha-adapter.js
C:/source/AngularCoffeeLessDemo/generated/lib/require.js
C:/source/AngularCoffeeLessDemo/generated/app.js
C:/source/AngularCoffeeLessDemo/generated/specs.js
debug: New browser has connected on socket GUWK6Yc8hryEiwEtA6Sm
info (Chrome 24.0): Connected on socket id GUWK6Yc8hryEiwEtA6Sm
debug: New browser has connected on socket 6D8bE-OoqQkaNWIkA6Sn
info (Chrome 24.0): Connected on socket id 6D8bE-OoqQkaNWIkA6Sn
debug: New browser has connected on socket WXJ4EtE6fbZL3xWrA6Sp
info (Chrome 24.0): Connected on socket id WXJ4EtE6fbZL3xWrA6Sp
debug: New browser has connected on socket dgS8cXbDYBftbCZeA6So
info (Chrome 24.0): Connected on socket id dgS8cXbDYBftbCZeA6So
debug: New browser has connected on socket I5Eqn9Zpju5ka4KJA6Si
info (Chrome 24.0): Connected on socket id I5Eqn9Zpju5ka4KJA6Si
debug: New browser has connected on socket 475cqd4WYR5-uiRRA6Sk
info (Chrome 24.0): Connected on socket id 475cqd4WYR5-uiRRA6Sk
debug: New browser has connected on socket sTIKRsyHJ2iDfyR8A6Sh
info (Chrome 24.0): Connected on socket id sTIKRsyHJ2iDfyR8A6Sh
Later on there is some output
info: Disconnecting all browsers
debug: Waiting for child processes to finish
So I'm not sure if it's doing what it's supposed to be doing... but it doesn't seem that it is.
This isn't so much bug report as a question. I have followed the video tutorial to the letter for setting up my environment using WebStorm, I then downloaded testacular from github and saw that you have some tests in there to kinda make sure that everything is working fine.
Now that I have the tests working and the server running I changed the config file to test my own jasmine test. and that works. My config looks like this
files = [
JASMINE,
JASMINE_ADAPTER,
'test/client/example.spec.js'
];
as you can see I created one test file and the test runs but as a way to reverse engineer the situation so that i can isolate the truly required files I get errors when I delete a few of the other folders.
can you tell me what the bare minimum files and directories are needed to run unit tests with testacular and angular.
Which of the following directories are needed?
adapter (I am guessing this is needed and is auto loaded)
lib
NaN
static
and do I need the /tests/e2e?
thank you for your time. I am eager to work with testacular and angular.js
Write an html reporter for mocha, that would report results to Testacular:
https://github.com/visionmedia/mocha/blob/master/lib/reporters/html.js
https://github.com/vojtajina/testacular/blob/master/adapter/jasmine.src.js#L33
So that testacular can be better integrated into jenkins CI.
As there is no standard location on Windows for Phantom, it would be nice to do one of two things
PATH
for PhantomJSWhen configuring for Firefox, then here...
https://github.com/vojtajina/testacular/blob/master/lib/launcher.js#L114
... I get a "TypeError: Cannot read property '1' of null".
Why is that array null?
Note 1: The launcher works fine with Chrome.
Note 2: This happens on Ubuntu 12.04
right now the second prints logs "watching ..." but it doesn't actually watch anything. the second doesn't print the log.
while it is useful to see which files are being loaded, the logging should be printed at lower log level for all cases (or there should be a flag --log-file-list).
"watching" should be logged when files are being watched. "loading" should be used in case when we don't autowatch.
People that need to clear things through legal need to know what license, terms and conditions testacular can be used under.
zombie.js is probably the best headless browser out there.
it's easier to install, node.js based, "insanely" fast, and has a great API.
I'd love to see it supported.
if a test accidentally reloads the context.html testacular should detect it and fail the test run + recover. right now it gets into a state where I have to manually refresh the testacular window.
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.