Skip to end of metadata
Go to start of metadata

Checks for missing image files.

Tags
Iteration
Filled
Level
1
Adresses requirement

Description

The (little) problem with checking images is their path: Consider the following HTML fragment (from the file testme.html:

<img src="./images/one-image.jpg">

This image file ("one-image.jpg") has to be located relative to the directory containing the corresponding HTML file.

Therefore the expected absolute path of the "one-image.jpg" has to be determined from the absolute path of the html file under test.

We check for existing files using the usual Java api, but have to do some directory arithmetic to get the absolutePathToImageFile:

  File f = new File( absolutePathToImageFile );
  if(f.exists() && !f.isDirectory())

Architecture Decisions

Name Short Description
To check HTML we parse it into an internal (DOM-like) representation. For this task we use jsoup HTML parser, an open-source parser without external dependencies.
In the current {revision} we won’t check external links. These checks have been postponed to later versions.
The small java-string-similarity library (by Ralph Allen Rice) contains implementations of several similarity-calculation algorithms.