Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Conversation

shyamseshadri
Copy link

Angular Scenario tests using Testacular! It exists!!!

Steps:

node scripts/web-server.js
testacular start test/e2e/testacular.conf.js
testacular run

(Assuming the latest, most awesome testacular is available of course!!!)

@alexeygolev
Copy link
Contributor

+1

@tregoning
Copy link

In the latest MV AngularJS meetup Igor mentioned that Testacular was going to be the default test framework for AngularJS so I guess it should be coming soon

@mgcrea
Copy link

mgcrea commented Aug 28, 2012

With latest testacular (git clone & sudo npm install . -g) & node v0.8.8 from macports I get this error :

testacular start test/e2e/testacular.conf.js
warn (watcher): Pattern "/opt/local/lib/node_modules/testacular/adapter/angular-scenario.js" does not match any file.
info (watcher): Watching "/opt/local/lib/node_modules/testacular/adapter/lib/angular-scenario.js"
info (watcher): Watching "/opt/local/lib/node_modules/testacular/adapter/angular-scenario.js"
info (watcher): Watching "/Users/olivier/Dropbox/Developer/angular/angular-seed/test/e2e/scenarios.js"
info: Web server started at http://localhost:9876/

events.js:66
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: ENOENT, lstat '/opt/local/lib/node_modules/testacular/adapter/angular-scenario.js'

Any idea where it could come from?


Ok, somehow the file was in /opt/local/lib/node_modules/testacular/adapter/angular-scenario.js so I just copied it and it seems to work.

@huyl
Copy link

huyl commented Sep 17, 2012

Hi I'm new to angular and I'm trying to run the tests -- any tests. And everything seems to fail.

Is the code in the middle of a jsTestDriver -> testacular transition where there is no jsTestDriver JAR and there are no testacular configs?

@vojtajina
Copy link
Contributor

Already switched to Testacular by: 2d315ac and c57d3b5

@vojtajina vojtajina closed this Sep 19, 2012
@vojtajina
Copy link
Contributor

@huyl The angular-seed repo uses Testacular, there should be everything requried.
Please, check out https://github.com/angular/angular-seed/blob/master/README.md#running-unit-tests

@huyl
Copy link

huyl commented Sep 19, 2012

@vojtajina Here's what I get when I run scripts/test.sh:

Starting Testacular Server (http://vojtajina.github.com/testacular)
-------------------------------------------------------------------
error (config): Config file does not exist!```

@mgcrea
Copy link

mgcrea commented Sep 19, 2012

@huyl you just need to do testacular start config/testacular.conf.js , you must be calling the script from the wrong location.

@IgorMinar
Copy link
Contributor

@mgcrea you should be able to call the script from wherever. test.sh will handle that.

@huyl what version of testacular do you have? make sure it's the latest.

@huyl
Copy link

huyl commented Sep 21, 2012

I was running the one from npm install -g testacular: version 0.0.17

Ok, I'll get the one from github then. Maybe the docs should be updated.

@huyl
Copy link

huyl commented Sep 21, 2012

Ok, got all the node modules installed. Now I get this error:

warn (watcher): Pattern "/Users/huy/git/testacular/adapter/jasmine.js" does not match any file.

@vojtajina
Copy link
Contributor

Now, you are running testacular from git repo. You can do that, however it's way better if you just install it from npm:

npm install -g testacular@canary

If you really wanna run it from git repo, you need to build it first, which means you need grunt:

grunt build

@huyl
Copy link

huyl commented Sep 24, 2012

@vojtajina Great, grunt build seems to work. However, all I get in the browser is this:

Testacular - connected
Chrome 21.0 is idle

And just this on the console:

Starting Testacular Server (http://vojtajina.github.com/testacular)
-------------------------------------------------------------------
info: Testacular server started at http://localhost:9876/
info (launcher): Starting  browser "Chrome"
info (watcher): Watching "/Users/huy/git/testacular/adapter/lib/jasmine.js"
info (watcher): Watching "/Users/huy/git/testacular/adapter/jasmine.js"
info (watcher): Watching "/Users/huy/git/angular-seed/app/lib/angular"
info (watcher): Watching "/Users/huy/git/angular-seed/test/lib/angular/angular-mocks.js"
info (watcher): Watching "/Users/huy/git/angular-seed/app/js"
info (watcher): Watching "/Users/huy/git/angular-seed/test/unit"
info (Chrome 21.0): Connected on socket id ggOKDwmE5IfWHoyHngSC

I would expect to see a list of tests and some results.

By the way, npm install -g testacular@canary didn't install:

npm ERR! Error: No compatible version found: testacular@'canary'
npm ERR! Valid install targets:
npm ERR! ["0.0.7","0.0.8","0.0.9","0.0.10","0.0.11","0.0.12","0.0.13","0.0.14","0.0.15","0.0.16","0.0.17"]

Also, when I run scripts/e2e-test.sh, I get this error:

warn (proxy): Proxy Request failed - Error: connect ECONNREFUSED

and the page just seems to hang, again without any results.

I had to comment out the config about proxy in config/testacular-e2e.conf.js.

Then it did run with these errors:

Chrome 21.0  my app view1 FAILED
    element '[ng-view] p:first' text
    /Users/huy/git/angular-seed/test/e2e/scenarios.js:25:14: Selector [ng-view] p:first did not match any elements.
Chrome 21.0  my app view2 FAILED
    element '[ng-view] p:first' text
    /Users/huy/git/angular-seed/test/e2e/scenarios.js:40:14: Selector [ng-view] p:first did not match any elements.
Chrome 21.0 ERROR
    Uncaught TypeError: Cannot read property 'name' of null
    at http://localhost:9876/adapter/angular-scenario.js?1348445210000:28
Chrome 21.0: Executed 2 of 3 (2 FAILED) ERROR (0.353 secs / 0.185 secs)

I assume that angular-seed should pass all tests out of the box, right?

@vojtajina
Copy link
Contributor

npm install -g testacular@canary is rejected, because you have old version of node. Testacular 0.3.0+ requires node 0.8.4+.
See https://github.com/isaacs/npm/issues/2841

In order to run e2e tests, you need a web server serving your app. That's why the proxy is getting ECONREFUSED.
Check out https://github.com/angular/angular-seed#end-to-end-testing

So again, to run the e2e tests, do this:
./scripts/web-server.js' ./scripts/e2e-test.sh`

@tomster
Copy link

tomster commented Nov 1, 2012

FTR i get the same error (Chrome 22.0 ERROR Uncaught TypeError: Cannot read property 'name' of null at http://localhost:9876/adapter/angular-scenario.js?1350373484000:28) when running my e2e test using testacular (visiting the runner.html in a browser works fine, though.

any idea what could cause this or how to fix it?

@vojtajina
Copy link
Contributor

@tomster Can you create a simple test case, how to reproduce it ? And file an issue https://github.com/vojtajina/testacular/issues/new

@tomster
Copy link

tomster commented Nov 5, 2012

thanks for responding @vojtajina. i have since created an issue of its own at angularjs (angular/angular.js#1518) since i wasn't sure, where it belongs.

should i still create the issue in testacular, as you suggested?

@vojtajina
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants