-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forms-1226-Team management functionality && Fix for failing tests on …
…Pr env (#1381) * #FORMS-974 * #974 updates * #980 modification to cypress config * FORMS-980 * #992 * #992 Fix cypress scripts * #1011 Form design page * #1011 test scripts * #1023 cypress scripts * #1023 advanced data components * #1023 Updated scripts * #1023 updation * Updated json file * Test/forms (#1011)(#1023) (#1307) * #FORMS-974 * #974 updates * #980 modification to cypress config * FORMS-980 * #992 * #992 Fix cypress scripts * #1011 Form design page * #1011 test scripts * #1023 cypress scripts * #1023 advanced data components * #1023 Updated scripts * #1023 updation * Updated json file * #1059 workflow file for cypress * #1059 updated the base url * #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 * #1059 updated package * #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 * Added form deletion scripts * Fixed the issue of running on test scripts on PR env --------- Co-authored-by: jasonchung1871 <[email protected]>
- Loading branch information
1 parent
c0ba285
commit 9bee9bb
Showing
9 changed files
with
282 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,3 @@ jobs: | |
with: | ||
name: cypress-screenshots | ||
path: '${{ github.workspace }}/tests/functional/screenshots' | ||
|
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
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
195 changes: 195 additions & 0 deletions
195
tests/functional/cypress/e2e/form-team-management.cy.js
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 |
---|---|---|
@@ -0,0 +1,195 @@ | ||
import 'cypress-keycloak-commands'; | ||
import 'cypress-drag-drop'; | ||
import { formsettings } from '../support/login.js'; | ||
|
||
const depEnv = Cypress.env('depEnv'); | ||
|
||
|
||
Cypress.Commands.add('waitForLoad', () => { | ||
const loaderTimeout = 60000; | ||
|
||
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 | ||
console.log(err); | ||
return false; | ||
}); | ||
}); | ||
it('Visits the form settings page', () => { | ||
|
||
|
||
cy.viewport(1000, 1100); | ||
cy.waitForLoad(); | ||
|
||
formsettings(); | ||
|
||
|
||
}); | ||
// Publish a simple form with Simplebc Address component | ||
it('Checks team management before form publish', () => { | ||
cy.viewport(1000, 1100); | ||
cy.waitForLoad(); | ||
|
||
cy.get('button').contains('BC Government').click(); | ||
cy.get('div.formio-builder-form').then($el => { | ||
const coords = $el[0].getBoundingClientRect(); | ||
cy.get('[data-key="simplebcaddress"]') | ||
.trigger('mousedown', { which: 1}, { force: true }) | ||
.trigger('mousemove', coords.x, -550, { force: true }) | ||
//.trigger('mousemove', coords.y, +100, { force: true }) | ||
.trigger('mouseup', { force: true }); | ||
cy.waitForLoad(); | ||
//cy.get('input[name="data[label]"]').type('s'); | ||
cy.get('button').contains('Save').click(); | ||
//cy.get('.btn-success').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.location('search').then(search => { | ||
//let pathName = fullUrl.pathname | ||
let arr = search.split('='); | ||
let arrayValues = arr[1].split('&'); | ||
cy.log(arrayValues[0]); | ||
//cy.log(arrayValues[1]); | ||
//cy.log(arrayValues[2]); | ||
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); | ||
cy.waitForLoad(); | ||
}) | ||
|
||
//Go to Team Management | ||
|
||
cy.get('.mdi-account-multiple').click(); | ||
cy.get('.mdi-account-plus').click(); | ||
//Search for a member to add | ||
cy.get('.v-col > .v-input > .v-input__control > .v-field > .v-field__field > .v-field__input').click(); | ||
cy.get('.v-col > .v-input > .v-input__control > .v-field > .v-field__field > .v-field__input').type('NIM'); | ||
cy.get(':nth-child(2) > .v-chip__content').should('be.visible'); | ||
cy.get(':nth-child(4) > .v-chip__content').should('be.visible'); | ||
cy.get(':nth-child(5) > .v-chip__content').should('be.visible'); | ||
cy.contains('John, Nimya 1 CITZ:EX ([email protected])').click(); | ||
cy.get(':nth-child(2) > .v-chip__content').click(); | ||
cy.get(':nth-child(4) > .v-chip__content').click(); | ||
cy.get(':nth-child(5) > .v-chip__content').click(); | ||
cy.get('.v-btn--elevated > .v-btn__content > span').click(); | ||
// Verify member is added with proper roles | ||
cy.get('#input-90').should('be.checked'); | ||
cy.get('#input-91').should('be.checked'); | ||
cy.get('#input-93').should('be.checked'); | ||
//Manage column views | ||
cy.get('.mdi-view-column').click(); | ||
cy.get('#input-121').should('be.checked'); | ||
cy.get('#input-122').should('be.checked'); | ||
cy.get('#input-123').should('be.checked'); | ||
cy.get('#input-124').should('be.checked'); | ||
|
||
cy.get('#input-121').click(); | ||
cy.waitForLoad(); | ||
cy.get('#input-121').should('not.be.checked'); | ||
//Column view management | ||
|
||
cy.get('.search').click(); | ||
cy.get('.search').type('Designer'); | ||
cy.get('[data-test="filter-table"] > .v-table__wrapper > table > tbody > .v-data-table__tr > :nth-child(2)').click(); | ||
cy.get('[data-test="save-btn"] > .v-btn__content').click(); | ||
cy.waitForLoad(); | ||
//Verify the roles on dashboard | ||
if(depEnv=="app") | ||
{ | ||
cy.get('#input-137').should('not.exist'); | ||
cy.get('#input-149').should('not.be.checked'); | ||
} | ||
else | ||
{ | ||
cy.get('#input-150').should('not.be.checked'); | ||
cy.get('#input-153').should('not.be.checked'); | ||
cy.get('#input-154').should('not.be.checked'); | ||
|
||
} | ||
|
||
|
||
|
||
//Remove a user from Roles | ||
cy.get('tbody > :nth-child(1) > [style="width: 1rem;"] > .v-btn').click(); | ||
cy.waitForLoad(); | ||
//cy.contains('REMOVE').click(); | ||
cy.get('[data-test="continue-btn-continue"] > .v-btn__content > span').click(); | ||
cy.waitForLoad(); | ||
cy.contains('NIMJOHN').should('not.exist'); | ||
|
||
}); | ||
|
||
it('Checks team management after form publish', () => { | ||
cy.viewport(1000, 1100); | ||
cy.waitForLoad(); | ||
|
||
|
||
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(); | ||
cy.log(arrayValues[0]); | ||
//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'); | ||
|
||
|
||
cy.get('.mdi-account-multiple').click(); | ||
cy.get('.mdi-account-plus').click(); | ||
//Search for a member to add | ||
cy.get('.v-col > .v-input > .v-input__control > .v-field > .v-field__field > .v-field__input').click(); | ||
cy.get('.v-col > .v-input > .v-input__control > .v-field > .v-field__field > .v-field__input').type('NIM'); | ||
cy.get(':nth-child(2) > .v-chip__content').should('be.visible'); | ||
cy.get(':nth-child(4) > .v-chip__content').should('be.visible'); | ||
cy.get(':nth-child(5) > .v-chip__content').should('be.visible'); | ||
cy.contains('John, Nimya 1 CITZ:EX ([email protected])').click(); | ||
cy.get(':nth-child(2) > .v-chip__content').click(); | ||
cy.get(':nth-child(4) > .v-chip__content').click(); | ||
cy.get(':nth-child(5) > .v-chip__content').click(); | ||
cy.get('.v-btn--elevated > .v-btn__content > span').click(); | ||
cy.waitForLoad(); | ||
cy.visit(`/${depEnv}`); | ||
cy.get('[data-cy="userFormsLinks"]').click(); | ||
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`); | ||
cy.waitForLoad(); | ||
//Delete form after test run | ||
cy.get('.mdi-delete').click(); | ||
cy.get('[data-test="continue-btn-continue"]').click(); | ||
}) | ||
|
||
}); | ||
|
||
}); |
Oops, something went wrong.