-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52bb082
commit e2ca80b
Showing
9 changed files
with
82 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import quickstrom; | ||
|
||
// Only links beginning with a slash and ending | ||
// with .html are followed. We could also use | ||
// an absolute base URL, e.g: | ||
// | ||
// a[href^='https://example.com'] | ||
// | ||
action ~navigate! = | ||
click!(`a[href^='/'][href$='.html']`); | ||
// We're interested in finding links that lead | ||
// to pages rendered with these status codes in | ||
// the heading. | ||
let patterns = [ "404", "500" ]; | ||
// In our system's error pages, status codes | ||
// are rendered in an <h1> element. | ||
let ~heading = | ||
let h1 = first(`h1`); | ||
h1.textContent when h1 != null; | ||
// Check if the heading has any of the error | ||
// codes in the text. | ||
let ~hasErrorCode = | ||
exists p in patterns { | ||
contains(p, heading) | ||
}; | ||
// This is the safety property. At no point, | ||
// following only internal links, should we | ||
// see error codes. | ||
let ~proposition = always (not hasErrorCode); | ||
check proposition with * when loaded?; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters