'Uploads a pdf textbook.'

def upload_pdf_file(self, file_name):

    test_dir = path(__file__).abspath().dirname().dirname().dirname().dirname()
    file_path = ((test_dir + '/data/uploads/') + file_name)
    click_css(self, '.edit-textbook    .action-upload', require_notification=False)
    self.wait_for_element_visibility('.upload-dialog    input', 'Upload    modal    opened')
    file_input = self.q(css='.upload-dialog    input').results[0]
    file_input.send_keys(file_path)
    click_css(self, '.wrapper-modal-window-assetupload    .action-upload', require_notification=False)
    self.wait_for_element_absence('.modal-window-overlay', 'Upload    modal    closed')
