Code Monkey home page Code Monkey logo

Comments (8)

jraska avatar jraska commented on May 13, 2024

Hi, I will try it during weekend. First thing which comes to my mind is maybe the dialog is not visible yet, because it take some times before the dialog appears in UI. You can check my idea with postponing screenshot capture for a second. Otherwise I will do it myself later.

from falcon.

hansvdg avatar hansvdg commented on May 13, 2024

Hi, I tried a thread.sleep(2000), but that didn't help.
The dialog should be instantly visible, it is triggered as part of the screen startup and there are no animations running on the device.

from falcon.

jraska avatar jraska commented on May 13, 2024

Hi, ok thank you, is there maybe anything unusual about your dialog? Do you use any library or custom dialog displaying or you just simply call system Alert dialog with message and title? I am trying to gather more information, because I believe it normally works for dialogs, so I am trying to find the difference in your case.

from falcon.

hansvdg avatar hansvdg commented on May 13, 2024

Hi, it is just a regular system AlertDialog with title, message and buttons.

from falcon.

jraska avatar jraska commented on May 13, 2024

Hi, that is weird, I will double check it when I will find some time, but AlertDialogs are generally working fine, so I believe it should be fine, but obviously its not.

Another idea: When I look at the code you posted above, could it be that getActivity() returns different activity then is currently at the top of Activity stack? It could happen for example when some of your tested activities calls startActivity() test runs fine, but the screenshot will not capture the top most Activity.

from falcon.

jraska avatar jraska commented on May 13, 2024

Hello, I wrote sample unit test with your scenario described and everything works fine.
Please find example test here.

I also updated Spoon dependency so you can try new Falcon version 1.0.1.

from falcon.

hansvdg avatar hansvdg commented on May 13, 2024

Hi,

The test works on both device and emulator and I could create a similar scenario in my app to get it to work.
That is, press a button to show a dialog and capture a screenshot.
If the dialog is triggered in the startup of the activity (in my case in response to a mocked api call) the dialog is not in the screenshot.
I think it has something to do with timing, but cannot yet find out why.

Thanks for creating a test scenario and thinking for solutions.

from falcon.

jraska avatar jraska commented on May 13, 2024

No problem.

Good luck with finding the solution. I will close the issue now.

from falcon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.