Skip to content

Commit

Permalink
Updated scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nimya-aot committed Oct 2, 2024
1 parent 9e68aa7 commit 4de3be9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 74 deletions.
55 changes: 24 additions & 31 deletions tests/functional/cypress/e2e/form-design-basicfields.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,41 +242,34 @@ describe('Form Designer', () => {
cy.get('[data-cy=saveButton]').click();
cy.waitForLoad();



// Filter the newly created form
cy.location('search').then(search => {
// 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[2]);
let dval=arr[2].split('&');
cy.log(dval);
//Form preview
cy.visit(`/${depEnv}/form/preview?f=${dval[0]}&d=${arrayValues[0]}`);
cy.waitForLoad();
cy.get('label').contains('Last Name').should('be.visible');
cy.get('label').contains('First Name').should('be.visible');
cy.get('label').contains('Applying for self').should('be.visible');
cy.get('label').contains('Select all skills').should('be.visible');
cy.get('label').contains('Phone Number').should('be.visible');
cy.get('label').contains('Date / Time').should('be.visible');
cy.get('label').contains('Select Gender');
let arr = search.split('=');
let arrayValues = arr[1].split('&');
cy.log(arrayValues[0]);
let dval=arr[2].split('&');
cy.log(dval);
//Form preview
cy.visit(`/${depEnv}/form/preview?f=${dval[0]}&d=${arrayValues[0]}`);
cy.waitForLoad();
cy.get('label').contains('Last Name').should('be.visible');
cy.get('label').contains('First Name').should('be.visible');
cy.get('label').contains('Applying for self').should('be.visible');
cy.get('label').contains('Select all skills').should('be.visible');
cy.get('label').contains('Phone Number').should('be.visible');
cy.get('label').contains('Date / Time').should('be.visible');
cy.get('label').contains('Select Gender');

//Delete form after test run
cy.visit(`/${depEnv}/form/design?d=${arrayValues[0]}&f=${dval[0]}`);
cy.wait(4000);
cy.get('[data-cy="settingsRouterLink"] > .v-btn').click();
cy.waitForLoad();
cy.get('[data-test="canRemoveForm"]').click();

cy.get('[data-test="continue-btn-continue"]').click();
cy.visit(`/${depEnv}/form/design?d=${arrayValues[0]}&f=${dval[0]}`);
cy.wait(4000);
cy.get('[data-cy="settingsRouterLink"] > .v-btn').click();
cy.waitForLoad();
cy.get('[data-test="canRemoveForm"]').click();
cy.get('[data-test="continue-btn-continue"]').click();

});


});
});

});
13 changes: 0 additions & 13 deletions tests/functional/cypress/e2e/form-manage-form.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ describe('Form Designer', () => {
});
});
it('Visits the form settings page', () => {


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

formsettings();


});
// Update manage form settings
it('Checks manage form settings', () => {
Expand Down Expand Up @@ -174,9 +170,6 @@ describe('Form Designer', () => {

cy.contains('SEND Reminder email').click();
cy.get('[data-test="canEditForm"]').click();



})
it('Checks Event Subscription settings', () => {
cy.viewport(1000, 1100);
Expand Down Expand Up @@ -204,11 +197,5 @@ describe('Form Designer', () => {
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 @@ -13,14 +13,9 @@ 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 Down Expand Up @@ -105,10 +100,6 @@ describe('Form Designer', () => {
cy.waitForLoad();
cy.get(':nth-child(3) > .v-card > .v-card-text > :nth-child(2) > .v-input__control > .v-selection-control > .v-label > span').click();//uncheck for not able to update the status of the form
cy.get('input[type="checkbox"]').then($el => {




const rem=$el[0];//save and edit drafts
const rem2=$el[2];//multiple draft upload
const rem3=$el[3];//form submission schedule settings
Expand All @@ -119,8 +110,6 @@ describe('Form Designer', () => {
cy.get(rem3).should("be.enabled");
cy.get(rem4).should("not.be.enabled");
cy.get(rem5).should("be.enabled");


});
cy.get('[data-test="canEditForm"]').click();
//Check team management functionality for public forms
Expand Down Expand Up @@ -150,12 +139,9 @@ describe('Form Designer', () => {
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
cy.waitForLoad();
cy.waitForLoad();
//Logout to submit the public form
//Logout to submit the public form
cy.get('#logoutButton > .v-btn__content > span').click();



//Form submission and verification for public forms
//Form submission and verification for public forms
cy.visit(`/${depEnv}/form/submit?f=${arrayValues[0]}`);
cy.waitForLoad();
cy.waitForLoad();
Expand All @@ -165,10 +151,10 @@ describe('Form Designer', () => {
cy.waitForLoad();
cy.contains('Text Field').click();
cy.contains('Text Field').type('Alex');
//form submission
//form submission
cy.get('button').contains('Submit').click();
cy.waitForLoad();
//cy.get('[data-test="continue-btn-continue"]').click({force: true});
//cy.get('[data-test="continue-btn-continue"]').click({force: true});
cy.waitForLoad();
cy.waitForLoad();
cy.waitForLoad();
Expand Down Expand Up @@ -198,9 +184,7 @@ describe('Form Designer', () => {
cy.get('.btn').click();
cy.waitForLoad();
cy.waitForLoad();
//view submission


//view submission
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
cy.get('.mdi-list-box-outline').click();
cy.waitForLoad();
Expand Down
13 changes: 4 additions & 9 deletions tests/functional/cypress/e2e/form-submission-public.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ describe('Form Designer', () => {
cy.get(rem2).should("not.be.enabled");
cy.get(rem3).should("be.enabled");
cy.get(rem4).should("not.be.enabled");
cy.get(rem5).should("be.enabled");


cy.get(rem5).should("be.enabled");
});
cy.get('[data-test="canEditForm"]').click();
//Check team management functionality for public forms
Expand Down Expand Up @@ -176,7 +174,6 @@ describe('Form Designer', () => {
}
else
{

cy.visit(`/${depEnv}`);

}
Expand Down Expand Up @@ -223,12 +220,12 @@ describe('Form Designer', () => {
cy.get(rem).type('some notes');


});
//Verify submitted by label is public
});
//Verify submitted by label is public
cy.get('p').contains('public').should('be.visible');
//Edit submission data for public form
cy.get('.mdi-pencil').click();
//check visibility of cancel button
//check visibility of cancel button
cy.get('.v-col-2 > .v-btn').should('be.visible');
cy.get('button').contains('Submit').should('be.visible');
cy.contains('Text Field').click();
Expand All @@ -244,9 +241,7 @@ describe('Form Designer', () => {
cy.get('.mdi-list-box-outline').click();
cy.waitForLoad();
cy.get('.mdi-cog').click();

//Delete form after test run

cy.waitForLoad();
cy.get(':nth-child(5) > .v-btn > .v-btn__content > .mdi-delete').click();
cy.get('[data-test="continue-btn-continue"]').click();
Expand Down

0 comments on commit 4de3be9

Please sign in to comment.