Merge pull request #93 from sartography/bug/cypress-tests
Bug/cypress tests
This commit is contained in:
commit
98279965c8
|
@ -9,16 +9,19 @@ describe('process-models', () => {
|
|||
cy.logout();
|
||||
});
|
||||
|
||||
const groupDisplayName = 'Acceptance Tests Group One';
|
||||
const deleteProcessModelButtonId = 'delete-process-model-button';
|
||||
const saveChangesButtonText = 'Save Changes';
|
||||
const fileNameInputSelector = 'input[name=file_name]';
|
||||
|
||||
it('can perform crud operations', () => {
|
||||
const uuid = () => Cypress._.random(0, 1e6);
|
||||
const id = uuid();
|
||||
const groupId = 'misc/acceptance-tests-group-one';
|
||||
const groupDisplayName = 'Acceptance Tests Group One';
|
||||
const modelDisplayName = `Test Model 2 ${id}`;
|
||||
const modelId = `test-model-2-${id}`;
|
||||
const newModelDisplayName = `${modelDisplayName} edited`;
|
||||
cy.contains(miscDisplayName).click();
|
||||
cy.wait(500);
|
||||
cy.contains(groupDisplayName).click();
|
||||
cy.createModel(groupId, modelId, modelDisplayName);
|
||||
cy.url().should(
|
||||
|
@ -34,18 +37,8 @@ describe('process-models', () => {
|
|||
cy.contains('Submit').click();
|
||||
cy.contains(`Process Model: ${newModelDisplayName}`);
|
||||
|
||||
// go back to process model show by clicking on the breadcrumb
|
||||
cy.contains(modelDisplayName).click();
|
||||
cy.deleteProcessModelAndConfirm(deleteProcessModelButtonId, groupId);
|
||||
|
||||
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(modelDisplayName).should('not.exist');
|
||||
});
|
||||
|
@ -54,17 +47,17 @@ describe('process-models', () => {
|
|||
const uuid = () => Cypress._.random(0, 1e6);
|
||||
const id = uuid();
|
||||
const directParentGroupId = 'acceptance-tests-group-one';
|
||||
const directParentGroupName = 'Acceptance Tests Group One';
|
||||
const groupId = `misc/${directParentGroupId}`;
|
||||
const groupDisplayName = 'Acceptance Tests Group One';
|
||||
const modelDisplayName = `Test Model 2 ${id}`;
|
||||
const modelId = `test-model-2-${id}`;
|
||||
|
||||
const bpmnFileName = `bpmn_test_file_${id}`;
|
||||
const dmnFileName = `dmn_test_file_${id}`;
|
||||
const jsonFileName = `json_test_file_${id}`;
|
||||
const decision_acceptance_test_id = `decision_acceptance_test_${id}`;
|
||||
|
||||
cy.contains(miscDisplayName).click();
|
||||
cy.wait(500);
|
||||
cy.contains(groupDisplayName).click();
|
||||
cy.createModel(groupId, modelId, modelDisplayName);
|
||||
cy.contains(groupDisplayName).click();
|
||||
|
@ -89,8 +82,8 @@ describe('process-models', () => {
|
|||
cy.wait(500);
|
||||
cy.contains('Save').click();
|
||||
cy.contains('Start Event Name');
|
||||
cy.get('input[name=file_name]').type(bpmnFileName);
|
||||
cy.contains('Save Changes').click();
|
||||
cy.get(fileNameInputSelector).type(bpmnFileName);
|
||||
cy.contains(saveChangesButtonText).click();
|
||||
cy.contains(`Process Model File: ${bpmnFileName}`);
|
||||
cy.contains(modelDisplayName).click();
|
||||
cy.contains(`Process Model: ${modelDisplayName}`);
|
||||
|
@ -104,11 +97,11 @@ describe('process-models', () => {
|
|||
cy.contains('General').click();
|
||||
cy.get('#bio-properties-panel-id')
|
||||
.clear()
|
||||
.type('decision_acceptance_test_1');
|
||||
.type(decision_acceptance_test_id);
|
||||
cy.contains('General').click();
|
||||
cy.contains('Save').click();
|
||||
cy.get('input[name=file_name]').type(dmnFileName);
|
||||
cy.contains('Save Changes').click();
|
||||
cy.get(fileNameInputSelector).type(dmnFileName);
|
||||
cy.contains(saveChangesButtonText).click();
|
||||
cy.contains(`Process Model File: ${dmnFileName}`);
|
||||
cy.contains(modelDisplayName).click();
|
||||
cy.contains(`Process Model: ${modelDisplayName}`);
|
||||
|
@ -121,8 +114,8 @@ describe('process-models', () => {
|
|||
// Some reason, cypress evals json strings so we have to escape it it with '{{}'
|
||||
cy.get('.view-line').type('{{} "test_key": "test_value" }');
|
||||
cy.getBySel('file-save-button').click();
|
||||
cy.get('input[name=file_name]').type(jsonFileName);
|
||||
cy.contains('Save Changes').click();
|
||||
cy.get(fileNameInputSelector).type(jsonFileName);
|
||||
cy.contains(saveChangesButtonText).click();
|
||||
cy.contains(`Process Model File: ${jsonFileName}`);
|
||||
// wait for json to load before clicking away to avoid network errors
|
||||
cy.wait(500);
|
||||
|
@ -131,15 +124,7 @@ describe('process-models', () => {
|
|||
// cy.getBySel('files-accordion').click();
|
||||
cy.contains(`${jsonFileName}.json`).should('exist');
|
||||
|
||||
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.deleteProcessModelAndConfirm(deleteProcessModelButtonId, groupId);
|
||||
cy.contains(modelId).should('not.exist');
|
||||
cy.contains(modelDisplayName).should('not.exist');
|
||||
|
||||
|
@ -152,12 +137,10 @@ describe('process-models', () => {
|
|||
const id = uuid();
|
||||
const directParentGroupId = 'acceptance-tests-group-one';
|
||||
const groupId = `misc/${directParentGroupId}`;
|
||||
const groupDisplayName = 'Acceptance Tests Group One';
|
||||
const modelDisplayName = `Test Model 2 ${id}`;
|
||||
const modelId = `test-model-2-${id}`;
|
||||
cy.contains('Add a process group');
|
||||
cy.contains(miscDisplayName).click();
|
||||
cy.wait(500);
|
||||
cy.contains(groupDisplayName).click();
|
||||
cy.createModel(groupId, modelId, modelDisplayName);
|
||||
|
||||
|
@ -193,7 +176,7 @@ describe('process-models', () => {
|
|||
// in breadcrumb
|
||||
cy.contains(modelDisplayName).click();
|
||||
|
||||
cy.getBySel('delete-process-model-button').click();
|
||||
cy.getBySel(deleteProcessModelButtonId).click();
|
||||
cy.contains('Are you sure');
|
||||
cy.getBySel('delete-process-model-button-modal-confirmation-dialog')
|
||||
.find('.cds--btn--danger')
|
||||
|
@ -206,14 +189,6 @@ describe('process-models', () => {
|
|||
cy.contains(modelDisplayName).should('not.exist');
|
||||
});
|
||||
|
||||
// process models no longer has pagination post-tiles
|
||||
// it.only('can paginate items', () => {
|
||||
// cy.contains(miscDisplayName).click();
|
||||
// cy.wait(500);
|
||||
// cy.contains('Acceptance Tests Group One').click();
|
||||
// cy.basicPaginationTest();
|
||||
// });
|
||||
|
||||
it('can allow searching for model', () => {
|
||||
cy.getBySel('process-model-selection').click().type('model-3');
|
||||
cy.contains('acceptance-tests-group-one/acceptance-tests-model-3').click();
|
||||
|
|
|
@ -151,3 +151,18 @@ Cypress.Commands.add('assertAtLeastOneItemInPaginatedResults', () => {
|
|||
Cypress.Commands.add('assertNoItemInPaginatedResults', () => {
|
||||
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)}`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -9850,9 +9850,9 @@
|
|||
"integrity": "sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A=="
|
||||
},
|
||||
"node_modules/cypress": {
|
||||
"version": "12.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.1.0.tgz",
|
||||
"integrity": "sha512-7fz8N84uhN1+ePNDsfQvoWEl4P3/VGKKmAg+bJQFY4onhA37Ys+6oBkGbNdwGeC7n2QqibNVPhk8x3YuQLwzfw==",
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.2.0.tgz",
|
||||
"integrity": "sha512-kvl95ri95KK8mAy++tEU/wUgzAOMiIciZSL97LQvnOinb532m7dGvwN0mDSIGbOd71RREtmT9o4h088RjK5pKw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
|
@ -38586,9 +38586,9 @@
|
|||
"integrity": "sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A=="
|
||||
},
|
||||
"cypress": {
|
||||
"version": "12.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.1.0.tgz",
|
||||
"integrity": "sha512-7fz8N84uhN1+ePNDsfQvoWEl4P3/VGKKmAg+bJQFY4onhA37Ys+6oBkGbNdwGeC7n2QqibNVPhk8x3YuQLwzfw==",
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.2.0.tgz",
|
||||
"integrity": "sha512-kvl95ri95KK8mAy++tEU/wUgzAOMiIciZSL97LQvnOinb532m7dGvwN0mDSIGbOd71RREtmT9o4h088RjK5pKw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cypress/request": "^2.88.10",
|
||||
|
|
Loading…
Reference in New Issue