Skip to content

Commit

Permalink
Apply Purva's solution
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeAlonso committed Dec 20, 2024
1 parent dc20b60 commit 5489de0
Showing 1 changed file with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,55 +69,55 @@ describe('An admin user can import and run a pipeline', { testIsolation: false }
const [, pipelineId, versionId] = match;
cy.log(`Pipeline ID: ${pipelineId}`);
cy.log(`Version ID: ${versionId}`);
} else {
throw new Error('Pipeline ID and Version ID could not be extracted from the URL.');
}

cy.step(`Create a ${testPipelineIrisName} pipeline run from the Runs view`);
pipelineRunsGlobal.navigate();
pipelineRunsGlobal.selectProjectByName(projectName);
pipelineRunsGlobal.findCreateRunButton().click();
cy.step(`Create a ${testPipelineIrisName} pipeline run from the Runs view`);
pipelineRunsGlobal.navigate();
pipelineRunsGlobal.selectProjectByName(projectName);
pipelineRunsGlobal.findCreateRunButton().click();

cy.step('Run the pipeline from the Runs view');
createRunPage.experimentSelect.findToggleButton().click();
createRunPage.selectExperimentByName('Default');
createRunPage.fillName(testRunName);
createRunPage.fillDescription('Run Description');
createRunPage.pipelineSelect.openAndSelectItem(testPipelineIrisName);
createRunPage.pipelineVersionSelect.selectItem(testPipelineIrisName);
createRunPage.findSubmitButton().click();
cy.step('Run the pipeline from the Runs view');
createRunPage.experimentSelect.findToggleButton().click();
createRunPage.selectExperimentByName('Default');
createRunPage.fillName(testRunName);
createRunPage.fillDescription('Run Description');
createRunPage.pipelineSelect.openAndSelectItem(testPipelineIrisName);
createRunPage.pipelineVersionSelect.selectItem(testPipelineIrisName);
createRunPage.findSubmitButton().click();

cy.step('Expect the run to Succeed');
pipelineRunDetails.expectStatusLabelToBe('Succeeded', 180000);
cy.step('Expect the run to Succeed');
pipelineRunDetails.expectStatusLabelToBe('Succeeded', 180000);

cy.step('Delete the pipeline version');
pipelinesGlobal.navigate();
// pipelineRunsGlobal.selectProjectByName(projectName);
const pipelineRowWithVersion = pipelinesTable.getRowById(pipelineId);
pipelineRowWithVersion.findExpandButton().click();
pipelineRowWithVersion
.getPipelineVersionRowById(versionId)
.findKebabAction('Delete pipeline version')
.click();
pipelineDeleteModal.findInput().fill(testPipelineIrisName);
pipelineDeleteModal.findSubmitButton().click();
// The line below it's not working due to a bug
// pipelineDeleteModal.shouldBeOpen(false);
cy.get('[role=dialog]').should('not.exist');
cy.step('Delete the pipeline version');
pipelinesGlobal.navigate();
// pipelineRunsGlobal.selectProjectByName(projectName);
const pipelineRowWithVersion = pipelinesTable.getRowById(pipelineId);
pipelineRowWithVersion.findExpandButton().click();
pipelineRowWithVersion
.getPipelineVersionRowById(versionId)
.findKebabAction('Delete pipeline version')
.click();
pipelineDeleteModal.findInput().fill(testPipelineIrisName);
pipelineDeleteModal.findSubmitButton().click();
// The line below it's not working due to a bug
// pipelineDeleteModal.shouldBeOpen(false);
cy.get('[role=dialog]').should('not.exist');

cy.step('Verify that the pipeline version no longer exist');
const pipelineRowWithVersionDeleted = pipelinesTable.getRowById(pipelineId);
pipelineRowWithVersionDeleted.findExpandButton().click();
pipelineRowWithVersionDeleted.shouldNotHavePipelineVersion();
cy.step('Verify that the pipeline version no longer exist');
const pipelineRowWithVersionDeleted = pipelinesTable.getRowById(pipelineId);
pipelineRowWithVersionDeleted.findExpandButton().click();
pipelineRowWithVersionDeleted.shouldNotHavePipelineVersion();

cy.step('Delete the pipeline');
const pipelineRow = pipelinesTable.getRowById(pipelineId);
pipelineRow.findKebabAction('Delete pipeline').click();
pipelineDeleteModal.findInput().fill(testPipelineIrisName);
pipelineDeleteModal.findSubmitButton().click();
cy.step('Delete the pipeline');
const pipelineRow = pipelinesTable.getRowById(pipelineId);
pipelineRow.findKebabAction('Delete pipeline').click();
pipelineDeleteModal.findInput().fill(testPipelineIrisName);
pipelineDeleteModal.findSubmitButton().click();

cy.step('Verify that the pipeline no longer exist');
pipelinesTable.shouldBeEmpty();
cy.step('Verify that the pipeline no longer exist');
pipelinesTable.shouldBeEmpty();
} else {
throw new Error('Pipeline ID and Version ID could not be extracted from the URL.');
}
});
});
});

0 comments on commit 5489de0

Please sign in to comment.