Skip to content

Commit

Permalink
MAGETWO-60425: [Internal] SITE - Replace FTF images to a separate dir…
Browse files Browse the repository at this point in the history
…ectory
  • Loading branch information
dshevtsov committed Nov 2, 2016
1 parent a78de94 commit 888ee67
Show file tree
Hide file tree
Showing 82 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ source 'https://rubygems.org'
gem 'github-pages', '83'
gem 'pygments.rb'
gem 'jekyll-last-modified-at'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
28 changes: 14 additions & 14 deletions guides/v2.0/mtf/create_test/create_new_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ All slashes must be escaped with `\\`.

As a result of previous commands, a brand new fixture can be found in the `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Search/Test/Fixture` directory.

![A new Synonym fixture]({{site.baseurl}}common/images/mtf_tut_fixt.png)
![A new Synonym fixture]({{site.baseurl}}common/images/ftf/mtf_tut_fixt.png)

The following is a code of the new Synonym fixture.

Expand All @@ -129,15 +129,15 @@ The following is a code of the new Synonym fixture.

If we open a New Synonym Group page in a browser

![New Synonym Group page]({{ site.baseurl }}common/images/mtf_tutorial_new_syn_ui.png)
![New Synonym Group page]({{ site.baseurl }}common/images/ftf/mtf_tutorial_new_syn_ui.png)

we see that `store_id` and `website_id` are combined in the "Scope" fields. To set `store_id` and `website_id`, we have to perform some more logic than just entering the data. That's why we should use a [data source][].

The same field is present in Magento_Widget module. It means that data source has been already written and we can reuse it.

Let's check the functional tests for the Magento_Widget module.

![ScopeID data source alternative from Magento_Widget]({{ site.baseurl }}common/images/mtf_tutorial_storeIds-widget.png)
![ScopeID data source alternative from Magento_Widget]({{ site.baseurl }}common/images/ftf/mtf_tutorial_storeIds-widget.png)

It contains a `StoreIds.php` data source, that is similar to what we need. It has the following code:

Expand Down Expand Up @@ -272,7 +272,7 @@ This data source:

We should save it as `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Search/Test/Fixture/Synonym/ScopeId.php`.

![Synonym ScopeID data source location]({{site.baseurl}}common/images/mtf_tutorial_datasource.png)
![Synonym ScopeID data source location]({{site.baseurl}}common/images/ftf/mtf_tutorial_datasource.png)

Now we should change the fixture. Instead of `store_id` and `website_id`, we must use `scope_id` with the `Magento\Search\Test\Fixture\Synonym\ScopeId` data source class.

Expand Down Expand Up @@ -373,7 +373,7 @@ Now we can create a [test case][].
From the [test case topic][] we know about the structure, location and name of the test case.
In this example it is named `CreateSynonymEntityTest.php` and stored in `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Search/Test/TestCase`.

![A test case location]({{site.baseurl}}common/images/mtf_tutorial_testcase_location.png)
![A test case location]({{site.baseurl}}common/images/ftf/mtf_tutorial_testcase_location.png)

As a result of [manual testing][] we know that we must work with a Search Synonym Index page and a New Synonym Group page during the test flow. We can code the initialization of these pages in the test using an `__inject()` method of the `Magento\Mtf\TestCase\Injectable` class. The pages will be created in [Step 5][]. Also, we will use the fixture from the [Step 2][].

Expand Down Expand Up @@ -444,7 +444,7 @@ class CreateSynonymEntityTest extends Injectable

Now we can add a [data set][] with variations that cover cases in the [test description][]: `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/CreateSynonymEntityTest.xml`

![Created data set]({{site.baseurl}}common/images/mtf_tutor_dataset.png)
![Created data set]({{site.baseurl}}common/images/ftf/mtf_tutor_dataset.png)

The following code contains a data set, but doesn't have data yet:

Expand Down Expand Up @@ -534,13 +534,13 @@ In [Step 3][], we added two [pages][] to the test case class. Because both pages

{% endhighlight %}

![Created pages]({{site.baseurl}}common/images/mtf_tutorial_pages.png)
![Created pages]({{site.baseurl}}common/images/ftf/mtf_tutorial_pages.png)

To generate PHP classes for these [pages][] enter and run in your terminal

php <magento2_root_dir>/dev/tests/functional/utils/generate.php

![PHP classes of pages]({{site.baseurl}}common/images/mtf_tutorial_pages_php.png)
![PHP classes of pages]({{site.baseurl}}common/images/ftf/mtf_tutorial_pages_php.png)

