Skip to content

Commit

Permalink
Merge pull request #2761 from uidoyen/RHOAIENG-4730
Browse files Browse the repository at this point in the history
Test for PipelineJob details action and  drawer
  • Loading branch information
openshift-merge-bot[bot] authored May 3, 2024
2 parents 25f43a4 + 66de3d8 commit 1aab9db
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -315,6 +315,12 @@ declare global {
response: OdhResponse<RegisteredModelList | undefined>,
): Cypress.Chainable<null>;

interceptOdh(
type: 'DELETE /api/service/pipelines/:projectId/dspa/apis/v2beta1/recurringruns/:pipeline_id',
options: { path: { projectId: string; pipeline_id: string } },
response: OdhResponse<K8sStatus>,
): Cypress.Chainable<null>;

interceptOdh(
type: 'GET /api/service/modelregistry/modelregistry-sample/api/model_registry/v1alpha3/registered_models/1/versions',
response: OdhResponse<ModelVersionList | undefined>,
Expand Down

0 comments on commit 1aab9db

Please sign in to comment.