<commit_before># tests for JavaScript events
# revision: $Revision$

require 'unittests/setup'

class TC_JSEvents < Test::Unit::TestCase

#button enabled/disabled tests
    def gotoJavaScriptEventsPage()
        $ie.goto($htmlRoot + "javascriptevents.html")
    end

  
    def test_Button_disabled
       gotoJavaScriptEventsPage()
       assert_false($ie.button(:caption, "Button 1").enabled?) 
    end

    def test_Button_Enabled
       gotoJavaScriptEventsPage()    
     
       $ie.textField(:name, "entertext").fireEvent("onkeyup")
       assert($ie.button(:caption, "Button 1").enabled?)   
     
    end

    def test_Button_click

       gotoJavaScriptEventsPage()
       
       puts "Firing event to make button enabled"
       $ie.textField(:name, "entertext").fireEvent("onKeyUp")
       puts "Clicking the button"

       $ie.button(:caption, "Button 1").click
       assert($ie.pageContainsText("PASS") )
    end
#end of button enabled/disabled tests


end
<commit_msg>added getStatus to capture page status and onMouseOver fireevent tests<commit_after># tests for JavaScript events
# revision: $Revision$

require 'unittests/setup'

class TC_JSEvents < Test::Unit::TestCase

#button enabled/disabled tests
    def gotoJavaScriptEventsPage()
        $ie.goto($htmlRoot + "javascriptevents.html")
    end

  
    def test_Button_disabled
       gotoJavaScriptEventsPage()
       assert_false($ie.button(:caption, "Button 1").enabled?) 
    end

    def test_Button_Enabled
       gotoJavaScriptEventsPage()    
     
       $ie.textField(:name, "entertext").fireEvent("onkeyup")
       assert($ie.button(:caption, "Button 1").enabled?)   
     
    end

    def test_Button_click

       gotoJavaScriptEventsPage()
       
       puts "Firing event to make button enabled"
       $ie.textField(:name, "entertext").fireEvent("onKeyUp")
       puts "Clicking the button"

       $ie.button(:caption, "Button 1").click
       assert($ie.pageContainsText("PASS") )
    end
#end of button enabled/disabled tests

#onMouseOver tests
 #window status

    def gotoJavaScriptEventsPage()
        $ie.goto($htmlRoot + "javascriptevents.html")
    end
    
    def test_page_nostatus
       gotoJavaScriptEventsPage()
       assert_false($ie.getStatus == "Here is your status") 
    end
  
    def test_page_status
       gotoJavaScriptEventsPage()
       $ie.link(:text, "Check the Status").fireEvent("onMouseOver")
       assert($ie.getStatus == "Here is your status") 
    end
 #end of window status

#end of onMouseOver tests

end

{'fraction_non_alphanumeric': 0.10393700787401575, 'fraction_numerical': 0.002362204724409449, 'mean_word_length': 3.0917874396135265, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2627700', 'n_tokens_mistral': 772, 'n_tokens_neox': 726, 'n_words': 174}