Skip to content

Commit

Permalink
TestResults 2nd level data load and view
Browse files Browse the repository at this point in the history
  • Loading branch information
evlach committed Jun 4, 2014
1 parent 0995a1d commit fcbd1c1
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 122 deletions.
9 changes: 6 additions & 3 deletions js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ window.accessdb.appRouter.on('route:results', function () {
});
window.accessdb.appRouter.on('route:results-technique', function (id) {
window.accessdb.appRouter.loadPage("results-technique");
//accessdb.TreeHelper.loadTrees();
//accessdb.TestResultsDataOverview = new accessdb.Views.TestResultsDataOverview();
//accessdb.TestResultsDataOverview.reload();
$(".results-technique-id").html(id);
accessdb.TreeHelper.loadTrees();
accessdb.TestResultsFullViewByTechniqueRelatedTests = new accessdb.Views.TestResultsFullViewByTechniqueRelatedTests();
accessdb.TestResultsFullViewByTechniqueRelatedTests.reload({techNameId : id});
accessdb.TestResultsFullViewByTechnique = new accessdb.Views.TestResultsFullViewByTechnique();
accessdb.TestResultsFullViewByTechnique.reload({techNameId : id});
});
window.accessdb.appRouter.on('route:results-test', function (id) {
window.accessdb.appRouter.loadPage("results-test");
Expand Down
58 changes: 53 additions & 5 deletions js/testresult-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ accessdb.Views.TestResultsDataTestCaseOverview = function (){
};

accessdb.Views.TestResultsFullViewByTechnique = function (){
this.$el = $("#TestResultsFullViewByTechnique");
this.$el = $("#TestResultsFullViewByTechniqueDiv");
this.results = null;
this.render = function(){
if(this.results){

var template = _.template( $("#TestResultsFullViewByTechnique_template").html(), {results: this.results} );
this.$el.html( template );
this.$el.find('.chart').peity("pie", {
fill: ["green", "#f98"]
});
}
};
this.fetch = function (params, callback){
Expand All @@ -128,15 +132,59 @@ accessdb.Views.TestResultsFullViewByTechnique = function (){
});
}
};
this.reload = function(){
var pageId = accessdb.config.PAGE_ID_PREFIX+"results";
this.reload = function(params){
var pageId = accessdb.config.PAGE_ID_PREFIX+"results-technique";
if(accessdb.appRouter.page === pageId){
var self = this;
var params = {filter: accessdb.filters[pageId]};
params = params || {};
params.filter = accessdb.filters[pageId];
this.fetch(params, function(error, data){
if(!error)
self.render();
});
}
}
};
accessdb.Views.TestResultsFullViewByTechniqueRelatedTests = function (){
this.$el = $("#RelatedTestCasesDiv");
this.results = null;
this.render = function(){
if(this.results){
var template = _.template( $("#RelatedTestCases_template").html(), {results: this.results} );
this.$el.html( template );
this.$el.find('.chart').peity("pie", {
fill: ["green", "#f98"]
});
}
};
this.fetch = function (params, callback){
var self = this;
if (!params || params.length<2 ){
console.warn("No filter defined!");
callback("params not defined!", null);
}
else {
accessdb.API.TESTRESULT.findByFilterTestResultTestOveview(params.filter, params.techNameId, function (error, data, status) {
if(!error){
console.log(data);
self.results = data;
callback(null, self.results);
}
else
callback(error);
});
}
};
this.reload = function(params){
var pageId = accessdb.config.PAGE_ID_PREFIX+"results-technique";
if(accessdb.appRouter.page === pageId){
var self = this;
params = params || {};
params.filter = accessdb.filters[pageId];
this.fetch(params, function(error, data){
if(!error)
self.render();
});
}
}
};
13 changes: 12 additions & 1 deletion js/tree-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,12 @@ accessdb.TreeHelper = {
},
loadTrees : function(event, callback){
var pageId = accessdb.appRouter.page;
var pagesIds = [accessdb.config.PAGE_ID_PREFIX +"results", accessdb.config.PAGE_ID_PREFIX +"tests-run"];
var pagesIds = [
accessdb.config.PAGE_ID_PREFIX +"results",
accessdb.config.PAGE_ID_PREFIX +"results-technique",
accessdb.config.PAGE_ID_PREFIX +"results-test",
accessdb.config.PAGE_ID_PREFIX +"tests-run"
];
if(!_.contains(pagesIds, pageId)){
if(callback)
callback();
Expand All @@ -325,6 +330,12 @@ accessdb.TreeHelper = {
if(pageId === accessdb.config.PAGE_ID_PREFIX + "results"){
toLoadTreeIds = ["AssistiveTechnology","UAgent","Platform","WCAG","WebTechnology"];
}
else if(pageId === accessdb.config.PAGE_ID_PREFIX + "results-technique"){
toLoadTreeIds = ["AssistiveTechnology", "UAgent","Platform"];
}
else if(pageId === accessdb.config.PAGE_ID_PREFIX + "results-test"){
toLoadTreeIds = ["AssistiveTechnology", "UAgent","Platform"];
}
else if(pageId === accessdb.config.PAGE_ID_PREFIX + "tests-run"){
toLoadTreeIds = ["AssistiveTechnology","WCAG","WebTechnology"];
}
Expand Down
134 changes: 21 additions & 113 deletions pages/results-technique.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,12 @@ <h1 class="page-title">
</nav>
<div class="content">
<div class="grid">
<h2>Details for Technique <span><strong>H4:</strong> Creating a logical tab order through links, form controls, and objects</span></h2>
<h2>Details for Technique <span><strong class="results-technique-id">H4:</strong> Creating a logical tab order through links, form controls, and objects</span></h2>
<div class="with-filter">
<aside class="column-first" aria-label="Filter results">
<div class="column-filters">
<h3>Filter test cases</h3>
<form action="#">
<div class="">
<h4>Conformance Level</h4>
<div>
<div>
<label><input type="radio" data-axsdb-filtertype="wcaglevel" name="conformance" value="AAA"> A &amp; AA &amp; AAA</label>
</div>
<div>
<label><input type="radio" data-axsdb-filtertype="wcaglevel" checked name="conformance" value="AA"> A &amp; AA</label>
</div>
<div>
<label><input type="radio" data-axsdb-filtertype="wcaglevel" name="conformance" value="A"> A</label>
</div>
</div>
</div>
<div class="">
<h4>Success Criteria</h4>
<div class="criteriaTreeDiv" data-axsdb-filtertype="WCAG">
</div>
</div>
<div class="">
<h4>Assistive Technology</h4>
<div class="atTreeDiv" data-axsdb-filtertype="AssistiveTechnology"></div>
Expand All @@ -45,107 +26,34 @@ <h4>Browser</h4>
<h4>Operating System</h4>
<div class="osTreeDiv" data-axsdb-filtertype="Platform"></div>
</div>
<div class="">
<h4>Web Technology</h4>
<div class="webTechTreeDiv" data-axsdb-filtertype="WebTechnology"></div>
</div>


</form>
</div>
</aside>
<div class="column-second">
<table class="result-details">
<caption>In the columns, you can find browser versions.<br>The rows show assistive technologies.</caption>
<thead>
<tr>
<th rowspan="2" colspan="2"> </th>
<th colspan="3" scope="colgroup">Firefox</th>
<th colspan="2" scope="colgroup">Internet Explorer</th>
</tr>
<tr>
<th scope="col" data-accessdbproductver="25" data-accessdbproductname="Firefox"><span class="visuallyhidden">Firefox</span> 25</th>
<th scope="col" data-accessdbproductver="27" data-accessdbproductname="Firefox"><span class="visuallyhidden">Firefox</span> 27</th>
<th scope="col" data-accessdbproductver="30" data-accessdbproductname="Firefox"><span class="visuallyhidden">Firefox</span> 30</th>
<th scope="col" data-accessdbproductver="10" data-accessdbproductname="Internet Explorer"><span class="visuallyhidden">Internet Explorer</span> 10</th>
<th scope="col" data-accessdbproductver="11" data-accessdbproductname="Internet Explorer"><span class="visuallyhidden">Internet Explorer</span> 11</th>
</tr>
</thead>
<tbody>
<tr>
<th data-accessdbproductver="" data-accessdbproductname="" colspan="2" scope="row">None</th>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td><span class="chart">2/2</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">2/2</a></td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
</tr>
<tr>
<th data-accessdbproductver="10" data-accessdbproductname="Cobra">Cobra</th>
<th scope="row"><span class="visuallyhidden">Cobra</span> 10</th>
<td><span class="chart">0/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">0/1</a></td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td><span class="chart">0/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">0/1</a></td>
<td class="untested">Not tested</td>
</tr>
<tr>
<th data-accessdbproductver="15" data-accessdbproductname="Jaws">Jaws</th>
<th scope="row"><span class="visuallyhidden">Jaws</span> 15</th>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td><span class="chart">0/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">0/1</a></td>
<td><span class="chart">1/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">1/1</a></td>
</tr>
<tr>
<th data-accessdbproductver="2013.2" data-accessdbproductname="NVDA">NVDA</th>
<th scope="row"><span class="visuallyhidden">NVDA</span> 2013.2</th>
<td><span class="chart">1/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">1/1</a></td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
</tr>
<tr>
<th data-accessdbproductver="2013.3" data-accessdbproductname="NVDA">NVDA</th>
<th scope="row"><span class="visuallyhidden">NVDA</span> 2013.3</th>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td><span class="chart">1/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">1/1</a></td>

</tr>
<tr>
<th data-accessdbproductver="8.4" data-accessdbproductname="Window-Eyes">Window-Eyes</th>
<th scope="row"><span class="visuallyhidden">Window Eyes</span> 8.4</th>
<td class="untested">Not tested</td>
<td><span class="chart">0/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">0/1</a></td>
<td class="untested">Not tested</td>
<td class="untested">Not tested</td>
<td><span class="chart">0/1</span> <a title="show test results of this combination" href="" class="TestResultFullViewTechniqueAnchor">0/1</a></td>
</tr>
</tbody>
</table>
<h3>Test cases covering this technique:</h3>
<ul id="RelatedTestCases">
<!-- Put data from Template “RelatedTestCases_template” here -->
<li>73: Em and strong elements can be used to stress parts of a text
<a href="h4.html" class="btn btn-small">
<span class="chart" style="display:none"><%= r.noOfPass %>/<%= r.noOfAll %></span>
<%= r.noOfPass %>/<%= r.noOfAll %>
<div id="TestResultsFullViewByTechniqueDiv">

</div>
<div id="RelatedTestCasesDiv">
<ul id="RelatedTestCases">
<!-- Put data from Template “RelatedTestCases_template” here -->
<li>73: Em and strong elements can be used to stress parts of a text
<a href="h4.html" class="btn btn-small">
<span class="chart" style="display:none"><%= r.noOfPass %>/<%= r.noOfAll %></span>
<%= r.noOfPass %>/<%= r.noOfAll %>
<span class="icon-arrow-right2">
<span class="visuallyhidden">Show results</span>
</span>
</a>
</li>
<li>74: sub elements indicate subscript in HTML</li>
<li>75: sup elements indicate superscript in HTML</li>
<li>76: abbr and acronym can identify special text in html</li>
<li>77: b, i and u can identify special text in HTML</li>
<li>78: small identifies special text in HTML</li>
</ul>
</a>
</li>
<li>74: sub elements indicate subscript in HTML</li>
<li>75: sup elements indicate superscript in HTML</li>
<li>76: abbr and acronym can identify special text in html</li>
<li>77: b, i and u can identify special text in HTML</li>
<li>78: small identifies special text in HTML</li>
</ul>
</div>

</div>
</div>
</div>
Expand Down
Loading

0 comments on commit fcbd1c1

Please sign in to comment.