From 938bcfe7b0e3b655596c23ec65db42146f8320b8 Mon Sep 17 00:00:00 2001 From: Jeff Fry Date: Tue, 11 May 2010 00:45:05 +0000 Subject: [PATCH] added waits to get additional asserts to succeed. working on numeric filter git-svn-id: http://google-refine.googlecode.com/svn/trunk@705 7d457c2a-affb-35e4-300a-418c747d4874 --- tests/windmill/js/facets.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/windmill/js/facets.js b/tests/windmill/js/facets.js index 6c0d85e34..80b1ce73a 100644 --- a/tests/windmill/js/facets.js +++ b/tests/windmill/js/facets.js @@ -1,6 +1,11 @@ var test_facets = new function() { - // test opening Food project + // TODO: if I'm in a project, go back to main page (useful when working on this test) + //if () { + //go back + //}; + + // test opening Food project this.test_open_project = [ action("click", { link: "Food" } ), action("waits.forPageLoad", { timeout: "20000" } ), @@ -30,9 +35,9 @@ var test_facets = new function() { // filter down to BEEF this.test_fitler_text_facet = [ - action("click", { jquery: '("a.facet-choice-label")[0]' } )//, - //TODO: gw_row_count fails with 'undefined' - //assert("gw_row_count", "457") + action("click", { jquery: '("a.facet-choice-label")[0]' } ), + action("waits.forElement", { jquery: '(".viewPanel-summary-row-count")[0]' } ), + assert("gw_row_count", "457") ]; // create numeric filter from Water column @@ -45,14 +50,15 @@ var test_facets = new function() { //function () { jum.assertTrue( $(".facet-panel span:contains(\'Water\')").length ); } ]; -/* // filter out BEEF with lower water content this.test_filter_numeric_facet = [ - //TODO: dragDropElem fails with 'undefined'. Maybe because of two params? - //action("dragDropElem", { jquery: '((".slider-widget-draggable.left"))[0]', pixels: '150, 0' } )//, - assert("gw_row_count", "153") + action("gw_wait4ajaxend"), + action("waits.forElement", { jquery: '((".slider-widget-draggable.left"))[0]' } ), + action("dragDropElem", { jquery: '((".slider-widget-draggable.left"))[0]', pixels: '150, 0' } )//, + // TODO: What to wait on, to know we're ready to do the following assert? Talk to dfhuynh. + //assert("gw_row_count", "153") ]; -*/ + };