[MGNLTEST-445] Keep (local) browser open after a failed test Created: 16/Oct/23  Updated: 23/Oct/23

Status: Open
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Bertrand Renuart Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:
Team: Foundation

 Description   

As a developper writing tests, I'd like the local browser to stay open after a failed test during development (or possibly after all tests). This will allow me to play with the browser content, open the console, inspect dom, etc, and understand why my test failed.

This feature could be restricted to "local" browser mode only, unless the remote/docket setup allows for multiple browsers to be opened (which would be the case with a full-blown grid). However, usefulness of that feature in a remote setup is questionable...

We could introduce two new configuration properties that would drive this feature:

  • holdBrowserOpen: instructs the framework to keep the browser open after any test, irrespective of the test outcome (similar to Selenide's selenide.holdBrowserOpen property).
  • holdBrowserOpenAfterFailedTest: tells the framework to keep the browser open only after failed tests

A new browser would be opened for subsequent tests if the previous had to be left open.

 



 Comments   
Comment by Christoph Meier [ 23/Oct/23 ]

We need to exactly define / narrow the scope.

Why?

While keeping open the "browser" also means not closing the Webdriver.

When not closing the Webdriver after a Junit5 test-method execution or after a cucumber-scenario execution ...
... then we actuall should reuse the webdriver.
Reusing the webdriver3 - depending on the general test set-up is tricky. It is especially tricky in case we run the tests with multiple threads or multiple browsers.

Keeping the browser open when running a single test locally is fine - "everything else" - running tests on Jenkins or runnig more than one tests - things get tricky.

By the way - what is the use case for this, brenuart?
When running a test locally for development reason - you can set a breakpoint somewhere in the code to prevent closing the webdriver/browser.

I'm not yet convinced whether "that" (the ticket) is really required.
But we can discuss it.

Comment by Christoph Meier [ 23/Oct/23 ]

However - I see a "use case" -> SAASTEST-93 ..
But we have filed it in context of SAASTEST -> "saas-TF supports feature-scope"

Generated at Mon Feb 12 07:49:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.