You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The htmlNoneContain function in Yesod's testing library is intended to evaluate the presence or absence of a given string within a specified HTML element. However, it currently includes the values and attributes within that element in its evaluation, which can lead to inaccurate results in certain cases.
For example, if I call htmlNoneContain "td" "S3" on the following HTML snippet:
The test fails, even though the string "S3" does not appear anywhere within the text content of the td element. This is because there is a value attribute within the input element that contains the string "S3".
I wanted to ask if this is the intended behavior of the function, or if there is a way to exclude the contents of attributes and take into account only the text content of the element.
Thank you for your attention to this matter!
The text was updated successfully, but these errors were encountered:
I guess it's intended that these functions check for HTML code, not for text content.
E.g. htmlAnyContain "input" "type=" should also be True because Data.List.isInfixOf is used on the result of htmlQuery which is just type ByteString (i.e. plain HTML code).
Maybe the documentation should be more precise on that.
Using yesod-test-1.6.15
The
htmlNoneContain
function in Yesod's testing library is intended to evaluate the presence or absence of a given string within a specified HTML element. However, it currently includes the values and attributes within that element in its evaluation, which can lead to inaccurate results in certain cases.For example, if I call
htmlNoneContain "td" "S3"
on the following HTML snippet:The test fails, even though the string "S3" does not appear anywhere within the text content of the td element. This is because there is a value attribute within the input element that contains the string "S3".
I wanted to ask if this is the intended behavior of the function, or if there is a way to exclude the contents of attributes and take into account only the text content of the element.
Thank you for your attention to this matter!
The text was updated successfully, but these errors were encountered: