Skip to content

Commit c9ddf79

Browse files
committed
Fix pointers
1 parent 8801962 commit c9ddf79

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

docs/test-prep.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ For our example, we have a test that creates a simple product. Note the hardcode
8383
<waitForPageLoad stepKey="waitForNewProductPageOpened" />
8484

8585
<!-- Fill field "Name" with "Simple Product %unique_value%" -->
86-
---> <fillField selector="input[name='product[name]']" userInput="Simple Product 12412431" stepKey="fillNameField" />
86+
-----><fillField selector="input[name='product[name]']" userInput="Simple Product 12412431" stepKey="fillNameField" />
8787

8888
<!-- Fill field "SKU" with "simple_product_%unique_value%" -->
8989
<fillField selector="input[name='product[sku]']" userInput="simple-product-12412431" stepKey="fillSKUField" />
@@ -149,10 +149,7 @@ In this example `AdminProductFormSection` refers to the `<section>` in the XML f
149149
<waitForPageLoad stepKey="waitForNewProductPageOpened" />
150150

151151
<!-- Fill field "Name" with "Simple Product %unique_value%" -->
152-
```diff
153-
-<fillField selector="input[name='product[name]']" userInput="Simple Product 12412431" stepKey="fillNameField" />
154-
+<fillField selector="{{AdminProductFormSection.productName}}" userInput="Simple Product 12412431" stepKey="fillNameField" />
155-
```
152+
-----><fillField selector="{{AdminProductFormSection.productName}}" userInput="Simple Product 12412431" stepKey="fillNameField" />
156153
<!-- Fill field "SKU" with "simple_product_%unique_value%" -->
157154
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="simple-product-12412431" stepKey="fillSKUField" />
158155

@@ -190,7 +187,7 @@ Here we are interested in `<section name="AdminProductFormSection">`, where we a
190187
<element name="attributeSetFilter" type="input" selector="div[data-index='attribute_set_id'] .admin__field-control input" timeout="30"/>
191188
<element name="attributeSetFilterResult" type="input" selector="div[data-index='attribute_set_id'] .action-menu-item._last" timeout="30"/>
192189
<element name="attributeSetFilterResultByName" type="text" selector="//label/span[text() = '{{var}}']" timeout="30" parameterized="true"/>
193-
---> <element name="productName" type="input" selector="input[name='product[name]']"/>
190+
-----><element name="productName" type="input" selector="input[name='product[name]']"/>
194191
<element name="RequiredNameIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=name]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
195192
<element name="RequiredSkuIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=sku]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
196193
<element name="productSku" type="input" selector="input[name='product[sku]']"/>
@@ -250,8 +247,7 @@ We replace the hardcoded values with variables and the MFTF will do the variable
250247
<waitForPageLoad stepKey="waitForNewProductPageOpened" />
251248

252249
<!-- Fill field "Name" with "Simple Product %unique_value%" -->
253-
-<fillField selector="{{AdminProductFormSection.productName}}" userInput="Simple Product 12412431" stepKey="fillNameField" />
254-
+<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillNameField" />
250+
----><fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillNameField" />
255251

256252
<!-- Fill field "SKU" with "simple_product_%unique_value%" -->
257253
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="fillSKUField" />
@@ -331,8 +327,7 @@ To create an action group, take the steps and put them within an `<actionGroup>`
331327
<arguments>
332328
<argument name="product" defaultValue="_defaultProduct"/>
333329
</arguments>
334-
-<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillNameField" />
335-
+<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
330+
-----><fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
336331
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
337332
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
338333
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/>
@@ -383,8 +378,8 @@ Now we can reference this action group within our test (and any other test).
383378

384379
<!-- Click "Add Product" button -->
385380
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage" />
386-
-<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
387-
+<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
381+
-----><fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
382+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
388383
<argument name="product" value="_defaultProduct" />
389384
</actionGroup>
390385

0 commit comments

Comments
 (0)