Can the karma-script-launcher also close something after the tests finish? - virtual-machine

I'm using the karma-script-launcher to open a virtual machine/browser/url but when the tests are complete I don't know how to close everything.
If I leave the browser open in the virtual machine it eventually stops trying to reconnect - no error message just fails to reconnect. I'm not sure if this is a bug or not. I can't see why you wouldn't want the browser indefinitely trying to reconnect? What ever the reason it leaves me needing to close and re-open the browser each time I run the tests. But if I'm using the script launcher I don't see how this is possible.
Thanks for any help

not quite sure if this covers your answer but I stumbled over your question while looking for a solution to a similar issue, so let me explain - in case someone else encounters this issue.
Was running karma unit tests on codeship ci environment for a nodejs app.
Tests were successful, however the test would keep watching and wouldn't shut down, thus setting the tests to 'passed' - instead it would idle and after a while timeout, setting the tests to 'failed'.
Setting the option singleRun to true within the karma config helped.
Hope this helps anyone who's having the same issue.
Sorry if not topical enough :S

Related

How to prevent testcafe from restarting when being in --debug-mode and the browser did halt on a breakpoint

I try to debug a little test client side with
testcafe --debug-mode --dev Safari test1.ts
When the testcafe debug controls are shown I can inspect variables etc all fine.
However if I put a breakpoint in client side code and inspect variables if the browser execution is stopped testcafe restarts my test after some minutes and interrupts my debug session.
Is there a way to instruct testcafe to have infinite testing time for this scenario?
(I thought --debug-mode would imply that )
At this moment, you cannot configure this behavior in TestCafe. However, TestCafe already has an issue with this suggestion, so you can vote for it. With more votes, there is a bigger chance that this feature will be implemented in the near future. Right now, you can debug your application under the TestCafe core using http-playground.

What is the possible causes that browser out of memory only when run with testcafe?

I have a test that run 30 times open & close a sub-webpage. And if I manually close and reopen, the web app runs okay, no issues at all.
If I use TestCafe to close and reopen for 30 times, I have error on the browser after around 20 times:
Error code: out of memory. like the screenshot shows.
And this will make my test hang then disconnect. I wonder is there any difference on TestCafe when storing & removing cache? Has anyone encountered or know about this issue?
Any help is really appreciated!
It can depend on the environment (website, operation system, hardware, etc.). If it can be reproduced on any machine, please submit an issue to the TestCafe repository.

testcafe test occasionally hanging when run in semaphore

This is not about pinning down the hang as such, its more about wondering if there is a way to make testcafe decide the test must be a failure after a given period of time.
Our test works fine on local machines, but occasionally when run in CI using a docker image on semaphore one of the selectors causes it to hang. I am fine ivestigating why that is, but it would be good if I could tesll the test to give up after say 5 minutes (it should finish in under 3) and exit gracefully so we can have the stack trace and video - if we have to kill the test run we don;t get either, so we end up having to debug by the logging we emit from the test code.
Currently, this functionality is not implemented in TestCafe. Please track the https://github.com/DevExpress/testcafe/issues/6096 issue to check our progress.

Manually setting QUARANTINE_THRESHOLD and DISCONNECT_THRESHOLD in testcafe does not work

I changed the QUARANTINE_THRESHOLD and DISCONNECT_THRESHOLD in test_run_controller.ts file to 1 million each and built successfully however, my test still fails after around 1000-10000 restarts with the error :
ERROR The Chrome 89.0.4389.90 / Linux 0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.
Is there something else that may be forcing testcafe to quit? or is the issue in browser perhaps?
Thank you
According to the error, your browser hangs for some reason. The problem could be in the way you organize your tests. It's likely that you have some code that leads to memory leaks, and after 1000-10000 restarts, your machine does not have enough RAM to run the browser.
Please clarify why you need to restart your tests 1000-10000 times.
I changed the QUARANTINE_THRESHOLD and DISCONNECT_THRESHOLD in
test_run_controller.ts file
We are working on the quarantine mode configuration, so you will have the capability to change quarantine options out of the box.

When macbook is locked, selenium safari tests initiated by Jenkins on the mac wont run

I have made sure that the mac does not sleep by adjusting the settings in the system preferences. Jenkins will start the test on a schedule, the browser comes up but the test fails because the page is blank.
The same test works with no problem if the mac is unlocked or the screen save is not up.
I cannot leave the mac unlocked because the test runs at night and its a security issue.
Has anyone encountered this issue? And have a solution. Please share.
Attaching some logs. This image will give an idea of what I am describing.
You can try to run tests on locked computer when:
you set your display never turn off, when you lock your computer
you made sure, that computer never goes in hibernate or sleeping mode
If it will not work you can use two more possibilities:
run your tests on headless browser. Here is a pretty good explanation how to do it.
run your tests on a remote screen via VNC or RDP
EDIT:
You can try not lock the screen, but instead start the screensaver, and require the screensaver to immediately require a password.