send/test/integration/pages/desktop/progress.py
Benjamin Forehand Jr 54e78b6274 This adds some user integration tests to aide the SoftVision team a bit. Right now I have 3 tests.
test_upload: This will create a file and make sure it uploads by verifying a file uploads and is assigned a URL.

    test_download: This will create a file, upload it and then download it making sure it is the same filename that was uploaded. We can expand this later to maybe check the sizes and such.

    test_progress: This will create a file and make sure the progress bar shows up after it begins uploading.

    These are python tests and use Pipenv to manage dependencies as well as tox as the virtualenv manager, and finally pytest as the test runner.
2018-04-24 11:00:19 -04:00

24 lines
743 B
Python

from selenium.webdriver.common.by import By
from pages.desktop.base import Base
class Progress(Base):
_cancel_button = (By.ID, 'cancel-upload')
_progress_icon_locator = (By.CLASS_NAME, 'progress__bar')
def wait_for_page_to_load(self, cancel_after_load=False):
self.wait.until(
lambda _: self.find_element(
*self._progress_icon_locator).is_displayed())
if cancel_after_load:
self.cancel_btn.click()
return
from pages.desktop.share import Share
return Share(self.selenium, self.base_url).wait_for_page_to_load()
@property
def cancel_btn(self):
"""Cancel upload button."""
return self.find_element(*self._cancel_button)