Commit 19596d44 authored by Rebecca Blundell's avatar Rebecca Blundell Committed by Robert Lyon

Bug #1694563 - add step to make breakpoint in testing

Added step to make the test pause until you press enter
in the console.

Also added a step to print a debug line to the console

behatnotneeded

Change-Id: I0066c0203d34f4fd021d8ac24105cf5e55a2cc07
parent d08c95a9
......@@ -1227,4 +1227,33 @@ JS;
);
}
/**
* Pauses the scenario until the user presses a key. Useful when debugging a scenario locally
* but not meant for automated runs.
*
* @Then /^(?:|I )insert breakpoint$/
*/
public function i_insert_breakpoint() {
fwrite(STDOUT, "\n\033[s \033[93m[Breakpoint] Press \033[1;93m[RETURN]\033[0;93m to continue...\033[0m\n");
while (fgets(STDIN, 1024) == '') {
}
fwrite(STDOUT, "\033[u");
return;
}
/**
* Echos a line to the console to indicate where the test has reached in a scenario.
* For debugging tests without using a breakpoint. Ok for automated runs.
*
* @Then /^(?:\I )echo the line "([^"]*)"$/
*/
public function i_echo_the_line($text){
fwrite(STDOUT, "\n\033[93m DEBUG: $text\033[0m\n\n");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment