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|
    while $i==1 do
    if ObjectSpace.const_get('next_page').new.identity? 
        $current_page = $current_page.change_page('next_page')

Can any one suggest something?

Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.