setup and teardown methods at class/file level
Do we have setup and teardown methods at class/file level. beforeEach and afterEach runs before and after each test case. Do we have setup and teardown at class level
@vishalshivnath, you can use afterAll. You can see example here https://github.com/angular/protractor/blob/master/example/onJasmineNodeSpec.js
Unfortunately, beforeAll and afterAll aren't supported by Jasmine, JasmineNode, or MiniJasmineNode. You can achieve the effect by relying on the fact that it specs run in order, but it's a hack.
Depending on what Jasmine 1.2's take is on the matter, we should consider adding this to MiniJasmineNode.
Note that you can do global setup/teardown via the config file with onPrepare and jasmineNodeOpts.onComplete. See https://github.com/angular/protractor/blob/master/referenceConf.js#L65
Thats helpful thanks
Jasmine has added support for beforeAll and afterAll in this https://github.com/pivotal/jasmine/commit/ba0982d89f6d2a6523e505f062638a708ac0c25e commit as of 15 days ago.
Any chance we can get an updated version of protractor with this patch? This would be huge for us right now.
Thanks.
It would be extremely helpful to have beforeAll and afterAll!
Please?
Right now protractor only supports jasmine 1.3 (see https://github.com/angular/protractor/issues/362 and https://github.com/angular/jasminewd/pull/5). Moving to 2.0 is definitely on the to-do list. Please add to that issue about this.
+1
Hi, all
I managed to create a custom beforeAll method which works (I guess) the same as it was supposed to. I'm currently using it as a helper in my tests, and it seems to work properly until now. Any help is appreciated.
You can find the helper code on the following gist: https://gist.github.com/lucasconstantino/269e24094898832068f3
+1 thanks a bunch @lucasconstantino
Note that with 1.6.0 you will be able to use jasmine2 with protractor. There you can use beforeAll/afterAll
Hi, What is the latest news about beforeAll/afterAll with protractor?
1.6.0 has been released - you may now use framework: jamsine2, which allows the use of beforeAll and afterAll
beforeAll and afterAll work like a charm in 1.6.0, Thanks guys!
Please help me, What am I doing wrong?
protractor --version Version 1.6.1
Message: ReferenceError: afterAll is not defined Stacktrace: ReferenceError: afterAll is not defined [chrome #2] at [object Object].jasmine.Env.describe_ (\node_modules\minijasminenode\lib\jasmine-1.3 .1.js:913:21)
@extdevelopment I think that error happens when you don't specify jasmine2 inside protractor.conf.js make sure you add this line: framework: jasmine2 to your protractor.conf.js
@americos thx framework: 'jasmine2' helped
After adding framework: 'jasmine2' I get the following error when trying to use ddescribe at the root of my test file:
launcher] Error: ReferenceError: ddescribe is not defined
Furthermore, ddescribe and iit take no effect inside the test suite.
@ljwagerfield Please read the upgrade guide. https://github.com/angular/protractor/blob/master/docs/jasmine-upgrade.md#focused-specs
ddescribe and iit -> fdescribe, fit