Skip to content

Commit f9b31a4

Browse files
authored
test: FORMS-2788 Cypress test scripts verify that the checkbox is cleared when disabled (bcgov#1772)
* Added Submitter revision form check * Added submission recall ability * Added recall functionality * Added public form check * Added validations for BC SC card login type on form settings * Added scripts to reuse formid in multiple tests * updated public form to access formid * Updated other tests to reuse same formid * Updated * Added updated scripts for Flating button changes on designer page * Updated * Added validations for updating design versions * Added cypress tests for permanent delete feature settings * Update form-apikey-cdogs.cy.js * Updated with latest changes * Updated scripts * Added checkbox clearing validation when disabled * Moved phone number
1 parent 7891510 commit f9b31a4

3 files changed

Lines changed: 19 additions & 20 deletions

File tree

tests/functional/cypress/e2e/form-design-basicfields.cy.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,6 @@ describe('Form Designer', () => {
130130
cy.get('.btn-success').click();
131131
});
132132
cy.wait(1000);
133-
//Phone Number
134-
cy.get('div.formio-builder-form').then($el => {
135-
const coords = $el[0].getBoundingClientRect();
136-
cy.get('span.btn').contains('Phone Number')
137-
138-
.trigger('mousedown', { which: 1}, { force: true })
139-
.trigger('mousemove', coords.x, -50, { force: true })
140-
.trigger('mouseup', { force: true });
141-
cy.get('.btn-success').click();
142-
});
143133
//Email
144134
cy.get('div.formio-builder-form').then($el => {
145135
const coords = $el[0].getBoundingClientRect();
@@ -155,7 +145,7 @@ describe('Form Designer', () => {
155145
cy.get('span.btn').contains('Date / Time')
156146

157147
.trigger('mousedown', { which: 1}, { force: true })
158-
.trigger('mousemove', coords.x, -80, { force: true })
148+
.trigger('mousemove', coords.x, -60, { force: true })
159149
.trigger('mouseup', { force: true });
160150
//cy.get('p').contains('Multi-line Text Component');
161151
cy.get('.btn-success').click();
@@ -206,7 +196,6 @@ describe('Form Designer', () => {
206196
cy.get('label').contains('First Name').should('be.visible');
207197
cy.get('label').contains('Applying for self').should('be.visible');
208198
cy.get('label').contains('Select all skills').should('be.visible');
209-
cy.get('label').contains('Phone Number').should('be.visible');
210199
cy.get('label').contains('Date / Time').should('be.visible');
211200
cy.get('label').contains('Select Gender');
212201

tests/functional/cypress/e2e/form-submission-public-no-status-assign.cy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ describe('Form Designer', () => {
6262
cy.get('[data-test="canUpdateStatusOfFormCheckbox"]').should("not.be.checked");
6363
cy.contains('span','Display assignee column for reviewers').should("not.exist");
6464
cy.get('[data-test="canScheduleFormSubmissionCheckbox"]').find('input[type="checkbox"]').click();
65+
cy.get('[data-test="enableTeamMemberDraftShare"]').find('input[type="checkbox"]').should('not.be.enabled')
66+
.and("not.be.checked");
67+
cy.get('[data-test="canUploadDraftCheckbox"]').find('input[type="checkbox"]').should('not.be.enabled')
68+
.and("not.be.checked");
69+
cy.get('[data-test="canCopyExistingSubmissionCheckbox"]').find('input[type="checkbox"]').should('not.be.enabled')
70+
.and("not.be.checked");
71+
cy.get('[data-test="canSubmitterRevisionFormCheckbox"]').find('input[type="checkbox"]').should('not.be.enabled')
72+
.and("not.be.checked");
6573
cy.get('[data-test="canEditForm"]').click();
6674

6775
//Logout to submit the public form

tests/functional/cypress/e2e/form-submission-revise-status.cy.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,20 @@ it('Verify draft submission', () => {
3131
cy.viewport(1000, 1100);
3232
cy.waitForLoad();
3333
cy.get('button').contains('Basic Fields').click();
34+
//Phone Number
3435
cy.get('div.formio-builder-form').then($el => {
35-
const coords = $el[0].getBoundingClientRect();
36-
cy.get('span.btn').contains('Text Field')
37-
.trigger('mousedown', { which: 1}, { force: true })
38-
.trigger('mousemove', coords.x, -110, { force: true })
39-
.trigger('mouseup', { force: true });
40-
cy.get('.btn-success').click();
36+
const coords = $el[0].getBoundingClientRect();
37+
cy.get('span.btn').contains('Phone Number')
38+
39+
.trigger('mousedown', { which: 1}, { force: true })
40+
.trigger('mousemove', coords.x, -410, { force: true })
41+
.trigger('mouseup', { force: true });
42+
cy.get('.btn-success').click();
4143
});
4244
//Multiline Text
4345
cy.get('div.formio-builder-form').then($el => {
4446
const coords = $el[0].getBoundingClientRect();
45-
cy.get('span.btn').contains('Multi-line Text')
46-
47+
cy.get('span.btn').contains('Text Field')
4748
.trigger('mousedown', { which: 1}, { force: true })
4849
.trigger('mousemove', coords.x, -110, { force: true })
4950
.trigger('mouseup', { force: true });
@@ -116,6 +117,7 @@ it('Submission revise status Assignment', () => {
116117
cy.contains('Text Field').click();
117118
cy.contains('Text Field').type('{selectall}{backspace}');
118119
cy.contains('Text Field').type('Nancy');
120+
cy.get('label').contains('Phone Number').should('be.visible');
119121
cy.get('button').contains('Submit').click();
120122
cy.waitForLoad();
121123
cy.get('[data-test="continue-btn-continue"]').click({force: true});

0 commit comments

Comments
 (0)