Skip to content

Commit e5ff930

Browse files
committed
Test: Update test cases for autosaved comments feature
Signed-off-by: Parth Raiyani <[email protected]> Change-Id: I0ebb1c8805d04e687e16529ba39742f00577dd0c
1 parent e1eab3c commit e5ff930

File tree

6 files changed

+162
-81
lines changed

6 files changed

+162
-81
lines changed

cypress_test/integration_tests/desktop/calc/annotation_spec.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
108108
it('Insert autosave',function() {
109109
desktopHelper.insertComment(undefined, false);
110110
cy.cGet('#map').focus();
111-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
111+
cy.cGet('.annotation-button-autosaved').should('be.visible');
112+
cy.cGet('.annotation-button-delete').should('be.visible');
112113
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
113114

114115
helper.reloadDocument(newFilePath);
@@ -124,15 +125,17 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
124125
it('Insert autosave save',function() {
125126
desktopHelper.insertComment(undefined, false);
126127
cy.cGet('#map').focus();
127-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
128+
cy.cGet('.annotation-button-autosaved').should('be.visible');
129+
cy.cGet('.annotation-button-delete').should('be.visible');
128130
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
129131
cy.cGet('#annotation-save-1').click();
130132
cy.cGet('.cool-annotation').should('exist');
131133
cy.cGet('#comment-container-1').then(function (element) {
132134
element[0].style.visibility = '';
133135
element[0].style.display = '';
134136
});
135-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
137+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
138+
cy.cGet('.annotation-button-delete').should('be.not.visible');
136139
cy.cGet('#comment-container-1').trigger('mouseover');
137140
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
138141

@@ -149,11 +152,13 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
149152
it('Insert autosave cancel',function() {
150153
desktopHelper.insertComment(undefined, false);
151154
cy.cGet('#map').focus();
152-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
155+
cy.cGet('.annotation-button-autosaved').should('be.visible');
156+
cy.cGet('.annotation-button-delete').should('be.visible');
153157
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
154158
cy.cGet('#annotation-cancel-1').click();
155159
cy.cGet('.cool-annotation').should('not.exist');
156-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
160+
cy.cGet('.annotation-button-autosaved').should('not.exist');
161+
cy.cGet('.annotation-button-delete').should('not.exist');
157162

158163
helper.reloadDocument(newFilePath);
159164
cy.cGet('.cool-annotation').should('not.exist');
@@ -174,7 +179,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
174179
cy.cGet('body').contains('.context-menu-item','Modify').click();
175180
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
176181
cy.cGet('#map').focus();
177-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
182+
cy.cGet('.annotation-button-autosaved').should('be.visible');
183+
cy.cGet('.annotation-button-delete').should('be.visible');
178184
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
179185

180186
helper.reloadDocument(newFilePath);
@@ -202,7 +208,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
202208
cy.cGet('body').contains('.context-menu-item','Modify').click();
203209
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
204210
cy.cGet('#map').focus();
205-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
211+
cy.cGet('.annotation-button-autosaved').should('be.visible');
212+
cy.cGet('.annotation-button-delete').should('be.visible');
206213
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
207214
cy.cGet('#annotation-save-1').click();
208215
cy.cGet('#comment-container-1').then(function (element) {
@@ -238,7 +245,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
238245
cy.cGet('body').contains('.context-menu-item','Modify').click();
239246
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
240247
cy.cGet('#map').focus();
241-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
248+
cy.cGet('.annotation-button-autosaved').should('be.visible');
249+
cy.cGet('.annotation-button-delete').should('be.visible');
242250
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
243251
cy.cGet('#annotation-cancel-1').click();
244252
cy.cGet('#comment-container-1').then(function (element) {

cypress_test/integration_tests/desktop/impress/annotation_spec.js

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,13 @@ describe(['tagdesktop'], 'Collapsed Annotation Tests', function() {
125125
cy.cGet('.cool-annotation-info-collapsed').should('have.text','!');
126126
cy.cGet('.cool-annotation-info-collapsed').should('be.visible');
127127
cy.cGet('.cool-annotation-img').click();
128-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
128+
cy.cGet('.annotation-button-autosaved').should('be.visible');
129+
cy.cGet('.annotation-button-delete').should('be.visible');
129130
cy.cGet('#annotation-save-1').click();
130131
cy.cGet('.cool-annotation-img').click();
131132
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
132-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
133+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
134+
cy.cGet('.annotation-button-delete').should('be.not.visible');
133135
cy.cGet('.cool-annotation-info-collapsed').should('not.have.text','!');
134136
cy.cGet('#map').focus();
135137
cy.cGet('.cool-annotation-info-collapsed').should('be.not.visible');
@@ -214,7 +216,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
214216
it('Insert autosave', function() {
215217
desktopHelper.insertComment(undefined, false);
216218
cy.cGet('#map').focus();
217-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
219+
cy.cGet('.annotation-button-autosaved').should('be.visible');
220+
cy.cGet('.annotation-button-delete').should('be.visible');
218221
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
219222

220223
helper.reloadDocument(newFilePath);
@@ -225,10 +228,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
225228
it('Insert autosave save', function() {
226229
desktopHelper.insertComment(undefined, false);
227230
cy.cGet('#map').focus();
228-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
231+
cy.cGet('.annotation-button-autosaved').should('be.visible');
232+
cy.cGet('.annotation-button-delete').should('be.visible');
229233
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
230234
cy.cGet('#annotation-save-1').click();
231-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
235+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
236+
cy.cGet('.annotation-button-delete').should('be.not.visible');
232237
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.not.visible');
233238
cy.cGet('.leaflet-marker-icon').should('exist');
234239
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@@ -241,10 +246,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
241246
it('Insert autosave cancel', function() {
242247
desktopHelper.insertComment(undefined, false);
243248
cy.cGet('#map').focus();
244-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
249+
cy.cGet('.annotation-button-autosaved').should('be.visible');
250+
cy.cGet('.annotation-button-delete').should('be.visible');
245251
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
246252
cy.cGet('#annotation-cancel-1').click();
247-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
253+
cy.cGet('.annotation-button-autosaved').should('not.exist');
254+
cy.cGet('.annotation-button-delete').should('not.exist');
248255
cy.cGet('.cool-annotation-edit.modify-annotation').should('not.exist');
249256
cy.cGet('.leaflet-marker-icon').should('not.exist');
250257
cy.cGet('.cool-annotation-content > div').should('not.exist');
@@ -262,7 +269,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
262269
cy.cGet('body').contains('.context-menu-item','Modify').click();
263270
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
264271
cy.cGet('#map').focus();
265-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
272+
cy.cGet('.annotation-button-autosaved').should('be.visible');
273+
cy.cGet('.annotation-button-delete').should('be.visible');
266274
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
267275

268276
helper.reloadDocument(newFilePath);
@@ -278,7 +286,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
278286
cy.cGet('body').contains('.context-menu-item','Modify').click();
279287
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
280288
cy.cGet('#map').focus();
281-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
289+
cy.cGet('.annotation-button-autosaved').should('be.visible');
290+
cy.cGet('.annotation-button-delete').should('be.visible');
282291
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
283292
cy.cGet('#annotation-save-1').click();
284293
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
@@ -297,7 +306,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
297306
cy.cGet('body').contains('.context-menu-item','Modify').click();
298307
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
299308
cy.cGet('#map').focus();
300-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
309+
cy.cGet('.annotation-button-autosaved').should('be.visible');
310+
cy.cGet('.annotation-button-delete').should('be.visible');
301311
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
302312
cy.cGet('#annotation-cancel-1').click();
303313
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
@@ -316,7 +326,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
316326
cy.cGet('body').contains('.context-menu-item','Reply').click();
317327
cy.cGet('#annotation-reply-textarea-1').type('some reply text');
318328
cy.cGet('#map').focus();
319-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
329+
cy.cGet('.annotation-button-autosaved').should('be.visible');
330+
cy.cGet('.annotation-button-delete').should('be.visible');
320331
cy.cGet('#annotation-modify-textarea-1').should('be.visible');
321332
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
322333
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
@@ -334,12 +345,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
334345
cy.cGet('body').contains('.context-menu-item','Reply').click();
335346
cy.cGet('#annotation-reply-textarea-1').type('some reply text');
336347
cy.cGet('#map').focus();
337-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
348+
cy.cGet('.annotation-button-autosaved').should('be.visible');
349+
cy.cGet('.annotation-button-delete').should('be.visible');
338350
cy.cGet('#annotation-modify-textarea-1').should('be.visible');
339351
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
340352
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
341353
cy.cGet('#annotation-save-1').click();
342-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
354+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
355+
cy.cGet('.annotation-button-delete').should('be.not.visible');
343356
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
344357
cy.cGet('.cool-annotation-content > div').should('include.text','some text0');
345358
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
@@ -357,12 +370,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
357370
cy.cGet('body').contains('.context-menu-item','Reply').click();
358371
cy.cGet('#annotation-reply-textarea-1').type('some reply text');
359372
cy.cGet('#map').focus();
360-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
373+
cy.cGet('.annotation-button-autosaved').should('be.visible');
374+
cy.cGet('.annotation-button-delete').should('be.visible');
361375
cy.cGet('#annotation-modify-textarea-1').should('be.visible');
362376
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
363377
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
364378
cy.cGet('#annotation-cancel-1').click();
365-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
379+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
380+
cy.cGet('.annotation-button-delete').should('be.not.visible');
366381
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
367382
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
368383

0 commit comments

Comments
 (0)