diff --git a/tests/functional/cypress/e2e/form-design-advancedfield.cy.js b/tests/functional/cypress/e2e/form-design-advancedfield.cy.js index 71f80662a..b0d0d9c49 100644 --- a/tests/functional/cypress/e2e/form-design-advancedfield.cy.js +++ b/tests/functional/cypress/e2e/form-design-advancedfield.cy.js @@ -320,7 +320,6 @@ describe('Form Designer', () => { cy.get('.mdi-delete').click(); cy.get('[data-test="continue-btn-continue"]').click(); - }) }); diff --git a/tests/functional/cypress/e2e/form-design-basicfields.cy.js b/tests/functional/cypress/e2e/form-design-basicfields.cy.js index 1db622f95..4e8170670 100644 --- a/tests/functional/cypress/e2e/form-design-basicfields.cy.js +++ b/tests/functional/cypress/e2e/form-design-basicfields.cy.js @@ -223,13 +223,9 @@ describe('Form Designer', () => { cy.waitForLoad(); cy.get('[data-cy="settingsRouterLink"]').click(); cy.get('a > .v-btn > .v-btn__content > .mdi-pencil').click(); - cy.waitForLoad(); - cy.waitForLoad(); + cy.wait(4000); //Adding another component - - //cy.get('button').contains('Basic Fields').click(); - //cy.get('button').contains('Basic Fields').click(); cy.get('label').contains('First Name').should('be.visible'); cy.get('div.formio-builder-form').then($el => { const coords = $el[0].getBoundingClientRect(); @@ -242,16 +238,7 @@ describe('Form Designer', () => { cy.get('button').contains('Save').click(); }); - /*cy.get('[ref=removeComponent]').then($el => { - - const rem=$el[11]; - rem.click(); - - }); - - cy.waitForLoad(); - cy.waitForLoad(); - */ + cy.wait(4000); cy.get('[data-cy=saveButton]').click(); cy.waitForLoad(); @@ -280,9 +267,7 @@ describe('Form Designer', () => { //Delete form after test run cy.visit(`/${depEnv}/form/design?d=${arrayValues[0]}&f=${dval[0]}`); - cy.waitForLoad(); - cy.waitForLoad(); - + cy.wait(4000); cy.get('[data-cy="settingsRouterLink"] > .v-btn').click(); cy.waitForLoad(); cy.get('[data-test="canRemoveForm"]').click(); diff --git a/tests/functional/cypress/e2e/form-edit-submission-data.cy.js b/tests/functional/cypress/e2e/form-edit-submission-data.cy.js index d10827e7c..f66d0549f 100644 --- a/tests/functional/cypress/e2e/form-edit-submission-data.cy.js +++ b/tests/functional/cypress/e2e/form-edit-submission-data.cy.js @@ -44,24 +44,7 @@ describe('Form Designer', () => { .trigger('mouseup', { force: true }); cy.get('button').contains('Save').click(); }); - - /*cy.get('div.formio-builder-form').then($el => { - const coords2 = $el[0].getBoundingClientRect(); - cy.get('span.btn').contains('Checkbox') - - .trigger('mousedown', { which: 1}, { force: true }) - .trigger('mousemove', coords2.x, -50, { force: true }) - .trigger('mouseup', { force: true }); - //cy.get('p').contains('Checkbox Component'); - //cy.get('input[name="data[label]"]').clear(); - //cy.get('input[name="data[label]"]').clear(); - //cy.get('input[name="data[label]"]').type('Applying for self'); - cy.get('button').contains('Save').click(); - }); - */ // Form saving - - }); it('Form Submission and Updation', () => { cy.viewport(1000, 1100); @@ -84,19 +67,13 @@ describe('Form Designer', () => { }); // Filter the newly created form cy.location('search').then(search => { - //let pathName = fullUrl.pathname + let arr = search.split('='); let arrayValues = arr[1].split('&'); cy.log(arrayValues[0]); - //cy.log(arrayValues[1]); - //cy.log(arrayValues[2]); cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); cy.waitForLoad(); - - - - - //Publish the form + //Publish the form cy.get('.v-label > span').click(); cy.get('span').contains('Publish Version 1'); @@ -113,20 +90,11 @@ describe('Form Designer', () => { cy.waitForLoad(); cy.contains('Text Field').click(); cy.contains('Text Field').type('Alex'); - //cy.contains('Text Field 2').click(); - //cy.contains('Text Field 2').type('Smith'); - //cy.get('.form-check-input').click(); //form submission cy.get('button').contains('Submit').click(); cy.waitForLoad(); - //cy.get('button').contains('Submit').click(); - //cy.contains('Submit').trigger({ force: true }).click(); cy.get('[data-test="continue-btn-continue"]').click({force: true}); cy.waitForLoad(); - //cy.get('button').contains('Submit').click(); - cy.waitForLoad(); - cy.waitForLoad(); - //cy.get('[data-test="continue-btn-continue"]').click(); cy.waitForLoad(); cy.waitForLoad(); cy.get('label').contains('Text Field').should('be.visible'); @@ -134,14 +102,6 @@ describe('Form Designer', () => { cy.location('pathname').should('eq', `/${depEnv}/form/success`); cy.contains('h1', 'Your form has been submitted successfully'); - - //cy.get('label').contains('Last Name').should('be.visible'); - //cy.get('label').contains('Applying for self').should('be.visible'); - - /*it('Form Submission and Updation', () => { - - //Update submission - */ cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); cy.waitForLoad(); cy.waitForLoad(); @@ -154,8 +114,6 @@ describe('Form Designer', () => { cy.waitForLoad(); cy.contains('Text Field').click(); cy.contains('Text Field').type('Alex'); - //cy.contains('Text Field 2').click(); - //cy.contains('Text Field 2').type('Smith'); cy.get('button').contains('Submit').click(); cy.waitForLoad(); cy.get('[data-test="continue-btn-continue"]').should('be.visible'); @@ -163,11 +121,7 @@ describe('Form Designer', () => { cy.get('[data-test="continue-btn-continue"]').click({force: true}); cy.waitForLoad(); cy.waitForLoad(); - //cy.get('[data-test="continue-btn-continue"]').click(); cy.waitForLoad(); - //cy.get('label').contains('First Name').should('be.visible'); - //cy.get('label').contains('Last Name').should('be.visible'); - //cy.get('label').contains('Applying for self').should('be.visible') //view submission cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); cy.waitForLoad(); @@ -183,11 +137,6 @@ describe('Form Designer', () => { cy.get('button').contains('Submit').should('be.visible'); //Edit submission data - //cy.get('input[name="data[simpletextfield1]"').click(); - //cy.get('input[name="data[simpletextfield1]"').clear(); - //cy.get('input[name="data[simpletextfield1]"').type('Nancy'); - //cy.get('input[name="data[simpletextfield2]"').click(); - //cy.get('input[name="data[simpletextfield2]"').type('Smith'); cy.contains('Text Field').click(); cy.contains('Text Field').type('Smith'); @@ -198,8 +147,7 @@ describe('Form Designer', () => { cy.waitForLoad(); cy.waitForLoad(); cy.waitForLoad(); - //cy.get('label').contains('First Name').should('be.visible'); - //cy.get('label').contains('Last Name').should('be.visible'); + //Adding notes to submission cy.get('.mdi-plus').click(); cy.get('div').find('textarea').then($el => { diff --git a/tests/functional/cypress/e2e/form-manage-form.cy.js b/tests/functional/cypress/e2e/form-manage-form.cy.js index d644334c7..05a71ef1d 100644 --- a/tests/functional/cypress/e2e/form-manage-form.cy.js +++ b/tests/functional/cypress/e2e/form-manage-form.cy.js @@ -134,9 +134,7 @@ describe('Form Designer', () => { }); cy.get(':nth-child(4) > .v-input > .v-input__control > .v-field').click(); - cy.waitForLoad(); - cy.waitForLoad(); - cy.waitForLoad(); + cy.wait(4000); cy.contains('days').click(); //verification of Summary cy.contains('span','This form will be open for submissions from').should('be.visible'); @@ -169,13 +167,12 @@ describe('Form Designer', () => { }); - //Clsing date for submission + //Closing date for submission cy.contains('Set custom closing message').click(); cy.get('textarea').type('closed for some reasons') cy.contains('SEND Reminder email').click(); cy.contains('SEND Reminder email').click(); - //cy.contains('b','2026-06-21').should('exist'); cy.get('[data-test="canEditForm"]').click(); @@ -201,7 +198,7 @@ describe('Form Designer', () => { cy.get('.v-col > .v-btn > .v-btn__content > span').click(); // Verify form settings updation success message - cy.get('.v-alert__content').contains('div','Your form settings have been updated successfully.').should('be.visible'); + cy.get('.v-alert__content').contains('div','Subscription settings for this form has been saved.').should('be.visible'); //Delete form after test run cy.get('.mdi-delete').click(); diff --git a/tests/functional/cypress/e2e/form-submission-assign-status.cy.js b/tests/functional/cypress/e2e/form-submission-assign-status.cy.js new file mode 100644 index 000000000..0c6cba167 --- /dev/null +++ b/tests/functional/cypress/e2e/form-submission-assign-status.cy.js @@ -0,0 +1,213 @@ +import 'cypress-keycloak-commands'; +import 'cypress-drag-drop'; +import { formsettings } from '../support/login.js'; + +const depEnv = Cypress.env('depEnv'); + + +Cypress.Commands.add('waitForLoad', () => { + const loaderTimeout = 60000; + + cy.get('.nprogress-busy', { timeout: loaderTimeout }).should('not.exist'); +}); +describe('Form Designer', () => { + + beforeEach(()=>{ + + + cy.on('uncaught:exception', (err, runnable) => { + // Form.io throws an uncaught exception for missing projectid + // Cypress catches it as undefined: undefined so we can't get the text + console.log(err); + return false; + }); + }); + it('Visits the form settings page', () => { + + + cy.viewport(1000, 1100); + cy.waitForLoad(); + formsettings(); + + }); + it('Add some fields for submission', () => { + + cy.viewport(1000, 1800); + cy.waitForLoad(); + cy.get('button').contains('Basic Fields').click(); + cy.get('div.formio-builder-form').then($el => { + const coords = $el[0].getBoundingClientRect(); + cy.get('span.btn').contains('Text Field') + + .trigger('mousedown', { which: 1}, { force: true }) + .trigger('mousemove', coords.x, -50, { force: true }) + .trigger('mouseup', { force: true }); + cy.get('button').contains('Save').click(); + }); + + }); + + it('Form Submission and Updation', () => { + cy.viewport(1000, 1100); + cy.wait(4000); + cy.intercept('GET', `/${depEnv}/api/v1/forms/*`).as('getForm'); + // Form saving + let savedButton = cy.get('[data-cy=saveButton]'); + expect(savedButton).to.not.be.null; + savedButton.trigger('click'); + cy.waitForLoad(); + // Go to My forms + cy.wait('@getForm').then(()=>{ + let userFormsLinks = cy.get('[data-cy=userFormsLinks]'); + expect(userFormsLinks).to.not.be.null; + userFormsLinks.trigger('click'); + }); + // Filter the newly created form + cy.location('search').then(search => { + //let pathName = fullUrl.pathname + let arr = search.split('='); + let arrayValues = arr[1].split('&'); + cy.log(arrayValues[0]); + cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); + cy.waitForLoad(); + //Publish the form + cy.get('.v-label > span').click(); + + cy.get('span').contains('Publish Version 1'); + + cy.contains('Continue').should('be.visible'); + cy.contains('Continue').trigger('click'); + //Submit the form + cy.visit(`/${depEnv}/form/submit?f=${arrayValues[0]}`); + cy.wait(4000); + cy.get('button').contains('Submit').should('be.visible'); + cy.waitForLoad(); + cy.contains('Text Field').click(); + cy.contains('Text Field').type('Alex'); + //cy.get('.form-check-input').click(); + //form submission + cy.get('button').contains('Submit').click(); + cy.waitForLoad(); + cy.get('button').contains('Submit').click(); + cy.wait(4000); + cy.get('label').contains('Text Field').should('be.visible'); + cy.get('label').contains('Text Field').should('be.visible'); + cy.location('pathname').should('eq', `/${depEnv}/form/success`); + cy.contains('h1', 'Your form has been submitted successfully'); + cy.wait(4000); + //Update submission + cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); + cy.wait(4000); + cy.visit(`/${depEnv}/form/submit?f=${arrayValues[0]}`); + cy.wait(4000); + cy.get('button').contains('Submit').should('be.visible'); + cy.contains('Text Field').click(); + cy.contains('Text Field').type('Smith'); + cy.get('button').contains('Submit').click(); + cy.waitForLoad(); + cy.get('button').contains('Submit').click(); + //cy.get('[data-test="continue-btn-continue"]').click(); + cy.get('label').contains('Text Field').should('be.visible'); + //cy.get('label').contains('Applying for self').should('be.visible'); + cy.location('pathname').should('eq', `/${depEnv}/form/success`); + cy.contains('h1', 'Your form has been submitted successfully'); + cy.wait(4000); + cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); + cy.wait(4000); + cy.get('.mdi-list-box-outline').click(); + cy.waitForLoad(); + //Verify pagination for submission + cy.get('div').contains('1-2 of 2').should('be.visible'); + cy.get('.v-select__selection-text').contains('10'); + cy.get('.v-data-table-footer__items-per-page > .v-input > .v-input__control > .v-field > .v-field__append-inner > .mdi-menu-down').click(); + cy.contains('20').should('be.visible'); + cy.contains('25').should('be.visible'); + cy.contains('50').should('be.visible'); + cy.contains('All').should('be.visible'); + cy.get('button[title="Delete Submission"]').should('be.visible'); + //view submission + cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click(); + cy.wait(4000); + }) + + }); + it('Submission status Assignment', () => { + cy.viewport(1000, 1100); + cy.wait(4000); + //Assign status submission + cy.get('.status-heading > .mdi-chevron-right').click(); + cy.get('[data-test="showStatusList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').click(); + cy.contains('ASSIGNED').click(); + cy.get('[data-test="canAssignToMe"] > .v-btn__content > span').should('be.visible'); + cy.get('[data-test="showAssigneeList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').click(); + cy.get('[data-test="showAssigneeList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').type('ch'); + cy.get('div').contains('CHEFS Testing').click(); + cy.get('[data-test="updateStatusToNew"] > .v-btn__content > span').click(); + cy.wait(4000); + //cy.get('[data-test="showStatusList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').click(); + cy.get('[data-test="showStatusList"] > .v-input__control > .v-field > .v-field__append-inner > .mdi-menu-down').click(); + cy.contains('REVISING').click(); + //cy.get('.v-selection-control > .v-label').click(); + cy.get('[data-test="canAttachCommentToEmail"] > .v-input__control > .v-selection-control > .v-label').click(); + cy.get('textarea[rows="1"]').type('some comments'); + cy.get('button').contains('REVISE').click(); + cy.get(':nth-child(1) > .v-checkbox > .v-input__control > .v-selection-control > .v-label').click(); + cy.wait(4000); + + //Verify Edit submission button is disabled + cy.get('button[title="Edit This Submission"]').should('be.disabled'); + //Verify Submission edit users history + cy.get('.mdi-history').click(); + cy.get('.v-data-table__tr > :nth-child(1)').contains('CHEFSTST@idir'); + cy.get('.v-card-actions > .v-btn').click(); + + //Verify History for status updation + cy.get('[data-test="viewHistoryButton"]').click(); + cy.get('[data-test="canCloseStatusPanel"] > .v-btn__content > span').click(); + cy.get('[data-test="showStatusList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').click(); + cy.contains('COMPLETED').click(); + cy.get('button').contains('COMPLETE').click(); + cy.get('[data-test="viewHistoryButton"]').click(); + cy.get('tbody > :nth-child(1) > :nth-child(1)').contains('COMPLETED'); + cy.get('tbody > :nth-child(2) > :nth-child(1)').contains('REVISING'); + cy.get('tbody > :nth-child(3) > :nth-child(1)').contains('ASSIGNED'); + cy.get('tbody > :nth-child(4) > :nth-child(1)').contains('SUBMITTED'); + cy.get('[data-test="canCloseStatusPanel"] > .v-btn__content > span').click(); + cy.get('.mdi-list-box-outline').click(); + cy.waitForLoad(); + cy.location('search').then(search => { + //let pathName = fullUrl.pathname + let arr = search.split('='); + cy.visit(`/${depEnv}/form/manage?f=${arr[1]}`); + cy.waitForLoad(); + // Checks copy submission button enabled for user + cy.visit(`/${depEnv}/user/submissions?f=${arr[1]}`); + + cy.get('.v-data-table-column--align-end > .d-flex > :nth-child(2) > a > .v-btn'); + cy.get('.mdi-pencil-box-multiple'); + + //Delete Submission + cy.visit(`/${depEnv}/form/manage?f=${arr[1]}`); + cy.waitForLoad(); + cy.waitForLoad(); + cy.get('.mdi-list-box-outline').click(); + cy.get('button[title="Delete Submission"]').then($el => { + + const rem=$el[0]; + rem.click(); + + }); + cy.get('[data-test="continue-btn-continue"] > .v-btn__content > span').click(); + cy.get('.v-data-table__tbody > :nth-child(2) > :nth-child(2)').should('not.exist'); + + //Delete form after test run + cy.visit(`/${depEnv}/form/manage?f=${arr[1]}`); + cy.wait(4000); + cy.get('.mdi-delete').click(); + cy.get('[data-test="continue-btn-continue"]').click(); + cy.get('#logoutButton > .v-btn__content > span').click(); + }) + + }); + +}); \ No newline at end of file