Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Is there a way to detect when a user clicks on Stop Test button in wiki page #1523

Open
suchita-rknair opened this issue Oct 4, 2024 · 1 comment

Comments

@suchita-rknair
Copy link

suchita-rknair commented Oct 4, 2024

** General Description **
We execute our test cases in a container. When a user clicks on "Test" button in fitnesse, we start a container and execute tests within the container(in cloud)

Scenario: when a user click on Stop Test button during the execution, we need to trigger a call to stop the execution in the container and proceeed with cleanup activity. We have tried using shutdownhooks but it only works when we stop the fitnesse server. shutdownhooks never gets called when stop test button is clicked

Is there a way to know when user clicks on stop test button and based on that make a call for cleanup. Any existing listeners in fitnesse that can be used for this purpose? Tried extending the class "StopTestReponder" to create a custom implementation but it doesn't work.

Is there a way to catch the internal exception thrown when we click on stop test button.

Any help/suggestion regarding this matter will be appreciated

@fhoeben
Copy link
Collaborator

fhoeben commented Oct 5, 2024

I haven't tried this myself. But I would expect a shutdown hook to work if you register it via your fixture code. Did you do that or did you add it to the FitNesse wiki process (which I expect based on that it did get run when you stopped the server)? Please note that the wiki server starts a separate process (unless you run in debug mode) to actually run the tests.

If you really need to do cleanup you probably also need to ensure that cleanup happens when the user closes their tab or browser without clicking anywhere. That will never be full-proof I suppose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants