You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing UI Tests with Appium and UiAutomator2 ([email protected]) on Android side right now. I decided that I want to have Tests that take screenshots and compare them to reference screenshots.
I know, in general this is debatable. But, I don't know of a better way to compare everything in my UI including background images, locations, dimensions etc.. So, I decided to give that a try.
On Android, I sometimes have the problem, that ScrollBars of ScrollViews are not fade out when the screenshot is taken and are still visible. Or the Flyout is still not opened completedly or closed again when the View, to which the test should navigate, is loading and the screenshot is taken.
Basically, the general problem is, how long should I wait e.g. with Task.Delay(...).Wait(); or with a construct like the following, what should I really wait for in my UI when there are background images layouts that need time to be fully positioned etc.?
Let's consider a View which should be displayed when I click something, what whould be an element I could wait for until it is present or in case of ScrollView with ScrollBars which are automatically fade out in 2-3 seconds on Android Emulator what should I wait here fore?
Any best practices I should follow so that there is no unnecessary waiting time and also no waiting time which is too short and the test fails when comparing the screenshot?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey folks,
I am implementing UI Tests with
Appium
andUiAutomator2
([email protected]
) on Android side right now. I decided that I want to have Tests that take screenshots and compare them to reference screenshots.I know, in general this is debatable. But, I don't know of a better way to compare everything in my UI including background images, locations, dimensions etc.. So, I decided to give that a try.
On Android, I sometimes have the problem, that
ScrollBars
ofScrollViews
are not fade out when the screenshot is taken and are still visible. Or theFlyout
is still not opened completedly or closed again when theView
, to which the test should navigate, is loading and the screenshot is taken.Basically, the general problem is, how long should I wait e.g. with
Task.Delay(...).Wait();
or with a construct like the following, what should I really wait for in my UI when there are background images layouts that need time to be fully positioned etc.?Let's consider a
View
which should be displayed when I click something, what whould be an element I could wait for until it is present or in case ofScrollView
withScrollBars
which are automatically fade out in 2-3 seconds on Android Emulator what should I wait here fore?Any best practices I should follow so that there is no unnecessary waiting time and also no waiting time which is too short and the test fails when comparing the screenshot?
Beta Was this translation helpful? Give feedback.
All reactions