forked from bcgov/common-hosted-form-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: FORMS- 1787 Added cypress test scripts for Geosearch location f…
…eature (bcgov#1610) * Added line marker point for Map component * Added tests for line marker points * Added Geosearch location for Map component * Fixed some running issues * Fixed running issues on PR env * Fixed issues with element id for submission closing date * Fixed running issues
- Loading branch information
Showing
5 changed files
with
64 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,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 | ||
|
@@ -27,20 +22,13 @@ describe('Form Designer', () => { | |
}); | ||
}); | ||
it('Visits the form settings page', () => { | ||
|
||
|
||
cy.viewport(1000, 1100); | ||
cy.waitForLoad(); | ||
|
||
formsettings(); | ||
|
||
|
||
}); | ||
// Publish a simple form | ||
it('Verify draft submission', () => { | ||
}); | ||
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(); | ||
|
@@ -51,42 +39,28 @@ 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'); | ||
}); | ||
// Filter the newly created form | ||
cy.wait(2000); | ||
// 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'); | ||
|
@@ -127,9 +101,7 @@ 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(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'); | ||
*/ | ||
|
@@ -138,7 +110,6 @@ it('Submission revise status Assignment', () => { | |
cy.get('.mt-6 > :nth-child(1) > .v-btn > .v-btn__content > span').click(); | ||
cy.get('.mdi-pencil').click(); | ||
cy.waitForLoad(); | ||
|
||
//Form submission | ||
cy.contains('Text Field').click(); | ||
cy.contains('Text Field').type('{selectall}{backspace}'); | ||
|
@@ -150,9 +121,7 @@ it('Submission revise status Assignment', () => { | |
cy.location('pathname').should('eq', `/${depEnv}/form/success`); | ||
cy.contains('h1', 'Your form has been submitted successfully'); | ||
cy.get('.mt-6 > :nth-child(1) > .v-btn > .v-btn__content > span').click(); | ||
|
||
//Assign status submission | ||
|
||
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); | ||
cy.get('.mdi-list-box-outline').click(); | ||
cy.waitForLoad(); | ||
|
@@ -168,32 +137,23 @@ 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('[data-test="showRecipientEmail"] > .v-input__control > .v-field > .v-field__append-inner > .mdi-menu-down').click(); | ||
/* | ||
cy.contains('John, Nimya 1 CITZ:EX ([email protected])').should('be.visible'); | ||
*/ | ||
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(); | ||
}); | ||
|
||
|
||
}); | ||
|
||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters