Skip to content

Commit 2ca6005

Browse files
committed
MQE-2110: MFTF command to pause test execution
1 parent 20f5203 commit 2ca6005

File tree

2 files changed

+30
-19
lines changed

2 files changed

+30
-19
lines changed

docs/commands/mftf.md

+4
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,10 @@ vendor/bin/mftf codecept:run functional Magento/_generated/default/AdminCreateCm
584584
vendor/bin/mftf codecept:run functional --verbose --steps -g default
585585
```
586586

587+
<div class="bs-callout-warning">
588+
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.
589+
</div>
590+
587591
<!-- LINK DEFINITIONS -->
588592

589593
[configuration]: ../configuration.md

docs/interactive-pause.md

+26-19
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,15 @@ It can be difficut to write a successful test on the first attempt. You will nee
44

55
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.
66

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`.
88

99
Check [pause on codeception.com][] for documentation and a video to see `Interactive Pause` in action.
1010

1111
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.
1212

13-
## Generation Time
13+
## MFTF Run Commands
1414

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`.
2616

2717
```bash
2818
vendor/bin/mftf run:group
@@ -40,10 +30,31 @@ vendor/bin/mftf run:manifest
4030
vendor/bin/mftf run:failed
4131
```
4232

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
4455

4556
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`.
4758

4859
```bash
4960
vendor/bin/mftf codecept:run --debug
@@ -53,10 +64,6 @@ vendor/bin/mftf codecept:run --debug
5364
Note: MFTF run command's `--debug` option is different from Codeception `--debug` mode option.
5465
</div>
5566

56-
<div class="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-
6067
## References
6168

6269
[pause on codeception.com](https://codeception.com/docs/02-GettingStarted#Interactive-Pause)

0 commit comments

Comments
 (0)