Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 514d635

Browse files
committed
MAGEDOC-2653: [mftf][reference] Create the Section topic
- technical review edits - internal links' fixes
1 parent 590bb42 commit 514d635

File tree

10 files changed

+34
-48
lines changed

10 files changed

+34
-48
lines changed

guides/v2.3/magento-functional-testing-framework/cest/actions.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
group: mftf
44
title: Actions in the Magento Functional Testing Framework cests
55
version: 2.3
6-
github_link: magento-functional-testing-framework/actions.md
6+
github_link: magento-functional-testing-framework/cest/actions.md
77
---
88

99
This topic contains a reference list of available action type tags available in the MFTF cests.
@@ -23,7 +23,6 @@ All actions contain the following attributes that are useful for merging needs:
2323

2424
## Principles
2525

26-
2726
`mergeKey` value format principles:
2827

2928
* Must be unique within [`<test>`](../cest.html#test)
@@ -35,7 +34,7 @@ All actions contain the following attributes that are useful for merging needs:
3534
* Should be the last attribute of an element
3635

3736
## Example
38-
37+
{%raw%}
3938
The following example contains four actions:
4039

4140
1. [Open the Sign In page for a Customer](#example-step1)
@@ -44,20 +43,16 @@ The following example contains four actions:
4443
4. [Click the Sign In button](#example-step4)
4544

4645
```xml
47-
{%raw%}
4846
<amOnPage mergeKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage}}"/>
4947
<fillField mergeKey="fillEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
5048
<fillField mergeKey="fillPassword" userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
5149
<click mergeKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
52-
{%endraw%}
5350
```
5451

55-
#### 1. Open the Sign In page for a Customer {#example-step2}
52+
#### 1. Open the Sign In page for a Customer {#example-step1}
5653

5754
```xml
58-
{%raw%}
5955
<amOnPage mergeKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
60-
{%endraw%}
6156
```
6257

6358
The Customer Sign In page is declared in the _.../Customer/Page/StorefrontCustomerSignInPage.xml_.
@@ -66,7 +61,6 @@ The given relative URI is declared in `StorefrontCustomerSignInPage.url`
6661
The _StorefrontCustomerSignInPage.xml_ source code:
6762

6863
```xml
69-
7064
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7165
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
7266
<page name="StorefrontCustomerSignInPage" url="/customer/account/login/" module="Magento_Customer">
@@ -82,14 +76,12 @@ Here, `url` contains a pointer to a `url` attribute of the `StorefrontCustomerSi
8276
#### 2. Enter customer's e-mail {#example-step2}
8377

8478
```xml
85-
{%raw%}
8679
<fillField mergeKey="fillEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
87-
{%endraw%}
8880
```
8981

9082
[fillField](#fillfield) fills a text field with the given string.
9183

92-
The customer's e-mail is stored in the `email` parameter of the `customer` entity created somewhere earlier it the test using a tag [createData](#createData).
84+
The customer's e-mail is stored in the `email` parameter of the `customer` entity created somewhere earlier it the test using a tag [createData](#createdata).
9385
`userInput` points to that data.
9486

9587
`selector` points to the field where to enter the data.
@@ -112,9 +104,7 @@ This section is declared in _.../Customer/Section/StorefrontCustomerSignInFormSe
112104
#### 3. Enter customer's password {#example-step3}
113105

114106
```xml
115-
{%raw%}
116107
<fillField mergeKey="fillPassword" userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
117-
{%endraw%}
118108
```
119109

120110
The action here is very similar to the action in a previous step.
@@ -124,14 +114,12 @@ The only difference is that different data assigned to the attributes which set
124114
#### 4. Click the Sign In button {#example-step4}
125115

126116
```xml
127-
{%raw%}
128117
<click mergeKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
129-
{%endraw%}
130118
```
131119

132120
Here, [click](#click) performs a click on a button that can be found by selector that is stored in the `signInAccountButton` of the `StorefrontCustomerSignInFormSection`.
133121
See the _StorefrontCustomerSignInPage.xml_ code in [step 2](#section-code)
134-
122+
{%endraw%}
135123
## Available actions
136124

137125
The following list contains reference documentation about all action elements available in the MFTF.

guides/v2.3/magento-functional-testing-framework/cest/annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
group: mftf
44
title: Annotations in the Magento Functional Testing Framework cests
55
version: 2.3
6-
github_link: magento-functional-testing-framework/annotations.md
6+
github_link: magento-functional-testing-framework/cest/annotations.md
77
---
88

99
This topic contains a reference list of available annotations in the MFTF cests.

guides/v2.3/magento-functional-testing-framework/commands/codeception.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Use custom path for config
373373
[env]: http://codeception.com/docs/07-AdvancedUsage#Environments
374374
[examples]: http://codeception.com/docs/reference/Commands#Run
375375

376-
[--env]: #env
376+
[--env]: #--env
377377
[robo]: robo.html
378378

379379
<!-- Abbreviations -->

guides/v2.3/magento-functional-testing-framework/commands/robo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ The following list contains commands and options available in __Robo 1.1.3__.
167167

168168
#### build
169169

170-
[`build:project`](#build:project) |Clone the Example configuration files Build the Codeception project
170+
[`build:project`](#buildproject) |Clone the Example configuration files Build the Codeception project
171171

172172
#### clone
173173

@@ -179,7 +179,7 @@ The following list contains commands and options available in __Robo 1.1.3__.
179179

180180
#### self
181181

182-
[`self:update`](#self:update) or `update` |Updates the `robo.phar` to the latest version. Only works when running the `phar` version of Robo.
182+
[`self:update`](#selfupdate) or `update` |Updates the `robo.phar` to the latest version. Only works when running the `phar` version of Robo.
183183

184184
***
185185
***

guides/v2.3/magento-functional-testing-framework/contribution-guidelines.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ To fork a repository on Github, do the following:
5050
3. Click **Fork** at the top right:
5151
4. Clone the repo into your development environment and start playing.
5252

53+
{%collapsible Show how fork the repo%}
5354
![MFTF forking](./img/mftf-fork.gif)
55+
{%endcollapsible%}
5456

5557
### Update the fork with the latest changes
5658

guides/v2.3/magento-functional-testing-framework/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
group: mftf
44
title: Getting started with the Magento Functional Testing Framework
55
version: 2.3
6-
github_link: magento-functional-testing-framework/running-tests.md
6+
github_link: magento-functional-testing-framework/getting-started.md
77
---
88

99
<div class="bs-callout bs-callout-info" markdown="1">
@@ -219,7 +219,7 @@ $ vendor/bin/robo allure2:report
219219
<!-- LINKS -->
220220

221221
[`codecept`]: commands/codeception.html
222-
[`robo]: commands/robo.html
222+
[`robo`]: commands/robo.html
223223
[allure commands]: commands/robo.html#allure-robo-commands
224224

225225
[git]: https://git-scm.com/downloads

guides/v2.3/magento-functional-testing-framework/page.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ layout: default
33
group: mftf
44
title: Page structure in the Magento Functional Testing Framework
55
version: 2.3
6-
github_link: magento-functional-testing-framework/page/structure.md
6+
github_link: magento-functional-testing-framework/page/structure.m
77
---
88

9-
{%raw%}
10-
119
## Overview
1210

1311
The MFTF employs a modified concept of [PageObjects].
@@ -18,10 +16,10 @@ In this way, you reuse sections and maintain a reusable single source of truth t
1816
Avoiding hardcoded location selectors from tests increases the maintainability and readability of tests, and test execution output/logging.
1917

2018
Two types of pages are available:
21-
19+
{%raw%}
2220
* page with `url` declared as a constant string or [explicit page]. It is called in a test in a format like `{{NameOfPage.url}}` , where `NameOfPage` is a value of `name` in corresponding page declaration _*.xml_ file.
2321
* page with `url` declared as a string with one or more variables or [parameterized page]. It is called in a test using a format like `{{NameOfPage.url(var1, var2, ...)}}`, where `var1, var2, ...` are parameters that will be substituted in `url` of the corresponding `<page>` declaration.
24-
22+
{%endraw%}
2523
The following diagram demonstrates XML structure of a page in the MFTF:
2624

2725
{% include_relative img/page-dia.svg %}
@@ -84,19 +82,16 @@ The `AdminCategoryPage` declares four [sections][section]:
8482
* `AdminCategorySEOSection` that is located in _Catalog/Section/AdminCategorySEOSection.xml_
8583

8684
Example of a call in test:
87-
85+
{%raw%}
8886
```xml
89-
9087
<amOnPage url="{{AdminCategoryPage.url}}" mergeKey="navigateToAdminCategory"/>
91-
9288
```
9389

9490
### Parameterized page
9591

9692
_Catalog/Page/StorefrontCategoryPage.xml_ is provided as an example::
9793

98-
```xml
99-
94+
```xml
10095
<?xml version="1.0" encoding="UTF-8"?>
10196

10297
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -105,7 +100,6 @@ _Catalog/Page/StorefrontCategoryPage.xml_ is provided as an example::
105100
<section name="StorefrontCategoryMainSection"/>
106101
</page>
107102
</config>
108-
109103
```
110104

111105
This example shows page with name `StorefrontCategoryPage`.
@@ -114,9 +108,7 @@ It will be merged with other `StorefrontCategoryPage` pages from other modules.
114108
Example of a call in test:
115109

116110
```xml
117-
118111
<amOnPage url="{{StorefrontCategoryPage.url($$createPreReqCategory.name$$)}}" mergeKey="navigateToCategoryPage"/>
119-
120112
```
121113

122114
The `StorefrontCategoryPage` page is declared as parameterized, where `url` contains a `{{var1}}` parameter.
@@ -162,6 +154,6 @@ remove|boolean|optional|Default value: `"false"`. Set to `"true"` to remove this
162154
[PageObjects]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects
163155
[test]: cest.html
164156
[createData]: cest/actions.html#createdata
165-
157+
[section]: section.html
166158
[explicit page]: #explicit-page
167159
[parameterized page]: #parameterized-page

guides/v2.3/magento-functional-testing-framework/section.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
layout: default
33
group: mftf
44
title: Section structure in the Magento Functional Testing Framework
5+
version: 2.3
56
github_link: magento-functional-testing-framework/section/structure.md
67
---
78

8-
{%raw%}
9-
109
## Overview
1110

11+
{%raw%}
1212
A section is a reusable part of a [page].
1313
It is the standard file for defining UI elements on a page used under test.
1414

@@ -18,7 +18,7 @@ You are able to define:
1818
Example: `selector="#add_root_category_button"`
1919
- parameterized element that contains substitutable values in selector.
2020
Example: `selector="#element .{{var1}} .{{var2}}"`.
21-
21+
{% endraw %}
2222
### Substitutable values
2323

2424
Sustainable values in the test can be of the following formats:
@@ -31,6 +31,7 @@ Sustainable values in the test can be of the following formats:
3131

3232
The following diagram demonstrates XML structure of a section in the MFTF:
3333

34+
3435
{%include_relative img/section-dia.svg%}
3536

3637
## Format
@@ -81,12 +82,11 @@ The section declares two buttons:
8182
* `AddSubcategoryButton` is a button with a locator `#add_subcategory_button` on the parent web page.
8283

8384
Example of a call in test:
84-
85+
{%raw%}
8586
```xml
8687
<!-- Click on the button with locator "#add_subcategory_button" on the web page-->
8788
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" mergeKey="clickOnAddSubCategory"/>
8889
```
89-
9090
## Available elements
9191

9292
### section {#section-ref}
@@ -118,4 +118,8 @@ remove|boolean|optional|Default: `false`. Set to `true` to remove this element d
118118
[action]: cest/actions.html
119119
[page]: page.html
120120
[CSS]: https://www.w3schools.com/cssref/css_selectors.asp
121-
[XPath]: https://www.w3schools.com/xml/xpath_nodes.asp
121+
[XPath]: https://www.w3schools.com/xml/xpath_nodes.asp
122+
[cest]: cest.html
123+
[test]: cest.html#test
124+
[createData]: cest/actions.html#createdata
125+
[before]: cest.html#before

guides/v2.3/magento-functional-testing-framework/section/parameterized-selectors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
layout: default
33
group: mftf
44
title: Create and use parameterized selectors in the Magento Functional Testing Framework
5-
github_link: magento-functional-testing-framework/section/structure/parameterized-selectors.md
5+
version: 2.3
6+
github_link: magento-functional-testing-framework/section/parameterized-selectors.md
67
---
78

89
{%raw%}
@@ -81,16 +82,15 @@ Add the 2nd/3rd parameters that you'd like to pass to the selector separated by
8182

8283
Here,
8384

84-
* `_defaultCategory.is_active` is a reference to `<data key="is_active">` in `<entity name="_defaultCategory" ... ></entity>` in _Data_
85+
* `_defaultCategory.is_active` is a reference to `<data key="is_active">` in `<entity name="_defaultCategory" ... ></entity>` in the corresponding _.../Data/*.xml_
8586
* `stringLiteral` is a literal
86-
* `$createDataKey.id$` is a reference to persisted data created in the `SampleTest` using action with `mergeKey="createDataKey"`
87+
* `$createDataKey.id$` is a reference to persisted data created in the `SampleCest1` within action with `mergeKey="createDataKey"`
8788

8889
{%endraw%}
8990

9091

9192
<!-- LINK DEFINITIONS -->
9293

93-
9494
<!-- Internal -->
9595

9696
[test]: ../cest.html#test

guides/v2.3/magento-functional-testing-framework/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
group: mftf
44
title: Troubleshooting in the Magento Functional Testing Framework
55
version: 2.3
6-
github_link: magento-functional-testing-framework/commands/troubleshooting.md
6+
github_link: magento-functional-testing-framework/troubleshooting.md
77
---
88

99
## WebDriver issues

0 commit comments

Comments
 (0)