Comments (7)
Done.
In the event there are multiple functions with the same number of arguments it'll call the first one. Acceptable?
from unium.
Under-the-hood it's a Type.GetMethod(string) call, which throws if there are multiple methods with the same name.
It could potentially be a bit more clever and try to match the arguments in the query to a function signature. However, as this would be trying to match strings with underlying types there will always be some ambiguity (e.g. is "123"
an int
or a float
?). It will also be slower and move convoluted code.
The most expedient solution is to rename the functions or add a test hook that shims the underlying implementation. If you think there is a strong case for unium handling some of the ambiguity I'll give it some consideration ;)
from unium.
from unium.
If you're working with async code take a look at UniTask.
Unium can invoke UniTask functions as normal, the query will then exit and the functions will execute asynchronously. This means the results aren't returned to the query but you can all the functions, which may be good enough for some things.
If you want the results returned in the query then there is some work to do. There's various ways to do this with varying degrees of effort and elegance.
from unium.
Alternatively you use callbacks to raise an event if you are using websockets.
from unium.
We are hitting this as well.
If we were to improve the heuristic to only find the method that has the same number of parameters, in the case there is only one, would that be an acceptable change? It would have a limited performance impact and increase the amount of supported cases
from unium.
The use case that @lacostej and me are hitting is on this function :
https://docs.unity3d.com/2019.3/Documentation/ScriptReference/Camera.WorldToScreenPoint.html
which have two different methods.
In my use case, to Automate some test, I am using Unium as the "eye" and Appium as the "hand", so this function is a must-have,
Anyway, in the meantime, I've patched it locally on my own by checking for the number of methods signatures and using getMethod(string,Type[]) instead for the relevant case.
I am getting my Type[] from the members parameters that have the right number of parameters and throwing an exception if I find multiple parameters signature with the same number or parameters.
It solves my issue with WorldToScreenPoint(), but it's not a catch-all as it still leaves out the case where you have more than one method with the same number of arguments.
from unium.
Related Issues (20)
- 1.0.5 ios socket bind not working HOT 1
- Binding to custom events HOT 1
- Passing complex objects through Invoke action HOT 1
- Full feature mobile UI automation tool. HOT 1
- how to change the main camera or player rotation? HOT 1
- trigger an event HOT 2
- Unity package import doesn't work due to missing meta-file HOT 7
- Cloned object paths cannot be resolved HOT 8
- Automate tap/click a toggle button HOT 2
- How to perform drag and drop? HOT 3
- Obtaining an image or its filename HOT 2
- automated_play not working correct HOT 5
- Make Unium class public? HOT 1
- Domain Reload Disabled support
- Maintenance of unium "API" HOT 3
- Websockets in Unity 2019 and 2020 HOT 9
- Unable to retrieve specific element instance with square brackets for objects with duplicate names/content HOT 9
- stacktrace should be part of events.debug data HOT 1
- How can I invoke an Event Trigger function? HOT 3
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 unium.