We have sometimes the problem that FF alert "Are you sure you want to leave this page?" interrupts the test.
This line works for us to solve problem:
$I->executeJS( "window.onbeforeunload = null" );
Mozilla dev docu https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload mentions also:
"Note also, that various browsers ignore the result of the event and do not ask the user for confirmation at all. The document will always be unloaded automatically. Firefox has a switch named dom.disable_beforeunload in about:config to enable this behaviour."
So if dom.disable_beforeunload in about:config is set to true, this alert would not even show at all.
Can this be set by CC itself?