Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/FORMS- 1911 Added cypress test scripts to verify validation message while adding users on revising status assignment #1617

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ describe('Form Designer', () => {

});
});
});
});
6 changes: 3 additions & 3 deletions tests/functional/cypress/e2e/form-manage-form.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ describe('Form Designer', () => {

//Checking the schedule of closing date settings
cy.contains('Schedule a closing date').click();
cy.get('[data-test="formattedCloseDate"]').should('be.visible');
cy.get('[data-test="formattedCloseDate"]').click();
cy.get('[data-test="formattedCloseDate"]').type('2026-09-17');
cy.get('[data-test="closeSubmissionDateTime"]').should('be.visible');
cy.get('[data-test="closeSubmissionDateTime"]').click();
cy.get('[data-test="closeSubmissionDateTime"]').type('2026-09-17');
cy.contains('Allow late submissions').click();
cy.get('[data-test="afterCloseDateFor"]').should('be.visible');
cy.get('[data-test="afterCloseDateFor"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Cypress.Commands.add('waitForLoad', () => {

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
Expand All @@ -22,13 +22,17 @@ describe('Form Designer', () => {
});
});
it('Visits the form settings page', () => {


cy.viewport(1000, 1100);
cy.waitForLoad();
formsettings();
});
it('Verify draft submission', () => {
});
// Publish a simple form
it('Verify draft submission', () => {
cy.viewport(1000, 1100);
cy.waitForLoad();

cy.get('button').contains('Basic Fields').click();
cy.get('div.formio-builder-form').then($el => {
const coords = $el[0].getBoundingClientRect();
Expand All @@ -43,24 +47,29 @@ describe('Form Designer', () => {
let savedButton = cy.get('[data-cy=saveButton]');
expect(savedButton).to.not.be.null;
savedButton.trigger('click');
cy.wait(2000);
// Filter the newly created form
cy.wait(3000);
// 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');
//Share link verification
let shareFormButton = cy.get('[data-cy=shareFormButton]');
expect(shareFormButton).to.not.be.null;
shareFormButton.trigger('click').then(()=>{
//let shareFormLinkButton = cy.get('[data-cy=shareFormLinkButtonss]');
let shareFormLinkButton=cy.get('.mx-2');
expect(shareFormLinkButton).to.not.be.null;
shareFormLinkButton.trigger('click');
Expand Down Expand Up @@ -137,23 +146,32 @@ it('Submission revise status Assignment', () => {
cy.wait(4000);
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-chip__content').contains('[email protected]').should('be.visible');
cy.get('input[type="text"]').then($el => {
const text_btn=$el[2];
cy.get(text_btn).type('NI');
});
//Verify validation message to add another member for revise status assignment
cy.contains('No results found. Please add team members in the draft/submission manage page.').should('be.visible');
cy.get('[data-test="showRecipientEmail"] > .v-input__control > .v-field > .v-field__append-inner > .mdi-menu-down').click();
cy.get('label').contains('Notify all submitters').should('be.visible');
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');

//Delete form after test run
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
cy.waitForLoad();
cy.get('.mdi-delete').click();
cy.get('[data-test="continue-btn-continue"]').click();
cy.get('#logoutButton > .v-btn__content > span').click();

});
});

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,12 @@ describe('Form Designer', () => {
.trigger('mouseup', { force: true });
cy.get('button').contains('Save').click();
});
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');
});
cy.wait(2000);
// Filter the newly created form
cy.location('search').then(search => {
//let pathName = fullUrl.pathname
Expand Down Expand Up @@ -180,8 +172,7 @@ describe('Form Designer', () => {
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.waitForLoad();
cy.waitForLoad();
cy.wait(2000);
cy.get('[data-test="showStatusList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').click({force: true});
cy.wait(2000);
cy.contains('COMPLETED').click();
Expand Down