Skip to content
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

validate HTML code for a page #302

Open
violinner opened this issue Feb 5, 2020 · 3 comments
Open

validate HTML code for a page #302

violinner opened this issue Feb 5, 2020 · 3 comments

Comments

@violinner
Copy link

violinner commented Feb 5, 2020

The nu HTML validator has a respectable embedded HTML validation library.

This can be made into an inline Browser Test command:

|validate page source |

or

|validate page source | ignoring_errors_map | 

Or it could be made into a completely different Fixture that 'knows' where savePageSource() saves its files, or even can decompose the link returned by savePageSource() to handle duplicate name resolution.

Thoughts?

@fhoeben
Copy link
Owner

fhoeben commented Feb 5, 2020

save page source returns a reference to a file in the wiki's 'files' section. You can store this in a Slim symbol and pass this symbol to another fixture. I do this extensively to combine browser (or http) test downloads and file fixture (the method SlimFixture.getFilePathFromWikiUrl() does what is needed in the receiving fixture).

I do believe that a HTML validating fixture might be nice. Maybe you could make a PR to add this functionality to HtmlFixture?

I don't believe HTML validation should be a feature of BrowserTest. Browser's don't warn a user if HTML is not valid: BrowserTest is about validating whether a site can accomplish the functional goals. If the HTML is invalid but works in the browser test should be green ;-)

@violinner
Copy link
Author

violinner commented Feb 13, 2020

Side note: Selenium (or the webdriver) injects an invalid tag in the HTML, which is always reported by the validator with a message: "vAttribute \u201Cwebdriver\u201D not allowed on element \u201Chtml\u201D in this context."

This feature will have to come with an easy way to ignore common errors like this, despite errors being defined by their message text, which contains special characters.

@fhoeben
Copy link
Owner

fhoeben commented Feb 15, 2020

I'm curious to find out where that invalid HTML tag comes from? I don't see it on my mac with chrome when I run HsacAcceptanceTests.SlimTests.BrowserTest.PageSourceTest. Do you see it there also, or only with different browser, or more complex page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants