<commit_before>var test_facets = new function() {

    // test opening Food project
    this.test_open_project = [
        action("click",             { link: "Food" } ),
        action("waits.forPageLoad", { timeout: "20000" } ),
        assert("gw_row_count", "7413" )
    ];

    // create text facet from 1st word of Short Description column
    this.test_create_text_facet = [
        action('click',            { jquery: '(".column-header-layout tr:contains(\'Shrt_Desc\') .column-header-menu")[0]' } ),
        action('mouseOver',        { jquery: '("td:contains(\'Facet\')")[0]' } ),
        action("gw_wait4menuitem", {   name: 'Custom Text Facet' } ),
        action("click",            { jquery: '(".menu-item:contains(\'Custom Text Facet\')")[0]' } ),
        action("type",             { jquery: '(".expression-preview-code")[0]', text: "value.split(',')[0]" } ),
        action("waits.forElement", { jquery: '("td:contains(\'value.split\')")[0]' } ),
        action("click",            { jquery: '("button:contains(\'OK\')")[0]' } ),
        action("gw_wait4ajaxend"), //doesn't help yet, since ajax_in_progress isn't yet reliable
        action("waits.forElement", { jquery: '("a.facet-choice-label")[0]' } ),
        assert("gw_expected_top_value","ABALONE")
    ];
        
    // sort the facet by count and test the result
    this.test_sort_text_facet = [
        action("click",            { jquery: '(".ui-button-text:contains(\'count\')")[0]' } ),
        action("waits.forElement", { jquery: '(".ui-state-active .ui-button-text:contains(\'count\')")[0]' } ), //wait til count is the active sort
        assert("gw_expected_top_value","BEEF")
    ];
        
    // 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")
    ];
        
    // create numeric filter from Water column
    this.test_create_numeric_facet = [
        action("click",            { jquery: '(".column-header-layout tr:contains(\'Water\') .column-header-menu")[0]' } ),
        action('mouseOver',        { jquery: '("td:contains(\'Facet\')")[0]' } ),
        action("gw_wait4menuitem", {   name: 'Numeric Facet' } ),
        action("click",            { jquery: '(".menu-item:contains(\'Numeric Facet\')")[0]' } )//,  
        //TODO: (How) can I run a JSUnit assert w/in an object?
        //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")
    ];
*/
        
};


<commit_msg>added waits to get additional asserts to succeed. working on numeric filter<commit_after>var test_facets = new function() {

	// 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" } ),
        assert("gw_row_count", "7413" )
    ];

    // create text facet from 1st word of Short Description column
    this.test_create_text_facet = [
        action('click',            { jquery: '(".column-header-layout tr:contains(\'Shrt_Desc\') .column-header-menu")[0]' } ),
        action('mouseOver',        { jquery: '("td:contains(\'Facet\')")[0]' } ),
        action("gw_wait4menuitem", {   name: 'Custom Text Facet' } ),
        action("click",            { jquery: '(".menu-item:contains(\'Custom Text Facet\')")[0]' } ),
        action("type",             { jquery: '(".expression-preview-code")[0]', text: "value.split(',')[0]" } ),
        action("waits.forElement", { jquery: '("td:contains(\'value.split\')")[0]' } ),
        action("click",            { jquery: '("button:contains(\'OK\')")[0]' } ),
        action("gw_wait4ajaxend"), //doesn't help yet, since ajax_in_progress isn't yet reliable
        action("waits.forElement", { jquery: '("a.facet-choice-label")[0]' } ),
        assert("gw_expected_top_value","ABALONE")
    ];
        
    // sort the facet by count and test the result
    this.test_sort_text_facet = [
        action("click",            { jquery: '(".ui-button-text:contains(\'count\')")[0]' } ),
        action("waits.forElement", { jquery: '(".ui-state-active .ui-button-text:contains(\'count\')")[0]' } ), //wait til count is the active sort
        assert("gw_expected_top_value","BEEF")
    ];
        
    // filter down to BEEF
    this.test_fitler_text_facet = [
        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
    this.test_create_numeric_facet = [
        action("click",            { jquery: '(".column-header-layout tr:contains(\'Water\') .column-header-menu")[0]' } ),
        action('mouseOver',        { jquery: '("td:contains(\'Facet\')")[0]' } ),
        action("gw_wait4menuitem", {   name: 'Numeric Facet' } ),
        action("click",            { jquery: '(".menu-item:contains(\'Numeric Facet\')")[0]' } )//,  
        //TODO: (How) can I run a JSUnit assert w/in an object?
        //function () { jum.assertTrue( $(".facet-panel span:contains(\'Water\')").length ); }
    ]; 

    // filter out BEEF with lower water content
    this.test_filter_numeric_facet = [
        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")
    ];

        
};



{'fraction_non_alphanumeric': 0.19297114299532483, 'fraction_numerical': 0.012735773013058197, 'mean_word_length': 2.5011286681715577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5367290', 'n_tokens_mistral': 2114, 'n_tokens_neox': 1999, 'n_words': 388}