diff --git a/tests/functional/cypress/e2e/form-edit-submission-data.cy.js b/tests/functional/cypress/e2e/form-edit-submission-data.cy.js index 98ef09ac7..e39e2e7ba 100644 --- a/tests/functional/cypress/e2e/form-edit-submission-data.cy.js +++ b/tests/functional/cypress/e2e/form-edit-submission-data.cy.js @@ -108,8 +108,8 @@ describe('Form Designer', () => { cy.waitForLoad(); cy.waitForLoad(); - //cy.get('.mdi-list-box-outline').click(); - cy.get('[data-test="canViewFormSubmissions"]').click({multiple:true,force:true}); + cy.get('.mdi-list-box-outline').click({multiple:true,force:true}); + //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 => { diff --git a/tests/functional/cypress/e2e/form-manage-form.cy.js b/tests/functional/cypress/e2e/form-manage-form.cy.js index 8b9ad06b9..7d002146d 100644 --- a/tests/functional/cypress/e2e/form-manage-form.cy.js +++ b/tests/functional/cypress/e2e/form-manage-form.cy.js @@ -197,10 +197,70 @@ 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(); + cy.get(':nth-child(5) > .v-expansion-panel > .v-expansion-panel-title > .v-expansion-panel-title__overlay').click(); + cy.get('.mt-6 > :nth-child(2) > .mdi-help-circle-outline').should('exist'); + cy.get('.mdi-plus-circle').click({ force: true }); + cy.wait(2000); + cy.get('input[type="text"]').then($el => { + cy.get('.mdi-plus-circle').click(); - //Delete form after test run - cy.get('.mdi-delete').click(); + const api_name=$el[12]; + const api_endpoint=$el[13]; + const api_header=$el[14]; + const api_keyvalue=$el[15]; + cy.get(api_name).click(); + cy.get(api_endpoint).click(); + + cy.wait(2000); + cy.get(api_header).click(); + cy.contains('div','Name is required.').should('be.visible'); + cy.get('.v-messages__message').contains('div','Please enter a valid endpoint starting with http:// or https://').should('be.visible'); + + cy.get(api_name).type('chefs_name'); + cy.get(api_endpoint).type('chefs_endpoint'); + cy.contains('div','Name is required.').should('not.exist'); + cy.get('.v-messages__message').contains('div','Please enter a valid endpoint starting with http:// or https://').should('be.visible'); + cy.get(api_endpoint).type('{selectall}{backspace}'); + cy.get(api_endpoint).type('https://chefs-dev.apps.silver.devops.gov.bc.ca/'); + cy.get(api_header).type('header'); + cy.get(api_keyvalue).type('keyvalue'); + }); + cy.get('input[type="checkbox"]').then($el => { + const user_apikey=$el[14]; + const user_info=$el[15]; + cy.get(user_info).click(); + cy.get(user_apikey).click(); + cy.get('[data-test="continue-btn-continue"]').should('be.enabled'); + cy.get('[data-test="continue-btn-cancel"]').should('be.enabled'); + cy.get('[data-test="continue-btn-continue"]').click(); + }) + + cy.get('.v-data-table__tbody > .v-data-table__tr > :nth-child(3)').contains('Submitted'); + cy.get(':nth-child(1) > .v-btn > .v-btn__content > .mdi-pencil').click(); + cy.get('span').contains('Submitted').should('exist'); cy.get('[data-test="continue-btn-continue"]').click(); + cy.get('.v-data-table__tbody > .v-data-table__tr > :nth-child(1)').should('have.text',"chefs_name"); + //Delete external api configuration + cy.get('.v-data-table__tbody > .v-data-table__tr > .v-data-table-column--align-end > :nth-child(2) > [targetref="[object Object]"] > .v-btn').click(); + cy.wait(2000); + cy.get('.v-data-table__tbody > .v-data-table__tr > :nth-child(1)').should('not.exist'); + //Delete form after test run + cy.get('[data-test="canRemoveForm"]').then($el => { + const delform=$el[0]; + cy.get(delform).click(); + }) + cy.get('[data-test="continue-btn-continue"] > .v-btn__content > span').then($el => { + const delcontinue=$el[1]; + cy.get(delcontinue).click(); cy.get('#logoutButton > .v-btn__content > span').click(); + + + + }) + }) }) \ No newline at end of file