Add selenium test for file_source upload

This commit is contained in:
mvdbeek
2021-04-23 15:31:42 +02:00
parent ed16d0a96f
commit 35b200cd5a
5 changed files with 53 additions and 19 deletions
@@ -30,7 +30,7 @@
<b-btn
v-if="multiple"
size="sm"
class="float-right ml-1"
class="float-right ml-1 file-dialog-modal-ok"
variant="primary"
@click="finalize"
:disabled="!hasValue"
+4
View File
@@ -679,6 +679,10 @@ upload:
rule_dataset_selector_row:
selector: '.selection-dialog-modal [aria-rowindex="${rowindex}"]'
build_btn: '#rule-based #btn-build'
file_source_selector:
type: xpath
selector: '//span[contains(@title, "${path}")]'
file_dialog_ok: '.file-dialog-modal-ok'
rule_builder:
selectors:
View File
+24 -18
View File
@@ -37,7 +37,7 @@ def create_file_source_config_file_on(temp_dir, root_dir):
return file_path
class PosixFileSourceIntegrationTestCase(integration_util.IntegrationTestCase):
class PosixFileSourceSetup:
@classmethod
def handle_galaxy_config_kwds(cls, config):
@@ -53,10 +53,32 @@ class PosixFileSourceIntegrationTestCase(integration_util.IntegrationTestCase):
config["library_import_dir"] = None
config["user_library_import_dir"] = None
def _write_file_fixtures(self):
root = self.root_dir
if os.path.exists(root):
shutil.rmtree(root)
os.mkdir(root)
with open(os.path.join(root, "a"), "w") as f:
f.write("a\n")
subdir1 = os.path.join(root, "subdir1")
os.mkdir(subdir1)
with open(os.path.join(subdir1, "b"), "w") as f:
f.write("b\n")
return root
def setUp(self):
super().setUp()
self._write_file_fixtures()
class PosixFileSourceIntegrationTestCase(PosixFileSourceSetup, integration_util.IntegrationTestCase):
def setUp(self):
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
self._write_file_fixtures()
def test_plugin_config(self):
plugin_config_response = self.galaxy_interactor.get("remote_files/plugins")
@@ -117,19 +139,3 @@ class PosixFileSourceIntegrationTestCase(integration_util.IntegrationTestCase):
def _assert_access_forbidden_response(self, response):
api_asserts.assert_status_code_is(response, 403)
def _write_file_fixtures(self):
root = PosixFileSourceIntegrationTestCase.root_dir
if os.path.exists(root):
shutil.rmtree(root)
os.mkdir(root)
with open(os.path.join(root, "a"), "w") as f:
f.write("a\n")
subdir1 = os.path.join(root, "subdir1")
os.mkdir(subdir1)
with open(os.path.join(subdir1, "b"), "w") as f:
f.write("b\n")
return root
@@ -0,0 +1,24 @@
from .framework import (
selenium_test,
SeleniumIntegrationTestCase,
)
from ..integration.test_remote_files_posix import (
PosixFileSourceSetup,
)
class PosixFileSourceSeleniumIntegrationTestCase(PosixFileSourceSetup, SeleniumIntegrationTestCase):
# For simplicity, otherwise need to setup a different file_sources_config_file
requires_admin = True
@selenium_test
def test_upload_from_posix(self):
self.admin_login()
self.components.upload.start.wait_for_and_click()
self.components.upload.ftp_add.wait_for_and_click()
self.components.upload.file_source_selector(path='gxfiles://posix_test').wait_for_and_click()
self.components.upload.file_source_selector(path='gxfiles://posix_test/a').wait_for_and_click()
self.components.upload.file_dialog_ok.wait_for_and_click()
self.upload_start()
self.sleep_for(self.wait_types.UX_RENDER)
self.wait_for_history()