nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

Reuse existing browser session in Nightwatch #3358

Closed kretschmannj closed 2 years ago

kretschmannj commented 2 years ago

Description

It would sure be nice if we could execute a Nightwatch test against an existing browser session. Something similar was asked for in https://github.com/nightwatchjs/nightwatch/issues/117 but that eventually closed with no resolution.

Problem Statement/Justification

This would be immensely helpful when debugging a test that has a significant amount of "pre-steps" that need to take place in the browser before we get to the stuff we care about. It would be very helpful if we could first launch a browser and manually navigate to the starting place and then launch Nightwatch with an option telling it to use an existing browser session.

Proposed Solution or API

It's certainly possible, at least in Selenium, as described here .... https://web.archive.org/web/20171129014322/http://tarunlalwani.com/post/reusing-existing-browser-session-selenium/ and here ... https://web.archive.org/web/20171214043703/http://tarunlalwani.com/post/reusing-existing-browser-session-selenium-java/

Alternatives

No response

Additional Information

No response

github-actions[bot] commented 2 years ago

Thank you for setting this as an enhancement. One of the product folk will triage this again to help see when we can fit this in an upcoming sprint.

beatfactor commented 2 years ago

We have something planned here which I think would accomplish this. It will be available for both end-to-end and component testing.

harshit-bs commented 2 years ago

@kretschmannj I am closing this issue, since we are tracking it already. Please feel free to reopen if we have missed anything.

ituradastra commented 1 year ago

Here it says 'component testing'. Is it plan to work on UI tests too?

gravityvi commented 1 year ago

@ituradastra --reuse-browser for reusing browser sessions should work with UI tests as well. You can try it out :)