-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Check the Splash Screen displaying or not, after launching the app using calabash #1384
Comments
Hey @edrum, I had the same issue than you, and I solved it (well for now the CI isn't complaining) today with the following step definition : Given(/^the app has launched$/) do
wait_for(timeout: 120) do
!query('*').empty?
end
wait_for(timeout: 120) do
query("UILabel {text LIKE 'Loading *% (*)…'}").empty?
end
wait_for(timeout: 120) do
query("UILabel marked:'Loading from localhost:8081...'").empty?
end
end Give it a try and le me know 😃 |
I had to improve it a bit as I discovered that sometimes you can have another "Downloading JavaScript bundle" banner, and also I have a loading screen that I need to wait for. To summarise my app workflow at boot:
Here is my step that seems to be quite stable : Given(/^the app has launched with locale (.*)$/) do |locale|
# Wait for anything on the screen
wait_for(timeout: 120) { !query('*').empty? }
# Wait until the "Loading 0% (0/0)…" is gone if present
loading_query = "UILabel {text LIKE 'Loading *% (*)…'}"
unless query(loading_query).empty?
wait_for(timeout: 120) { query(loading_query).empty? }
end
# Wait until the "Loading from localhost:8081..." is gone if present
loading_from_query = "UILabel marked:'Loading from localhost:8081...'"
unless query(loading_from_query).empty?
wait_for(timeout: 120) { query(loading_from_query).empty? }
end
# Wait until the "Downloading JavaScript bundle 0% (0/0)…" is gone if present
downloading_query = "UILabel {text LIKE 'Downloading JavaScript bundle *% (*)…'}"
unless query(downloading_query).empty?
wait_for(timeout: 120) { query(downloading_query).empty? }
end
@locale = locale
@translations = load_translation_for(locale)
if @translations.nil?
screenshot_and_raise("No translations found for locale #{locale}.")
end
if @translations[@locale]['screens'].key?('loading')
if @translations[@locale]['screens']['loading'].key?('title')
# Wait until the "Loading" screen is gone if present
loading_screen_title = @translations[@locale]['screens']['loading']['title']
loading_screen_query = "UINavigationBar marked:'#{loading_screen_title}'"
unless query(loading_screen_query).empty?
wait_for(timeout: 120) { query(loading_screen_query).empty? }
end
else
screenshot_and_raise("The #{@locale} translation is missing the " \
"'title' key for the loading screen")
end
else
screenshot_and_raise("The #{@locale} translation is missing the 'loading'" \
' key')
end
end If it's not clear, feel free to ask 🙂 |
Dear @zedtux, Thanks for your Reply. |
Oh, I maybe better understood. Then, what I do is not using the Other than that, yeah, you can't inspect the splash screen. |
Automating the Test case(splash screen is visible or not & how much time it is displaying) using calabash.
First I'm trying to verify whether the splash screen is displaying or not after launching the app. But i couldn't achieve. Please help me in doing only in calabash-ios or calabash-android
The text was updated successfully, but these errors were encountered: