54e78b6274
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.
27 lines
801 B
Python
27 lines
801 B
Python
from selenium.webdriver.common.by import By
|
|
|
|
from pages.desktop.base import Base
|
|
|
|
|
|
class Home(Base):
|
|
"""Addons Home page"""
|
|
|
|
_upload_area_locator = (By.ID, 'file-upload')
|
|
_upload_button_locator = (By.CLASS_NAME, 'btn--file')
|
|
|
|
@property
|
|
def upload_btn(self):
|
|
"""Upload button."""
|
|
return self.find_element(*self._upload_button_locator)
|
|
|
|
def upload_area(self, path, cancel=False):
|
|
"""Area that allows for drag and drop uploading.
|
|
|
|
Returns Progress Object.
|
|
"""
|
|
self.find_element(*self._upload_area_locator).send_keys(path)
|
|
from pages.desktop.progress import Progress
|
|
return Progress(
|
|
self.selenium, self.base_url).wait_for_page_to_load(
|
|
cancel_after_load=cancel)
|