Skip to content

Commit 7425330

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop-master
2 parents 5d4aab2 + aeb6aca commit 7425330

28 files changed

+606
-514
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ dev/tests/mftf.log
1919
dev/tests/docs/*
2020
dev/tests/_output
2121
dev/tests/functional.suite.yml
22-
22+
/v2/

docs/best-practices.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ We recommend to keep Action Groups having single responsibility, for example `Ad
3737

3838
## Contribute
3939

40-
Althought the Magento Core team and Contributors join forces to cover most of the features with tests, it is impossible to have this done quickly.
40+
Although the Magento Core team and Contributors join forces to cover most of the features with tests, it is impossible to have this done quickly.
4141
If you've covered Magento Core feature with Functional Tests - you are more than welcome to contribute.
4242

43-
You can also help with MFTF Test Migration to get the experience and valuable feedback from other community members and maintainers.
44-
4543
## Action group
4644

4745
1. [Action group] names should be sufficiently descriptive to inform a test writer of what the action group does and when it should be used. Add additional explanation in annotations if needed.
@@ -108,7 +106,7 @@ Example: _StorefrontCreateCustomerTest.xml_.
108106

109107
#### Action Group file name
110108

111-
Format: {_Admin_ or _Storefront_}{Action Group Summary}ActionGroup.xml`, where Action Group Summary describes with a few words what we can expect from it.
109+
Format: {_Admin_ or _Storefront_}{Action Group Summary}ActionGroup.xml`, where Action Group Summary is a short description of what the action group does.
112110

113111
Example: _AdminCreateStoreActionGroup.xml_
114112

@@ -217,4 +215,3 @@ Since the configurable product module could be disabled, this approach is more r
217215
[merging]: merging.html
218216
[parameterized selectors]: section/parameterized-selectors.html
219217
[sections]: section.html
220-
[MFTF Test Migration]: https://github.com/magento/magento-functional-tests-migration

docs/commands/codeception.md

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI commands: vendor/bin/codecept
22

33
<div class="bs-callout bs-callout-warning" markdown="1">
4-
We do not recommend using Codeception commands directly as they can break the MFTF basic workflow.
4+
We do not recommend using Codeception commands directly as they can break MFTF basic workflow.
55
All the Codeception commands you need are wrapped using the [mftf tool][].
66

77
To run the Codeception testing framework commands directly, change your directory to the `<Magento root>`.
@@ -36,7 +36,7 @@ vendor/bin/codecept run
3636
```
3737

3838
<div class="bs-callout bs-callout-info">
39-
The following documentation corresponds to Codeception 2.3.8.
39+
The following documentation corresponds to Codeception 4.1.4.
4040
</div>
4141

4242
```bash
@@ -47,36 +47,44 @@ Arguments:
4747
test test to be run
4848

4949
Options:
50-
-o, --override=OVERRIDE Override config values (multiple values allowed)
51-
--config (-c) Use custom path for config
52-
--report Show output in compact style
53-
--html Generate html with results (default: "report.html")
54-
--xml Generate JUnit XML Log (default: "report.xml")
55-
--tap Generate Tap Log (default: "report.tap.log")
56-
--json Generate Json Log (default: "report.json")
57-
--colors Use colors in output
58-
--no-colors Force no colors in output (useful to override config file)
59-
--silent Only outputs suite names and final results
60-
--steps Show steps in output
61-
--debug (-d) Show debug and scenario output
62-
--coverage Run with code coverage (default: "coverage.serialized")
63-
--coverage-html Generate CodeCoverage HTML report in path (default: "coverage")
64-
--coverage-xml Generate CodeCoverage XML report in file (default: "coverage.xml")
65-
--coverage-text Generate CodeCoverage text report in file (default: "coverage.txt")
66-
--coverage-phpunit Generate CodeCoverage PHPUnit report in file (default: "coverage-phpunit")
67-
--no-exit Do not finish with exit code
68-
--group (-g) Groups of tests to be executed (multiple values allowed)
69-
--skip (-s) Skip selected suites (multiple values allowed)
70-
--skip-group (-x) Skip selected groups (multiple values allowed)
71-
--env Run tests in selected environments. (multiple values allowed, environments can be merged with ',')
72-
--fail-fast (-f) Stop after first failure
73-
--help (-h) Display this help message.
74-
--quiet (-q) Do not output any message.
75-
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
76-
--version (-V) Display this application version.
77-
--ansi Force ANSI output.
78-
--no-ansi Disable ANSI output.
79-
--no-interaction (-n) Do not ask any interactive question.
50+
-o, --override=OVERRIDE Override config values (multiple values allowed)
51+
-e, --ext=EXT Run with extension enabled (multiple values allowed)
52+
--report Show output in compact style
53+
--html[=HTML] Generate html with results [default: "report.html"]
54+
--xml[=XML] Generate JUnit XML Log [default: "report.xml"]
55+
--phpunit-xml[=PHPUNIT-XML] Generate PhpUnit XML Log [default: "phpunit-report.xml"]
56+
--tap[=TAP] Generate Tap Log [default: "report.tap.log"]
57+
--json[=JSON] Generate Json Log [default: "report.json"]
58+
--colors Use colors in output
59+
--no-colors Force no colors in output (useful to override config file)
60+
--silent Only outputs suite names and final results
61+
--steps Show steps in output
62+
-d, --debug Show debug and scenario output
63+
--bootstrap[=BOOTSTRAP] Execute custom PHP script before running tests. Path can be absolute or relative to current working directory [default: false]
64+
--no-redirect Do not redirect to Composer-installed version in vendor/codeception
65+
--coverage[=COVERAGE] Run with code coverage
66+
--coverage-html[=COVERAGE-HTML] Generate CodeCoverage HTML report in path
67+
--coverage-xml[=COVERAGE-XML] Generate CodeCoverage XML report in file
68+
--coverage-text[=COVERAGE-TEXT] Generate CodeCoverage text report in file
69+
--coverage-crap4j[=COVERAGE-CRAP4J] Generate CodeCoverage report in Crap4J XML format
70+
--coverage-phpunit[=COVERAGE-PHPUNIT] Generate CodeCoverage PHPUnit report in path
71+
--no-exit Don't finish with exit code
72+
-g, --group=GROUP Groups of tests to be executed (multiple values allowed)
73+
-s, --skip=SKIP Skip selected suites (multiple values allowed)
74+
-x, --skip-group=SKIP-GROUP Skip selected groups (multiple values allowed)
75+
--env=ENV Run tests in selected environments. (multiple values allowed)
76+
-f, --fail-fast Stop after first failure
77+
--no-rebuild Do not rebuild actor classes on start
78+
--seed=SEED Define random seed for shuffle setting
79+
--no-artifacts Don't report about artifacts
80+
-h, --help Display this help message
81+
-q, --quiet Do not output any message
82+
-V, --version Display this application version
83+
--ansi Force ANSI output
84+
--no-ansi Disable ANSI output
85+
-n, --no-interaction Do not ask any interactive question
86+
-c, --config[=CONFIG] Use custom path for config
87+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
8088
```
8189

8290
<!-- Link definitions -->

docs/commands/mftf.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ vendor/bin/mftf generate:tests AdminLoginSuccessfulTest StorefrontPersistedCusto
4545
### Generate test by test and suite name
4646

4747
```bash
48-
vendor/bin/mftf generate:tests LoginSuite:AdminLoginSuccessfulTest
48+
vendor/bin/mftf generate:tests WYSIWYGDisabledSuite:AdminCMSPageCreatePageTest
4949
```
5050

5151
### Generate and run the tests for a specified group
@@ -62,15 +62,15 @@ This command cleans up the previously generated tests; generates and runs tests
6262
vendor/bin/mftf run:test AdminLoginSuccessfulTest StorefrontPersistedCustomerLoginTest -r
6363
```
6464

65-
This command cleans up the previously generated tests; generates and runs the `LoginAsAdminTest` and `LoginAsCustomerTest` tests.
65+
This command cleans up the previously generated tests; generates and runs the `AdminLoginSuccessfulTest` and `StorefrontPersistedCustomerLoginTest` tests.
6666

6767
### Generate and run particular test in a specific suite's context
6868

6969
```bash
70-
vendor/bin/mftf run:test LoginSuite:AdminLoginSuccessfulTest -r
70+
vendor/bin/mftf run:test WYSIWYGDisabledSuite:AdminCMSPageCreatePageTest -r
7171
```
7272

73-
This command cleans up previously generated tests; generates and run `AdminLoginSuccessfulTest` within the context of the `LoginSuite`.
73+
This command cleans up previously generated tests; generates and run `AdminCMSPageCreatePageTest` within the context of the `WYSIWYGDisabledSuite`.
7474

7575
### Generate and run a testManifest.txt file
7676

docs/configuration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Configuration
22

33
The `*.env` file provides additional configuration for the Magento Functional Testing Framework (MFTF).
4-
To run the MFTF on your Magento instance, specify the basic configuration values.
4+
To run MFTF on your Magento instance, specify the basic configuration values.
55
Advanced users can create custom configurations based on requirements and environment.
66

77
## Basic configuration
88

9-
These basic configuration values are __required__ and must be set by the user before the MFTF can function correctly.
9+
These basic configuration values are __required__ and must be set by the user before MFTF can function correctly.
1010

1111
### MAGENTO_BASE_URL
1212

@@ -34,7 +34,7 @@ MAGENTO_BACKEND_NAME=admin_12346
3434

3535
### MAGENTO_BACKEND_BASE_URL
3636

37-
(Optional) If you are running the Admin Panel on separate a domain, specify this value:
37+
(Optional) If you are running the Admin Panel on a separate domain, specify this value:
3838

3939
Example:
4040

@@ -64,7 +64,7 @@ MAGENTO_ADMIN_PASSWORD=1234reTyt%$7
6464

6565
## Advanced configuration
6666

67-
Depending on the environment you use, you may need to configure the MFTF more precisely by setting more configuration parameters then for basic configuration.
67+
Depending on the environment you use, you may need to configure MFTF more precisely by setting additional configuration parameters.
6868
This section describes available configuration parameters and their default values (where applicable).
6969

7070
### DEFAULT_TIMEZONE
@@ -173,8 +173,8 @@ MAGENTO_RESTAPI_SERVER_PORT=5000
173173
### \*_BP
174174

175175
Settings to override base paths for the framework.
176-
You can use it when the MFTF is applied as a separate tool.
177-
For example, when you need to place the MFTF and the Magento codebase in separate projects.
176+
You can use it when MFTF is applied as a separate tool.
177+
For example, when you need to place MFTF and the Magento codebase in separate projects.
178178

179179
```conf
180180
MAGENTO_BP
@@ -221,13 +221,13 @@ The path to where the MFTF modules mirror Magento modules.
221221
Example:
222222

223223
```conf
224-
TESTS_MODULE_PATH=~/magento2/dev/tests/acceptance/tests/functional/Magento/FunctionalTest
224+
TESTS_MODULE_PATH=~/magento2/dev/tests/acceptance/tests/functional/Magento
225225
```
226226

227227
### MODULE_ALLOWLIST
228228

229229
Use for a new module.
230-
When adding a new directory at `Magento/FunctionalTest`, add the directory name to `MODULE_ALLOWLIST` to enable the MFTF to process it.
230+
When adding a new directory at `tests/functional/Magento`, add the directory name to `MODULE_ALLOWLIST` to enable MFTF to process it.
231231

232232
Example:
233233

@@ -245,7 +245,7 @@ It points to `MAGENTO_BASE_URL` + `dev/tests/acceptance/utils/command.php`
245245
Modify the default value:
246246

247247
- for non-default Magento installation
248-
- when use a subdirectory in the `MAGENTO_BASE_URL`
248+
- when using a subdirectory in the `MAGENTO_BASE_URL`
249249

250250
Example: `dev/tests/acceptance/utils/command.php`
251251

docs/configure-2fa.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Use the action `getOTP` [Reference](./test/actions.md#getotp) to generate the co
4444
Note:
4545
You will need to set the `secret` for any non-default admin users first, before using `getOTP`. For example:
4646

47+
{%raw%}
48+
4749
```xml
4850
<magentoCLI command="security:tfa:google:set-secret admin2 {{_CREDS.magento/tfa/OTP_SHARED_SECRET}}" stepKey="setSecret"/>
4951
```
52+
53+
{%endraw%}

docs/credentials.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
When you test functionality that involves external services such as UPS, FedEx, PayPal, or SignifyD,
44
use the MFTF credentials feature to hide sensitive [data][] like integration tokens and API keys.
55

6-
Currently the MFTF supports three types of credential storage:
6+
Currently MFTF supports three types of credential storage:
77

88
- **.credentials file**
99
- **HashiCorp Vault**
1010
- **AWS Secrets Manager**
1111

1212
## Configure File Storage
1313

14-
The MFTF creates a sample file for credentials during [initial setup][]: `magento2/dev/tests/acceptance/.credentials.example`.
14+
MFTF creates a sample file for credentials during [initial setup][]: `magento2/dev/tests/acceptance/.credentials.example`.
1515
The file contains an example list of keys for fields that can require credentials.
1616

1717
### Create `.credentials`
1818

19-
To make the MFTF process the file with credentials, in the command line, navigate to `magento2/dev/tests/acceptance/` and rename `.credentials.example` to `.credentials`.
19+
To make MFTF process the file with credentials, in the command line, navigate to `magento2/dev/tests/acceptance/` and rename `.credentials.example` to `.credentials`.
2020

2121
```bash
2222
cd dev/tests/acceptance/
@@ -78,7 +78,7 @@ vendor/my_awesome_service_token=rRVSVnh3cbDsVG39oTMz4A
7878
Hashicorp vault secures, stores, and tightly controls access to data in modern computing.
7979
It provides advanced data protection for your testing credentials.
8080

81-
The MFTF works with both `vault enterprise` and `vault open source` that use `KV Version 2` secret engine.
81+
MFTF works with both `vault enterprise` and `vault open source` that use `KV Version 2` secret engine.
8282

8383
### Install vault CLI
8484

@@ -92,11 +92,11 @@ Authenticate to vault server via the vault CLI tool: [Login Vault][Login Vault].
9292
vault login -method -path
9393
```
9494

95-
**Do not** use `-no-store` command option, as the MFTF will rely on the persisted token in the token helper (usually the local filesystem) for future API requests.
95+
**Do not** use `-no-store` command option, as MFTF will rely on the persisted token in the token helper (usually the local filesystem) for future API requests.
9696

9797
### Store secrets in vault
9898

99-
The MFTF uses the `KV Version 2` secret engine for secret storage.
99+
MFTF uses the `KV Version 2` secret engine for secret storage.
100100
More information for working with `KV Version 2` can be found in [Vault KV2][Vault KV2].
101101

102102
#### Secrets path and key convention
@@ -225,7 +225,7 @@ export CREDENTIAL_AWS_ACCOUNT_ID=<Your_12_Digits_AWS_Account_ID>
225225
## Configure multiple credential storage
226226

227227
It is possible and sometimes useful to setup and use multiple credential storage at the same time.
228-
In this case, the MFTF tests are able to read secret data at runtime from all storage options, in this case MFTF use the following precedence:
228+
In this case, the MFTF tests are able to read secret data at runtime from all storage options. MFTF will use the following precedence:
229229

230230
```
231231
.credentials File > HashiCorp Vault > AWS Secrets Manager
@@ -253,7 +253,7 @@ For example, to reference secret data in the [`fillField`][] action, use the `us
253253
## Implementation details
254254

255255
The generated tests do not contain credentials values.
256-
The MFTF dynamically retrieves, encrypts, and decrypts the sensitive data during test execution.
256+
MFTF dynamically retrieves, encrypts, and decrypts the sensitive data during test execution.
257257
Decrypted credentials do not appear in the console, error logs, or [test reports][].
258258
The decrypted values are only available in the `.credentials` file or within vault.
259259

@@ -277,4 +277,4 @@ The MFTF tests delivered with Magento application do not use credentials and do
277277
[`CREDENTIAL_AWS_SECRETS_MANAGER_PROFILE`]: configuration.md#credential_aws_secrets_manager_profile
278278
[`CREDENTIAL_AWS_SECRETS_MANAGER_REGION`]: configuration.md#credential_aws_secrets_manager_region
279279
[Key Management Service]: https://aws.amazon.com/kms/
280-
[Amazon Resource Name]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
280+
[Amazon Resource Name]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

0 commit comments

Comments
 (0)