From 2a4bba78c873e046c7fc919f4531d2f986f83528 Mon Sep 17 00:00:00 2001 From: Ashley McEntee Date: Fri, 3 May 2024 15:35:50 -0400 Subject: [PATCH] Update PipelineRun details test --- .../e2e/pipelines/PipelinesTopology.cy.ts | 63 +++++++++++++++++++ .../cypress/pages/pipelines/topology.ts | 14 ++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelinesTopology.cy.ts b/frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelinesTopology.cy.ts index f5abc98a97..4409ee7ccc 100644 --- a/frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelinesTopology.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelinesTopology.cy.ts @@ -466,6 +466,69 @@ describe('Pipeline topology', () => { .findValue() .contains('False'); }); + + it('Test pipeline triggered run bottom drawer output', () => { + initIntercepts(); + pipelineRunDetails.visit(projectId, mockRun.run_id); + + pipelineRunJobDetails.findBottomDrawer().findBottomDrawerYamlTab().click(); + pipelineRunDetails.findBottomDrawer(); + pipelineDetails.findYamlOutput().click(); + const pipelineDashboardCodeEditor = pipelineDetails.getPipelineDashboardCodeEditor(); + pipelineDashboardCodeEditor.findInput().should('not.be.empty'); + }); + }); + + describe('Pipeline run Input/Output', () => { + beforeEach(() => { + initIntercepts(); + pipelineRunDetails.visit(projectId, mockRun.run_id); + }); + + it('Test with input/output artifacts', () => { + pipelineRunDetails.findTaskNode('create-dataset').click(); + pipelineRunDetails.findRightDrawer().findRightDrawerInputOutputTab().should('be.visible'); + pipelineRunDetails.findRightDrawer().findRightDrawerInputOutputTab().click(); + pipelineDetails.findRunTaskRightDrawer(); + pipelineDetails + .findOutputArtifacts() + .should('contain', 'Output artifacts') + .should('contain', 'iris_dataset'); + + pipelineRunDetails.findTaskNode('normalize-dataset').click(); + pipelineRunDetails.findRightDrawer().findRightDrawerInputOutputTab().should('be.visible'); + pipelineDetails.findRunTaskRightDrawer(); + pipelineDetails + .findInputArtifacts() + .should('contain', 'Input artifacts') + .should('contain', 'input_iris_dataset'); + }); + }); + + describe('Pipeline run Details', () => { + beforeEach(() => { + initIntercepts(); + pipelineRunDetails.visit(projectId, mockRun.run_id); + }); + + it('Test with the details', () => { + pipelineRunDetails.findTaskNode('create-dataset').click(); + pipelineRunDetails.findRightDrawer().findRightDrawerDetailsTab().should('be.visible'); + pipelineRunDetails.findRightDrawer().findRightDrawerDetailsTab().click(); + pipelineRunDetails + .findRightDrawer() + .findRightDrawerDetailItem('Task ID') + .findValue() + .should('contain', 'task.create-dataset'); + + pipelineRunDetails.findTaskNode('normalize-dataset').click(); + pipelineRunDetails.findRightDrawer().findRightDrawerDetailsTab().should('be.visible'); + pipelineRunDetails + .findRightDrawer() + .findRightDrawerDetailItem('Task ID') + .findValue() + .should('contain', 'task.normalize-dataset'); + }); }); describe('Pipeline run volume mounts', () => { diff --git a/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts b/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts index 0f46d02ade..0dc12eb513 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts @@ -72,7 +72,7 @@ class PipelineRunRightDrawer extends Contextual { } findRightDrawerDetailItem(key: string) { - return new DetailsItem(() => this.find().findByTestId(`detail-item-${key}`).parent()); + return new DetailsItem(() => this.find().findByTestId(`detail-item-${key}`)); } } @@ -120,6 +120,10 @@ class PipelineDetails extends PipelinesTopology { return cy.findByTestId('pipeline-yaml-tab'); } + findYamlOutput() { + return cy.findByTestId('pipeline-dashboard-code-editor'); + } + getPipelineDashboardCodeEditor() { return new DashboardCodeEditor(() => cy.findByTestId('pipeline-dashboard-code-editor')); } @@ -140,6 +144,14 @@ class PipelineDetails extends PipelinesTopology { return cy.findByTestId('pipeline-run-drawer-right-content'); } + findInputArtifacts() { + return cy.findByTestId('Input-artifacts'); + } + + findOutputArtifacts() { + return cy.findByTestId('Output-artifacts'); + } + findLogsSuccessAlert() { return cy.findByTestId('logs-success-alert'); }