Skip to content

Commit

Permalink
#1578 updated scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nimya-aot committed Nov 18, 2024
1 parent 31505be commit 77c0d0e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
2 changes: 1 addition & 1 deletion tests/functional/cypress/e2e/form-apikey-cdogs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Form Designer', () => {
cy.waitForLoad();
cy.waitForLoad();
cy.get('button[title="Upload"]').click();

cy.wait(2000);
cy.get('.mdi-minus-circle').click();
cy.get('input[type=file]').should('not.to.be.null');
fileUploadInputField.attachFile('file_example_XLSX_50.xlsx');
Expand Down
49 changes: 28 additions & 21 deletions tests/functional/cypress/e2e/form-edit-submission-data.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,33 +102,40 @@ describe('Form Designer', () => {
cy.location('pathname').should('eq', `/${depEnv}/form/success`);

cy.contains('h1', 'Your form has been submitted successfully');
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
cy.waitForLoad();
cy.waitForLoad();
cy.waitForLoad();
cy.visit(`/${depEnv}/form/submit?f=${arrayValues[0]}`);
cy.waitForLoad();
cy.waitForLoad();
cy.waitForLoad();
cy.get('button').contains('Submit').should('be.visible');
cy.waitForLoad();
cy.contains('Text Field').click();
cy.contains('Text Field').type('Alex');
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.waitForLoad();

//view submission
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
cy.waitForLoad();
cy.waitForLoad();

cy.get('.mdi-list-box-outline').click();
//cy.get('.mdi-list-box-outline').click();
cy.get('[data-test="canViewFormSubmissions"]').click();
cy.waitForLoad();
cy.get('.v-data-table__tr > :nth-child(2)').should('exist');
cy.get('input[type="checkbox"]').then($el => {
const rem=$el[0];
rem.click();
const rem1=$el[1];
cy.get('.v-data-table__tr > :nth-child(2)').should('not.exist');
rem.click();
rem1.click();
cy.get('.v-data-table__tr > :nth-child(2)').should('not.exist');
cy.wait(2000);
cy.get(rem).click({ force: true });
cy.get('.v-data-table__tr > :nth-child(7) > span[data-v-1cd101d8=""] > .v-btn > .v-btn__content > .mdi-minus').click();
cy.get('[data-test="continue-btn-continue"]').click();
cy.get('.v-alert__content').contains('div','Submission deleted successfully.').should('be.visible');
cy.get(rem).click({ force: true });
cy.get(':nth-child(2) > .v-btn > .v-btn__content > .mdi-delete-restore').click();
cy.get('[data-test="continue-btn-continue"] > .v-btn__content > span').click();
cy.get('.v-data-table__tr > :nth-child(2)').should('not.exist');
cy.get(rem).click({ force: true });

cy.get('.v-data-table__tr > :nth-child(2)').should('exist');


});

cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
//Edit submission
cy.get('.mdi-pencil').click();
Expand Down
13 changes: 8 additions & 5 deletions tests/functional/cypress/e2e/form-submission-assign-status.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,24 @@ describe('Form Designer', () => {
it('Form Submission and Updation', () => {
cy.viewport(1000, 1100);
cy.wait(4000);
cy.intercept('GET', `/${depEnv}/api/v1/forms/*`).as('getForm');
/*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();
cy.wait(4000);
// Go to My forms
cy.wait('@getForm').then(()=>{
/*cy.wait('@getForm').then(()=>{
let userFormsLinks = cy.get('[data-cy=userFormsLinks]');
expect(userFormsLinks).to.not.be.null;
userFormsLinks.trigger('click');
});
*/
// 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]);
Expand Down Expand Up @@ -128,7 +131,7 @@ describe('Form Designer', () => {
//view submission
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
cy.wait(4000);
})
});

});
it('Submission status Assignment', () => {
Expand Down Expand Up @@ -206,7 +209,7 @@ describe('Form Designer', () => {
cy.get('.mdi-delete').click();
cy.get('[data-test="continue-btn-continue"]').click();
cy.get('#logoutButton > .v-btn__content > span').click();
})
});

});

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/cypress/e2e/form-submission-export.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ describe("Form Designer", () => {
const rem = $elem.text();
cy.log(rem);
const remname = rem + "_submissions.json";
cy.wait(2000);
cy.get(".ml-1").contains(remname);
});
cy.get(':nth-child(2) > .v-col > .v-input > .v-input__control > .v-selection-control-group > :nth-child(2) > .v-label > .radioboxLabelStyle').click();
Expand Down Expand Up @@ -183,8 +184,7 @@ describe("Form Designer", () => {
cy.viewport(1000, 1100);
cy.waitForLoad();
cy.get(".mdi-list-box-outline").click();


cy.wait(2000);
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn').click();
//print option
cy.get('.mdi-printer').click();
Expand Down

0 comments on commit 77c0d0e

Please sign in to comment.