Hi all,
Just wondering can anyone help me with this code. I just want to check
my assert at the finish to see if the value "loading..." is present.
If after 35 seconds it is present I want it to fail, if it is gone
from the screen I want it to pass. My code is included.

Thanks.

require 'yaml'
require 'test/unit'
require 'watir'

require 'myCompany'
require 'utils'

include COMPANY::Utils
#load test parameters
@@ddt = open('data.yml') {|f| YAML.load(f) }
@@ie = getBrowser(@@ddt['url'])

class DocumentTestScripts < Test::Unit::TestCase

  def setup


      @myCompany = COMPANY::MyCompany.new(@@ie)

  end

  def test_00009_Bug4986_error_on_dialog_close

    @myCompany.loginIssue @@ddt['username'], "aasda" #deliberately
enter the wrong pwd

    if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x
and click if present
    @@ie.document.parentWindow.eval(jsToEval)
    else
    @@ie.button(:text, 'Close').click() #otherwise just click close
    end

    #sleep 1 until @@ie.text.!include? "Loading..."

    sleep 35

    assert(@@ie.div(:text, 'Loading...').exists?)

    #Simple pusedo code representaion of what I want to do

    #if true
    #puts 'Loading present, test failed'
    #else
    #puts 'Test passed'
    #end

    end

end

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to