protractor icon indicating copy to clipboard operation
protractor copied to clipboard

how to close browser after execution of all testcase or after fail of testcase

Open rajit-daffodil opened this issue 11 years ago • 4 comments

Hi,

I am able to run testcases with protractor using selenium server with angularjs

I want to close my browser after execution of all testcase or after fail of testcase,

I am able to do this by writing

browser.close() in the last testcase, but this will not work if testcase fails , is there any other way to close the browser in this case also, or is there any different name for after like afterEach

Thanks in advance..

rajit-daffodil avatar Dec 09 '14 07:12 rajit-daffodil

Duplicate of https://github.com/juliemr/minijasminenode/issues/20

You should not need to explicitly close the browser - it will close itself when your testcase is finished.

juliemr avatar Dec 09 '14 18:12 juliemr

Sorry julimer, I think my question is wrong, I want to ask that I want to do something, after each describe(not after each testcase), is there any way to do this? actually i have take close as an example, but i might have required to do some other task also, after each describe, is there any way to do this, i have require something like after block like afterEach block, please help...

rajit-daffodil avatar Dec 10 '14 04:12 rajit-daffodil

Thanks,

I have found solution of my problem,

by using jasmine-beforeall nodejs module we can use beforeAll and afterAll for each describe

https://github.com/nonplus/jasmine-beforeAll

rajit-daffodil avatar Dec 15 '14 04:12 rajit-daffodil

@rajit-daffodil , Can you help me how to use with my script using jasmine 2 framework https://github.com/nonplus/jasmine-beforeAll

Saurabh06 avatar Jun 21 '16 10:06 Saurabh06