Skip to content

Commit

Permalink
Merge branch 'main' into fix/forms-1487
Browse files Browse the repository at this point in the history
  • Loading branch information
nimya-aot authored Sep 26, 2024
2 parents 4ce9fcc + 072d93e commit 7b0f3f6
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ describe('Form Designer', () => {
cy.get('.mdi-delete').click();
cy.get('[data-test="continue-btn-continue"]').click();


})

});
Expand Down
21 changes: 3 additions & 18 deletions tests/functional/cypress/e2e/form-design-basicfields.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();

Expand Down Expand Up @@ -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();
Expand Down
58 changes: 3 additions & 55 deletions tests/functional/cypress/e2e/form-edit-submission-data.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');
Expand All @@ -113,35 +90,18 @@ 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');
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.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();
Expand All @@ -154,20 +114,14 @@ 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');
cy.get('[data-test="continue-btn-continue"]').should('exist');
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();
Expand All @@ -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');

Expand All @@ -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 => {
Expand Down
9 changes: 3 additions & 6 deletions tests/functional/cypress/e2e/form-manage-form.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();


Expand All @@ -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();
Expand Down
Loading

0 comments on commit 7b0f3f6

Please sign in to comment.