You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brady mentioned the idea of a JSON file for test structure and metadata that would be processed into a test EPUB.
I wonder if XML might be more appropriate, just because almost all EPUB documents are XML-based. I was playing around with a test for a package version attribute less than three.
The idea here is you can specify exactly what you want to test, but some script will fill in all the boilerplate.
<packagexmlns="http://www.idpf.org/2007/opf"version="0"xml:lang="en"unique-identifier="q">
<metadataxmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title>Package Version Zero 001</dc:title>
<metaname="assert"content="This test checks if a reading system will open an EPUB with package version attribute less than 3" />
<metaname="test"content="test passes if this text is visible" />
<metaname="help"href="https://w3c.github.io/epub-specs/epub33/rs/#confreq-rs-backward-epub"/>
&date;&identifier;&language;
</metadata>
&manifest;&spine;
</package>
Here, dc:title is the name of the test. The entities can be expanded to create the needed boilerplate.
meta name="assert" describes the test (this is the syntax used by CSSWG tests).
meta name="test" describes the criteria for the test passing--in this case, just that the EPUB opened. This text would be put in the HTML file for the EPUB.
meta name="help" is the link to the statement in the specification we are testing (this is the syntax used by CSSWG tests).
Similarly, we could use the same idea for HTML-based tests. Create the file we need to test with the relevant metadata, and then script into an EPUB. Example soon.
The text was updated successfully, but these errors were encountered:
Same idea. Script can turn this into an EPUB, as we don't need a customized package file.
<htmlxmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en"><head><title>CMT Images PNG 001</title><metaname="help" href="https://w3c.github.io/epub-specs/epub33/core/#sec-cmt-supported"/>
<metaname="flags" content="image"/>
<metaname="assert" content="This test checks if a reading system supports PNG as a core media type" />
</head><body><imgsrc="support/green-square.png" alt="green square"/>
<p>Test passes if a green square is visible above</p></body></html>
Brady mentioned the idea of a JSON file for test structure and metadata that would be processed into a test EPUB.
I wonder if XML might be more appropriate, just because almost all EPUB documents are XML-based. I was playing around with a test for a package version attribute less than three.
The idea here is you can specify exactly what you want to test, but some script will fill in all the boilerplate.
Here,
dc:title
is the name of the test. The entities can be expanded to create the needed boilerplate.meta name="assert"
describes the test (this is the syntax used by CSSWG tests).meta name="test"
describes the criteria for the test passing--in this case, just that the EPUB opened. This text would be put in the HTML file for the EPUB.meta name="help"
is the link to the statement in the specification we are testing (this is the syntax used by CSSWG tests).Similarly, we could use the same idea for HTML-based tests. Create the file we need to test with the relevant metadata, and then script into an EPUB. Example soon.
The text was updated successfully, but these errors were encountered: