Skip to content

Commit 928cf7c

Browse files
committed
CCP-4997: Adjust Cypress Tests to handle new offline options. Fixced flaky cypress test
1 parent 18ab333 commit 928cf7c

3 files changed

Lines changed: 24 additions & 30 deletions

File tree

tests/functional/cypress/e2e/form-apikey-cdogs.cy.js

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ describe('Form Designer', () => {
3939
// Publish a simple form
4040
it('Verify Data Retention Settings', () => {
4141
cy.viewport(1000, 1100);
42-
cy.get('div.formio-builder-form').then($el => {
42+
cy.get('div.formio-builder-form').then(($el) => {
4343
const coords = $el[0].getBoundingClientRect();
44-
cy.get('span.btn').contains('Text Field')
45-
46-
.trigger('mousedown', { which: 1}, { force: true })
47-
.trigger('mousemove', coords.x, -150, { force: true })
48-
.trigger('mouseup', { force: true });
44+
cy.get('span.btn').contains('Text Field').trigger('mousedown', { which: 1, force: true });
45+
cy.get('div.formio-builder-form').trigger('mousemove', coords.x, -150, { force: true });
46+
cy.get('div.formio-builder-form').trigger('mouseup', { force: true });
4947
cy.get('.btn-success').click();
5048
});
5149
// Form saving
@@ -71,13 +69,12 @@ describe('Form Designer', () => {
7169
//Update form design version
7270
cy.get('.mdi-plus').click();
7371
//Add new component to version 1
74-
cy.get('div.formio-builder-form').then($el => {
75-
const coords = $el[0].getBoundingClientRect();
76-
cy.get('span.btn').contains('Columns - 2')
77-
.trigger('mousedown', { which: 1}, { force: true })
78-
.trigger('mousemove', coords.x, -140, { force: true })
79-
.trigger('mouseup', { force: true });
80-
cy.get('.btn-success').click();
72+
cy.get('div.formio-builder-form').then(($el) => {
73+
const coords = $el[0].getBoundingClientRect();
74+
cy.get('span.btn').contains('Columns - 2').trigger('mousedown', { which: 1, force: true });
75+
cy.get('div.formio-builder-form').trigger('mousemove', coords.x, -140, { force: true });
76+
cy.get('div.formio-builder-form').trigger('mouseup', { force: true });
77+
cy.get('.btn-success').click();
8178
});
8279
// Form saving
8380
cy.wait(1000);
@@ -98,15 +95,13 @@ describe('Form Designer', () => {
9895
cy.get('button[title="Edit Version"]').click();
9996
cy.wait(1000);
10097
//Add new component to version 1
101-
cy.get('div.formio-builder-form').then($el => {
102-
const coords = $el[0].getBoundingClientRect();
103-
cy.get('span.btn').contains('Text/Images')
104-
105-
.trigger('mousedown', { which: 1}, { force: true })
106-
.trigger('mousemove', coords.x, -50, { force: true })
107-
.trigger('mouseup', { force: true });
98+
cy.get('div.formio-builder-form').then(($el) => {
99+
const coords = $el[0].getBoundingClientRect();
100+
cy.get('span.btn').contains('Text/Images').trigger('mousedown', { which: 1, force: true });
101+
cy.get('div.formio-builder-form').trigger('mousemove', coords.x, -50, { force: true });
102+
cy.get('div.formio-builder-form').trigger('mouseup', { force: true });
108103
cy.waitForLoad();
109-
cy.get('.btn-success').click();
104+
cy.get('.btn-success').click();
110105
});
111106
cy.wait(1000);
112107
cy.get('.mdi-dots-vertical').click();
@@ -122,13 +117,12 @@ describe('Form Designer', () => {
122117
cy.get('button[title="Delete Version"]').should('not.exist');
123118
//Update form design version
124119
cy.get('.mdi-plus').click();
125-
cy.get('div.formio-builder-form').then($el => {
126-
const coords = $el[0].getBoundingClientRect();
127-
cy.get('span.btn').contains('Columns - 3')
128-
.trigger('mousedown', { which: 1}, { force: true })
129-
.trigger('mousemove', coords.x, -140, { force: true })
130-
.trigger('mouseup', { force: true });
131-
cy.get('.btn-success').click();
120+
cy.get('div.formio-builder-form').then(($el) => {
121+
const coords = $el[0].getBoundingClientRect();
122+
cy.get('span.btn').contains('Columns - 3').trigger('mousedown', { which: 1, force: true });
123+
cy.get('div.formio-builder-form').trigger('mousemove', coords.x, -140, { force: true });
124+
cy.get('div.formio-builder-form').trigger('mouseup', { force: true });
125+
cy.get('.btn-success').click();
132126
});
133127
//Form saving
134128
cy.wait(1000);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('Form Designer', () => {
7474
//Hide submission content on success page
7575
cy.get('[data-test="hideSubmissionContentOnSuccessCheckbox"] input[type="checkbox"]').click();
7676
cy.waitForLoad();
77-
cy.get(':nth-child(3) > .v-card > .v-card-text > :nth-child(2) > .v-input__control > .v-selection-control > .v-label > span').click();//uncheck for not able to update the status of the form
77+
cy.get('[data-test="canUpdateStatusOfFormCheckbox"]').find('input[type="checkbox"]').click(); //uncheck so the form cannot update status
7878
cy.get('[data-test="canUpdateStatusOfFormCheckbox"]').should("not.be.checked");
7979
cy.contains('span','Display assignee column for reviewers').should("not.exist");
8080
cy.get('[data-test="canScheduleFormSubmissionCheckbox"]').find('input[type="checkbox"]').click();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('Form Designer', () => {
4949
cy.wait(2000);
5050
cy.get(':nth-child(1) > .v-expansion-panel > .v-expansion-panel-title > .v-expansion-panel-title__overlay').click();
5151
cy.get('[lang="en"] > .v-btn > .v-btn__content > .mdi-pencil').click();
52-
cy.get('[data-test="canUpdateStatusOfFormCheckbox"]').click();//Check to update the status of the form
52+
cy.get('[data-test="canUpdateStatusOfFormCheckbox"]').find('input[type="checkbox"]').click(); //check to update the status of the form
5353
cy.wait(1000);
5454
cy.contains('span','Display assignee column for reviewers').should('exist');
5555
cy.get('[data-test="showAssigneeInSubmissionsTableCheckbox"]').find('input[type="checkbox"]').click();

0 commit comments

Comments
 (0)