SOURCE CODE: Widget Visual Tests
VIEW EXAMPLE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Widget Visual Tests | JavaScript Examples | UIZE JavaScript Framework</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="keywords" content="widget Uize.Widgets.VisualTests.Widget Uize.Widgets.VisualTests.TestCase.Widget"/>
  <meta name="description" content="See the visual tests for any widget that implements visual tests. Use this page to test a widget while you're developing it."/>
  <link rel="alternate" type="application/rss+xml" title="UIZE JavaScript Framework - Latest News" href="http://www.uize.com/latest-news.rss"/>
  <link rel="stylesheet" href="../css/page.css"/>
  <link rel="stylesheet" href="../css/page.example.css"/>
</head>

<body>

<script type="text/javascript" src="../js/Uize.js"></script>

<h1 class="header">
  <a id="page-homeLink" href="../index.html" title="UIZE JavaScript Framework home"></a>
  <a href="../index.html" class="homeLinkText" title="UIZE JavaScript Framework home">UIZE JavaScript Framework</a>
</h1>

<div class="main">
  <h1 class="document-title">
    <a href="../javascript-examples.html" class="breadcrumb breadcrumbWithArrow">JAVASCRIPT EXAMPLES</a>
    Widget Visual Tests
    <div class="pageActionsShell">
      <div id="page-actions" class="pageActions"><a href="source-code/widget-visual-tests.html" class="buttonLink">SOURCE</a></div>
    </div>
  </h1>

  <!-- explanation copy -->

  <div class="explanation">
    <p>This example lets you select and run any of the visual tests for UIZE widgets that implement visual tests. Simply select a widget from the dropdown menu (only widgets that implement visual tests will be listed in this menu).</p>
  </div>

  <div id="page-widgetViewer"></div>
</div>

<script type="text/javascript">

Uize.require (
  [
    'UizeSite.Page.Example',
    'UizeSite.ModulesTree',
    'Uize.Data.PathsTree',
    'Uize.Url',
    'Uize.Widgets.WidgetViewer.VisualTestsViewer.Widget'
  ],
  function () {
    'use strict';

    /*** create the example page widget ***/
      var _page = window.page = UizeSite.Page.Example ();

    /*** add the visual tests viewer ***/
      var _modulesTree = Uize.copy (UizeSite.ModulesTree ());
      delete _modulesTree.Uize.Build;

      _page.addChild (
        'widgetViewer',
        Uize.Widgets.WidgetViewer.VisualTestsViewer.Widget,
        {
          modules:Uize.Data.PathsTree.toList (_modulesTree),
          value:Uize.Url.fromParams (location.href).widgetClass,
          built:false
        }
      );

    /*** wire up the page widget ***/
      _page.wireUi ();
  }
);

</script>

</body>
</html>