I want to write wait function until some screen is shown in ruby

I am doing android app test automation using Cucumber-Appium in ruby.

I want to write a wait function which should wait till the next page is shown.

I tried few ways but it is not working.

The code:

And (/^I wait till '(.*)' appears$/) do |next_page|
    $i=1
    while $i==1 do
    if ObjectSpace.const_get('next_page').new.identity? 
        $current_page = $current_page.change_page('next_page')
        $i=0
    else
    wait_secs(1)
    end
end

Can any one suggest something?


Source: ruby

Leave a Reply