fix cypress tests

This commit is contained in:
burnettk 2022-09-29 12:59:24 -04:00
parent b8f8a0bebb
commit a64e480d41
4 changed files with 20 additions and 15 deletions

View File

@ -21,7 +21,7 @@ describe('tasks', () => {
cy.logout();
});
it.only('can complete and navigate a form', () => {
it('can complete and navigate a form', () => {
const groupId = 'acceptance-tests-group-one';
const modelId = `acceptance-tests-model-2`;
const completedTaskClassName = 'completed-task-highlight';
@ -29,13 +29,11 @@ describe('tasks', () => {
cy.navigateToProcessModel(groupId, modelId);
// create a bunch to test pagination as well
cy.runPrimaryBpmnFile();
cy.navigateToTasks();
cy.url().should('include', '/tasks');
// avoid reloading so we can click on the task link that appears on running the process instance
cy.runPrimaryBpmnFile(false);
cy.contains('my task').click();
// FIXME: this will probably need a better way to link to the proper form that we want
cy.contains('Complete form1').click();
submitInputIntoFormField(
'get_user_generated_number_one',
'#root_user_generated_number_1',
@ -91,7 +89,8 @@ describe('tasks', () => {
cy.url().should('include', '/tasks');
// FIXME: this will probably need a better way to link to the proper form that we want
cy.contains('Complete form4').click();
cy.contains('Complete Task').click();
submitInputIntoFormField(
'get_user_generated_number_four',
'#root_user_generated_number_4',

View File

@ -74,11 +74,13 @@ Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => {
cy.contains(`Process Model: ${modelId}`);
});
Cypress.Commands.add('runPrimaryBpmnFile', () => {
Cypress.Commands.add('runPrimaryBpmnFile', (reload = true) => {
cy.contains('Run').click();
cy.contains(/Process Instance.*kicked off/);
cy.reload(true);
cy.contains(/Process Instance.*kicked off/).should('not.exist');
if (reload) {
cy.reload(true);
cy.contains(/Process Instance.*kicked off/).should('not.exist');
}
});
Cypress.Commands.add('navigateToProcessModel', (groupId, modelId) => {

View File

@ -41,18 +41,20 @@ export default function ProcessGroupNew() {
<ProcessBreadcrumb />
<h2>Add Process Group</h2>
<Form onSubmit={addProcessGroup}>
<Form.Group className="mb-3" controlId="formDisplayName">
<Form.Group className="mb-3" controlId="display_name">
<Form.Label>Display Name:</Form.Label>
<Form.Control
type="text"
name="display_name"
value={displayName}
onChange={(e) => onDisplayNameChanged(e.target.value)}
/>
</Form.Group>
<Form.Group className="mb-3" controlId="formIdentifier">
<Form.Group className="mb-3" controlId="identifier">
<Form.Label>ID:</Form.Label>
<Form.Control
type="text"
name="id"
value={identifier}
onChange={(e) => {
setIdentifier(e.target.value);

View File

@ -48,17 +48,19 @@ export default function ProcessModelNew() {
<ProcessBreadcrumb />
<h2>Add Process Model</h2>
<Form onSubmit={addProcessModel}>
<Form.Group className="mb-3" controlId="formDisplayName">
<Form.Group className="mb-3" controlId="display_name">
<Form.Label>Display Name:</Form.Label>
<Form.Control
name="display_name"
type="text"
value={displayName}
onChange={(e) => onDisplayNameChanged(e.target.value)}
/>
</Form.Group>
<Form.Group className="mb-3" controlId="formIdentifier">
<Form.Group className="mb-3" controlId="identifier">
<Form.Label>ID:</Form.Label>
<Form.Control
name="id"
type="text"
value={identifier}
onChange={(e) => {