
LibTidy.cpp: System::String^ _clrcall LibTidy::Test(System::String^ input)Ĭonst size_t newsizew = (cstring. System::String^ _clrcall Test(System::String^ input) The sample program they've posted did a good job for me, with a little adapting. But libtidy can be written into a C++ dll to be called from managed code. The best HTML5 validator, the nu checker, is in Java and hard to interface with from. Validator subject = new Validator(BrokenHtml) Īssert.IsTrue(().Contains("ERROR")) Public void CanInvalidHtmlStringReturnErrors() Validator subject = new Validator(ValidHtml) Īssert.IsTrue( = 0) Public void CanValidHtmlStringReturnNoErrors() Private const string BrokenHtml = "Hello World" Usage/Testing private const string ValidHtml = "Hello World" Preferably a DotNet assembly that I can call.Īfter spending an entire weekend on this problem, the only solution I can see is a commercial library called CSE HTML Validator I thought I'd see if anyone knows of another way before I go down this track. The closest thing that I see is this, using it would require writing temp files and parsing reports.
Totalvalidator full#
I would like to avoid installing a full W3C server locally. This Test version performs accessibility validation against the WCAG 2.1 and US Section 508 guidelines and HTML validation against the published W3C specifications. They also don't appear to support getting SOAP responses back. The W3C site exposes a SOAP api, however I don't want to hit their site as part of the CI process. My problem is that I can't find anything that will do this locally and is easy to integrate into my UI tests. As a bonus, I would also like to pick up on a 508 issues. I want to pick up on the same sorts of things that picks up on. PageSource attribute, and it makes sense (to me) to run that source through a HTML5 validator as another part each UI test. These tests ( as well as unit tests ) are run by our CI server. We have extensive UI tests which use Selenium Web Driver. We are currently building a green-fields app in C#.
