Use selenium wait function the way selenium code suggests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Undecided
|
Imran Hayder |
Bug Description
BACKGROUND:
its known that horizon openstack dashboard integration tests uses selenium extensively to perform tests.
Selenium official code is great in way each class and function has a docstring explaining the Usage and how params should be passed.
INFO:
Regarding this bug, In the helper file for integration tests i.e. 'horizon/
we call a selenium function named 'until()' passing a lambda function that returns title of webdriver.
Source: https:/
We dont have to pass like 'until(lambda d: return self.driver.
instead we can do it (as suggested by selenium docstrings for this function) like this 'until(lambda d: return d.title) and it would perfectly fine.
Why? because see the usage of this selenium function until():
https:/
this docstring suggests how a lambda function be passed.
also, looking at function definition of until() , it takes care of passing self.driver.. so when we say lambda d: , until will pass self.driver to this lambda function, and our return statement will eventually be self.driver.title if we define this lambda function as
lambda d: return d.title
This is where until() is passing self.driver to method passed to it, ( here the method passed is labmda d )
https:/
FIX: simple fix to rework 'lambda d: return self.driver.title' to 'lambda d: return d.title'
tags: | added: integration-tests |
Changed in horizon: | |
milestone: | none → kilo-2 |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | kilo-2 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/143224
Review: https:/