Skip to content

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

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

Merged
merged 24 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dcd4555
Added line marker point for Map component
nimya-aot Feb 7, 2025
b1fcc91
Merge branch 'bcgov:main' into tests/FORMS-1694
nimya-aot Feb 7, 2025
cf7a125
Added tests for line marker points
nimya-aot Feb 11, 2025
c5a2ec3
Merge branch 'tests/FORMS-1694' of https://github.com/nimya-aot/commo…
nimya-aot Feb 11, 2025
93b544e
Merge branch 'main' into tests/FORMS-1694
nimya-aot Feb 14, 2025
a8f0364
Added Geosearch location for Map component
nimya-aot Feb 20, 2025
72020fa
Merge branch 'main' into test/forms-1787
nimya-aot Feb 20, 2025
c77fa9a
Fixed some running issues
nimya-aot Feb 21, 2025
2af306a
Merge branch 'test/forms-1787' of https://github.com/nimya-aot/common…
nimya-aot Feb 21, 2025
225a71b
Merge branch 'bcgov:main' into test/forms-1787
nimya-aot Feb 24, 2025
a46380b
Added scripts to validate validation message for revise status
nimya-aot Feb 25, 2025
ef15c09
Merge branch 'main' into test/forms-1911
nimya-aot Feb 26, 2025
76c6ac8
Update form-design-map-point-circle-markers.cy.js
nimya-aot Feb 26, 2025
7aad575
Reverted new change with closing date field id
nimya-aot Feb 26, 2025
cfc28ca
Fixed running issues
nimya-aot Feb 27, 2025
b49739c
Merge branch 'main' into test/forms-1911
nimya-aot Feb 28, 2025
2036ad8
Fixed timeout issues
nimya-aot Feb 28, 2025
0dbfc19
Fixed running issues
nimya-aot Mar 4, 2025
af9e0c9
Update form-apikey-cdogs.cy.js
nimya-aot Mar 5, 2025
22935be
Updated pagination issues on submission page
nimya-aot Mar 6, 2025
8bbdc8b
fixed time out issues
nimya-aot Mar 6, 2025
4bb0306
Merge branch 'test/forms-1911' of https://github.com/nimya-aot/common…
nimya-aot Mar 6, 2025
dce82cc
Added timeout
nimya-aot Mar 7, 2025
fb30ba6
Merge branch 'main' into test/forms-1911
nimya-aot Mar 7, 2025
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
18 changes: 3 additions & 15 deletions tests/functional/cypress/e2e/form-apikey-cdogs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@ 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
Expand All @@ -28,13 +22,9 @@ describe('Form Designer', () => {
});
it('Visits the form settings page', () => {


cy.viewport(1000, 1100);
cy.waitForLoad();

formsettings();


});
it('checks Apikey Settings', () => {
cy.viewport(1000, 1100);
Expand All @@ -48,13 +38,11 @@ describe('Form Designer', () => {
.trigger('mousemove', coords.x, -550, { force: true })
//.trigger('mousemove', coords.y, +100, { force: true })
.trigger('mouseup', { force: true });
cy.waitForLoad();
cy.wait(2000);
cy.get('button').contains('Save').click();



});
// Form saving
cy.wait(2000);
let savedButton = cy.get('[data-cy=saveButton]');
expect(savedButton).to.not.be.null;
savedButton.trigger('click');
Expand Down Expand Up @@ -123,4 +111,4 @@ describe('Form Designer', () => {

})

})
})
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ describe('Form Designer', () => {

});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,11 @@ it('Verify draft submission', () => {
.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
20 changes: 9 additions & 11 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 Expand Up @@ -162,7 +162,7 @@ describe('Form Designer', () => {

cy.contains('SEND Reminder email').click();
cy.get('[data-test="canEditForm"]').click();
})
});
it('Checks Event Subscription settings', () => {
cy.viewport(1000, 1100);
cy.waitForLoad();
Expand All @@ -184,7 +184,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','Subscription settings for this form has been saved.').should('be.visible');
})
});
it('Checks External API settings', () => {
cy.viewport(1000, 1100);
cy.waitForLoad();
Expand Down Expand Up @@ -245,10 +245,8 @@ describe('Form Designer', () => {
const delcontinue=$el[1];
cy.get(delcontinue).click();
cy.get('#logoutButton > .v-btn__content > span').click();



})

});

})
})
});
});
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 @@ -108,9 +108,10 @@ describe('Form Designer', () => {
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('10').should('be.visible');
cy.contains('25').should('be.visible');
cy.contains('50').should('be.visible');
cy.contains('100').should('be.visible');
cy.contains('All').should('be.visible');
cy.get('button[title="Delete Submission"]').should('be.visible');
//view submission
Expand Down
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');
cy.wait(2000);
// 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