Selenium - better fix for upload build click before callback registered.

Should fix this transient failure.

https://jenkins.galaxyproject.org/job/selenium/568/artifact/568-test-errors/test_upload_paired_list2017092319301506209412/stacktrace.txt
This commit is contained in:
John Chilton
2017-09-24 17:00:43 -04:00
parent 76fe60180a
commit 4a4d0498d6
+12 -6
View File
@@ -460,13 +460,19 @@ class NavigatesGalaxy(HasDriver):
@retry_during_transitions
def upload_build(self):
build_button = self.wait_for_selector_clickable("div#collection button#btn-build")
# TODO: Eliminate the need for this hack. This hack is in here because the test
# occasionally fails at the next step because the UI has not transitioned to the
# new content. I assume that means this click is sent before the callback is
# registered.
build_selector = "div#collection button#btn-build"
# Pause a bit to let the callback on the build button be registered.
time.sleep(.5)
build_button.click()
# Click the Build button and make sure it disappears.
self.wait_for_and_click_selector(build_selector)
try:
self.wait_for_selector_absent_or_hidden(build_selector)
except TimeoutException:
# Sometimes the callback in the JS hasn't be registered by the
# time that the build button is clicked. By the time the timeout
# has been registered - it should have been.
self.wait_for_and_click_selector(build_selector)
self.wait_for_selector_absent_or_hidden(build_selector)
def upload_queue_local_file(self, test_path, tab_id="regular"):
self.wait_for_and_click_selector("div#%s button#btn-local" % tab_id)