Skip to content

Fixed broken link and abstracted the others. #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions docs/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This emphasizes the practice for the `stepKey` of `createData` to be descriptive

## Use data returned by test actions

A test can also reference data that was returned as a result of [test actions](./test/actions.md#actions-returning-a-variable), like the action `<grabValueFrom selector="someSelector" stepKey="grabStepKey>`.
A test can also reference data that was returned as a result of [test actions][], like the action `<grabValueFrom selector="someSelector" stepKey="grabStepKey>`.

Further in the test, the data grabbed by the `someSelector` selector can be referenced using the `stepKey` value. In this case, it is `grabStepKey`.

Expand All @@ -89,7 +89,7 @@ The following example shows the usage of `grabValueFrom` in testing, where the r

The data to operate against can be included as literals in a test. Hard-coded data input can be useful in assertions.

See also [Actions](./test/actions.md).
See also [Actions][].

```xml
userInput="We'll email you an order confirmation with details and tracking info."
Expand Down Expand Up @@ -145,7 +145,7 @@ Example (`.../Catalog/Data/CategoryData.xml` file):
</entities>
```

This example declares two `<data>` entities: `_defaultCategory` and `SimpleSubCategory`. They set the data required for [category creation](http://docs.magento.com/m2/ce/user_guide/catalog/category-create.html).
This example declares two `<data>` entities: `_defaultCategory` and `SimpleSubCategory`. They set the data required for [category creation][].

All entities that have the same name will be merged during test generation. Both entities are of the `category` type.

Expand Down Expand Up @@ -187,7 +187,7 @@ Attributes|Type|Use|Description
`name`|string|optional|Name of the `<entity>`.
`type`|string|optional|Node containing the exact name of `<entity>` type. Used later to find specific Persistence Layer Model class. `type` in `<data>` can be whatever the user wants; There are no constraints. It is important when persisting data, depending on the `type` given, as it will try to match a metadata definition with the operation being done. Example: A `myCustomer` entity with `type="customer"`, calling `<createData entity="myCustomer"/>`, will try to find a metadata entry with the following attributes: `<operation dataType="customer" type="create">`.

`<entity>` may contain one or more [`<data>`](#data-tag), [`<var>`](#var-tag), [`<required-entities>`](#requiredentity-tag), or [`<array>`](#array-tag) elements in any sequence.
`<entity>` may contain one or more [`<data>`][], [`<var>`][], [`<required-entities>`][], or [`<array>`][] elements in any sequence.

### data {#data-tag}

Expand Down Expand Up @@ -248,8 +248,19 @@ Attributes|Type|Use|Description
---|---|---|---
`key`|string|required|Key attribute of this entity in which to assign a value.

`<array>` may contain [`<item>`](#item-tag) elements.
`<array>` may contain [`<item>`][] elements.

### item {#item-tag}

`<item>` is an individual piece of data to be passed in as part of the parent `<array>` type.
`<item>` is an individual piece of data to be passed in as part of the parent `<array>` type.

<!-- Link Definitions -->
[`<array>`]: #array-tag
[`<data>`]: #data-tag
[`<item>`]: #item-tag
[`<required-entities>`]: #requiredentity-tag
[`<var>`]: #var-tag
[Actions]: ./test/actions.md
[category creation]: http://docs.magento.com/m2/ce/user_guide/catalog/category-create.html
[Credentials]: ./credentials.md
[test actions]: ./test/actions.md#actions-returning-a-variable