angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Jasmine 2.0 is out, explore updating to that #362

Closed juliemr closed 9 years ago

juliemr commented 10 years ago

This should be in sync with Karma, probably. See https://github.com/karma-runner/karma-jasmine/issues/15

juliemr commented 10 years ago

Got minijasminenode working with 2.0: https://github.com/juliemr/minijasminenode/tree/jasmine2

The only regression is that there is now no way to specify a timeout for only one spec :(

Raised an issue https://github.com/pivotal/jasmine/issues/483 to see if we can perhaps find a way around this.

juliemr commented 10 years ago

See Karma's update for reference: https://github.com/karma-runner/karma-jasmine/commit/4e0b48aa3703db0d9b785fc32b720defd93156bd

And fixing iit/ddescribe: https://github.com/karma-runner/karma-jasmine/commit/07ddb36b4ca662c414ccbc5af29df8d2da1e5019

geppy commented 10 years ago

What's remaining to support updating Jasmine to 2.0? I'd be interested in working on this one.

geppy commented 10 years ago

Ah, I see #483, I'll look into it.

juliemr commented 10 years ago

@BrianGeppert at this point I'm mostly waiting on Jasmine to update itself. They've said they're going to be adding an npm module, so to reduce churn later I was just waiting for that.

geppy commented 10 years ago

Makes sense. Thanks!

hyzhak commented 10 years ago

Is there any changes? :+1: for Jasmine 2.0.

juliemr commented 10 years ago

Status update:

We've decoupled more of the protractor versus Jasmine system, so now there are three npm packages at play: protractor, jasminewd, and minijasminenode.

I've released minijasminenode2, which is an adapter for Jasmine 2.0 to node.js. It's available for download (npm install minijasminenode2).

Getting JasmineWD to work with minijasminenode2 has proved difficult. We're losing some functionality, and there's no user-visible benefits. The full discussion is here: https://github.com/angular/jasminewd/pull/5. So, for the moment, we're going to hold off on updating JasmineWD or Protractor to use Jasmine 2.0. What we'll probably do is eventually make this a separate framework option, so folks happy with the status quo can continue without breaking changes and you can use --framework jasmine2 if you care about a particular feature from Jasmine 2.0.

panuhorsmalahti commented 10 years ago

The end user benefit from updating to Jasmine 2.0 is significant, as Jasmine 2.0 makes async tests sane. The 1.x branch has a pretty annoying syntax for that.

mgol commented 10 years ago

@panuhorsmalahti

The end user benefit from updating to Jasmine 2.0 is significant, as Jasmine 2.0 makes async tests sane. The 1.x branch has a pretty annoying syntax for that.

Yeah, that's true. I couldn't believe how terrible async testing was in 1.x with all this manual waiting etc.

AGresvig commented 10 years ago

Amen!

Sent from my Sony Xperia™ smartphone

---- Michał Gołębiowski wrote ----

@panuhorsmalahti

The end user benefit from updating to Jasmine 2.0 is significant, as Jasmine 2.0 makes async tests sane. The 1.x branch has a pretty annoying syntax for that.

Yeah, that's true. I couldn't believe how terrible async testing was in 1.x with all this manual waiting etc.

— Reply to this email directly or view it on GitHub.

mgol commented 10 years ago

...that said, Protractor has its own async handling so that may be not important here.

It's nice to be able to use the same Jasmine version in unit tests & e2e ones to not require context switch, though.

PaddyMann commented 10 years ago

Any progress on this or has it been parked?

I'd love to see Jasmine 2's support for pending tests (in Jasmine 1.3 you cannot mark as a test as xit, but then it doesn't get returned in the results, whereas in Jasmine 2 it will be displayed in the results as pending).

This may sound trivial, but given our workflow it would save a lot of time.

Any suggestions of alternative ways to achieve the same effect would be gratefully received (an easy way to view pending tests without causing the test to fail and so polluting the terminal when you're trying to debug).

smahalingam commented 10 years ago

Is there a way to generate report using jasmine 2.0 ?

jbnicolai commented 10 years ago

+1 on adding 2.0 support.

Is this still actively being looked at? Otherwise I might give it a shot.

juliemr commented 10 years ago

Hi all,

Jasmine 2.0 is not on my todo soon (tm) list at the moment. (e.g., I'm not going to look at it in the next month). The issues at angular/jasminewd#5 are still relevant - if anyone wants to update that PR to address the missing features I'd take a look at it.

gamebox commented 9 years ago

Just opining that if this project is looking at upgrading Jasmine support - it should go straight to 2.1. Support for beforeAll and afterAll without additional dependencies would be great

juliemr commented 9 years ago

@gamebox Agreed, we'll just go to the latest.

The current plan is to support Jasmine 2.something as a different framework option, since there will be some loss of features. @hankduan

mhaligowski commented 9 years ago

is there any progress with that? it would be great to have even jasmine 2.1, which has beforeAll().

xdissent commented 9 years ago

@mhaligowski I have a jasmine 2.1.3 branch at https://github.com/xdissent/protractor/tree/jasmine-2 that works great but it depends on forks of jasminewd and minijasminenode2 (juliemr/minijasminenode#27, https://github.com/xdissent/jasminewd/tree/jasmine-2). It also alters the existing framework rather than adding an additional one as @juliemr mentioned. But if you just want jasmine 2 now (like me) it gets the job done. Anyway, jasminewd and minijasminenode2 must be updated before protractor can make a move.

hankduan commented 9 years ago

jasmine2 is added into protractor via 1e60a95

As mentioned in https://github.com/angular/protractor/pull/1675, there are two caveats:

nishakchaudhari commented 9 years ago

So timeout for individual test has been fixed? I tried running my test with jasmine2. It gives me timeout error.

hankduan commented 9 years ago

I'm not sure what is your question. Jasmine2 doesn't make timeouts all magically disappear. If your test doesn't finish without a specified time, or your app isn't load, etc, your test will still time out. See https://github.com/angular/protractor/blob/master/docs/timeouts.md

nishakchaudhari commented 9 years ago

So I want to know how to setup timeout for individual test with jasmine2. Before I was doing it in this way : it(description, testFn, timeout_in_millis). And it worked when my jasmine version was <2. I upgraded jasmine version and now I get following error: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

vsathyak commented 9 years ago

@nishakchaudhari : I started using protractor and jasmine 2 and I am also facing the same issue. Any work around for this??

nishakchaudhari commented 9 years ago

upgrade jasmine version to 2.3.1 . jasmine 2.3.1 supports timeout for individual test .

srajwadi commented 9 years ago

How to update jasmine version. I am currently using 1.3.1 and protractor version is 2.1.0. Can anyone say that how to update jasmine version. I am new to this. Thanks..

hankduan commented 9 years ago

http://www.protractortest.org/#/jasmine-upgrade

mocsharp commented 9 years ago

how can I have beforeAll wait for async calls in Jasmine 2.0? Thanks.