diff --git a/cypress/e2e/20-workflow-executions.cy.ts b/cypress/e2e/20-workflow-executions.cy.ts index 37036a7971d6e..0773d6f8fc35c 100644 --- a/cypress/e2e/20-workflow-executions.cy.ts +++ b/cypress/e2e/20-workflow-executions.cy.ts @@ -71,6 +71,45 @@ describe('Current Workflow Executions', () => { cy.wait(executionsRefreshInterval); cy.url().should('not.include', '/executions'); }); + + it.only('should auto load more items if there is space and auto scroll', () => { + cy.viewport(1280, 960); + executionsTab.actions.createManualExecutions(24); + + cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions'); + cy.intercept('GET', '/rest/executions/*').as('getExecution'); + executionsTab.actions.switchToExecutionsTab(); + + cy.wait(['@getExecutions']); + executionsTab.getters.executionListItems().its('length').should('be.gte', 10); + + cy.getByTestId('current-executions-list').scrollTo('bottom'); + cy.wait(['@getExecutions']); + executionsTab.getters.executionListItems().should('have.length', 24); + + executionsTab.getters.executionListItems().eq(14).click(); + cy.wait(['@getExecution']); + cy.reload(); + + cy.wait(['@getExecutions']); + executionsTab.getters.executionListItems().eq(14).should('not.be.visible'); + executionsTab.getters.executionListItems().should('have.length', 24); + executionsTab.getters.executionListItems().first().should('not.be.visible'); + cy.getByTestId('current-executions-list').scrollTo(0, 0); + executionsTab.getters.executionListItems().first().should('be.visible'); + executionsTab.getters.executionListItems().eq(14).should('not.be.visible'); + + executionsTab.actions.switchToEditorTab(); + executionsTab.actions.switchToExecutionsTab(); + + cy.wait(['@getExecutions']); + executionsTab.getters.executionListItems().eq(14).should('not.be.visible'); + executionsTab.getters.executionListItems().should('have.length', 24); + executionsTab.getters.executionListItems().first().should('not.be.visible'); + cy.getByTestId('current-executions-list').scrollTo(0, 0); + executionsTab.getters.executionListItems().first().should('be.visible'); + executionsTab.getters.executionListItems().eq(14).should('not.be.visible'); + }); }); const createMockExecutions = () => { diff --git a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.vue b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.vue index d178273ca53a0..fc4907745fc4b 100644 --- a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.vue +++ b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.vue @@ -110,6 +110,7 @@ export default defineComponent({ default: false, }, }, + emits: ['retryExecution', 'mounted'], setup() { const executionHelpers = useExecutionHelpers(); @@ -147,6 +148,9 @@ export default defineComponent({ return VIEWS.EXECUTION_PREVIEW; }, }, + mounted() { + this.$emit('mounted', this.execution.id); + }, methods: { onRetryMenuItemSelect(action: string): void { this.$emit('retryExecution', { execution: this.execution, command: action }); diff --git a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsSidebar.vue b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsSidebar.vue index d0f5fc7e41317..1b5553259ed49 100644 --- a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsSidebar.vue +++ b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsSidebar.vue @@ -53,6 +53,7 @@ :execution="execution" :data-test-id="`execution-details-${execution.id}`" @retry-execution="onRetryExecution" + @mounted="onItemMounted" />