diff --git a/tests/functional/cypress/e2e/form-submission-assign-status.cy.js b/tests/functional/cypress/e2e/form-submission-assign-status.cy.js index c276a7bb2..2bbeaeb82 100644 --- a/tests/functional/cypress/e2e/form-submission-assign-status.cy.js +++ b/tests/functional/cypress/e2e/form-submission-assign-status.cy.js @@ -35,38 +35,16 @@ describe('Form Designer', () => { cy.viewport(1000, 1800); cy.waitForLoad(); cy.get('button').contains('Basic Fields').click(); - let textFields = ["First Name", "Middle Name", "Last Name"]; - - for(let i=0; i { - const bounds = $el[0].getBoundingClientRect(); - cy.get('span.btn').contains('Text Field') - .trigger('mousedown', { which: 1}, { force: true }) - .trigger('mousemove', bounds.x, -100, { force: true }) - .trigger('mouseup', { force: true }); - cy.get('p').contains('Text Field Component'); - cy.get('input[name="data[label]"]').clear(); - cy.get('input[name="data[label]"]').clear(); - cy.get('input[name="data[label]"]').type(textFields[i]); - 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(); - }); - - + 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', () => { @@ -115,23 +93,22 @@ describe('Form Designer', () => { cy.get('button').contains('Submit').should('be.visible'); cy.waitForLoad(); cy.waitForLoad(); - cy.get('input[name="data[simpletextfield1]"').click(); - cy.get('input[name="data[simpletextfield1]"').type('Alex'); - 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('Alex'); //cy.get('.form-check-input').click(); //form submission cy.get('button').contains('Submit').click(); cy.waitForLoad(); cy.get('button').contains('Submit').click(); cy.waitForLoad(); - cy.get('button').contains('Submit').click(); cy.waitForLoad(); cy.waitForLoad(); + 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.waitForLoad(); 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'); //Update submission @@ -143,17 +120,19 @@ describe('Form Designer', () => { cy.waitForLoad(); cy.waitForLoad(); cy.get('button').contains('Submit').should('be.visible'); - cy.get('input[name="data[simpletextfield1]"').click(); - cy.get('input[name="data[simpletextfield1]"').type('Alex'); - 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'); 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('First Name').should('be.visible'); - cy.get('label').contains('Last Name').should('be.visible'); - cy.get('label').contains('Applying for self').should('be.visible'); + //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.waitForLoad(); + cy.waitForLoad(); cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); cy.waitForLoad(); cy.waitForLoad(); @@ -194,9 +173,11 @@ describe('Form Designer', () => { //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('.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.waitForLoad(); cy.waitForLoad(); //Verify Edit submission button is disabled