Selenium testing for new unified history export

New test_history_export.py tests wizard-based export (requires Celery+STS).
Rename old integration test to test_history_export_legacy.py for non-Celery path.
Uses existing history_export_tasks + last_export_record selectors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
John Chilton
2026-03-22 11:13:55 -04:00
co-authored by Claude Opus 4.6
parent 3424766ff6
commit e3ca01c4b2
2 changed files with 85 additions and 1 deletions
@@ -0,0 +1,75 @@
from .framework import (
managed_history,
selenium_test,
SeleniumTestCase,
)
class TestHistoryExport(SeleniumTestCase):
"""Test history export wizard (requires Celery + STS enabled, the default)."""
ensure_registered = True
@selenium_test
@managed_history
def test_history_native_export_to_file(self):
self.perform_upload_of_pasted_content("my cool content")
self.history_panel_wait_for_hid_ok(1)
self.home()
self.click_history_option_export_to_file()
history_export_tasks = self.components.history_export_tasks
last_export_record = self.components.last_export_record
self.screenshot("history_export_formats")
# Step 1: Select export format (tar.gz)
history_export_tasks.select_format(format="tar.gz").wait_for_and_click()
history_export_tasks.next_button.wait_for_and_click()
# Step 2: Select download destination
history_export_tasks.select_destination(destination="download").wait_for_and_click()
self.screenshot("history_export_native_destinations")
history_export_tasks.next_button.wait_for_and_click()
# Step 3: Complete the export
self.screenshot("history_export_native_download_options")
history_export_tasks.export_button.wait_for_and_click()
# Wait for export to complete
last_export_record.preparing_export_badge.wait_for_visible()
self.screenshot("history_export_native_preparing_download")
last_export_record.preparing_export_badge.wait_for_absent(wait_type=self.wait_types.DATABASE_OPERATION)
last_export_record.download_btn.wait_for_visible()
self.screenshot("history_export_native_download_ready")
@selenium_test
@managed_history
def test_history_rocrate_export_to_file(self):
self.perform_upload_of_pasted_content("my cool content")
self.history_panel_wait_for_hid_ok(1)
self.home()
self.click_history_option_export_to_file()
history_export_tasks = self.components.history_export_tasks
last_export_record = self.components.last_export_record
self.screenshot("history_export_formats")
# Step 1: Select export format (rocrate)
history_export_tasks.select_format(format="rocrate.zip").wait_for_and_click()
history_export_tasks.next_button.wait_for_and_click()
# Step 2: Select download destination
history_export_tasks.select_destination(destination="download").wait_for_and_click()
self.screenshot("history_export_rocrate_destinations")
history_export_tasks.next_button.wait_for_and_click()
# Step 3: Complete the export
self.screenshot("history_export_rocrate_download_options")
history_export_tasks.export_button.wait_for_and_click()
# Wait for export to complete
last_export_record.preparing_export_badge.wait_for_visible()
self.screenshot("history_export_rocrate_preparing_download")
last_export_record.preparing_export_badge.wait_for_absent(wait_type=self.wait_types.DATABASE_OPERATION)
last_export_record.download_btn.wait_for_visible()
self.screenshot("history_export_rocrate_download_ready")
@@ -4,7 +4,16 @@ from .framework import (
)
class TestHistoryExport(SeleniumIntegrationTestCase):
class TestLegacyHistoryExport(SeleniumIntegrationTestCase):
"""Test legacy history export for when celery is disabled.
If Celery is enabled, a wizard will be setup and STS will serve downloads,
this is tested in test_history_export.py in the main selenium test suite.
This test needs to disable celery in order to work so it is an integration
test and we disable celery in handle_galaxy_config_kwds.
"""
ensure_registered = True
@classmethod