@@ -179,6 +179,18 @@ The following test actions handle data entities using [metadata](../metadata.md)
179
179
180
180
Learn more in [ Handling a REST API response] ( ../metadata.md#rest-response ) .
181
181
182
+ ## Actions specifying HTML values
183
+
184
+ To use HTML in actions you must encode the HTML string using a tool. We recommend [ CyberChef] ( https://gchq.github.io/CyberChef/#recipe=To_HTML_Entity(false,'Numeric%20entities') ) . Using CyberChef or a similar tool is easy. You just need to enter in your HTML string, copy the encoded result, and paste that value into your MFTF test.
185
+
186
+ For example, we want to ensure we don't see this HTML: ` <h1 class="login-header"> `
187
+
188
+ After passing ` <h1 class="login-header"> ` through CyberChef we get ` <h1 class="login-header"> ` which can be used in a test like:
189
+
190
+ ``` xml
191
+ <dontSeeInSource html =" < h1 class=" login-header"> " stepKey =" dontSeeInSource" />
192
+ ```
193
+
182
194
## Reference
183
195
184
196
The following list contains reference documentation about all action elements available in the MFTF.
@@ -868,17 +880,19 @@ See [dontSeeInSource docs on codeception.com](http://codeception.com/docs/module
868
880
869
881
Attribute|Type|Use|Description
870
882
---|---|---|---
871
- ` html ` |string|optional| HTML code to search for within the source code.
883
+ ` html ` |string|optional| HTML code to search for within the source code. The value must be encoded. See example.
872
884
` stepKey ` |string|required| A unique identifier of the action.
873
885
` skipReadiness ` |boolean|optional| A flag to skip the readiness check.
874
886
` before ` |string|optional| ` stepKey ` of action that must be executed next.
875
887
` after ` |string|optional| ` stepKey ` of preceding action.
876
888
877
889
#### Example
878
890
891
+ You must encode the ` html ` using a tool such as [ CyberChef] ( https://gchq.github.io/CyberChef/#recipe=To_HTML_Entity(false,'Numeric%20entities') ) .
892
+
879
893
``` xml
880
- <!-- Verify that the page does not contain the raw source code `<h1>Sample text</h1 >`. -->
881
- <dontSeeInSource userInput = " <h1>Sample text</h1> " stepKey =" dontSeeInSource" />
894
+ <!-- Verify that the page does not contain the raw source code `<h1 class="login-header" >`. -->
895
+ <dontSeeInSource html = " < h1 class =" login-header "> " stepKey =" dontSeeInSource" />
882
896
```
883
897
884
898
### dontSeeInTitle
@@ -1922,17 +1936,19 @@ See [seeInPageSource docs on codeception.com](http://codeception.com/docs/module
1922
1936
1923
1937
Attribute|Type|Use|Description
1924
1938
---|---|---|---
1925
- ` html ` |string|optional| HTML code to be searched for within the document.
1939
+ ` html ` |string|optional| HTML code to be searched for within the document. The value must be encoded. See example.
1926
1940
` stepKey ` |string|required| A unique identifier of the action.
1927
1941
` skipReadiness ` |boolean|optional| A flag to skip the readiness check.
1928
1942
` before ` |string|optional| ` stepKey ` of action that must be executed next.
1929
1943
` after ` |string|optional| ` stepKey ` of preceding action.
1930
1944
1931
1945
#### Example
1932
1946
1947
+ You must encode the ` html ` using a tool such as [ CyberChef] ( https://gchq.github.io/CyberChef/#recipe=To_HTML_Entity(false,'Numeric%20entities') ) .
1948
+
1933
1949
``` xml
1934
- <!-- Verify that the page source contains the string "Sample text" . -->
1935
- <seeInPageSource userInput = " Sample text " stepKey =" seeInPageSource" />
1950
+ <!-- Verify that the page source contains the raw source code `<h1 class="login-header">` . -->
1951
+ <seeInPageSource html = " < h1 class =" login-header "> " stepKey =" seeInPageSource" />
1936
1952
```
1937
1953
1938
1954
### seeInPopup
@@ -1960,17 +1976,19 @@ See [seeInSource docs on codeception.com](http://codeception.com/docs/modules/We
1960
1976
1961
1977
Attribute|Type|Use|Description
1962
1978
---|---|---|---
1963
- ` html ` |string|optional| HTML code to be searched for within the page source.
1979
+ ` html ` |string|optional| HTML code to be searched for within the page source. The value must be encoded. See example.
1964
1980
` stepKey ` |string|required| A unique identifier of the action.
1965
1981
` skipReadiness ` |boolean|optional| A flag to skip the readiness check.
1966
1982
` before ` |string|optional| ` stepKey ` of action that must be executed next.
1967
1983
` after ` |string|optional| ` stepKey ` of preceding action.
1968
1984
1969
1985
#### Example
1970
1986
1987
+ You must encode the ` html ` using a tool such as [ CyberChef] ( https://gchq.github.io/CyberChef/#recipe=To_HTML_Entity(false,'Numeric%20entities') ) .
1988
+
1971
1989
``` xml
1972
- <!-- Verify that the page does contains the raw source code `<h1>Sample text</h1 >`. -->
1973
- <seeInSource userInput = " <h1>Sample text</h1> " stepKey =" seeInSource" />
1990
+ <!-- Verify that the page does contains the raw source code `<h1 class="login-header" >`. -->
1991
+ <seeInSource html = " < h1 class =" login-header "> " stepKey =" seeInSource" />
1974
1992
```
1975
1993
1976
1994
### seeInTitle
0 commit comments