Skip to content

Commit

Permalink
test:FORMS-1578 Cypress test scripts for Submission filter functional…
Browse files Browse the repository at this point in the history
…ity (bcgov#1532)

* #FORMS-974

* bcgov#974 updates

* bcgov#980 modification to cypress config

* FORMS-980

* bcgov#992

* bcgov#992 Fix cypress scripts

* bcgov#1011 Form design page

* bcgov#1011 test scripts

* bcgov#1023 cypress scripts

* bcgov#1023 advanced data components

* bcgov#1023 Updated scripts

* bcgov#1023 updation

* Updated json file

* Test/forms (bcgov#1011)(bcgov#1023) (bcgov#1307)

* #FORMS-974

* bcgov#974 updates

* bcgov#980 modification to cypress config

* FORMS-980

* bcgov#992

* bcgov#992 Fix cypress scripts

* bcgov#1011 Form design page

* bcgov#1011 test scripts

* bcgov#1023 cypress scripts

* bcgov#1023 advanced data components

* bcgov#1023 Updated scripts

* bcgov#1023 updation

* Updated json file

* bcgov#1059 workflow file for cypress

* bcgov#1059 updated the base url

* bcgov#1059 updated workflow

* Updated node version

* updated

* updated

* Updation

* updated file

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* updated package file

* Update cypress-ci.yaml

* Updated config file

* Update cypress-ci.yaml

* bcgov#1059 updated package

* bcgov#1060 scripts for Advanced fields and BC Gov components

* Fixing review comments

* Updated changes

* # Updated with PR comments

* updated

* Update form-design-basicfields.cy.js

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Modifies test scripts

* Updated files

* Fixed errors during CI/CD Run

* Updated browser type

* Updated Simple BC address component

* Updated

* Fields updated

* Test script changed

* Updated

* Updated fields

* Updated env variable

* Update form-design-basicfields.cy.js

* Updated

* Update cypress-ci.yaml

* Updated email input

* screenshots

* Updated path

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Updated version on workflow

* Fix to failed tests

* Fix to BC address component

* Updated the  component

* Changed button element

* Fixed BC components

* Modified submission

* Modified components

* Updated attribute

* Updated

* Changed simpleBC address component

* Update package.json

* Update package-lock.json

* Test scripts

* Updated

* Pushed the changes

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Env change

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Update cypress-ci.yaml

* Updated

* Updated to take default env variable

* Updated with current workflow

* updated

* Formatted

* Update cypress.config.js

* updated

* Test scripts for updating submission data

* Scripts for adding notes

* Added scripts for logout after each run

* Adding statuses to submission

* Fixed alert message for subscription settings

* Fixing CI/CD running issues

* Fixed issues on schedule date verification

* bcgov#1488 public form submission

* bcgov#1488 form for public

* form settings page for public form

* Added scripts for public forms with no status assign ability

* Changes with login page

* Removed additional login page

* bcgov#1478/Draft submission

* Scripts for draft submission

* bcgov#1478 Added column management functionality and delete button

* Fixed some CI/Cd issues

* bcgov#1478 Renamed public form

* Removed duplicate files

* # Fixed issues after implimenting custom metadata

* Updated settings button

* bcgov#1540 Test scripts for revise status changes

* Modified scripts

* Fixed CI/Cd issue

* bcgov#1547 test scripts for export/imprt design

* bcgov#1547 added preview form

* Added downloads folder to config file

* Added downloads folder

* Fixed spacing issue

* Removed downloaded files

* Modified download folder path

* Fixed some fornmatting issue

* Updated component check

* bcgov#1578 updated scripts

* bcgov#1578 Added email notification

* bcgov#1578 Fixed running issues

---------

Co-authored-by: jasonchung1871 <[email protected]>
  • Loading branch information
nimya-aot and jasonchung1871 authored Nov 27, 2024
1 parent 83d6ae6 commit 39252c5
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 33 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
52 changes: 31 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,43 @@ 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({multiple:true,force:true});
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 });
//submission delete verification
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 });
//Submission restore verification
cy.get('.v-btn > .v-btn__content > .mdi-minus').should('not.exist');
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ it('Submission revise status Assignment', () => {
cy.get('.v-col-3').click();
cy.get('tbody > :nth-child(2) > :nth-child(1)').contains('John, Nimya 1 CITZ:EX').should('be.visible');
cy.get(':nth-child(1) > :nth-child(4) > .v-btn > .v-btn__content > .mdi-minus').should('not.be.enabled');
cy.wait(4000);

cy.wait(1000);

cy.get('.v-card-actions > .v-btn > .v-btn__content > span').click();
cy.get('.v-alert__content').contains('Sent invite email to [email protected]').should('be.visible');
cy.waitForLoad();
// Edit draft submission
cy.get('.mt-6 > :nth-child(1) > .v-btn > .v-btn__content > span').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
10 changes: 5 additions & 5 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 All @@ -208,14 +208,14 @@ describe("Form Designer", () => {
cy.get('input[type=file]').should('not.to.be.null');
fileUploadInputField.attachFile('add1.png');
cy.waitForLoad();
//cy.get('label').contains('Upload template file').click({multiple:true,force:true});
//cy.get('.v-messages__message').contains('The template must use one of the following extentions: .txt, .docx, .html, .odt, .pptx, .xlsx');
cy.get('label').contains('Upload template file').click({multiple:true,force:true});
cy.get('.v-messages__message').contains('The template must use one of the following extentions: .txt, .docx, .html, .odt, .pptx, .xlsx');
cy.get('#file-input-submit').should('not.be.enabled');
//
cy.waitForLoad();
//Upload print template
cy.get('[tabindex="-1"] > .v-btn__content').click();
cy.get('.v-slide-group__content > [tabindex="-1"]').click();
cy.get('[tabindex="-1"] > .v-btn__content').click();
cy.waitForLoad();
cy.get('.mdi-close-circle').click();
cy.get('input[type=file]').attachFile('test.docx');
Expand Down

0 comments on commit 39252c5

Please sign in to comment.