In the next step we will create [blocks][] that implements logic in these pages.

Expand Down Expand Up @@ -591,15 +591,15 @@ Now you can run `generate.php` as we did before to re-generate page classes.

We need to enter data from a data set into the form fields.

![New Synonym Group page]({{site.baseurl}}common/images/mtf_tutorial_page_new_synonym.png)
![New Synonym Group page]({{site.baseurl}}common/images/ftf/mtf_tutorial_page_new_synonym.png)

The `Block` directory in the Magento_Search module (in the Magento code) contains the `Adminhtml/Synonyms/Edit` directories, as shown below:

![Block structure in a code base]({{site.baseurl}}common/images/mtf_tutorial_block_struct.png)
![Block structure in a code base]({{site.baseurl}}common/images/ftf/mtf_tutorial_block_struct.png)

The `Search/Test` directory in functional tests should be constructed in a similar manner:

![Block structure in a functional test]({{site.baseurl}}common/images/mtf_tutorial_block_struct_test.png)
![Block structure in a functional test]({{site.baseurl}}common/images/ftf/mtf_tutorial_block_struct_test.png)

We need a `fill()` method from the [`\Magento\Mtf\Block\Form`][] class and a mapping file.

Expand Down Expand Up @@ -644,7 +644,7 @@ class SynonymsForm extends Form
Now we have the following structure:
![Form mapping block]({{site.baseurl}}common/images/mtf_tutorial_block_mapping.png)
![Form mapping block]({{site.baseurl}}common/images/ftf/mtf_tutorial_block_mapping.png)
Then we should add the block class to the `SynonymsNew.xml` page object. To identify a form block on the HTML page, use an `id='page:main-container'` css selector.
Expand Down Expand Up @@ -905,7 +905,7 @@ You can run the test using your IDE or the CLI. The Selenium Server must be [up

The last item in the test description says that the test must check that a success message is displayed after the test flow completes.

![Message about the successful save]({{site.baseurl}}common/images/mtf_tutorial_success_message.png)
![Message about the successful save]({{site.baseurl}}common/images/ftf/mtf_tutorial_success_message.png)

To cover this, we should create the test assertion ([constraint][]) and add the full class name to a variation of the data set.

Expand Down Expand Up @@ -964,7 +964,7 @@ class AssertCustomerSuccessSaveMessage extends AbstractConstraint

By making a simple change, we can create a constraint class that is needed `\Magento\Search\Test\Constraint\AssertSynonymSuccessSaveMessage`

![A constraint location]({{site.baseurl}}common/images/mtf_tutorial_constraint_dir.png)
![A constraint location]({{site.baseurl}}common/images/ftf/mtf_tutorial_constraint_dir.png)

with the following code:

Expand Down
2 changes: 1 addition & 1 deletion guides/v2.0/mtf/features/modularity.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ github_link: mtf/features/modularity.md

The Functional Testing Framework (FTF) enables you to follow the principle of modularity as Magento does. Functional tests for each module are collected in separate directory with the name of corresponding module.

![Functional tests modules image]({{site.baseurl}}common/images/mtf_modularity_dirs.png)
![Functional tests modules image]({{site.baseurl}}common/images/ftf/mtf_modularity_dirs.png)

Modularity gives the following advantages:

Expand Down
6 changes: 3 additions & 3 deletions guides/v2.0/mtf/features/parallel_execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ A general mechanism is:

Comparatively to the common testing flow

![Common flow image]({{site.baseurl}}common/images/mtf_features_common_dia.png)
![Common flow image]({{site.baseurl}}common/images/ftf/mtf_features_common_dia.png)

you can run a test suite using parallel execution flow with one Magento instance

![Parallel execution flow with one instance image]({{site.baseurl}}common/images/mtf_features_parallel_one_dia.png)
![Parallel execution flow with one instance image]({{site.baseurl}}common/images/ftf/mtf_features_parallel_one_dia.png)

or run a test suite using parallel execution flow with multiple Magento instances.

![Common flow and Parallel execution flow image]({{site.baseurl}}common/images/mtf_features_parallel_multi_dia.png)
![Common flow and Parallel execution flow image]({{site.baseurl}}common/images/ftf/mtf_features_parallel_multi_dia.png)

## Set up parallel execution

Expand Down
2 changes: 1 addition & 1 deletion guides/v2.0/mtf/features/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The Functional Testing Framework (FTF) provides a reporting tool, which logs fai

The following image demonstrates example of a general flow.

<a href="{{site.baseurl}}common/images/ftf-reporting-diagram.png" alt="Reporting mechanism diagram" target="_blank"><img src="{{site.baseurl}}common/images/ftf-reporting-diagram.png" /></a>
<a href="{{site.baseurl}}common/images/ftf/ftf-reporting-diagram.png" alt="Reporting mechanism diagram" target="_blank"><img src="{{site.baseurl}}common/images/ftf/ftf-reporting-diagram.png" /></a>

The event manager is a core component which:

Expand Down
22 changes: 11 additions & 11 deletions guides/v2.0/mtf/mtf_entities/mtf_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ To enable this feature follow:
1. Set **Add Block Name to Hints** to **Yes**
1. **Save Config**

![]({{site.baseurl}}common/images/mtf_bloch_namepath_ui_onoff.png)
![]({{site.baseurl}}common/images/ftf/mtf_bloch_namepath_ui_onoff.png)

Now each UI block has hint about its name and path. Also, you can see the path to a PHTML template, where you can find a path to the Magento block, if you cannot find it in the hint.

<a href="{{ site.baseurl }}common/images/mtf_block_name_path_in_ui.png"><img src="{{ site.baseurl }}common/images/mtf_block_name_path_in_ui.png" /></a>
<a href="{{ site.baseurl }}common/images/ftf/mtf_block_name_path_in_ui.png"><img src="{{ site.baseurl }}common/images/ftf/mtf_block_name_path_in_ui.png" /></a>

<div class="bs-callout bs-callout-tip">
  <p>If the name and path cover partially each other, hover the mouse pointer over the name or the path (whatever you need) with mouse pointer to see the full phrase.</p>
Expand Down Expand Up @@ -111,7 +111,7 @@ protected function _toHtml()

Now you can inspect any element in a browser, and find which block contains it.

<a href="{{ site.baseurl }}common/images/mtf_block_name_path_in_code.png"><img src="{{ site.baseurl }}common/images/mtf_block_name_path_in_code.png" /></a>
<a href="{{ site.baseurl }}common/images/ftf/mtf_block_name_path_in_code.png"><img src="{{ site.baseurl }}common/images/ftf/mtf_block_name_path_in_code.png" /></a>

### Block class {#mtf_block_class}

Expand Down Expand Up @@ -202,11 +202,11 @@ A mapping file is an XML file which has the same name and path as the block does

Let's see the [Customer Login]({{site.mage2000url}}app/code/Magento/Customer/Block/Form/Login.php) block. The block has two input fields: `email` and `password`.

<a href="{{site.baseurl}}common/images/mtf_block_login_ui.png"><img src="{{site.baseurl}}common/images/mtf_block_login_ui.png" /></a>
<a href="{{site.baseurl}}common/images/ftf/mtf_block_login_ui.png"><img src="{{site.baseurl}}common/images/ftf/mtf_block_login_ui.png" /></a>

The mapping file for the block is stored in `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/Login.xml`, along with the block.

<img src="{{site.baseurl}}common/images/mtf_block_login_dir.png" />
<img src="{{site.baseurl}}common/images/ftf/mtf_block_login_dir.png" />

The mapping file defines the fields from the form.

Expand Down Expand Up @@ -247,7 +247,7 @@ All nodes are optional. Default value is assigned automatically if a node (`sele

The general structure of the form mapping file:

<img src="{{site.baseurl}}common/images/mtf_block_map_form_xml.png" />
<img src="{{site.baseurl}}common/images/ftf/mtf_block_map_form_xml.png" />

### Form tab mapping {#mtf_block_map_form_tab}

Expand All @@ -256,11 +256,11 @@ To get the block class with form tab mapping, extend your class from <a href="{{

For example, let's see tabs for the Magento Widget: **Settings**, **Storefront properties**, **Frontend App Options**, **Layout Updates** .

<img src="{{site.baseurl}}common/images/mtf_block_tabs_ui.png" />
<img src="{{site.baseurl}}common/images/ftf/mtf_block_tabs_ui.png" />

Four tabs are mapped in the `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml` file, which is stored along with the block class.

<img src="{{site.baseurl}}common/images/mtf_block_tab_struc.png" />
<img src="{{site.baseurl}}common/images/ftf/mtf_block_tab_struc.png" />

The file contains the following mapping:

Expand Down Expand Up @@ -344,11 +344,11 @@ In the mapping file:

On the UI:

![Example of `composite` field]({{site.baseurl}}common/images/mtf_block_tab_composite_ui.png)
![Example of `composite` field]({{site.baseurl}}common/images/ftf/mtf_block_tab_composite_ui.png)

The general structure of the form tab mapping file:

<img src="{{site.baseurl}}common/images/mtf_block_map_form_tab_xml.png" />
<img src="{{site.baseurl}}common/images/ftf/mtf_block_map_form_tab_xml.png" />

### Merging form tab mapping files {#mtf_block_map_form_tab_merge}

Expand All @@ -358,7 +358,7 @@ The form tab mapping files that have the same name and path inside different mod

Form tab mapping files in the following example will be merged automatically:

<img src="{{site.baseurl}}common/images/mtf_block_formtab_merge.png" />
<img src="{{site.baseurl}}common/images/ftf/mtf_block_formtab_merge.png" />

## Renders {#mtf_block_render}

Expand Down
10 changes: 5 additions & 5 deletions guides/v2.0/mtf/mtf_entities/mtf_constraint.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ github_link: mtf/mtf_entities/mtf_constraint.md
The Functional Testing Framework (FTF) constraint performs assertions after a test flow. A test flow is a set of test steps without assertions.
Each constraint name must be globally unique in Magento application and must be placed in the module to which it belongs. Constraints run automatically after test flow has finished.

![Constraints and test flow]({{site.baseurl}}common/images/mtf_constraint_flow.png)
![Constraints and test flow]({{site.baseurl}}common/images/ftf/mtf_constraint_flow.png)

## Constraint structure {#mtf_constraint_structure}

### `Constraint` directory {#mtf_constraint_directory}

A module in functional tests (`<magento2_root_dir>/dev/tests/app/Magento/`) stores constraints in the `Constraint` directory. The following image shows the `Constraint` directory of the Magento_Widget module.

![]({{site.baseurl}}common/images/mtf_constraint_dir.png)
![]({{site.baseurl}}common/images/ftf/mtf_constraint_dir.png)

### Constraint class {#mtf_constraint_assert}

Expand Down Expand Up @@ -56,15 +56,15 @@ An object that is not defined in the data set or isn't returned from the test ca

Let's see the following images for the `CreateSimpleProductEntityTest` test and the `AssertProductPricesOnCategoryPage` constraint. Data set from the diagrams contains three variables with data: `product`, `category` and `price`.

<img src="{{ site.baseurl }}common/images/mtf_constraint_arguments_green.png" width="800" />
<img src="{{ site.baseurl }}common/images/ftf/mtf_constraint_arguments_green.png" width="800" />

<span style="color: #21610B; font-weight:bold">Green arrows</span> show that `product` value is transferred to the test and the constraint.

<img src="{{ site.baseurl }}common/images/mtf_constraint_arguments_orange.png" width="800" />
<img src="{{ site.baseurl }}common/images/ftf/mtf_constraint_arguments_orange.png" width="800" />

<span style="color: #FF8000; font-weight:bold">Orange arrows</span> show that `category` variable is transferred to the test directly, overwritten by `testCreate()` method and only then transferred to constraint.

<img src="{{ site.baseurl }}common/images/mtf_constraint_arguments_blue.png" width="800"/>
<img src="{{ site.baseurl }}common/images/ftf/mtf_constraint_arguments_blue.png" width="800"/>

<span style="color: #0000FF; font-weight:bold">Blue arrow</span> shows that `price` value is transferred to the constraint only.

Expand Down
2 changes: 1 addition & 1 deletion guides/v2.0/mtf/mtf_entities/mtf_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ A data set should be placed in the same directory with a corresponding test case

Let's see an example for `CreateSimpleProductEntityTest`. A data set and its corresponding [test case][] must be placed in the `<magento2_root_dir>/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product` directory.

<a href="{{ site.baseurl }}common/images/mtf_dataset_dir.png"><img src="{{ site.baseurl }}common/images/mtf_dataset_dir.png"/></a>
<a href="{{ site.baseurl }}common/images/ftf/mtf_dataset_dir.png"><img src="{{ site.baseurl }}common/images/ftf/mtf_dataset_dir.png"/></a>

The `CreateSimpleProductEntityTest.xml` data set contains:

Expand Down
Loading

0 comments on commit 888ee67

Please sign in to comment.