Skip to content

Commit 43ffdbb

Browse files
authored
Merge branch 'develop' into executeInSelenium2
2 parents 8ea87ea + 5a4909c commit 43ffdbb

32 files changed

+893
-233
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
2.5.1
5+
-----
6+
7+
### Fixes
8+
* Fixed missing `use` statement in the generate:suite command
9+
10+
### GitHub Issues
11+
* [#471](https://github.com/magento/magento2-functional-testing-framework/issues/471) -- PHP Fatal error: MftfApplicationConfig not found in GenerateSuiteCommand
12+
413
2.5.0
514
-----
615
* Traceability

bin/mftf

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ try {
2929
try {
3030
$application = new Symfony\Component\Console\Application();
3131
$application->setName('Magento Functional Testing Framework CLI');
32-
$application->setVersion('2.5.0');
32+
$application->setVersion('2.5.1');
3333
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
3434
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
3535
foreach ($commandList->getCommands() as $command) {

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "2.5.0",
5+
"version": "2.5.1",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/best-practices.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ Use the _Foo.camelCase_ naming convention, which is similar to _Classes_ and _cl
8484

8585
Use an upper case first letter for:
8686

87-
- File names. Example: _StorefrontCreateCustomerTest.xml_
88-
- Test name attributes. Example: `<test name="TestAllTheThingsTest">`.
89-
- Data entity names. Example: `<entity name="OutOfStockProduct">`.
90-
- Page name. Example: `<page name="AdminLoginPage">`.
91-
- Section name. Example: `<section name="AdminCategorySidebarActionSection">`.
92-
- Action group name. Example: `<actionGroup name="LoginToAdminActionGroup">`.
87+
- File names. Example: _StorefrontCreateCustomerTest.xml_
88+
- Test name attributes. Example: `<test name="TestAllTheThingsTest">`.
89+
- Data entity names. Example: `<entity name="OutOfStockProduct">`.
90+
- Page name. Example: `<page name="AdminLoginPage">`.
91+
- Section name. Example: `<section name="AdminCategorySidebarActionSection">`.
92+
- Action group name. Example: `<actionGroup name="LoginToAdminActionGroup">`.
9393

9494
#### Lower case
9595

9696
Use a lower case first letter for:
9797

98-
- Data keys. Example: `<data key="firstName">`.
99-
- Element names. Examples: `<element name="confirmDeleteButton"/>`.
98+
- Data keys. Example: `<data key="firstName">`.
99+
- Element names. Examples: `<element name="confirmDeleteButton"/>`.
100100

101101
## Page object
102102

@@ -134,9 +134,9 @@ Define these three elements and reference them by name in the tests.
134134
1. Keep your tests short and granular for target testing, easier reviews, and easier merge conflict resolution.
135135
It also helps you to identify the cause of test failure.
136136
1. Use comments to keep tests readable and maintainable:
137-
- Keep the inline `<!-- XML comments -->` and [`<comment>`] tags up to date.
137+
- Keep the inline `<!-- XML comments -->` and [`<comment>`] tags up to date.
138138
It helps to inform the reader of what you are testing and to yield a more descriptive Allure report.
139-
- Explain in comments unclear or tricky test steps.
139+
- Explain in comments unclear or tricky test steps.
140140
1. Refer to [sections] instead of writing selectors.
141141

142142
## Test step merging order

docs/credentials.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Credentials can be used in actions: [`fillField`][], [`magentoCLI`][], and [`cre
148148

149149
Define the value as a reference to the corresponding key in the credentials file or vault such as `{{_CREDS.my_data_key}}`:
150150

151-
- `_CREDS` is an environment constant pointing to the `.credentials` file
152-
- `my_data_key` is a key in the the `.credentials` file or vault that contains the value to be used in a test step
151+
- `_CREDS` is an environment constant pointing to the `.credentials` file
152+
- `my_data_key` is a key in the the `.credentials` file or vault that contains the value to be used in a test step
153153

154154
For example, reference secret data in the [`fillField`][] action with the `userInput` attribute.
155155

@@ -180,5 +180,5 @@ The MFTF tests delivered with Magento application do not use credentials and do
180180
[Download Vault]: https://www.hashicorp.com/products/vault/
181181
[Login Vault]: https://www.vaultproject.io/docs/commands/login.html
182182
[Vault KV2]: https://www.vaultproject.io/docs/secrets/kv/kv-v2.html
183-
[`CREDENTIAL_VAULT_ADDRESS`]: configuration.md#CREDENTIAL_VAULT_ADDRESS
184-
[`CREDENTIAL_VAULT_SECRET_BASE_PATH`]: configuration.md#CREDENTIAL_VAULT_SECRET_BASE_PATH
183+
[`CREDENTIAL_VAULT_ADDRESS`]: configuration.md#credential_vault_address
184+
[`CREDENTIAL_VAULT_SECRET_BASE_PATH`]: configuration.md#credential_vault_secret_base_path

docs/data.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ userInput="{{SimpleSubCategory.name}}"
1717

1818
In this example:
1919

20-
* `SimpleSubCategory` is an entity name.
21-
* `name` is a `<data>` key of the entity. The corresponding value will be assigned to `userInput` as a result.
20+
* `SimpleSubCategory` is an entity name.
21+
* `name` is a `<data>` key of the entity. The corresponding value will be assigned to `userInput` as a result.
2222

2323
### Environmental data
2424

@@ -28,8 +28,8 @@ userInput="{{_ENV.MAGENTO_ADMIN_USERNAME}}"
2828

2929
In this example:
3030

31-
* `_ENV` is a reference to the `dev/tests/acceptance/.env` file, where basic environment variables are set.
32-
* `MAGENTO_ADMIN_USERNAME` is a name of an environment variable.
31+
* `_ENV` is a reference to the `dev/tests/acceptance/.env` file, where basic environment variables are set.
32+
* `MAGENTO_ADMIN_USERNAME` is a name of an environment variable.
3333
The corresponding value will be assigned to `userInput` as a result.
3434

3535
### Sensitive data
@@ -40,10 +40,10 @@ userInput="{{_CREDS.my_secret_token}}"
4040

4141
In this example:
4242

43-
* `_CREDS` is a constant to reference to the `dev/tests/acceptance/.credentials` file, where sensitive data and secrets are stored for use in a test.
44-
* `MY_SECRET_TOKEN` is the name of a key in the credentials variable.
43+
* `_CREDS` is a constant to reference to the `dev/tests/acceptance/.credentials` file, where sensitive data and secrets are stored for use in a test.
44+
* `MY_SECRET_TOKEN` is the name of a key in the credentials variable.
4545
The corresponding value of the credential will be assigned to `userInput` as a result.
46-
* The decrypted values are only available in the `.credentials` file in which they are stored.
46+
* The decrypted values are only available in the `.credentials` file in which they are stored.
4747

4848
Learn more in [Credentials][].
4949

@@ -59,8 +59,8 @@ userInput="$createCustomer.email$"
5959

6060
In this example:
6161

62-
* `createCustomer` is a step key of the corresponding test step that creates an entity.
63-
* `email` is a data key of the entity.
62+
* `createCustomer` is a step key of the corresponding test step that creates an entity.
63+
* `email` is a data key of the entity.
6464
The corresponding value will be assigned to `userInput` as a result.
6565

6666
<div class="bs-callout bs-callout-info">
@@ -118,10 +118,10 @@ The format of `<data>` is:
118118

119119
The following conventions apply to MFTF `<data>`:
120120

121-
* A `<data>` file may contain multiple data entities.
122-
* Camel case is used for `<data>` elements. The name represents the `<data>` type. For example, a file with customer data is `CustomerData.xml`. A file for simple product would be `SimpleProductData.xml`.
123-
* Camel case is used for the entity name.
124-
* The file name must have the suffix `Data.xml`.
121+
* A `<data>` file may contain multiple data entities.
122+
* Camel case is used for `<data>` elements. The name represents the `<data>` type. For example, a file with customer data is `CustomerData.xml`. A file for simple product would be `SimpleProductData.xml`.
123+
* Camel case is used for the entity name.
124+
* The file name must have the suffix `Data.xml`.
125125

126126
## Example
127127

@@ -152,16 +152,16 @@ All entities that have the same name will be merged during test generation. Both
152152

153153
`_defaultCategory` sets three data fields:
154154

155-
* `name` defines the category name as `simpleCategory` with a unique suffix. Example: `simpleCategory598742365`.
156-
* `name_lwr` defines the category name in lowercase format with a unique suffix. Example: `simplecategory697543215`.
157-
* `is_active` sets the enable category to `true`.
155+
* `name` defines the category name as `simpleCategory` with a unique suffix. Example: `simpleCategory598742365`.
156+
* `name_lwr` defines the category name in lowercase format with a unique suffix. Example: `simplecategory697543215`.
157+
* `is_active` sets the enable category to `true`.
158158

159159
`SimpleSubCategory` sets four data fields:
160160

161-
* `name` that defines the category name with a unique suffix. Example: `SimpleSubCategory458712365`.
162-
* `name_lwr` that defines the category name in lowercase format with a unique suffix. Example: `simplesubcategory753698741`.
163-
* `is_active` sets the enable category to `true`.
164-
* `include_in_menu` that sets the include in the menu to `true`.
161+
* `name` that defines the category name with a unique suffix. Example: `SimpleSubCategory458712365`.
162+
* `name_lwr` that defines the category name in lowercase format with a unique suffix. Example: `simplesubcategory753698741`.
163+
* `is_active` sets the enable category to `true`.
164+
* `include_in_menu` that sets the include in the menu to `true`.
165165

166166
The following is an example of a call in test:
167167

docs/debugging.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
Debugging within the Magento Functional Testing Framework is helpful in identifying test bugs by allowing you to pause execution so that you may:
44

5-
- Examine the page.
6-
- Check returned data and other variables being used during run-time.
5+
- Examine the page.
6+
- Check returned data and other variables being used during run-time.
77

88
This is straightforward to do once you create a basic Debug Configuration.
99

1010
## Prerequisites
1111

12-
- [Xdebug][]
13-
- PHPUnit configured for use in [PHPStorm][]
12+
- [Xdebug][]
13+
- PHPUnit configured for use in [PHPStorm][]
1414

1515
## Creating Debug Configuration with PHPStorm
1616

@@ -27,8 +27,8 @@ If you get a warning `Path to Codeception for local machine is not configured.`:
2727

2828
The easiest method of tagging a test for debugging is the following:
2929

30-
- In your Debug configuration, locate `Test Runner options:` and set `--group testDebug`.
31-
- When you want to debug a test you are working on, simply add `<group value="testDebug"/>` to the annotations. Be sure to remove this after done debugging.
30+
- In your Debug configuration, locate `Test Runner options:` and set `--group testDebug`.
31+
- When you want to debug a test you are working on, simply add `<group value="testDebug"/>` to the annotations. Be sure to remove this after done debugging.
3232

3333
Your Debug Configuration should now be able to run your test and pause execution on any breakpoints you have set in the generated `.php` file under the `_generated` folder.
3434

docs/extending.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ For example, only one or two parameters (for example, URL) might vary between te
55
To avoid copy-pasting and to save some time the Magento Functional Testing Framework (MFTF) enables you to extend test components such as [test], [data], and [action group].
66
You can create or update any component of the parent body in your new test/action group/entity.
77

8-
* A test starting with `<test name="SampleTest" extends="ParentTest">` creates a test `SampleTest` that takes body of existing test `ParentTest` and adds to it the body of `SampleTest`.
9-
* An action group starting with `<actionGroup name="SampleActionGroup" extends="ParentActionGroup">` creates an action group based on the `ParentActionGroup`, but with the changes specified in `SampleActionGroup`.
10-
* An entity starting with `<entity name="SampleEntity" extends="ParentEntity">` creates an entity `SampleEntity` that is equivalent to merging the `SampleEntity` with the `ParentEntity`.
8+
* A test starting with `<test name="SampleTest" extends="ParentTest">` creates a test `SampleTest` that takes body of existing test `ParentTest` and adds to it the body of `SampleTest`.
9+
* An action group starting with `<actionGroup name="SampleActionGroup" extends="ParentActionGroup">` creates an action group based on the `ParentActionGroup`, but with the changes specified in `SampleActionGroup`.
10+
* An entity starting with `<entity name="SampleEntity" extends="ParentEntity">` creates an entity `SampleEntity` that is equivalent to merging the `SampleEntity` with the `ParentEntity`.
1111

1212
Specify needed variations for a parent object and produce a copy of the original that incorporates the specified changes (the "delta").
1313

@@ -71,8 +71,8 @@ __Use case__: Create two similar tests with different `url` (`"{{AdminCategoryPa
7171

7272
__Use case__: Create two similar tests where the second test contains two additional steps:
7373

74-
* `checkOption` before `click` (`stepKey="clickLogin"`)
75-
* `seeInCurrentUrl` after `click` in the `LogInAsAdminTest` test (in the `.../Backend/Test/LogInAsAdminTest.xml` file)
74+
* `checkOption` before `click` (`stepKey="clickLogin"`)
75+
* `seeInCurrentUrl` after `click` in the `LogInAsAdminTest` test (in the `.../Backend/Test/LogInAsAdminTest.xml` file)
7676

7777
> Tests with "extends":
7878
@@ -119,8 +119,8 @@ __Use case__: Create two similar tests where the second test contains two additi
119119

120120
__Use case__: Create two similar tests where the second one contains two additional actions in the `before` hook:
121121

122-
* `checkOption` before `click` (`stepKey="clickLogin"`)
123-
* `seeInCurrentUrl` after `click` in the `LogInAsAdminTest` test (in the `.../Backend/Test/LogInAsAdminTest.xml` file)
122+
* `checkOption` before `click` (`stepKey="clickLogin"`)
123+
* `seeInCurrentUrl` after `click` in the `LogInAsAdminTest` test (in the `.../Backend/Test/LogInAsAdminTest.xml` file)
124124

125125
> Tests with "extends":
126126
@@ -366,4 +366,4 @@ __Use case__: Create an entity named `DivPanelGreen`, which is similar to the `D
366366
[test]: ./test.md
367367
[data]: ./data.md
368368
[action group]: ./test/action-groups.md
369-
[actions]: ./test/actions.md
369+
[actions]: ./test/actions.md

docs/getting-started.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ The latest Magento 2.2 release supports MFTF 2.3.8.
1010

1111
Make sure that you have the following software installed and configured on your development environment:
1212

13-
- [PHP version supported by the Magento instance under test][php]
14-
- [Composer 1.3 or later][composer]
15-
- [Java 1.8 or later][java]
16-
- [Selenium Server Standalone 3.1 or later][selenium server] and [ChromeDriver 2.33 or later][chrome driver] or other webdriver in the same directory
13+
- [PHP version supported by the Magento instance under test][php]
14+
- [Composer 1.3 or later][composer]
15+
- [Java 1.8 or later][java]
16+
- [Selenium Server Standalone 3.1 or later][selenium server] and [ChromeDriver 2.33 or later][chrome driver] or other webdriver in the same directory
1717

1818
<div class="bs-callout bs-callout-tip" markdown="1">
1919
[PhpStorm] supports [Codeception test execution][], which is helpful when debugging.
@@ -147,16 +147,16 @@ vim dev/tests/acceptance/.env
147147

148148
Specify the following parameters, which are required to launch tests:
149149

150-
- `MAGENTO_BASE_URL` must contain a domain name of the Magento instance that will be tested.
150+
- `MAGENTO_BASE_URL` must contain a domain name of the Magento instance that will be tested.
151151
Example: `MAGENTO_BASE_URL=http://magento.test`
152152

153-
- `MAGENTO_BACKEND_NAME` must contain the relative path for the Admin area.
153+
- `MAGENTO_BACKEND_NAME` must contain the relative path for the Admin area.
154154
Example: `MAGENTO_BACKEND_NAME=admin`
155155

156-
- `MAGENTO_ADMIN_USERNAME` must contain the username required for authorization in the Admin area.
156+
- `MAGENTO_ADMIN_USERNAME` must contain the username required for authorization in the Admin area.
157157
Example: `MAGENTO_ADMIN_USERNAME=admin`
158158

159-
- `MAGENTO_ADMIN_PASSWORD` must contain the user password required for authorization in the Admin area.
159+
- `MAGENTO_ADMIN_PASSWORD` must contain the user password required for authorization in the Admin area.
160160
Example: `MAGENTO_ADMIN_PASSWORD=123123q`
161161

162162
<div class="bs-callout bs-callout-info" markdown="1">
@@ -222,8 +222,8 @@ During testing, the MFTF generates test reports in CLI.
222222
You can generate visual representations of the report data using [Allure Framework][].
223223
To view the reports in GUI:
224224

225-
- [Install Allure][]
226-
- Run the tool to serve the artifacts in `dev/tests/acceptance/tests/_output/allure-results/`:
225+
- [Install Allure][]
226+
- Run the tool to serve the artifacts in `dev/tests/acceptance/tests/_output/allure-results/`:
227227

228228
```bash
229229
allure serve dev/tests/acceptance/tests/_output/allure-results/

0 commit comments

Comments
 (0)