-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feature request: mocha adapter support #35
Comments
Hello, I assume you saw There are a couple things missing for good mocha integration. First, there's an adapter for Jasmine that allows expectations to be called directly on webdriver promises The other missing bit would be a way to run it directly from the command line and with a configuration file (so your tests are separate from the configuration), but I'm not sure if that's what you're asking for. |
I did; using that example as a sort of base to model after, and so far so good. I would like to be able to use the Chai assertion library instead of Jasmine; our unit tests are Mocha/Chai, so having one less library for our developers to learn would be fantastic. The additional setup required in the current implementation (including Protractor and wrapping the driver) isn't an issue right now, but having things abstracted out and being able to use Protractor directly would be highly desired. |
+1 on this. I have some time this week to work on this if someone is willing to join me. |
As for promise adapters. I've done some preliminary work on one: It has chai+mocha support built in. I have been dogfooding it for a few months, and it works. |
nice, +1 |
Some early work done in 478c00a Please check it out and see if it works for your project! The big problem is that it does not include an adapter for assertions yet - so you will have to resolve promises manually. |
After a little more research, got mocha working using Chai As Promised for assertions. Check out https://github.com/angular/protractor/blob/master/docs/using-mocha.md for info on how-to. Closing this issue - but please, give it a shot and open others if you find problems! |
Doh! |
The updated URL for using the awesome Mocha/Chai framework with protractor appears to be https://github.com/angular/protractor/blob/master/docs/frameworks.md#using-mocha |
Would love to see this supported. Currently we are experimenting with using protractor as a library for our mocha tests; thank you, included code example ;)
If there is some high-level conceptual understanding that someone could present that would describe how to accomplish this, I would love to fork this and do it myself. Some guidance as to the right direction to head would be awesome, if anyone has any ideas.
The text was updated successfully, but these errors were encountered: