Fix flaky textbook upload lettuce tests
This commit is contained in:
@@ -348,10 +348,20 @@ def attach_file(filename, sub_path):
|
||||
|
||||
|
||||
def upload_file(filename, sub_path=''):
|
||||
# The file upload dialog is a faux modal, a div that takes over the display
|
||||
attach_file(filename, sub_path)
|
||||
button_css = '.wrapper-modal-window-assetupload .action-upload'
|
||||
modal_css = 'div.wrapper-modal-window-assetupload'
|
||||
button_css = '{} .action-upload'.format(modal_css)
|
||||
world.css_click(button_css)
|
||||
|
||||
# Clicking the Upload button triggers an AJAX POST.
|
||||
world.wait_for_ajax_complete()
|
||||
|
||||
# The modal stays up with a "File uploaded succeeded" confirmation message, then goes away.
|
||||
# It should take under 2 seconds, so wait up to 10.
|
||||
# Note that is_css_not_present will return as soon as the element is gone.
|
||||
assert world.is_css_not_present(modal_css, wait_time=10)
|
||||
|
||||
|
||||
@step(u'"([^"]*)" logs in$')
|
||||
def other_user_login(step, name):
|
||||
|
||||
@@ -17,7 +17,6 @@ Feature: CMS.Textbooks
|
||||
And I name the first chapter "Chapter 1"
|
||||
And I click the Upload Asset link for the first chapter
|
||||
And I upload the textbook "textbook.pdf"
|
||||
And I wait for "2" seconds
|
||||
And I save the textbook
|
||||
Then I should see a textbook named "Economics" with a chapter path containing "/static/textbook.pdf"
|
||||
And I reload the page
|
||||
|
||||
Reference in New Issue
Block a user