Comments (8)
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.
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.
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.
Hi, it is just a regular system AlertDialog with title, message and buttons.
from falcon.
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.
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.
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.
No problem.
Good luck with finding the solution. I will close the issue now.
from falcon.
Related Issues (20)
- Crash when call not in UI Thread HOT 2
- FalconSpoon class present in 2.0.0 release HOT 1
- java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/spoon/SpoonRule HOT 4
- Update Readme HOT 2
- Crash: onMeasure() did not set the measured dimension by calling setMeasuredDimension() HOT 4
- Usage of Undocumented API (API 29) HOT 10
- Impossible to capture shadows around components HOT 3
- Shading or packaging Spoon dependency HOT 4
- Falcon enhancement to work with AirBnb's Lottie animations HOT 4
- Screenshot not Capturing Overlay HOT 5
- can not cature webview HOT 2
- Add Kotlin examples
- Fails to capture screenshot with hardware bitmaps HOT 13
- Migrate to Maven Central HOT 8
- How to take screenshot of textureview alongwith otherviews ? HOT 1
- 高德地图使用问题 HOT 1
- react-native webview canvas Black screen HOT 1
- Values are not getting reflected in screenshot for AutoCompleteTextView and TextInputEditText HOT 2
- PreviewView HOT 1
- com.jraska.falcon.Falcon$UnableToTakeScreenshotException: Unable to take screenshot to file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from falcon.