Advanced Tester usage
These are either advanced or just too cumbersome to include in the readme
Modify HTML Output
This is the exact code used in the Tester
class. You just have to overwrite this method in your child class.
public function showResult($details){
$successStatement = $details->result ? '<span style="color:green;">success</span>' : '<span style="color:red;">fail</span>';
if ($details->error!=null)$successStatement = '<strong style="color:blue;">error</strong>';
echo "<details>\n <summary><b>".$details->method.":</b> ".$successStatement." </summary>\n";
echo " <div style='padding-left:4ch;white-space:pre;'>\n";
$detailsOutput = htmlentities($details->output);
$detailsLines = explode("\n",$detailsOutput);
$detailsLines = array_map(function($value){return ' '.$value;},$detailsLines);
echo implode("\n",$detailsLines);
// var_dump($detailsLines);
echo "\n </div>";
if ($details->error!=null){
echo "\n <br>\n";
echo " <div style='color:red;padding-left:4ch;white-space:pre;'>\n";
$errorOutput = $details->error;
$errorLines = explode("\n",$errorOutput);
$errorLines = array_map(function($value){return ' '.$value;},$errorLines);
echo implode("\n",$errorLines);
echo "\n </div>";
}
echo "\n</details>\n";
}
Refresh Firefox Browser Tab
Call Taeluf\Tester::xdotoolRefreshFirefox($switchBackToCurrWindow = false)
to refresh your browser tab.
If you're writing you're using runAllToFile($file)
, this could come in handy.