From 66de3d84b5527100b61d1d148d7e7a1ee0f0855e Mon Sep 17 00:00:00 2001 From: Ashique Ansari Date: Tue, 30 Apr 2024 19:46:54 +0530 Subject: [PATCH] test for PipelineJob details action and drawer --- .../e2e/pipelines/PipelinesTopology.cy.ts | 33 +++++++++++++++++++ .../cypress/cypress/support/commands/odh.ts | 8 ++++- 2 files changed, 40 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..078407d3e1 100644 --- a/frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelinesTopology.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelinesTopology.cy.ts @@ -335,6 +335,22 @@ describe('Pipeline topology', () => { ); }); + it('Test pipeline job delete navigation', () => { + pipelineRunJobDetails.visit(projectId, mockJob.recurring_run_id); + pipelineRunJobDetails.selectActionDropdownItem('Delete'); + deleteModal.shouldBeOpen(); + deleteModal.findInput().type(mockPipeline.display_name); + + cy.interceptOdh( + 'DELETE /api/service/pipelines/:projectId/dspa/apis/v2beta1/recurringruns/:pipeline_id', + { path: { projectId, pipeline_id: mockPipeline.pipeline_id } }, + mock200Status({}), + ).as('deletepipelineRunJob'); + + deleteModal.findSubmitButton().click(); + cy.wait('@deletepipelineRunJob'); + }); + it('Test pipeline job bottom drawer project navigation', () => { pipelineRunJobDetails.visit(projectId, mockJob.recurring_run_id); @@ -414,6 +430,23 @@ describe('Pipeline topology', () => { .findValue() .contains('yes'); }); + it('Ensure that clicking on a node will open a right-side drawer', () => { + initIntercepts(); + + pipelineRunJobDetails.visit(projectId, mockJob.recurring_run_id); + + pipelineDetails.findTaskNode('create-dataset').click(); + const taskDrawer = pipelineDetails.getTaskDrawer(); + taskDrawer.shouldHaveTaskName('create-dataset '); + taskDrawer.findInputArtifacts().should('not.exist'); + taskDrawer.findOutputParameters().should('not.exist'); + taskDrawer.findOutputArtifacts().should('exist'); + taskDrawer.findCommandCodeBlock().should('not.be.empty'); + taskDrawer.findArgumentCodeBlock().should('not.be.empty'); + taskDrawer.findTaskImage().should('have.text', 'Imagequay.io/hukhan/iris-base:1'); + taskDrawer.findCloseDrawerButton().click(); + taskDrawer.find().should('not.exist'); + }); it('Test pipeline triggered run bottom drawer details', () => { initIntercepts(); diff --git a/frontend/src/__tests__/cypress/cypress/support/commands/odh.ts b/frontend/src/__tests__/cypress/cypress/support/commands/odh.ts index 30d06ce43d..b8d229a482 100644 --- a/frontend/src/__tests__/cypress/cypress/support/commands/odh.ts +++ b/frontend/src/__tests__/cypress/cypress/support/commands/odh.ts @@ -1,4 +1,4 @@ -import { K8sResourceListResult } from '@openshift/dynamic-plugin-sdk-utils'; +import { K8sResourceListResult, K8sStatus } from '@openshift/dynamic-plugin-sdk-utils'; import type { GenericStaticResponse, RouteHandlerController } from 'cypress/types/net-stubbing'; import { BaseMetricCreationResponse, BaseMetricListResponse } from '~/api'; import { ModelVersionList, RegisteredModelList } from '~/concepts/modelRegistry/types'; @@ -290,6 +290,12 @@ declare global { response: OdhResponse, ): Cypress.Chainable; + interceptOdh( + type: 'DELETE /api/service/pipelines/:projectId/dspa/apis/v2beta1/recurringruns/:pipeline_id', + options: { path: { projectId: string; pipeline_id: string } }, + response: OdhResponse, + ): Cypress.Chainable; + interceptOdh( type: 'GET /api/service/modelregistry/modelregistry-sample/api/model_registry/v1alpha3/registered_models/1/versions', response: OdhResponse,