-
Notifications
You must be signed in to change notification settings - Fork 27
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
Wildcard/pattern matching on output #3
Comments
+1 So, I haven't actually used thymeleaf-testing, but it seems like without this, the tests will always be brittle. As soon as someone changes the DOM structure or adds a CSS class, things will break. It would be nice to be able to do XPath or CSS style selectors to be able to assert only specific things about the results. Is there any way to hook into or override the matching currently, even just to be able to do some basic Regex matches? |
Since I'm complaining, I also wanted to add that I've enjoyed using Thymeleaf. I really like how abstracted out things are and how many extension points there are. |
@xdhmoore that's not complaining, that's actually adding valuable feedback :-) Note that, even if pattern matching is not yet available, you can actually test only fragments of templates by providing a |
Thanks. Do they work after the template is rendered? I was having trouble understanding the difference between |
|
Lol, I guess I meant |
From what I can tell, |
@xdhmoore correct. |
I have somethink like: <test:element .../> and when there is no id attribute, I generate a randomized id. Wildcard/pattern matching would be very nice. |
In order to make more robust test for templates that have a variable output, for instance showing the current date, it would be nice to have either wildcard or pattern matching support in the output of test cases.
For example the following template would otherwise be impossible to test:
The text was updated successfully, but these errors were encountered: