mirror of
https://github.com/sartography/spiffworkflow-frontend.git
synced 2025-02-24 04:08:10 +00:00
create process instance and then run it in 2 calls now w/ burnettk
This commit is contained in:
parent
70a48991f5
commit
c7f0719e06
@ -71,7 +71,7 @@ describe('process-instances', () => {
|
||||
cy.runPrimaryBpmnFile(dmnOutputForKevin);
|
||||
});
|
||||
|
||||
it.only('can paginate items', () => {
|
||||
it('can paginate items', () => {
|
||||
// make sure we have some process instances
|
||||
cy.runPrimaryBpmnFile('Very wonderful');
|
||||
cy.runPrimaryBpmnFile('Very wonderful');
|
||||
@ -110,6 +110,9 @@ describe('process-instances', () => {
|
||||
date.setHours(date.getHours() - 1);
|
||||
filterByDate(date);
|
||||
assertAtLeastOneItemInPaginatedResults();
|
||||
|
||||
// make sure we are at the bottom of the page
|
||||
cy.scrollTo(0, 1000)
|
||||
cy.getBySel("process-instance-status").contains("not_started");
|
||||
|
||||
date.setHours(date.getHours() + 2);
|
||||
|
@ -54,7 +54,7 @@ Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => {
|
||||
});
|
||||
|
||||
Cypress.Commands.add('runPrimaryBpmnFile', (expectedText) => {
|
||||
cy.contains('Run Primary').click();
|
||||
cy.contains('Run').click();
|
||||
cy.contains(expectedText);
|
||||
cy.reload(true)
|
||||
cy.contains(expectedText).should('not.exist');
|
||||
|
@ -30,12 +30,30 @@ export default function ProcessModelShow() {
|
||||
)
|
||||
}, [params]);
|
||||
|
||||
const processModelRun = ((event) => {
|
||||
const processInstanceCreateAndRun = ((event) => {
|
||||
fetch(`${BACKEND_BASE_URL}/process-models/${processModel.process_group_id}/${processModel.id}`, {
|
||||
headers: new Headers({
|
||||
'Authorization': `Bearer ${HOT_AUTH_TOKEN}`
|
||||
}),
|
||||
method: 'POST',
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(
|
||||
(result) => {
|
||||
processModelRun(result);
|
||||
},
|
||||
(error) => {
|
||||
console.log(error);
|
||||
}
|
||||
)
|
||||
});
|
||||
|
||||
const processModelRun = ((processInstance) => {
|
||||
fetch(`${BACKEND_BASE_URL}/process-models/${processModel.process_group_id}/${processModel.id}/process-instances/${processInstance.id}/run`, {
|
||||
headers: new Headers({
|
||||
'Authorization': `Bearer ${HOT_AUTH_TOKEN}`
|
||||
}),
|
||||
method: 'POST',
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(
|
||||
@ -82,7 +100,7 @@ export default function ProcessModelShow() {
|
||||
<FileInput processModel={processModel} />
|
||||
<br />
|
||||
<Stack direction="horizontal" gap={3}>
|
||||
<Button onClick={processModelRun} variant="primary">Run Primary</Button>
|
||||
<Button onClick={processInstanceCreateAndRun} variant="primary">Run</Button>
|
||||
<Button href={`/process-models/${processModel.process_group_id}/${processModel.id}/edit`} variant="secondary">Edit process model</Button>
|
||||
<Button href={`/process-models/${processModel.process_group_id}/${processModel.id}/file?file_type=bpmn`} variant="warning">Add New BPMN File</Button>
|
||||
<Button href={`/process-models/${processModel.process_group_id}/${processModel.id}/file?file_type=dmn`} variant="success">Add New DMN File</Button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user