Commit 7680d0b9 by Muddasser

Decreased the flakiness of upload_tar function

parent 68ae1325
...@@ -178,7 +178,15 @@ class ImportMixin(object): ...@@ -178,7 +178,15 @@ class ImportMixin(object):
asset_file_path = self.file_path(tarball_filename) asset_file_path = self.file_path(tarball_filename)
# Make the upload elements visible to the WebDriver. # Make the upload elements visible to the WebDriver.
self.browser.execute_script('$(".file-name-block").show();$(".file-input").show()') self.browser.execute_script('$(".file-name-block").show();$(".file-input").show()')
# Upload the file.
self.q(css='input[type="file"]')[0].send_keys(asset_file_path) self.q(css='input[type="file"]')[0].send_keys(asset_file_path)
# Upload the same file again. Reason behind this is to decrease the
# probability or fraction of times the failure occur. Please be
# noted this doesn't eradicate the root cause of the error, it
# just decreases to failure rate to minimal.
# Jira ticket reference: TNL-4191.
self.q(css='input[type="file"]')[0].send_keys(asset_file_path)
# Some of the tests need these lines to pass so don't remove them.
self._wait_for_button() self._wait_for_button()
click_css(self, '.submit-button', require_notification=False) click_css(self, '.submit-button', require_notification=False)
......
...@@ -182,7 +182,6 @@ class ImportTestMixin(object): ...@@ -182,7 +182,6 @@ class ImportTestMixin(object):
""" """
return [] return []
@flaky # TODO, fix this: TNL-4191
def test_upload(self): def test_upload(self):
""" """
Scenario: I want to upload a course or library for import. Scenario: I want to upload a course or library for import.
......
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