[widgets] Test Suite for Packaging and Configuration

I'm wondering, for the sake of testing, should we mandate the that in
order to run the test suite a user agent support the widgets A&E
specification? This would kinda sucks because we say in the spec that
a UA is not required to support of the Widgets A&E spec. However,
without the A&E spec, testing becomes a bit more difficult.

For example, consider the following testable assertion:

 "If this is not the first name element encountered by the user agent,
then the user agent must skip this element."

The test would be:

<!-- To pass, the second name element must be skipped by the user agent -->
<widget xmlns="http://www.w3.org/ns/widgets">
 <name>PASS</name>
 <name>FAIL</name>
</widget>

However, there is no way to visualize this test without using the
widgets A&E spec:
<!doctype html>
<html>
<body style="background-color:red">
<script>
  body = document.getElementsByTagName("body")[0];
  if(widget.name == "PASS"){
     body.setAttribute("style","background-color:green");
     body.innerHTML = "<h1>PASS </h1>";
  }else{
     body.innerHTML = "<h1>FAIL</h1>";
  }
</script>

Actually, there are some tests that cannot even be visualized with the
A&E spec... e.g., testing the <license> element, whose content is not
exposed via any attribute of the widget object. The only way for a UA
to verify if it passed, is to dump its internal representation of the
Configuration Defaults table.

Other things that suck about adding support for A&E is that tests are
no longer atomic. To actually get widget.name, about 100 other
preconditions need to have occurred.

Thoughts? Or have I answered my own question (don't test with the A&E
spec! :) )?

Kind regards,
Marcos

--
Marcos Caceres
http://datadriven.com.au

Received on Friday, 7 August 2009 16:34:34 UTC