Skip to content

Commit 5e0f14f

Browse files
Merge branch 'main' into FORMS-2190-admin-responsiveness
2 parents 94080e9 + ee20943 commit 5e0f14f

9 files changed

Lines changed: 83 additions & 16 deletions

tests/functional/cypress/e2e/form-design-map-polygon-marker.cy.js

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ describe('Form Designer', () => {
109109
cy.get('a[class="leaflet-control-layers-toggle"').then($el => {
110110
const base_map_btn=$el[0];
111111
cy.get(base_map_btn).trigger('mouseover');
112+
});
112113
cy.contains('span', 'OpenStreetMap') // Find the span with the text
113114
.prev('input[type="radio"]') // Get the radio input just before it
114115
.should('be.checked'); // Assert that it's checked
@@ -117,10 +118,43 @@ describe('Form Designer', () => {
117118
cy.contains('span', ' Dark').prev('input[type="radio"]')
118119
.should('not.have.attr', 'checked');
119120
cy.contains('span', ' Topographic').prev('input[type="radio"]')
120-
.should('not.have.attr', 'checked');
121-
cy.get('button').contains('Save').click();
122-
121+
.should('not.have.attr', 'checked');
122+
cy.wait(2000);
123+
cy.get('a[title="Draw a marker"]').then($el => {
124+
const marker_elem=$el[0];
125+
cy.get(marker_elem).click({force: true});
126+
});
127+
cy.get('a[title="Cancel drawing"').click();
128+
//validate visiility of different layers
129+
cy.get('a[class="leaflet-control-layers-toggle"').then($el => {
130+
const base_map_btn=$el[0];
131+
cy.get(base_map_btn).trigger('mouseover',{force: true});
132+
133+
cy.get('input[class="leaflet-control-layers-selector"]')
134+
.then($el => {
135+
const base_select_light=$el[1];
136+
const base_select_dark=$el[2];
137+
const base_select_topographic=$el[3];
138+
cy.get(base_select_dark).closest('span').contains(' Dark').click({ force: true });
139+
cy.get(base_select_dark).check();
140+
cy.wait(2000);
141+
cy.get('img[src*="https://b.basemaps.cartocdn.com/dark_all/"]').should('be.visible');
142+
cy.get(base_select_light).closest('span').contains(' Light').click({ force: true });
143+
cy.wait(1000);
144+
cy.get(base_select_light).check();
145+
cy.wait(2000);
146+
cy.get('img[src*="https://b.basemaps.cartocdn.com/light_all/"]').should('be.visible');
147+
cy.get(base_map_btn).trigger('mouseover',{force: true});
148+
cy.get(base_select_topographic).closest('span').contains(' Topographic').click({ force: true });
149+
cy.waitForLoad();
150+
cy.get(base_select_topographic).check();
151+
cy.wait(2000);
152+
cy.get('img[src*="https://b.tile.opentopomap.org/"]').should('be.visible');
153+
});
123154
});
155+
cy.waitForLoad();
156+
cy.get('button').contains('Save').click();
157+
124158
});
125159
it('Checks form submission for a Map component', () => {
126160
cy.viewport(1000, 1100);
@@ -163,6 +197,34 @@ describe('Form Designer', () => {
163197
.trigger('mouseup', coords.x, -5, { force: true })
164198
cy.wait(2000);
165199
});
200+
//validate different basic layers existence on submitter view
201+
cy.get('a[class="leaflet-control-layers-toggle"').then($el => {
202+
const base_map_btn=$el[0];
203+
cy.get(base_map_btn).trigger('mouseover',{force: true});
204+
205+
cy.get('input[class="leaflet-control-layers-selector"]')
206+
.then($el => {
207+
const base_select_light=$el[1];
208+
const base_select_dark=$el[2];
209+
const base_select_topographic=$el[3];
210+
cy.get(base_select_dark).closest('span').contains(' Dark').click({ force: true });
211+
cy.get(base_select_dark).check();
212+
cy.wait(2000);
213+
cy.get('img[src*="https://b.basemaps.cartocdn.com/dark_all/"]').should('be.visible');
214+
cy.get(base_select_light).closest('span').contains(' Light').click({ force: true });
215+
cy.wait(1000);
216+
cy.get(base_select_light).check();
217+
cy.wait(2000);
218+
cy.get('img[src*="https://b.basemaps.cartocdn.com/light_all/"]').should('be.visible');
219+
cy.get(base_map_btn).trigger('mouseover',{force: true});
220+
cy.get(base_select_topographic).closest('span').contains(' Topographic').click({ force: true });
221+
cy.waitForLoad();
222+
cy.get(base_select_topographic).check();
223+
cy.wait(2000);
224+
cy.get('img[src*="https://b.tile.opentopomap.org/"]').should('be.visible');
225+
});
226+
});
227+
cy.waitForLoad();
166228
cy.get('a[title="Draw a marker"]').then($el => {
167229
const marker_elem=$el[0];
168230
cy.get(marker_elem).click({force: true});
@@ -171,6 +233,7 @@ describe('Form Designer', () => {
171233
cy.wait(2000);
172234
//Verify marker limit validation message
173235
cy.get('div[class="leaflet-popup-content"]').find('p').contains('Only 3 features per submission').should('be.visible');
236+
174237
//Validate the feature of deleting existing markers not possible
175238
cy.get('.leaflet-draw-edit-remove').click();
176239
cy.get('g').find('path[stroke-linejoin="round"]').then($el => {
@@ -204,7 +267,6 @@ describe('Form Designer', () => {
204267
cy.get('#logoutButton > .v-btn__content > span').click();
205268

206269
});
207-
208270
});
209271

210272
});

tests/functional/cypress/e2e/form-edit-submission-data.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('Form Designer', () => {
119119

120120
});
121121

122-
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
122+
cy.get(':nth-child(1) > :nth-child(7) > a > .v-btn').click();
123123
//Edit submission
124124
cy.get('.mdi-pencil').click();
125125
//check visibility of cancel button

tests/functional/cypress/e2e/form-manage-form.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Form Designer', () => {
3535
cy.get('span.btn').contains('Text Field')
3636

3737
.trigger('mousedown', { which: 1}, { force: true })
38-
.trigger('mousemove', coords.x, -50, { force: true })
38+
.trigger('mousemove', coords.x, -110, { force: true })
3939
.trigger('mouseup', { force: true });
4040
cy.get('button').contains('Save').click();
4141
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ it('Submission revise status Assignment', () => {
124124
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
125125
cy.get('.mdi-list-box-outline').click();
126126
cy.waitForLoad();
127-
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
127+
cy.get(':nth-child(1) > :nth-child(7) > a > .v-btn').click();
128128
cy.get('.status-heading > .mdi-chevron-right').click();
129129
cy.get('[data-test="showStatusList"] > .v-input__control > .v-field > .v-field__field > .v-field__input').click();
130130
cy.contains('ASSIGNED').click();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('Form Designer', () => {
114114
cy.get('div.v-list-item-title').contains('All').should('be.visible');
115115
cy.get('button[title="Delete Submission"]').should('be.visible');
116116
//view submission
117-
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
117+
cy.get(':nth-child(1) > :nth-child(7) > a > .v-btn').click();
118118
cy.wait(4000);
119119
});
120120

tests/functional/cypress/e2e/form-submission-export.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ describe("Form Designer", () => {
180180
cy.waitForLoad();
181181
cy.get(".mdi-list-box-outline").click();
182182
cy.wait(2000);
183-
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn').click();
183+
cy.get(':nth-child(1) > :nth-child(7) > a > .v-btn').click();
184184
//print option
185185
cy.get('.mdi-printer').click();
186186
cy.get('.flex-container > .v-btn--elevated').should('be.enabled');

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
@@ -145,7 +145,7 @@ describe('Form Designer', () => {
145145
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
146146
cy.get('.mdi-list-box-outline').click();
147147
cy.wait(2000);
148-
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
148+
cy.get(':nth-child(6) > a > .v-btn').click();
149149
cy.waitForLoad();
150150
//Verify status option is not available for this
151151
cy.get('.status-heading > .mdi-chevron-right').should('not.exist');

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
@@ -147,7 +147,7 @@ describe('Form Designer', () => {
147147
cy.visit(`/${depEnv}/form/manage?f=${arrayValues[0]}`);
148148
cy.get('.mdi-list-box-outline').click();
149149
cy.waitForLoad();
150-
cy.get(':nth-child(1) > :nth-child(6) > a > .v-btn > .v-btn__content > .mdi-eye').click();
150+
cy.get(':nth-child(6) > a > .v-btn').click();
151151

152152
});
153153
//Assign status submission

tests/functional/cypress/support/login.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@ export function formsettings(){
5555
cy.get(email_notify).click({force: true});
5656
cy.contains('Send a notification to your specified email address when any user submits this form').should('be.visible');
5757
});
58+
//validate share draft with team is not enabled
59+
cy.get('[data-test="enableTeamMemberDraftShare"]').should('not.be.enabled');
5860
cy.get('[data-test="canSaveAndEditDraftsCheckbox"]').click();
59-
cy.get(':nth-child(3) > .v-card > .v-card-text > :nth-child(2) > .v-input__control > .v-selection-control > .v-label > span').click();//Update the status of the form
60-
cy.get(':nth-child(5) > .v-input__control > .v-selection-control > .v-label > div > span > strong').click();//Copy existing submission
61-
cy.get(':nth-child(7) > .v-input__control > .v-selection-control > .v-label > div').click();//Wide form Layout
61+
//validate share draft with team is enabled
62+
cy.get('[data-test="enableTeamMemberDraftShare"]').should('be.visible').and('not.be.disabled');
63+
cy.get('[data-test="canUpdateStatusOfFormCheckbox"]').click();//Update the status of the form
64+
cy.get('[data-test="canCopyExistingSubmissionCheckbox"]').click();//Copy existing submission
65+
cy.get('[data-test="canAllowWideFormLayoutCheckbox"]').click();//Wide form Layout
66+
cy.get('[data-test="enableTeamMemberDraftShare"]').click();//share form drafts with team members only
67+
cy.get('[data-test="showAssigneeInSubmissionsTableCheckbox"]').click();//display assignee column for reviewers
6268
cy.get('[data-test="email-test"] > .v-input__control > .v-selection-control > .v-label > div > span').click({force: true});
6369
cy.get('[data-test="email-test"] > .v-input__control > .v-selection-control > .v-label > div > span').click();
6470
cy.get(':nth-child(4) > .v-card > .v-card-text > .v-text-field > .v-input__control > .v-field > .v-field__field > .v-field__input').type('abc@gmail.com');
@@ -97,15 +103,14 @@ export function formsettings(){
97103
cy.get('.v-list').should('contain','Reporting usually on a repeating schedule or event driven like follow-ups');
98104
cy.get('.v-list').should('contain','Feedback Form to determine satisfaction, agreement, likelihood, or other qualitative questions');
99105
cy.contains('Reporting usually on a repeating schedule or event driven like follow-ups').click();
100-
101106
cy.get('input[value="test"]').click();
102-
;
103107
cy.get('[data-test="api-true"] > .v-label > span').click();
104108
cy.get('.mt-3 > .mdi-help-circle-outline').should('be.visible');
105109
cy.get('.mt-3 > .mdi-help-circle-outline').click();
106110
cy.contains('Labels serve as a means to categorize similar forms that may belong to a common organization or share a related context.').should('be.visible');
107111
cy.get('.d-flex > .v-input > .v-input__control > .v-field > .v-field__field > .v-field__input').click();
108112
cy.get('.d-flex > .v-input > .v-input__control > .v-field > .v-field__field > .v-field__input').type('test label');
113+
//Disclaimer declaration
109114
cy.get(':nth-child(4) > .v-card-text > .v-input > .v-input__control > .v-selection-control > .v-label > span').click();
110115
cy.get('button').contains('Continue').click();
111116

0 commit comments

Comments
 (0)