Skip to content
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

Wait for qml animations #58

Open
Zitrax opened this issue Aug 22, 2017 · 1 comment
Open

Wait for qml animations #58

Zitrax opened this issue Aug 22, 2017 · 1 comment

Comments

@Zitrax
Copy link

Zitrax commented Aug 22, 2017

I am evaluating qtwebdriver for use with our qml project, and I have built it and gotten simple test cases to work. I am using python selenium at the moment.

However we have some transition animations and I have not found how to properly wait for them (except an ugly and not optimal time.sleep() ). I have tried the existing wait conditions such as visibiliy_of_element_located and element_to_be_clickable but they both trigger before the animation is done.

Do I need some custom wait condition to handle this, or is there some other known way to deal with this? Or possibly some known limitations or issues? Any pointer would be helpful.

@hekra01
Copy link
Contributor

hekra01 commented Aug 25, 2017

Maybe trying with selenium JS injection, and some qml features of QtWebdriver

1-From selenium you can locate a qml element by id see https://github.com/cisco-open-source/qtwebdriver/wiki/QML-Specifics if you define "objectName" of element to locate

2-Use 1) to locate your qml animation

3-Then use Selenium javascript inject to interact with qml element, e.g: query get animation "running" status

isRunning = webdriver.execute_script("var v = ObjectNameUtils.findChild('animationId'); return v.running;")

4-Refactor previous in a method in your selenium test, e.g

public void waitForAnim(String animID) {
// locate anim
// While (anim.running) sleep (1s) 
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants