Skip to content

Commit

Permalink
Test/forms-1114 cypress workflow (#1342)
Browse files Browse the repository at this point in the history
* #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

* cleared

* Removed package

* screenshot folder updated

* Updated id for email notification

* Updated email input id

* Updated scripts according to PR review

* #1269 updated PR env variable

* updated

* updated

* Updated home page content visibility

* reverted changes

* changed

* Updated scripts

* updated

* null pr number

* changed pr env

* updated

* changed

* updated

* updated

* changed url

* updated url

* log added

* updated

* updated

* updated

* Updated scripts

* updated

* Updated with PR review comments

* updated

* updated

---------

Co-authored-by: jasonchung1871 <[email protected]>
  • Loading branch information
nimya-aot and jasonchung1871 authored Jun 3, 2024
1 parent 44f5866 commit a48df4a
Show file tree
Hide file tree
Showing 11 changed files with 554 additions and 259 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cypress-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Cypress Tests
on:
workflow_dispatch:
inputs:
pr-number:
description: Pull request number
required: false
type: string

jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: cache
uses: actions/cache@v4
with:
path: "tests/functional"
key: node-modules-${{ hashFiles('tests/functional/package.json') }}


- name: cypress install
uses: cypress-io/github-action@v6
with:
working-directory: '${{ github.workspace }}/tests/functional'
env:
CYPRESS_keycloakUsername: ${{secrets.keycloakUsername}}
CYPRESS_keycloakPassword: ${{secrets.keycloakPassword}}
CYPRESS_depEnv: ${{ github.event.inputs.pr-number }}

- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: '${{ github.workspace }}/tests/functional/screenshots'

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ build
coverage
dist
**/src/formio
**/cypress/**/screenshots
**/cypress/**/videos
screenshots
node_modules

# Ignore only top-level package-lock.json
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/cypress/e2e/about.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@
const depEnv = Cypress.env('depEnv');
const baseUrl = Cypress.env('baseUrl');


describe('Application About Page', () => {
it('Visits the app about page', () => {
cy.visit(`/${depEnv}`);
cy.contains('h1', 'Create, publish forms, and receive submissions with the Common Hosted Forms Service.');

if(depEnv=="")
{

cy.visit(`/app`);
cy.contains('Create, publish forms, and receive submissions with the Common Hosted Forms Service.').should('be.visible');
}
else
{

cy.visit(`/${depEnv}`);
cy.contains('Create, publish forms, and receive submissions with the Common Hosted Forms Service.').should('be.visible');
cy.get('[data-test="base-auth-btn"] > .v-btn > .v-btn__content > span').click();
}

});
});
94 changes: 34 additions & 60 deletions tests/functional/cypress/e2e/form-design-advanceddata.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,75 +84,49 @@ it('Checks the Container component', () => {

var pretty=JSON.stringify({
"label": "Applicant Details",
"customClass": "bg-primary",
"reorder": false,
"addAnotherPosition": "bottom",
"layoutFixed": false,
"enableRowGroups": false,
"initEmpty": false,
"tableView": false,
"key": "dataGrid",
"type": "datagrid",
"input": true,
"components": [
"key": "dataGrid",
"type": "datagrid",
"input": true,
"components": [
{
"label": "Children",
"key": "children",
"type": "datagrid",
"input": true,
"validate": {
"minLength": 3,
"maxLength": 6
},


"components": [
{
"label": "First Name",
"key": "firstName",
"type": "textfield",
"input": true,
"tableView": true,
{
"label": "First Name",
"key": "firstName",
"type": "textfield",
"input": true,
"tableView": true
},

{
"label": "Last Name",
"key": "lastName",
"type": "textfield",
"input": true,
"tableView": true
},
{
"label": "Gender",
"key": "gender",
"type": "select",
"input": true,
data: {
values: [
{
"value": "male",
"label": "Male"
},
{
"value": "female",
"label": "Female"
},
{
"value": "other",
"label": "Other"
}
]
{
"label": "Gender",
"key": "gender",
"type": "select",
"input": true,
data: {
values: [
{
"value": "male",
"label": "Male"
},

}

{
"value": "female",
"label": "Female"
}
]
},

}
]

}

]



})
}
]

})

cy.get('div.ace_content').type(pretty,{ parseSpecialCharSequences: false });
cy.get('button').contains('Save').click();
Expand Down
Loading

0 comments on commit a48df4a

Please sign in to comment.