Commit b2e08ddc by Muhammad Ammar

Add promise to ensure unit visibility is changed

parent 246e0e6f
......@@ -73,6 +73,14 @@ class UnitPage(PageObject):
self.q(css='select[name="visibility-select"] option[value="{}"]'.format(visibility)).first.click()
self.wait_for_ajax()
selector = '.edit-button'
if visibility == 'private':
check_func = lambda: self.q(css=selector).visible
elif visibility == 'public':
check_func = lambda: not self.q(css=selector).visible
EmptyPromise(check_func, 'Unit Visibility is {}'.format(visibility)).fulfill()
COMPONENT_BUTTONS = {
'advanced_tab': '.editor-tabs li.inner_tab_wrap:nth-child(2) > a',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment