Web Validate Action- A GitHub Action for Invoking Web Validate
Run a sample validation test against microsoft.com
- In your repository, create a TestFiles folder in the root of the repository.
- Place the msft.json file in ./TestFiles.
- Create a new workflow file and inlcude the following:
- name: Web Validate
uses: hattan/webvalidate-action@v1.0.0
with:
server: 'https://www.microsoft.com'
filename: 'msft.json'Note: currently the json files need to be in a TestFiles folder!
-
server
- base Url (i.e.
https://www.microsoft.com) - required
- base Url (i.e.
-
filename
- a json test file
- default baseline.json
- default location ./TestFiles/
(WebV supports multiple file inputs, that feature will be added soon to webvalidate-action)
The msft.json file contains sample validation tests that will will successfully run against the microsoft.com endpoint (assuming content hasn't changed)
- note that http status codes are not specified when 200 is expected
- note that ContentType is not specified when the default of application/json is expected
- Note that redirects are not followed
{
"Url":"/",
"Validation":
{
"Code":302
}
}
{
"Url":"/en-us",
"Validation":
{"
ContentType":"text/html",
"Contains":
[
{ "Value":"<title>Microsoft - Official Home Page</title>" },
{ "Value":"<head data-info=\"{" }
]
}
}
{
"Url": "/favicon.ico",
"Validation":
{
"ContentType":"image/x-icon"
}
}{
"Url": "/robots.txt",
"Validation":
{
"ContentType": "text/plain",
"MinLength": 200,
"Contains":
[
{ "Value": "User-agent: *" },
{ "Value": "Disallow: /en-us/windows/si/matrix.html"}
]
}
}This project welcomes contributions and suggestions.