mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Update test selectors to new, shared components
This commit is contained in:
@@ -70,9 +70,9 @@ const USER_ZENODO_PLUGIN: BrowsableFilesSourcePlugin = {
|
||||
|
||||
const selectors = {
|
||||
wizard: ".history-export-wizard",
|
||||
formatCard: "[data-history-export-format]",
|
||||
formatCard: "[data-export-format]",
|
||||
destinationCard: "[data-history-export-destination]",
|
||||
directoryInput: "#directory",
|
||||
directoryInput: '[data-test-id="export-destination-input"]',
|
||||
fileNameInput: "#exported-file-name",
|
||||
includeFilesCheckbox: 'input[type="checkbox"]',
|
||||
submitButton: ".go-next-btn",
|
||||
@@ -145,7 +145,7 @@ describe("HistoryExportWizard.vue", () => {
|
||||
const formatCards = wrapper.findAll(selectors.formatCard);
|
||||
expect(formatCards.length).toBe(formats.length);
|
||||
for (const format of formats) {
|
||||
const card = wrapper.find(`[data-history-export-format="${format.id}"]`);
|
||||
const card = wrapper.find(`[data-export-format="${format.id}"]`);
|
||||
expect(card.exists()).toBe(true);
|
||||
expect(card.text()).toContain(format.label);
|
||||
}
|
||||
@@ -253,6 +253,7 @@ describe("HistoryExportWizard.vue", () => {
|
||||
nextButton = wrapper.find(selectors.nextButton);
|
||||
if (nextButton.exists()) {
|
||||
await nextButton.trigger("click");
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
// Check that the setup step is rendered with directory selection
|
||||
@@ -288,18 +289,23 @@ describe("HistoryExportWizard.vue", () => {
|
||||
nextButton = wrapper.find(selectors.nextButton);
|
||||
if (nextButton.exists()) {
|
||||
await nextButton.trigger("click");
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
// Simulate selecting a directory by triggering the input
|
||||
const directoryInput = wrapper.find('input[placeholder="Click to select directory"]');
|
||||
if (directoryInput.exists()) {
|
||||
await directoryInput.setValue("gxfiles://test-remote-source/test-directory");
|
||||
// Find the files input using the data-test-id and simulate setting a value
|
||||
const filesInputElement = wrapper.find('[data-test-id="export-destination-input"]');
|
||||
if (filesInputElement.exists()) {
|
||||
// Trigger the input event to update the parent component's state
|
||||
await filesInputElement.setValue("gxfiles://test-posix-source/test-directory");
|
||||
await filesInputElement.trigger("input");
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
// Step 4: Navigate to final step
|
||||
nextButton = wrapper.find(selectors.nextButton);
|
||||
if (nextButton.exists()) {
|
||||
await nextButton.trigger("click");
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
// Check if the file name input has the expected placeholder text
|
||||
@@ -365,6 +371,7 @@ describe("HistoryExportWizard.vue", () => {
|
||||
nextButton = wrapper.find(selectors.nextButton);
|
||||
if (nextButton.exists()) {
|
||||
await nextButton.trigger("click");
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
// Check for directory input presence
|
||||
@@ -399,6 +406,7 @@ describe("HistoryExportWizard.vue", () => {
|
||||
nextButton = wrapper.find(selectors.nextButton);
|
||||
if (nextButton.exists()) {
|
||||
await nextButton.trigger("click");
|
||||
await flushPromises();
|
||||
}
|
||||
|
||||
// Should show setup for remote source
|
||||
|
||||
@@ -573,7 +573,7 @@ history_export_tasks:
|
||||
next_button: '.go-next-btn'
|
||||
back_button: '.go-back-btn'
|
||||
export_button: '.go-next-btn.btn-primary'
|
||||
select_format: '[data-history-export-format="${format}"]'
|
||||
select_format: '[data-export-format="${format}"]'
|
||||
select_destination: '[data-history-export-destination="${destination}"]'
|
||||
exported_file_name: '#exported-file-name'
|
||||
|
||||
@@ -1076,7 +1076,7 @@ invocations:
|
||||
step_job_information_tool_id: '[data-step="${order_index}"] .invocation-step-job-details .info_data_table #galaxy-tool-id'
|
||||
export_tab: '.invocation-export-tab'
|
||||
export_tab_disabled: '.invocation-export-tab .nav-link[aria-disabled="true"]'
|
||||
export_output_format: '[data-invocation-export-type="${type}"] .card-body'
|
||||
export_output_format: '[data-export-format="${type}"]'
|
||||
export_destination: '[data-invocation-export-destination="${destination}"] .card-body'
|
||||
wizard_next_button: '.wizard-actions .go-next-btn'
|
||||
wizard_export_button: '.wizard-actions .go-next-btn.btn-primary'
|
||||
|
||||
@@ -39,10 +39,6 @@ from .test_workflow_editor import CHIPSEQ_COLUMNS
|
||||
class TestWorkflowRun(SeleniumTestCase, UsesHistoryItemAssertions, RunsWorkflows):
|
||||
ensure_registered = True
|
||||
|
||||
@classmethod
|
||||
def handle_galaxy_config_kwds(cls, config):
|
||||
config["simplified_workflow_run_ui"] = "prefer"
|
||||
|
||||
@selenium_only("Not yet migrated to support Playwright backend")
|
||||
@selenium_test
|
||||
@managed_history
|
||||
@@ -53,7 +49,7 @@ class TestWorkflowRun(SeleniumTestCase, UsesHistoryItemAssertions, RunsWorkflows
|
||||
invocations.export_tab_disabled.wait_for_absent()
|
||||
invocations.export_tab.wait_for_and_click()
|
||||
self.screenshot("invocation_export_formats")
|
||||
invocations.export_output_format(type="ro-crate").wait_for_and_click()
|
||||
invocations.export_output_format(type="rocrate.zip").wait_for_and_click()
|
||||
invocations.wizard_next_button.wait_for_and_click()
|
||||
download_option = invocations.export_destination(destination="download")
|
||||
download_option.wait_for_present()
|
||||
@@ -79,7 +75,7 @@ class TestWorkflowRun(SeleniumTestCase, UsesHistoryItemAssertions, RunsWorkflows
|
||||
invocations.export_tab_disabled.wait_for_absent()
|
||||
invocations.export_tab.wait_for_and_click()
|
||||
self.screenshot("invocation_export_formats")
|
||||
invocations.export_output_format(type="default-file").wait_for_and_click()
|
||||
invocations.export_output_format(type="tgz").wait_for_and_click()
|
||||
invocations.wizard_next_button.wait_for_and_click()
|
||||
download_option = invocations.export_destination(destination="download")
|
||||
download_option.wait_for_present()
|
||||
|
||||
Reference in New Issue
Block a user