You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/06-Debugging.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ By looking into the following debugging practices you will learn how to get all
9
9
Codeception provides `codecept_debug` function to print a debug output when running test.
10
10
Think of it as `var_dump` but for testing:
11
11
12
-
{% highlight php %}
12
+
```php
13
13
codecept_debug($user);
14
-
{% endhighlight %}
14
+
```
15
15
16
16
Unlinke var_dump, the output will be printed to screen only if tests are executed with `--debug` flag.
17
17
@@ -27,13 +27,13 @@ This function is loaded only by Codeception, so the application may be broken tr
27
27
Inside a [Helper](/docs/06-ModulesAndHelpers#Helpers) you can use analogs of this function to provide a debug output for a complex action.
28
28
29
29
30
-
{% highlight php %}
30
+
```php
31
31
// print variable from helper
32
32
$this->debug($response);
33
33
34
34
// print variable with a short comment
35
35
$this->debugSection('Response', $response);
36
-
{% endhighlight %}
36
+
```
37
37
38
38
Codeception Modules use debug output to give more information to user about the data used by a test. For instance, in debug mode you can see request and responses body when testing REST API.
39
39
@@ -44,10 +44,10 @@ When running acceptance or functional test it might be needed to pause execution
44
44
45
45
Writing a new acceptance from scratch can be more convenient if you hold a browser window open. It is recommended to start writing a new acceptance test with these two commands:
46
46
47
-
{% highlight php %}
47
+
```php
48
48
$I->amOnPage('/');
49
49
$I->pause();
50
-
{% endhighlight %}
50
+
```
51
51
52
52
Interactive pause is launched only when `--debug ` option is enabled:
53
53
@@ -57,9 +57,9 @@ php vendor/bin/codecept run --debug
57
57
58
58
To launch interactive pause in a context when the `$I` object is not available, use `codecept_pause` function instead. To inspect local variables pass them into interactive shell using an array:
0 commit comments