process model cypress tests are passing w/ burnettk

This commit is contained in:
jasquat 2022-12-14 17:45:31 -05:00
parent 7cfc08d620
commit 576b5f8a63
3 changed files with 16 additions and 14 deletions

View File

@ -35,7 +35,7 @@ describe('process-models', () => {
cy.contains(`Process Model: ${newModelDisplayName}`); cy.contains(`Process Model: ${newModelDisplayName}`);
// go back to process model show by clicking on the breadcrumb // go back to process model show by clicking on the breadcrumb
cy.contains(modelId).click(); cy.contains(modelDisplayName).click();
cy.getBySel('delete-process-model-button').click(); cy.getBySel('delete-process-model-button').click();
cy.contains('Are you sure'); cy.contains('Are you sure');
@ -47,6 +47,7 @@ describe('process-models', () => {
`process-groups/${modifyProcessIdentifierForPathParam(groupId)}` `process-groups/${modifyProcessIdentifierForPathParam(groupId)}`
); );
cy.contains(modelId).should('not.exist'); cy.contains(modelId).should('not.exist');
cy.contains(modelDisplayName).should('not.exist');
}); });
it('can create new bpmn, dmn, and json files', () => { it('can create new bpmn, dmn, and json files', () => {
@ -66,7 +67,7 @@ describe('process-models', () => {
cy.wait(500); cy.wait(500);
cy.contains(groupDisplayName).click(); cy.contains(groupDisplayName).click();
cy.createModel(groupId, modelId, modelDisplayName); cy.createModel(groupId, modelId, modelDisplayName);
cy.contains(directParentGroupId).click(); cy.contains(groupDisplayName).click();
cy.contains(modelDisplayName).click(); cy.contains(modelDisplayName).click();
cy.url().should( cy.url().should(
'include', 'include',
@ -91,7 +92,7 @@ describe('process-models', () => {
cy.get('input[name=file_name]').type(bpmnFileName); cy.get('input[name=file_name]').type(bpmnFileName);
cy.contains('Save Changes').click(); cy.contains('Save Changes').click();
cy.contains(`Process Model File: ${bpmnFileName}`); cy.contains(`Process Model File: ${bpmnFileName}`);
cy.contains(modelId).click(); cy.contains(modelDisplayName).click();
cy.contains(`Process Model: ${modelDisplayName}`); cy.contains(`Process Model: ${modelDisplayName}`);
// cy.getBySel('files-accordion').click(); // cy.getBySel('files-accordion').click();
cy.contains(`${bpmnFileName}.bpmn`).should('exist'); cy.contains(`${bpmnFileName}.bpmn`).should('exist');
@ -109,7 +110,7 @@ describe('process-models', () => {
cy.get('input[name=file_name]').type(dmnFileName); cy.get('input[name=file_name]').type(dmnFileName);
cy.contains('Save Changes').click(); cy.contains('Save Changes').click();
cy.contains(`Process Model File: ${dmnFileName}`); cy.contains(`Process Model File: ${dmnFileName}`);
cy.contains(modelId).click(); cy.contains(modelDisplayName).click();
cy.contains(`Process Model: ${modelDisplayName}`); cy.contains(`Process Model: ${modelDisplayName}`);
// cy.getBySel('files-accordion').click(); // cy.getBySel('files-accordion').click();
cy.contains(`${dmnFileName}.dmn`).should('exist'); cy.contains(`${dmnFileName}.dmn`).should('exist');
@ -125,7 +126,7 @@ describe('process-models', () => {
cy.contains(`Process Model File: ${jsonFileName}`); cy.contains(`Process Model File: ${jsonFileName}`);
// wait for json to load before clicking away to avoid network errors // wait for json to load before clicking away to avoid network errors
cy.wait(500); cy.wait(500);
cy.contains(modelId).click(); cy.contains(modelDisplayName).click();
cy.contains(`Process Model: ${modelDisplayName}`); cy.contains(`Process Model: ${modelDisplayName}`);
// cy.getBySel('files-accordion').click(); // cy.getBySel('files-accordion').click();
cy.contains(`${jsonFileName}.json`).should('exist'); cy.contains(`${jsonFileName}.json`).should('exist');
@ -157,7 +158,7 @@ describe('process-models', () => {
cy.contains(groupDisplayName).click(); cy.contains(groupDisplayName).click();
cy.createModel(groupId, modelId, modelDisplayName); cy.createModel(groupId, modelId, modelDisplayName);
cy.contains(`${directParentGroupId}`).click(); cy.contains(`${groupDisplayName}`).click();
cy.contains('Add a process model'); cy.contains('Add a process model');
cy.contains(modelDisplayName).click(); cy.contains(modelDisplayName).click();
cy.url().should( cy.url().should(
@ -187,7 +188,7 @@ describe('process-models', () => {
.click(); .click();
// in breadcrumb // in breadcrumb
cy.contains(modelId).click(); cy.contains(modelDisplayName).click();
cy.getBySel('delete-process-model-button').click(); cy.getBySel('delete-process-model-button').click();
cy.contains('Are you sure'); cy.contains('Are you sure');

View File

@ -87,15 +87,15 @@ Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => {
Cypress.Commands.add( Cypress.Commands.add(
'runPrimaryBpmnFile', 'runPrimaryBpmnFile',
(expectAutoRedirectToHumanTask = false) => { (expectAutoRedirectToHumanTask = false) => {
cy.contains('Run').click(); cy.contains('Start').click();
if (expectAutoRedirectToHumanTask) { if (expectAutoRedirectToHumanTask) {
// the url changes immediately, so also make sure we get some content from the next page, "Task:", or else when we try to interact with the page, it'll re-render and we'll get an error with cypress. // the url changes immediately, so also make sure we get some content from the next page, "Task:", or else when we try to interact with the page, it'll re-render and we'll get an error with cypress.
cy.url().should('include', `/tasks/`); cy.url().should('include', `/tasks/`);
cy.contains('Task: '); cy.contains('Task: ');
} else { } else {
cy.contains(/Process Instance.*kicked off/); cy.contains(/Process Instance.*[kK]icked [oO]ff/);
cy.reload(true); cy.reload(true);
cy.contains(/Process Instance.*kicked off/).should('not.exist'); cy.contains(/Process Instance.*[kK]icked [oO]ff/).should('not.exist');
} }
} }
); );

View File

@ -21,10 +21,11 @@ export default function ProcessInstanceList() {
<ProcessBreadcrumb <ProcessBreadcrumb
hotCrumbs={[ hotCrumbs={[
['Process Groups', '/admin'], ['Process Groups', '/admin'],
[ {
`Process Model: ${processModelFullIdentifier}`, entityToExplode: processModelFullIdentifier,
`process_model:${processModelFullIdentifier}:link`, entityType: 'process-model-id',
], linkLastItem: true,
},
['Process Instances'], ['Process Instances'],
]} ]}
/> />