Stop running a cucumber test feature - ruby

Is it possible to cancel a cucumber test while it is running? I have tried Ctrl + C and esc, but to no avail. The only way I can stop cucumber once I have started running tests is to wait for the tests to finish or to manually kill the process using the operating system. Is there a better way?

Pressing Ctrl + C and Ctrl + C twice. It should stop immediately.

Try Ctrl + Z. It stops the test but messes a few things up because I think it thinks the process is still going. If you try rake db:test:prepare after you've stopped the test, that usually works. It takes a minute or so, but it's faster than waiting for a long test with lots of JavaScript.

CTRL+Z on mac
Pressing twice CTRL+C on windows
will interrupt the cucumber tests

Related

How to disable F10/F11 unless I'm debugging in Visual Studio?

So I have this weird problem where I press keys subconsciously sometimes. F10 (step over) and F11 (step into) are two that I keep pressing... or if I meant to hit F12, sometimes I hit F11 accidently...
Anyway, this is a major annoyance since it starts a build, which takes a while, I immediately start spamming CTRL + BREAK to break the build, but it only rarely works; it seems that it just freezes or maybe there is only a short window of time where it does work? Then if the build succeeds, my configuration is set up to do a deploy as well, and often, VS just locks and I have to end the process with Task Manager and restart VS.
So just wondering if there is any possibility to only allow F10, F11 to work when pressed if I am debugging, where I actually need it (I use attach to process so F5/F10/F11 are useless shortcuts when not debugging)?
Thanks.
You can assign F10 to the following C# command for Visual Commander:
if (DTE.Mode == vsIDEMode.vsIDEModeDebug)
DTE.ExecuteCommand("Debug.StepOver");
It will call StepOver only when you are in the Debug mode. For F11 use Debug.StepInto.
I had the same problem - kept randomly hitting F11 instead of F12. I ended up re-assigning F10 and F11 to something innocuous (like Find Next / Previous) and then re-assigned StepOver / StepInto to Ctrl-' and ctrl-; respectively (these are the same shortcut keys used by the Chrome debugger).
Perhaps a bit extreme, but it works for me. I now have a new problem though where I occasionally invoke Find Next when debugging :) On balance the new problem is less annoying.

Start without debugging doesn't run - blank cmd - and after an error on any attempt to run

Visual Studio 2015 Community
So I am new to Visual Studio completely. It works perfectly on my desktop, but I am having this problem on my laptop. Here is the gist of it -
I just write something to print the numbers 0 - 10. If I hit F5, it builds and flashes on the screen real quick, as expected. Next, I hit Ctrl F5 - cmd opens and is blank, just the flashing line. It does not run. I close the cmd window (have tried just hitting return/any key on the blank window). After closing, if I try to run it again, either F5 or Ctrl F5, I get the error:
Could not copy "obj\Debug\ConsoleApplication2.exe" to "bin\Debug\ConsoleApplication2.exe". Exceeded retry count of 10. Failed.
I have looked around for a solution and even though both of these separate issues are talked about, cannot find any solution to either of them.
If I go to task manager, I have several ConsoleApplication2.exe*32 processes - I can kill all of them but two. No matter what I do I cannot terminate them, and cannot delete the src/bin folders as I saw someone suggest.
Further, even if I figure out how to kill these processes so I can run again, it still doesn't help me with why Ctrl F5 just doesn't run.
Can anyone help or point me in a direction to a possible cause for this? I tried repairing, uninstalling and reinstalling, and several other suggestions and nothing seems to work. I am going crazy trying to get this to work.
I think it's your anti-virus .. especially if you're using Avast. It causes the same issue for me.
To solve it add exclusion to your anti-virus:

How to resume from debugger without interrupting the entire test in protractor?

I am writing a test using protractor. I am able to enter the debugger if I put the following code in my tests:
browser.pause();
However, I am not able to quit the debugger and resume the test execution.
According to this documentation:
When you finish debugging, exit by pressing Ctrl-C. Your tests will continue where they left off, using the same browser.
Actually, even the debugger itself tells me the same when it pauses:
------- WebDriver Debugger -------
ready
press c to continue to the next webdriver command
press d to continue to the next debugger statement
type "repl" to enter interactive mode
type "exit" to break out of interactive mode
press ^C to exit
That all sounds good, but when I try Ctrl-C, it interrupts the entire test. What am I doing wrong?
I'm running the protractor test using grunt-protractor-runner#1.2.1 on Windows 7.
As it says in the message, you can use
press d to continue to the next debugger statement
and an entire suite will continue execution until it meets another debugger invocation (so you have to press 'd' one more time) or until the very end of the suite.
Note: press d actually means that you type in letter 'd' and hit 'Enter'

Can I stop an RSpec test run in the middle?

Sometimes after I start the rspec tests, I realized that I wanted to change something; and if it's a long run I would love to be able to stop it in the middle, change whatever it was, and rerun the tests. Would someone tell me if that is possible and if it is, how to do it?
One can stop the RSpec test in the middle by pressing ctrl-C twice.
As #zetetic said, press Control-C. Or, if you're running from an IDE, click the stop button for the test (not the server or other code you're testing!)

Running tests using the menu vs. shortcut keys

In VS2010, if I click on
Test->Run->All Tests in Solution (CTRL+R,A)
All of my tests will run and I'll be able to see what tests passed and what tests failed.
If I use the shortcut (Ctrl+R,A), then it will break when an exception is thrown.
Why is this experience different? How can I run all my tests through no matter what without going to the menu bar?
The chord "CTRL-R, A" executes
Test->Run->All Tests in Solution (CTRL+R,A)
The chord "CTRL-R, CTRL-A" executes
Test->Debug->All Tests in Solution (CTRL+R,CTRL-A)
So the fact is that you aren't using the shortcut you think you are.

Resources