fixed process model tests
This commit is contained in:
parent
cf48d572f6
commit
9870a0b040
|
@ -8,16 +8,19 @@ describe('process-models', () => {
|
||||||
cy.logout();
|
cy.logout();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const sharedResourceString = 'Shared Resources';
|
||||||
|
const groupDisplayName = 'Acceptance Tests Group One';
|
||||||
|
const deleteProcessModelButtonId = 'delete-process-model-button';
|
||||||
|
|
||||||
it('can perform crud operations', () => {
|
it('can perform crud operations', () => {
|
||||||
const uuid = () => Cypress._.random(0, 1e6);
|
const uuid = () => Cypress._.random(0, 1e6);
|
||||||
const id = uuid();
|
const id = uuid();
|
||||||
const groupId = 'misc/acceptance-tests-group-one';
|
const groupId = 'misc/acceptance-tests-group-one';
|
||||||
const groupDisplayName = 'Acceptance Tests Group One';
|
|
||||||
const modelDisplayName = `Test Model 2 ${id}`;
|
const modelDisplayName = `Test Model 2 ${id}`;
|
||||||
const modelId = `test-model-2-${id}`;
|
const modelId = `test-model-2-${id}`;
|
||||||
const newModelDisplayName = `${modelDisplayName} edited`;
|
const newModelDisplayName = `${modelDisplayName} edited`;
|
||||||
cy.contains('99-Shared Resources').click();
|
cy.contains(sharedResourceString).click();
|
||||||
cy.wait(500);
|
cy.wait(750);
|
||||||
cy.contains(groupDisplayName).click();
|
cy.contains(groupDisplayName).click();
|
||||||
cy.createModel(groupId, modelId, modelDisplayName);
|
cy.createModel(groupId, modelId, modelDisplayName);
|
||||||
cy.url().should(
|
cy.url().should(
|
||||||
|
@ -33,18 +36,8 @@ describe('process-models', () => {
|
||||||
cy.contains('Submit').click();
|
cy.contains('Submit').click();
|
||||||
cy.contains(`Process Model: ${newModelDisplayName}`);
|
cy.contains(`Process Model: ${newModelDisplayName}`);
|
||||||
|
|
||||||
// go back to process model show by clicking on the breadcrumb
|
cy.deleteProcessModelAndConfirm(deleteProcessModelButtonId, groupId);
|
||||||
cy.contains(modelId).click();
|
|
||||||
|
|
||||||
cy.getBySel('delete-process-model-button').click();
|
|
||||||
cy.contains('Are you sure');
|
|
||||||
cy.getBySel('delete-process-model-button-modal-confirmation-dialog')
|
|
||||||
.find('.cds--btn--danger')
|
|
||||||
.click();
|
|
||||||
cy.url().should(
|
|
||||||
'include',
|
|
||||||
`process-groups/${modifyProcessIdentifierForPathParam(groupId)}`
|
|
||||||
);
|
|
||||||
cy.contains(modelId).should('not.exist');
|
cy.contains(modelId).should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,20 +45,22 @@ describe('process-models', () => {
|
||||||
const uuid = () => Cypress._.random(0, 1e6);
|
const uuid = () => Cypress._.random(0, 1e6);
|
||||||
const id = uuid();
|
const id = uuid();
|
||||||
const directParentGroupId = 'acceptance-tests-group-one';
|
const directParentGroupId = 'acceptance-tests-group-one';
|
||||||
|
const directParentGroupName = 'Acceptance Tests Group One';
|
||||||
const groupId = `misc/${directParentGroupId}`;
|
const groupId = `misc/${directParentGroupId}`;
|
||||||
const groupDisplayName = 'Acceptance Tests Group One';
|
|
||||||
const modelDisplayName = `Test Model 2 ${id}`;
|
const modelDisplayName = `Test Model 2 ${id}`;
|
||||||
const modelId = `test-model-2-${id}`;
|
const modelId = `test-model-2-${id}`;
|
||||||
|
|
||||||
const bpmnFileName = `bpmn_test_file_${id}`;
|
const bpmnFileName = `bpmn_test_file_${id}`;
|
||||||
const dmnFileName = `dmn_test_file_${id}`;
|
const dmnFileName = `dmn_test_file_${id}`;
|
||||||
const jsonFileName = `json_test_file_${id}`;
|
const jsonFileName = `json_test_file_${id}`;
|
||||||
|
const decision_acceptance_test_id = `decision_acceptance_test_${id}`;
|
||||||
|
|
||||||
cy.contains('99-Shared Resources').click();
|
cy.contains(sharedResourceString).click();
|
||||||
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(directParentGroupName).click();
|
||||||
|
cy.wait(500);
|
||||||
cy.contains(modelDisplayName).click();
|
cy.contains(modelDisplayName).click();
|
||||||
cy.url().should(
|
cy.url().should(
|
||||||
'include',
|
'include',
|
||||||
|
@ -90,7 +85,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');
|
||||||
|
@ -102,13 +97,13 @@ describe('process-models', () => {
|
||||||
cy.contains('General').click();
|
cy.contains('General').click();
|
||||||
cy.get('#bio-properties-panel-id')
|
cy.get('#bio-properties-panel-id')
|
||||||
.clear()
|
.clear()
|
||||||
.type('decision_acceptance_test_1');
|
.type(decision_acceptance_test_id);
|
||||||
cy.contains('General').click();
|
cy.contains('General').click();
|
||||||
cy.contains('Save').click();
|
cy.contains('Save').click();
|
||||||
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');
|
||||||
|
@ -124,20 +119,12 @@ 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');
|
||||||
|
|
||||||
cy.getBySel('delete-process-model-button').click();
|
cy.deleteProcessModelAndConfirm(deleteProcessModelButtonId, groupId);
|
||||||
cy.contains('Are you sure');
|
|
||||||
cy.getBySel('delete-process-model-button-modal-confirmation-dialog')
|
|
||||||
.find('.cds--btn--danger')
|
|
||||||
.click();
|
|
||||||
cy.url().should(
|
|
||||||
'include',
|
|
||||||
`process-groups/${modifyProcessIdentifierForPathParam(groupId)}`
|
|
||||||
);
|
|
||||||
cy.contains(modelId).should('not.exist');
|
cy.contains(modelId).should('not.exist');
|
||||||
cy.contains(modelDisplayName).should('not.exist');
|
cy.contains(modelDisplayName).should('not.exist');
|
||||||
});
|
});
|
||||||
|
@ -147,16 +134,15 @@ describe('process-models', () => {
|
||||||
const id = uuid();
|
const id = uuid();
|
||||||
const directParentGroupId = 'acceptance-tests-group-one';
|
const directParentGroupId = 'acceptance-tests-group-one';
|
||||||
const groupId = `misc/${directParentGroupId}`;
|
const groupId = `misc/${directParentGroupId}`;
|
||||||
const groupDisplayName = 'Acceptance Tests Group One';
|
|
||||||
const modelDisplayName = `Test Model 2 ${id}`;
|
const modelDisplayName = `Test Model 2 ${id}`;
|
||||||
const modelId = `test-model-2-${id}`;
|
const modelId = `test-model-2-${id}`;
|
||||||
cy.contains('Add a process group');
|
cy.contains('Add a process group');
|
||||||
cy.contains('99-Shared Resources').click();
|
cy.contains(sharedResourceString).click();
|
||||||
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('Add a process model');
|
cy.contains('Add a process model');
|
||||||
cy.contains(modelDisplayName).click();
|
cy.contains(modelDisplayName).click();
|
||||||
cy.url().should(
|
cy.url().should(
|
||||||
|
@ -188,27 +174,20 @@ describe('process-models', () => {
|
||||||
// in breadcrumb
|
// in breadcrumb
|
||||||
cy.contains(modelId).click();
|
cy.contains(modelId).click();
|
||||||
|
|
||||||
cy.getBySel('delete-process-model-button').click();
|
cy.getBySel(deleteProcessModelButtonId).click();
|
||||||
cy.contains('Are you sure');
|
cy.contains('Are you sure');
|
||||||
cy.getBySel('delete-process-model-button-modal-confirmation-dialog')
|
cy.getBySel('delete-process-model-button-modal-confirmation-dialog')
|
||||||
.find('.cds--btn--danger')
|
.find('.cds--btn--danger')
|
||||||
.click();
|
.click();
|
||||||
cy.url().should(
|
// cy.url().should(
|
||||||
'include',
|
// 'include',
|
||||||
`process-groups/${modifyProcessIdentifierForPathParam(groupId)}`
|
// `process-instances?process_model_identifier=${modifyProcessIdentifierForPathParam(groupId)}`
|
||||||
);
|
// );
|
||||||
|
// cy.wait(750);
|
||||||
cy.contains(modelId).should('not.exist');
|
cy.contains(modelId).should('not.exist');
|
||||||
cy.contains(modelDisplayName).should('not.exist');
|
cy.contains(modelDisplayName).should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
// process models no longer has pagination post-tiles
|
|
||||||
// it.only('can paginate items', () => {
|
|
||||||
// cy.contains('99-Shared Resources').click();
|
|
||||||
// cy.wait(500);
|
|
||||||
// cy.contains('Acceptance Tests Group One').click();
|
|
||||||
// cy.basicPaginationTest();
|
|
||||||
// });
|
|
||||||
|
|
||||||
it('can allow searching for model', () => {
|
it('can allow searching for model', () => {
|
||||||
cy.getBySel('process-model-selection').click().type('model-3');
|
cy.getBySel('process-model-selection').click().type('model-3');
|
||||||
cy.contains('acceptance-tests-group-one/acceptance-tests-model-3').click();
|
cy.contains('acceptance-tests-group-one/acceptance-tests-model-3').click();
|
||||||
|
|
|
@ -86,15 +86,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 Kicked Off/);
|
||||||
cy.reload(true);
|
cy.reload(true);
|
||||||
cy.contains(/Process Instance.*kicked off/).should('not.exist');
|
cy.contains(/Process Instance Kicked Off/).should('not.exist');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -132,3 +132,18 @@ Cypress.Commands.add('assertAtLeastOneItemInPaginatedResults', () => {
|
||||||
Cypress.Commands.add('assertNoItemInPaginatedResults', () => {
|
Cypress.Commands.add('assertNoItemInPaginatedResults', () => {
|
||||||
cy.contains(/\b0–0 of 0 items/);
|
cy.contains(/\b0–0 of 0 items/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add(
|
||||||
|
'deleteProcessModelAndConfirm',
|
||||||
|
(buttonId, groupId) => {
|
||||||
|
cy.getBySel(buttonId).click();
|
||||||
|
cy.contains('Are you sure');
|
||||||
|
cy.getBySel('delete-process-model-button-modal-confirmation-dialog')
|
||||||
|
.find('.cds--btn--danger')
|
||||||
|
.click();
|
||||||
|
cy.url().should(
|
||||||
|
'include',
|
||||||
|
`process-groups/${modifyProcessIdentifierForPathParam(groupId)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue