'Opens upload image dialog and upload given image file.'

def upload_signature_image(self, image_filename):

    self.wait_for_signature_image_upload_button()
    self.find_css('.action-upload-signature').first.click()
    self.wait_for_signature_image_upload_prompt()
    asset_file_path = self.file_path(image_filename)
    self.q(css='.assetupload-modal    .upload-dialog    input[type="file"]')[0].send_keys(asset_file_path)
    EmptyPromise((lambda : (not self.q(css='.assetupload-modal    a.action-upload.disabled').present)), 'Upload    button    is    not    disabled    anymore').fulfill()
    self.q(css='.assetupload-modal    a.action-upload').first.click()
    EmptyPromise((lambda : (not self.q(css='.assetupload-modal    .upload-dialog').visible)), 'Upload    dialog    is    removed    after    uploading    image').fulfill()
