Skip to content

Commit 007c83c

Browse files
committed
Merge branch 'master' into 2.5.0-RC
2 parents 2c4f210 + d9de524 commit 007c83c

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Magento Functional Testing Framework Changelog
3737
### GitHub Issues/Pull requests:
3838
* [#377](https://github.com/magento/magento2-functional-testing-framework/pull/377) -- Non-API operations fixes
3939

40+
2.4.5
41+
-----
42+
### Fixes
43+
* Fixed an issue where `.credentials` was required when using `<createData>` actions with field overrides.
44+
4045
2.4.4
4146
-----
4247
### Fixes

docs/actiongroup-list.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# MFTF action group reference
2+
3+
Action groups are important building blocks for quickly creating tests for the Magento Functional Testing Framework.
4+
This page lists all current action groups so developers can see what is available to them.
5+
6+
{% include mftf/actiongroup_data.md %}

docs/selectors.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Selectors
2+
3+
These guidelines should help you to write high quality selectors.
4+
5+
### Selectors SHOULD be written in CSS instead of XPath whenever possible
6+
7+
CSS is generally easier to read than XPath. For example, `//*[@id="foo"]` in XPath can be expressed as simply as `#foo` in CSS.
8+
See this [XPath Cheatsheet](https://devhints.io/xpath) for more examples.
9+
10+
### XPath selectors SHOULD NOT use `@attribute="foo"`.
11+
12+
This would fail if the attribute was `attribute="foo bar"`.
13+
Instead you SHOULD use `contains(@attribute, "foo")` where `@attribute` is any valid attribute such as `@text` or `@class`.
14+
15+
### CSS and XPath selectors SHOULD be implemented in their most simple form
16+
17+
* <span class="color:green">GOOD:</span> `#foo`
18+
* <span class="color:red">BAD:</span> `button[contains(@id, "foo")]`
19+
20+
### CSS and XPath selectors SHOULD avoid making use of hardcoded indices
21+
22+
Instead you SHOULD parameterize the selector.
23+
24+
* <span class="color:green">GOOD:</span> `.foo:nth-of-type({{index}})`
25+
* <span class="color:red">BAD:</span> `.foo:nth-of-type(1)`
26+
27+
* <span class="color:green">GOOD:</span> `button[contains(@id, "foo")][{{index}}]`
28+
* <span class="color:red">BAD:</span> `button[contains(@id, "foo")][1]`
29+
30+
* <span class="color:green">GOOD:</span> `#actions__{{index}}__aggregator`
31+
* <span class="color:red">BAD:</span> `#actions__1__aggregator`
32+
33+
### CSS and XPath selectors MUST NOT reference the `@data-bind` attribute
34+
35+
The `@data-bind` attribute is used by KnockoutJS, a framework Magento uses to create dynamic Javascript pages. Since this `@data-bind` attribute is tied to a specific framework, it should not be used for selectors. If Magento decides to use a different framework then these `@data-bind` selectors would break.

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/PersistedObjectHandler.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ public function createEntity(
8989
}
9090

9191
foreach ($overrideFields as $index => $field) {
92-
$overrideFields[$index] = CredentialStore::getInstance()->decryptAllSecretsInString($field);
92+
try {
93+
$overrideFields[$index] = CredentialStore::getInstance()->decryptAllSecretsInString($field);
94+
} catch (TestFrameworkException $e) {
95+
//do not rethrow if Credentials are not defined
96+
$overrideFields[$index] = $field;
97+
}
9398
}
9499

95100
$retrievedEntity = DataObjectHandler::getInstance()->getObject($entity);

0 commit comments

Comments
 (0)