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
Note: You may want to limit the usage of this Codeception command with arguments and options for `acceptance` only, since it is what is supported by MFTF. You should also change `acceptance` to `functional` when using this command when referring to Codeception documentation.
Copy file name to clipboardExpand all lines: docs/interactive-pause.md
+26-19
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,15 @@ It can be difficut to write a successful test on the first attempt. You will nee
4
4
5
5
Since Codeception 3.0, you can pause execution in any point and enter an interactive shell where you will be able to try commands in action.
6
6
7
-
Now this `Interactive Pause` feature is available in MFTF. All you need to do is to set `ENABLE_PAUSE=true` in `.env`.
7
+
Now this `Interactive Pause` feature is available in MFTF. All you need to do is to set `ENABLE_PAUSE` to `true` in `.env`.
8
8
9
9
Check [pause on codeception.com][] for documentation and a video to see `Interactive Pause` in action.
10
10
11
11
In short, when a test gets to `$I->pause()` step, it stops and shows a console where you can try all available commands with auto-completion, stash commands, save screenshots, etc.
12
12
13
-
## Generation Time
13
+
## MFTF Run Commands
14
14
15
-
A `<pause>` action in xml will always be generated into php regardless if `ENABLE_PAUSE=true` is set or not.
16
-
However, when `ENABLE_PAUSE=true` is set, an additional `pause()` action will be generated in `_failed()` hook for a test,
17
-
so that the test may pause on failure at run time.
18
-
19
-
## Execution Time
20
-
21
-
To use `Interactive Pause` at run time, there are two types of MFTF commands to use:
22
-
23
-
### MFTF Run Commands
24
-
25
-
When `ENABLE_PAUSE=true` is set, the following MFTF run commands support `Interactive Pause`.
15
+
The following MFTF run commands support `Interactive Pause` when `ENABLE_PAUSE` is set to `true`.
26
16
27
17
```bash
28
18
vendor/bin/mftf run:group
@@ -40,10 +30,31 @@ vendor/bin/mftf run:manifest
40
30
vendor/bin/mftf run:failed
41
31
```
42
32
43
-
### MFTF Codecept Run Command
33
+
### Use `Interactive Pause` During Test Development
34
+
35
+
Here is a typical work flow for this use case:
36
+
37
+
- Set `ENABLE_PAUSE` to `true` under `.env`
38
+
- Add `<pause>` action in a test where you want to stop for investigation
39
+
- Run test
40
+
- Execution should pause at <pause> action and invoke interactive console
41
+
- Try out commands in interactive console
42
+
- Resume test execution by pressing `ENTER`
43
+
44
+
### Use `Pause` On Test Failure
45
+
46
+
When `ENABLE_PAUSE` is set to `true`, MFTF automatically generates `pause()` action in `_failed()` hook for tests and in `_failed()` function in `MagentoWebDriver`.
47
+
This allows you to use `pause` to debug test failure for a long running test. The work flow might look like:
48
+
49
+
- Set `ENABLE_PAUSE` to `true` under `.env`
50
+
- Run test
51
+
- Execution pauses and invokes interactive console right after test fails
52
+
- Examine and debug on the spot of failure
53
+
54
+
## MFTF Codecept Run Command
44
55
45
56
You can also use MFTF's wrapper command to run Codeception directly and activate `Interactive Pause` by passing `--debug` option.
46
-
You do not need to set `ENABLE_PAUSE=true` for this command.
57
+
You do not need to set `ENABLE_PAUSE=true` for this command if you are not using `Pause on Failure`.
Note: MFTF run command's `--debug` option is different from Codeception `--debug` mode option.
54
65
</div>
55
66
56
-
<divclass="bs-callout-warning">
57
-
Note: You may want to limit the usage of this Codeception command with arguments and options for `acceptance` only, since it is what is supported by MFTF. You should also change `acceptance` to `functional` when using this command when referring to Codeception documentation.
58
-
</div>
59
-
60
67
## References
61
68
62
69
[pause on codeception.com](https://codeception.com/docs/02-GettingStarted#Interactive-Pause)
0 commit comments