Module: Teber::Wait

Defined in:
lib/teber/wait.rb

Class Method Summary collapse

Class Method Details

.wait_for_element(locator, timeout = $conf["implicit_wait"], focus_driver = $focus_driver) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/teber/wait.rb', line 7

def wait_for_element(locator, timeout=$conf["implicit_wait"], focus_driver = $focus_driver)
    index=0
    while locator.is_present?(focus_driver) == false
        sleep 1
        if index == timeout
            break
        end
        index+=1
    end
end

.wait_for_element_hide(locator, timeout = $conf["implicit_wait"], focus_driver = $focus_driver) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/teber/wait.rb', line 18

def wait_for_element_hide(locator, timeout=$conf["implicit_wait"], focus_driver = $focus_driver)
    index=0
    while locator.is_present?(focus_driver) == true
        sleep 1
        if index == timeout
            break
        end
        index+=1
    end
end